Documentation ¶
Overview ¶
Package jsv implements Univa Grid Engine's job submission verifier protocol.
Index ¶
- Variables
- func Accept(args string)
- func AddEnv(envVar, value string)
- func Correct(args string)
- func DelEnv(envVar string)
- func DelParam(suffix string)
- func GetEnv(envVar string) (string, bool)
- func GetParam(suffix string) (string, bool)
- func IsEnv(envVar string) bool
- func IsParam(param string) bool
- func ListEnvs()
- func LogError(message string)
- func LogInfo(message string)
- func LogWarning(message string)
- func ModEnv(envVar, value string)
- func Reject(args string)
- func RejectWait(args string)
- func Run(checkEnvironment bool, verificationFunction func(), onStartFunction func())
- func SendEnv()
- func SetParam(suffix string, value string)
- func SetTimeout(timeout int)
- func SubAddParam(param, subParam, value string)
- func SubDelParam(param, subParam string)
- func SubGetParam(param, subParam string) (string, bool)
- func SubIsParam(param, subParam string) bool
- type State
Constants ¶
This section is empty.
Variables ¶
var Logfile = "/tmp/jsv_logfile.log"
Logfile is the path to the logfile which should be used for logging when LoggingEnabled is set to true.
var LoggingEnabled = false
LoggingEnabled turns logging on or off. Note that when the logfile can't be opened LoggingEnabled is set to false automatically. This can be used as a check in the JSV application. Don't change the setting during the runtime of a JSV application.
Functions ¶
func Accept ¶
func Accept(args string)
Accept must be called in the JSV function when the job is accepted. Alternativly Correct() can be called at the end of a JSV when the job was modified. Currently both have the same semantic only Java JSV differs in that.
func Correct ¶
func Correct(args string)
Correct must be called in the JSV function when the job was modified and corrected. Currently it the same like jsv_accept().
func GetParam ¶
GetParam returns the value of a simple job submission parameter which was requested by the job. Example: JSV_get_param("SCRIPT")
func LogError ¶
func LogError(message string)
LogError logs the string provided as argument as error. In case of an server side JSV the output appears in the messages file of qmaster if the log level allows it.
func LogInfo ¶
func LogInfo(message string)
LogInfo logs the string provided as argmument as info message. In case of an server side JSV the output appears in the messages file of qmaster if the log level allows it.
func LogWarning ¶
func LogWarning(message string)
LogWarning logs the string provided as argument as warning. In case of an server side JSV the output appears in the messages file of qmaster if the log level allows it.
func Reject ¶
func Reject(args string)
Reject rejects a job. That means the job is not added to the qmasters job list. The argument specifies the reject message.
func RejectWait ¶
func RejectWait(args string)
RejectWait rejects a job due to a temporary reason. Must be called when is job is going to be rejected because of a temporary reason. The only difference to jsv_reject() is that a different message is logged by Grid Engine.
func Run ¶
func Run(checkEnvironment bool, verificationFunction func(), onStartFunction func())
Run is the main JSV function. Must be called by the JSV 'script'. requires the verification function to be passed. Optional a function which is run before the verification process can be passed or nil instead.
func SendEnv ¶
func SendEnv()
SendEnv can be called in the jsv_on_start function in order to let Grid Engine send all environment variables to the JSV script.
func SetTimeout ¶
func SetTimeout(timeout int)
SetTimeout overrides the timeout for server side JSVs specified in the SGE_JSV_TIMEOUT environment variable. The timeout is specified in seconds and must be greater than one. The command might only with Univa Grid Engine.
func SubAddParam ¶
func SubAddParam(param, subParam, value string)
SubAddParam adds a new sublist parameter to a list. The expected parameter is a sub parameter of a parameter group, like a resource request (qsub -l h_vmem=1G ...). In this case the function would be called like: JSV_sub_add_param("l", "h_vmem", "1G")
func SubDelParam ¶
func SubDelParam(param, subParam string)
SubDelParam deletes a sublist element from a list (like removing h_vmem from l_hard request list).
func SubGetParam ¶
SubGetParam returns the value of a sub-parameter. Example: qsub -l h_vmem=1G ... JSV_sub_get_param("l", "h_vmem") == "1G"
func SubIsParam ¶
SubIsParam returns true in case a specific sub parameter is set. Example: qsub -l h_vmem=1G ... jsv_sub_is_param("l", "h_vmem") == true