SUBMIT(1)
SUBMIT(1) ๐ Grid Engine User Commands ๐
okay bestie, sit down, hydrate, because this is the manual page for SUBMIT(1) โ the whole job-submitting squad in Grid Engine. It's long, it's iconic, and we're doing it in parts. Let's go ๐ซถ
โจ NAME โจ
qsub, qsh, qlogin, qrsh, qalter, qresub โ submit jobs to Grid Engine ๐
๐ธ SYNTAX ๐ธ
no notes, just the receipts, verbatim ๐
qsub [options] [command [command_args] | -- [command_args]]
qsh [options] [-- xterm_args]
qlogin [options]
qrsh [options] [command [command_args]]
qalter [options] wc_job_range_list [-- [command_args]]
qalter [options] -u user_list | -u * [-- [command_args]]
qresub [options] job_id_list
๐ฆ DESCRIPTION ๐ฆ
the qsub of it all
qsub submits batch jobs to the Grid Engine queuing system. Grid Engine supports single- and multiple-node jobs, so like, go big if you want. command can be a path to a binary or a script (peep -b below ๐) which contains the commands to be run by the job using a shell (for example, sh(1) or csh(1)). Arguments to the command get passed as command_args to qsub. And here's the cute part: if command is handled as a script, you can embed flags in the script itself. If the first two characters of a script line either match '#$' or are equal to the prefix string defined with the -C option described below, that line gets parsed for embedded command flags. yes bestie, your script is also a config file โจ
qsh, aka the X-windows one
qsh submits an interactive X-windows session to Grid Engine. An xterm(1) gets brought up from the executing machine, with the display directed either to the X-server indicated by the DISPLAY environment variable or as specified with the -display option of qsh. Interactive jobs are not spooled if no resource is available to execute them โ they either get dispatched to a suitable machine for execution immediately, or the user submitting the job gets notified by qsh that appropriate resources to execute the job are not available. xterm_args are passed to the xterm(1) executable. But heads up though: the -e and -ls xterm options do not work with qsh. sorry babe ๐
qlogin
qlogin is similar to qsh in that it submits an interactive job to the queuing system. It does not open an xterm(1) window on the X display, but uses the current terminal for user I/O. It establishes a telnet(1)-like connection with the remote host, using the configured mechanisms described in remote_startup(5). qlogin is invoked exactly like qsh, and its jobs can only run on INTERACTIVE queues. Also, qlogin jobs can only be used if the sge_execd(8) is running under the root account. permission check, periodt ๐
qrsh
qrsh is similar to qlogin in that it submits an interactive job to the queuing system. It uses the current terminal for user I/O. With a command, it establishes a rsh(1)-like connection with the remote host. If no command is given to qrsh, an rlogin(1)-like session is established. It uses the configured mechanisms described in remote_startup(5). qrsh jobs can only run in INTERACTIVE queues unless the option -now no is used (see below). They can also only be run if the sge_execd(8) is running under the root account.
qrsh provides an additional useful feature for integrating with interactive tools providing a specific command shell ๐. If the environment variable QRSH_WRAPPER is set when qrsh is invoked, the command interpreter pointed to by QRSH_WRAPPER will be executed to run qrsh commands instead of the user's login shell or any shell specified in the qrsh command-line. The options -cwd, -v, -V, and -display only apply to batch jobs. iykyk ๐
qalter
qalter can be used to change the attributes of pending jobs. For array jobs with a mix of running and pending tasks (see the -t option below), modification with qalter only affects the pending tasks. qalter can change most of the characteristics of a job (see the corresponding statements in the OPTIONS section below), including those which were defined as embedded flags in the script file (see above).
โ ๏ธ An option specified withqaltercompletely replaces any parameters previously specified for the job by that option. e.g. if the job has a resource requirement corresponding to-l h_rt=3600,h_vmem=2G, then after aqalter -l h_rt=7200, the resource requirement is simplyh_rt=7200; it is not currently possible to override one or more values. it's giving all-or-nothing ๐ญ
Some submit options, such as the job script, cannot be changed with qalter. If parameters are set with qalter, the output from qstat -j acquires an additional field, version, which is incremented each time.
If a server JSV is defined, modifications are forbidden unless they are explicitly allowed by the sge_conf(5) parameter jsv_allowed_mod. (See also jsv(1).)
qresub
qresub lets the user create jobs as copies of existing pending or running jobs. The copied jobs will have exactly the same attributes as the ones from which they were copied, except with a new job ID and with a cleared hold state. The only modification to the copied jobs supported by qresub is assignment of a new hold state with the -h option. This option can be used to first copy a job and then change its attributes via qalter.
Only a manager can use qresub on jobs submitted by another user. Regular users can only use qresub on their own jobs. stay in your lane bestie ๐ซถ
See sge_shepherd(8) for the significance of exit codes returned by the submitted job.
default request files & how the vibes stack
For qsub, qsh, qrsh, and qlogin the administrator and the user may define default request files (see sge_request(5)) which can contain any of the options described below. If an option in a default request file is understood by qsub and qlogin but not by qsh, the option is silently ignored if qsh is invoked. Thus you can maintain shared default request files for both qsub and qsh. sharing is caring ๐
A cluster-wide default request file may be placed under $SGE_ROOT/$SGE_CELL/common/sge_request. User private default request files are processed under the locations $HOME/.sge_request and $cwd/.sge_request. The working directory local default request file has the highest precedence, then the home directory file, and then the cluster global file. The option arguments, the embedded script flags and the options in the default request files are processed in the following order:
- left to right in the script line,
- left to right in the default request files,
- from top to bottom of the script file (
qsubonly), - from top to bottom of default request files,
- from left to right of the command line.
In other words, the command line can be used to override the embedded flags and the default request settings. The embedded flags, however, will override the default settings.
๐ก Note, that the-clearoption can be used to discard any previous settings at any time in a default request file, in the embedded script flags, or in a command-line option. It is, however, not available withqalter.
The request options described below can be requested either hard or soft. By default, all requests are considered hard until the -soft option (see below) is encountered. The hard/soft status remains in effect until its counterpart is encountered again. If all the hard requests for a job cannot be met, the job will not be scheduled. Jobs which cannot be run at the present time remain spooled. manifesting a slot for you tho โจ
๐ OPTIONS ๐
the whole menu, one by one
-@optionfile โ Forcesqsub,qrsh,qsh, orqloginto use the options contained in optionfile. The indicated file may contain all valid options. Comment lines must start with a"#"sign.-adate_time โ Available forqsubandqalteronly.
Defines or redefines the time and date at which a job is eligible for execution. date_time is of the form [[CC]YY]MMDDhhmm[.SS]; for the details, please see date_time in sge_types(5).
If this option is used with qsub or if a corresponding value is specified in qmon then a parameter named a and the value in the format CCYYMMDDhhmm.SS will be passed to the defined JSV instances. (See -jsv option below or find more information concerning JSV in jsv(1).) โฐ
-acvariable[=value],... โ Available forqsub,qsh,qrsh,qloginandqalteronly.
Adds the given name/value pair(s) to the job's context. value may be omitted. Grid Engine appends the given argument to the list of context variables for the job. Multiple -ac, -dc, and -sc options may be given. The order is important here.
The outcome of the evaluation of all -ac, -dc, and -sc options or corresponding values in qmon is passed to defined JSV instances as parameter with the name ac. (See -jsv option below or find more information concerning JSV in jsv(1).)
qalter allows changing this option even while the job executes. ๐ฅ
-arar_id โ Available forqsub,qalter,qrsh,qsh, orqloginonly.
Assigns the submitted job to be a part of an existing Advance Reservation with id ar_id. The complete list of existing Advance Reservations can be obtained using the qrstat(1) command.
๐ก Note that the-aroption implicitly adds the-w eoption if not otherwise requested.
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job however.
If this option or a corresponding value in qmon is specified then this value will be passed to defined JSV instances as parameter with the name ar. (See -jsv option below or find more information concerning JSV in jsv(1).)
-Aaccount_string โ Available forqsub,qsh,qrsh,qloginandqalteronly.
Identifies the account to which the resource consumption of the job should be charged ๐ธ. The account_string should conform to the account_name definition in sge_types(5). In the absence of this parameter Grid Engine will place the default account string "sge" in the accounting record of the job.
qalter allows changing this option even while the job executes.
If this option or a corresponding value in qmon is specified then this value will be passed to defined JSV instances as parameter with the name A. (See -jsv option below or find more information concerning JSV in jsv(1).)
-by[es]|n[o] โ Available forqsub,qrshonly.qalterdoes not allow changing this option. This option cannot be embedded in the script file itself.
Gives the user the possibility to indicate explicitly whether command should be treated as binary or script. If the argument of -b is 'y', then command may be a binary or script. The command might not be accessible from the submission host. Nothing except the path of the command will be transferred from the submission host to the execution host. Path aliasing will be applied to the path of command before it is executed. ๐ง
Okay so back to -b for a sec, bestie โ this part is lowkey important. ๐
If the argument of -b is 'n', then command needs to be a script, and it gets handled as such. The script file has to be accessible by the submission host. It will be transferred to the execution host. qsub/qrsh will search directive prefixes within scripts.
qsub will implicitly use -b n, whereas qrsh will apply the -b y option if nothing else is specified.
The value specified with this option or the corresponding value specified in qmon will only be passed to defined JSV instances if the value is yes. The name of the parameter will be b. The value will be y also when the long form yes was specified during submission. (See -jsv option below or find more information concerning JSV in jsv(1).)
Please note that submission ofcommandas a script (-b n) can have a significant performance impact, especially for short running jobs and big job scripts. Script submission adds a number of operations to the submission process: The job script needs to be
- parsed at client side (for special comments)
- transferred from submit client to qmaster
- spooled in qmaster
- transferred to execd at job execution
- spooled in execd
- removed from spooling both in execd and qmaster once the job is done
If job scripts are available on the execution nodes, e.g. via NFS, binary submission can be the better choice. iykyk ๐ฆ
-binding [binding_instance] binding_strategyโ okay so a job can request a specific processor core binding (processor affinity) with this parameter. This request is neither a hard nor a soft request, it is a hint for the execution host to do this if possible. โจ Please note that the requested binding strategy is not used for resource selection within Grid Engine. As a result an execution host might be selected where Grid Engine does not even know the hardware topology and therefore is not able to apply the requested binding. (The binding facility depends on the platform, and on Grid Engine being compiled with appropriate support.)
To make Grid Engine select hardware on which the binding can be applied, please use the -l switch in combination with the complex attribute m_topology. slay ๐
binding_instance is an optional parameter. It might either be env, pe or set depending on which instance should accomplish the job to core binding. If the value for binding_instance is not specified then set will be used.
envmeans that only the environment variableSGE_BINDINGwill be exported to the job environment of the job. This variable contains the selected operating system internal processor numbers. In presence of SMT or CMT it may contain more than the number of cores selected, because each core could be represented by multiple processor identifiers. The processor numbers are space-separated.pemeans that the information about the selected cores appears in the fourth column of thepe_hostfile. Here the logical core and socket numbers are printed (they start at 0 and have no holes) in colon-separated pairs (e.g."0,0:1,0", which means core 0 on socket 0 and core 0 on socket 1). For more information about the$pe_hostfilechecksge_pe(5). In addition,SGE_BINDINGis set as forenvbinding.set(the default if nothing else is specified) means that the binding strategy is applied by Grid Engine. Each shepherd (on the master host, or those connected to withqrsh -inherit) is bound to the relevant cores. The binding is inherited by the task that is started, so that processes or threads it spawns are bound to those cores, but it is up to the task to make any more specific bindings of its sub-tasks within the set of bound cores it inherits. How Grid Engine does this depends on the underlying hardware architecture of the execution host where the submitted job will be started. In addition,SGE_BINDINGis set as forenvbinding.
Binding will be done to restrict the job to run exclusively on the selected cores, if possible on the platform; otherwise bound processes may still be able to use other cores. The operating system will probably allow other unbound processes to use these cores. Note that if all cores on a node are specified to be bound by one job, that is probably equivalent to no binding, with the task free to use all the cores. fr fr ๐
The loadcheck tool in the utilbin directory can be used to check the host's capabilities. You can also use -sep in combination with -cb of qconf(5) to find whether Grid Engine is able to recognize the hardware topology. hwloc-ps(1) can be used to check the bindings in force on a host.
Possible values for binding_strategy are as follows:
linear:[number[:socket,core]]
striding:number:n[:socket,core]
explicit:socket,core[:socket,core]...
For the binding strategies "linear" and "striding" there is an optional socket and core pair attached. These denote the mandatory starting point for the first core to bind on. Logical socket and core numbers are used, per hwloc(7).
linearmeans that Grid Engine tries to bind the job onnumbersuccessive cores. If socket and core are omitted then Grid Engine first allocates successive cores on the first empty socket found. ("Empty" means that there are no jobs bound to the socket by Grid Engine.) If this is not possible, or is not sufficient, Grid Engine tries to find (further) cores on the socket with the most unbound cores, and so on. If socket and core are specified, then Grid Engine tries to find empty cores with this starting point. If the binding request cannot be satisfied, then binding is not done on the host concerned.numbermay be omitted or specified asslots. In that case it will be taken as the number of slots assigned to the job on a per-host basis, on the assumption that one slot per core is used. That allows binding to work when parallel jobs run across nodes with variable slot counts per node. Multiple processing units (hardware threads) per core are currently not taken into account in this, but systems running such parallel jobs will typically have only a single thread per core.-binding linearis a reasonable overall default forsge_request(5)in many cases.stridingmeans that Grid Engine tries to find cores with a certain offset. It will selectnumberof empty cores with an offset ofn-1cores in between. Start point for the search algorithm is socket 0 core 0. As soon asnumbercores are found they will be used to do the job binding. If there are not enough empty cores, or if the correct offset cannot be achieved, then no binding will be done on the host concerned.explicitbinds the specified sockets and cores that are mentioned in the provided socket/core list. Each socket/core pair has to be specified only once. If a socket/core pair is already in use by a different job, the whole binding request will be ignored.
Note that a binding like "pe linear:number..." is only useful if the job has exclusive access to its multiple compute nodes, they all have the same topology, and the PE has a fixed allocation rule (allocation_rule n). (The $pe_hostfile content is created on the job's master host, with the same <socket,core> specification for each.) This method can't be used for job isolation. Similarly, set requires a fixed allocation per host for distributed parallel jobs.
Qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however. not me learning that the hard way ๐ญ
If this option, or a corresponding value in qmon, is specified then these values will be passed to defined JSV instances as parameters with the names binding_strategy, binding_type, binding_amount, binding_step, binding_socket, binding_core, binding_exp_n, binding_exp_socketid, binding_exp_coreid.
Please note that the length of the socket/core value list of the explicit binding is reported as binding_exp_n. id will be replaced by the position of the socket/core pair within the explicit list (0 <= id < binding_exp_n). The first socket/core pair of the explicit binding will be reported with the parameter names binding_exp_socket0 and binding_exp_core0.
Values that do not apply for the specified binding will not be reported to JSV. E.g. binding_step will only be reported for the striding binding and all binding_exp_* values will passed to JSV if explicit binding was specified. (See -jsv option below or find more information concerning JSV in jsv1(.))
-c occasion_specifierโ available forqsubandqalteronly. ๐
Defines or redefines whether the job should be checkpointed, and if so, under what circumstances. The specification of the checkpointing occasions with this option overwrites the definitions of the when parameter in the checkpointing environment (see checkpoint(5)) referenced by the qsub -ckpt switch. Possible values for occasion_specifier are
nโ No checkpoint is performed;sโ Checkpoint when batch server is shut down;mโ Checkpoint at minimum CPU interval;xโ Checkpoint when job gets suspended;rโ Reschedule when execution host goes into the"unknown"state;intervalโ Checkpoint in the specified interval (atime_specifierpersge_types(5)).
The minimum CPU interval is defined in the queue configuration (see queue_conf(5) for details). If interval is specified, the maximum of that and the queue's minimum CPU interval is used (to ensure that a machine is not overloaded by checkpoints being generated too frequently). periodt โจ
Okay bestie, picking right back up where we left off โ whatever value you drop with this option, <em>or</em> the matching value you set over in qmon, gets passed along to any defined JSV instances. The interval shows up there as a parameter named c_interval. The character sequence you specify shows up as a parameter named c_occasion. ๐ซ
Heads up though: if you changec_occasionthrough JSV, then the last setting ofc_intervalgets overwritten, and vice versa. They're doing that toxic-codependency thing. ๐
(Peep the -jsv option below, or go read jsv(1) for the whole JSV lore.)
-ckptckpt_name โ qsub and qalter only, bestie.
This one picks the checkpointing environment (go look at checkpoint(5)) that's gonna be used to checkpoint the job. It also declares the job as an actual checkpointing job. So likeโฆ it's giving commitment. ๐
If this option gets specified, or a corresponding value in qmon does, then that value gets passed to defined JSV instances as a parameter named ckpt. (See the -jsv option below, or go find more about JSV in jsv(1).)
-clearโ available for qsub, qsh, qrsh, and qlogin only.
Causes all elements of the job to be reset back to their initial default status, <em>before</em> any modifications (if any) appearing in this specific command get applied. It's the factory reset before the glow-up. โจ
-cwdโ available for qsub, qsh, qrsh and qalter only.
Executes the job from the current working directory. ๐โโ๏ธ This switch activates Grid Engine's path aliasing facility, if the corresponding configuration files are present (see sge_aliases(5)).
With qalter, the previous definition of the current working directory gets overwritten if qalter is run from a different directory than the preceding qsub or qalter. Different directory, different story. ๐ญ
qalter lets you change this option even while the job is executing. <em>But</em> the modified parameter only takes effect after a restart or migration of the job. So, not immediately. Patience, queen. ๐ง
If this option or a corresponding value in qmon is specified, then this value gets passed to defined JSV instances as a parameter named cwd. The value of that parameter will be the absolute path to the current working directory. JSV scripts can remove the path from jobs during the verification process by setting the value of this parameter to an empty string. As a result, the job behaves as if -cwd was not specified during job submission. (See the -jsv option below, or find more about JSV in jsv(1).)
-Cprefix_string โ available for qsub and qrsh with script submission (-b n).
Prefix_string defines the prefix that declares a directive in the job's command. The prefix is not a job attribute, but it does affect the behavior of qsub and qrsh. If prefix is a null string, the command won't be scanned for embedded directives at all. ๐ซ
The directive prefix consists of two ASCII characters which, when appearing in the first two bytes of a script line, indicate that what follows is a Grid Engine command. The default is "#$".
The user should be aware that changing the first delimiting character can produce unforeseen side effects. If the script file contains anything other than a "#" character in the first byte position of the line, the shell processor for the job will reject the line and may exit the job prematurely. ๐ Not the vibe you want.
If the -C option is present in the script file, it is ignored.
-dcvariable,... โ available for qsub, qsh, qrsh, qlogin and qalter only.
Removes the given variable(s) from the job's context. Multiple -ac, -dc, and -sc options may be given. The order is important. โ ๏ธ
qalter allows changing this option even while the job executes.
The outcome of the evaluation of all -ac, -dc, and -sc options, or corresponding values in qmon, is passed to defined JSV instances as a parameter named ac. (See the -jsv option below, or find more about JSV in jsv(1).)
-displaydisplay_specifier โ available for qsh and qrsh with a command.
Directs xterm(1) to use display_specifier in order to contact the X server. The display_specifier has to contain the hostname part of the display name (e.g. myhost:1). Local display names (e.g. :0) cannot be used in grid environments. Values set with the -display option overwrite settings from the submission environment and from -v command line options. Overwriting, slay. ๐ฅ
If this option or a corresponding value in qmon is specified, then this value gets passed to defined JSV instances as a parameter named display. This value will also be available in the job environment, which might optionally be passed to JSV scripts. The variable name will be DISPLAY. (See the -jsv option below, or find more about JSV in jsv(1).)
-dldate_time โ available for qsub, qsh, qrsh, qlogin and qalter only.
Specifies the deadline initiation time in [[CC]YY]MMDDhhmm[.SS] format (see the -a option above). The deadline initiation time is the time at which a deadline job has to reach top priority to be able to complete within a given deadline. Before the deadline initiation time, the priority of a deadline job gets raised steadily until it reaches the maximum as configured by the Grid Engine administrator. It's climbing the ranks, bestie. ๐
This option is applicable <strong>only</strong> for users allowed to submit deadline jobs.
If this option or a corresponding value in qmon is specified, then this value gets passed to defined JSV instances as a parameter named dl. The format for the date_time value is CCYYMMDDhhmm.SS. (See the -jsv option below, or find more about JSV in jsv(1).)
-e[[hostname]:]path...โ available for qsub and qalter only, but currently silently ignored byqsh,qrsh, andqlogin.
Defines or redefines the path used for the standard error stream of the job. For qsh, qrsh and qlogin, only the standard error stream of prolog and epilog is redirected. ๐
If the path constitutes an absolute path name, the error-path attribute of the job is set to path, including the hostname. If the path name is relative, Grid Engine expands path, either relative to the current working directory (if the -cwd switch โ see above โ is also specified) or to the home directory. If hostname is present, the standard error stream will be placed in the corresponding location only if the job runs on the specified host. If the path contains a ":" without a hostname, a leading ":" has to be specified.
By default, the file name for interactive jobs is /dev/null. For batch jobs, the default file name has the form job_name.ejob_id and job_name.ejob_id.task_id for array job tasks (see the -t option below).
If path is a directory, the standard error stream of the job will be put in this directory under the default file name. If the pathname contains certain pseudo environment variables, their value will be expanded at runtime of the job and will be used to constitute the standard error stream path name. The following pseudo environment variables are supported currently โ and note the <em>lack</em> of a Grid Engine_ prefix in this context, bestie:
$HOMEโ home directory on execution machine$USERโ user ID of job owner$JOB_IDโ current job ID$JOB_NAMEโ current job name (see the-Noption)$HOSTNAMEโ name of the execution host$TASK_IDโ array job task index number
The tilde sign "~" can be used as an alternative to $HOME, as in csh(1), bash(1), or ksh(1). Note that the "~" sign also works in combination with user names, so that "~user" expands to the home directory of user. Using another user ID than that of the job owner requires corresponding permissions, of course. ๐ซถ
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option or a corresponding value in qmon is specified, then this value gets passed to defined JSV instances as a parameter named e. (See the -jsv option below, or find more about JSV in jsv(1).)
-hardโ available for qsub, qsh, qrsh, qlogin and qalter only.
Signifies that all -q and -l resource requirements following in the command line will be <strong>hard</strong> requirements and must be satisfied <em>in full</em> before a job can be scheduled. No compromises, no maybes. ๐
As Grid Engine scans the command line and script file for Grid Engine options and parameters, it builds a list of resources required by a job. All such resource requests are normally considered as absolutely essential for the job to commence. However, if the -soft option (see below) is encountered during the scan, then all following resources are designated as "soft requirements" for execution โ or "nice-to-have, but not essential". If the -hard flag is encountered at a later stage of the scan, all resource requests following it once again become essential. The -hard and -soft options in effect act as <strong>toggles</strong> during the scan. Flip-flop, flip-flop. ๐
If this option or a corresponding value in qmon is specified, then the corresponding -q and -l resource requirements will be passed to defined JSV instances as parameters with the names q_hard and l_hard. Find more information in the sections describing -q and -l. (See the -jsv option below, or find more about JSV in jsv(1).)
-h|-h {u|s|o|n|U|O|S}...โ available for qsub (only-h), qrsh, qalter and qresub (hold state is removed when not set explicitly).
List of holds to place on a job, a task, or some tasks of a job. โ
uโ denotes a user hold.sโ denotes a system hold.oโ denotes a operator hold.nโ denotes no hold (requires manager privileges).
As long as any hold other than n is assigned to the job, the job is not eligible for execution. Holds can be released via qalter and qrls(1). In the case of qalter, this is supported by the following additional option specifiers for the -h switch:
Uโ removes a user hold.Sโ removes a system hold.Oโ removes a operator hold.
Still going, bestie โ the flags do not stop and neither do I ๐
So who can actually slap a hold on things? Grid Engine managers can assign and remove all hold types, Grid Engine operators can assign and remove user and operator holds, and regular users can only assign or remove user holds. That's the whole hierarchy, bestie. ๐
With qsub it's user holds only, so literally only the first form of the option is allowed โ just the -h switch, alone, by itself, no extras. qalter is the opposite vibe: it requires the second form described up above. โจ
Wanna assign a hold some other way? There's an alternate route via the qhold(1) facility. ๐ซถ
Array job moment (peep the -t option below): all tasks you specified via -t get hit by the -h operation simultaneously. All of them, at once. ๐
qalter lets you change this option even while the job is executing โ but lowkey the modified parameter only takes effect after a restart or a migration of the job. That's just how it is.
If this option is specified with qsub, or during the submission of a job in qmon, then the parameter h with the value u gets passed to the defined JSV instances โ that's how they know the job will be in user hold once the submission finishes. (See the -jsv option below, or go dig up more JSV lore in jsv(1).) ๐
-helpโ prints a listing of all options. That's it, that's the whole girl. ๐-hold_jidwc_job_list โ available forqsub,qrshandqalteronly. Seesge_types(5)for the definition ofwc_job_list.
Defines or redefines the job dependency list of the submitted job. A reference by job name or pattern is only accepted if the referenced job is owned by the same user as the referring job. Your submitted job is not eligible for execution unless all the jobs referenced in the comma-separated job id and/or job name list have completed. And if any of those referenced jobs exits with exit code 100, your submitted job stays ineligible for execution. Periodt. ๐ซ
With job names or regular patterns you can specify a job dependency on multiple jobs that satisfy the regular pattern, or on all jobs with the requested name. Name dependencies are resolved at submit time and can only be changed via qalter. New jobs, or name changes of other jobs, will not be taken into account. ๐
To remove a job dependency list with qalter, use a null wc_job_list, i.e.:
qalter -hold_jid '' ...
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option, or a corresponding value in qmon, is specified, then this value will be passed to defined JSV instances as a parameter with the name hold_jid. (See the -jsv option below, or find more information concerning JSV in jsv(1).) ๐ฆ
-hold_jid_adwc_job_list โ available forqsub,qrshandqalteronly. Seesge_types(5)for the definition ofwc_job_list. (Yes, it's the array-flavored twin of the one above. ๐ง)
Defines or redefines the job array dependency list of the submitted job. A reference by job name or pattern is only accepted if the referenced job is owned by the same user as the referring job. Each sub-task of the submitted job is not eligible for execution unless the corresponding sub-tasks of all jobs referenced in the comma-separated job id and/or job name list have completed. If dependent jobs have a different array stride to referenced jobs, the dependency may be many-to-one or one-to-many โ for example, if an array is submitted with -t 1:50:2, depending on one submitted with -t 1:50, then task n of the dependent depends on task n+1 of the other. Math girlies rise up. ๐ฅ
If any array task of the referenced jobs exits with exit code 100, the dependent tasks of the submitted job will remain ineligible for execution.
With job names or regular patterns you can specify a job dependency on multiple jobs satisfying the regular pattern, or on all jobs with the requested name. The name dependencies are resolved at submit time and can only be changed via qalter. New jobs or name changes of other jobs will not be taken into account.
If either the submitted job or any job in wc_job_list are not array jobs with the same range of sub-tasks (see the -t option below), the request list will be rejected and the job create or modify operation will return an error. ๐
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option or a corresponding value in qmon is specified, then this value will be passed to defined JSV instances as a parameter with the name hold_jid_ad. (See the -jsv option below, or find more information concerning JSV in jsv(1).)
-i [[hostname]:]path,...โ available forqsubandqalteronly.
Defines or redefines the path used for the standard input stream of the job. The path is handled exactly as described in the -e option for the standard error stream. ๐
By default /dev/null is the input stream for the job. (Yeah, nothing. Void. Silence. ๐ณ๏ธ)
You can use certain pseudo variables, whose values will be expanded at runtime of the job, to express the standard input stream โ same deal as described in the -e option for the standard error stream.
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option or a corresponding value in qmon is specified, then this value will be passed to defined JSV instances as a parameter with the name i. (See the -jsv option below, or find more information concerning JSV in jsv(1).) โญ
-inheritโ available only forqrshandqmake(1).
qrsh lets you start a task inside an already scheduled parallel job. The option -inherit tells qrsh to read a job id from the environment variable JOB_ID and start the specified command as a task in this job. Please note that in this case the hostname of the host where the command will be executed must precede the command to execute โ the syntax changes to:
qrsh -inherit [other options] hostname command [command_args]
Also note: in combination with -inherit, most other command line options will be ignored. Only the options -verbose, -v and -V will be interpreted. As a replacement for option -cwd, please use -v PWD. ๐
Usually a task should have the same environment (including the current working directory) as the corresponding job, so specifying the option -V should be suitable for most applications.
Note: If in your system the qmaster tcp port is not configured as a service, but rather via the environment variableSGE_QMASTER_PORT, make sure that this variable is set in the environment when callingqrshorqmakewith the-inheritoption. If you callqrshorqmakewith the-inheritoption from within a job script, exportSGE_QMASTER_PORTwith the option"-v SGE_QMASTER_PORT"either as a command argument or an embedded directive.
This parameter is not available in the JSV context. (See the -jsv option below, or find more information concerning JSV in jsv(1).)
-j y[es]|n[o]โ available forqsub,qsh,qrsh,qloginandqalteronly.
Specifies whether or not the standard error stream of the job is merged into the standard output stream. If both the -j y and the -e options are present, Grid Engine sets, but ignores, the error-path attribute. ๐
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
The value specified with this option, or the corresponding value specified in qmon, will only be passed to defined JSV instances if the value is yes. The name of the parameter will be j. The value will be y also when the long form yes was specified during submission. (See the -jsv option below, or find more information concerning JSV in jsv(1).) โจ
-jsjob_share โ available forqsub,qsh,qrsh,qloginandqalteronly.
Defines or redefines the job share of the job relative to other jobs. Job share is an unsigned integer value. The default job share value for jobs is 0. ๐
The job share influences the Share Tree Policy and the Functional Policy. It has no effect on the Urgency and Override Policies (see share_tree(5) and sched_conf(5) for further information on the resource management policies supported by Grid Engine).
In case of the Share Tree Policy, users can distribute the tickets to which they are currently entitled among their jobs using different shares assigned via -js. If all jobs have the same job share value, the tickets are distributed evenly. Otherwise, jobs receive tickets relative to the different job shares. Job shares are treated like an additional level in the share tree in the latter case.
In connection with the Functional Policy, the job share can be used to weight jobs within the functional job category. Tickets are distributed relative to any uneven job share distribution treated as a virtual share distribution level underneath the functional job category.
If both the Share Tree and the Functional Policy are active, the job shares will have an effect in both policies, and the tickets independently derived in each of them are added to the total number of tickets for each job.
If this option or a corresponding value in qmon is specified, then this value will be passed to defined JSV instances as a parameter with the name js. (See the -jsv option below, or find more information concerning JSV in jsv(1).) ๐
-jsvjsv_url โ available forqsub,qsh,qrshandqloginonly.
Defines a client JSV instance which will be executed to verify the job specification before the job is sent to qmaster. ๐
In contrast to other options, this switch will not be overwritten if it is also used in sge_request files. Instead, all specified JSV instances will be executed to verify the job to be submitted.
The JSV instance that gets passed straight up with the client's command line runs first to vibe-check the job spec, okay? Then, after that, the JSV instance that might've been defined in all those various sge_request files gets triggered to check the job too. More deets live in jsv(1) and sge_request(5) โ and the syntax of the jsv_url is spelled out in sge_types(5). ๐
-l resource=expression,...โ available forqsub,qsh,qrsh,qloginandqalteronly.
Launch the job in a Grid Engine queue that actually meets the resource request list you're asking for. And heads up: with qalter, your previous definition gets fully replaced by whatever you specify now โ no merging, bestie.
complex(5) explains how to get the list of available resources and their valid value specifiers, and the "MATCHING TYPES" section in sge_types(5) describes the possible forms of the expression for the resources you're requesting. ๐ฆ
You can have multiple -l switches in a single command, no cap. And you may request multiple -l options to be soft or hard โ both in the same command line. For a serial job, multiple -l switches refine the definition of the sought queue.
qalter lets you change the value of this option even while the job is running, but only if no change is made to requests for resources marked as consumable. Even then? The modification only kicks in after a restart or migration of the job. ๐ญ
If this option โ or a corresponding value in qmon โ is specified, then these hard and soft resource requirements get passed to defined JSV instances as parameters named l_hard and l_soft. If regular expressions are used for resource requests, those expressions get passed as they are. Also, shortcut names will not be expanded. (See the -jsv option above, or go find more info about JSV in jsv(1).) โจ
-m b|e|a|s|n,...โ available forqsub,qsh,qrsh,qloginandqalteronly.
Defines โ or redefines โ under which circumstances mail gets sent to the job owner, or to the users defined with the -M option described below. The option arguments mean:
bโ mail is sent at the beginning of the job.eโ mail is sent at the end of the job.aโ mail is sent when the job is aborted or rescheduled.sโ mail is sent when the job is suspended.nโ no mail is sent.
Currently no mail is sent when a job is suspended. (Yeah. We know. ๐)
qalter lets you change the b, e, and a option arguments even while the job executes. The modification of the option arguments will only be in effect after a restart or migration of the job, though.
If this option โ or a corresponding value in qmon โ is specified, then this value gets passed to defined JSV instances as a parameter with the name m. (See the -jsv option above or find more information concerning JSV in
-M user[@host],...โ available forqsub,qsh,qrsh,qloginandqalteronly.
Defines โ or redefines โ the list of users to which the server executing the job has to send mail, if the server sends mail about the job. Default is the job owner at the originating host. ๐
qalter lets you change this option even while the job executes. The modification will only be in effect after a restart or migration of the job, though.
If this option โ or a corresponding value in qmon โ is specified, then this value gets passed to defined JSV instances as a parameter with the name M. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-masterq wc_queue_listโ available forqsub,qrsh,qsh,qloginandqalter. Only meaningful for parallel jobs, i.e. together with the-peoption.
Defines โ or redefines โ a list of cluster queues, queue domains and queue instances which may be used to become the so-called master queue of this parallel job. A more detailed description of wc_queue_list lives in sge_types(5). The master queue is defined as the queue where the parallel job is started. The other queues that the parallel job spawns tasks onto? Those are called slave queues. And a parallel job only ever has one master queue. ๐
This parameter has all the properties of a resource request, and it gets merged with requirements derived from the -l option described above.
qalter lets you change this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, though.
If this option โ or a corresponding value in qmon โ is specified, this hard resource requirement gets passed to defined JSV instances as a parameter with the name masterq. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-notifyโ available forqsub,qrsh(with command) andqalteronly.
This flag, when set, makes Grid Engine send "warning" signals to a running job before sending the signals themselves. If a SIGSTOP is pending, the job receives a SIGUSR1 several seconds before the SIGSTOP. If a SIGKILL is pending, the job receives a SIGUSR2 several seconds before the SIGKILL. This gives the running job a configured time interval to do its cleanup operations before it gets hit with the SIGSTOP or SIGKILL. ๐ The amount of time delay is controlled by the notify parameter in each queue configuration (see queue_conf(5)).
qalter lets you change this option even while the job executes.
Only if this option is used does the parameter named notify with the value y get passed to defined JSV instances. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-now y[es]|n[o]โ available forqsub,qsh,qloginandqrsh.
-now y tries to start the job immediately โ or not at all. The command returns 0 on success, or 1 on failure (and yes, that includes when the job could not be scheduled immediately). For array jobs submitted with the -now option: if all tasks cannot be immediately scheduled, no tasks are scheduled. All or nothing, periodt.
Jobs submitted with the -now y option can only run on INTERACTIVE queues. -now y is the default for qsh, qlogin and qrsh. ๐
With the -now n option, the job gets put into the pending queue if it can't be executed immediately. -now n is the default for qsub.
-N nameโ available forqsub,qsh,qrsh,qloginandqalteronly.
The name of the job. The name should follow the "name" definition in sge_types(5). Invalid job names will be denied at submit time. ๐ซ
If the -N option is not present, Grid Engine assigns the name of the job script to the job after any directory pathname has been removed from the script name. If the script is read from standard input, the job name defaults to STDIN.
In the case of qsh or qlogin with the -N option absent, the name "INTERACTIVE" or "QLOGIN" respectively gets assigned to the job.
In the case of qrsh, if the -N option is absent, the resulting job name is determined from the qrsh command line by using the argument string up to the first occurrence of a semicolon or whitespace, and removing the directory pathname. With no command, "QRLOGIN" is used.
qalter lets you change this option even while the job executes.
The value specified with this option โ or the corresponding value specified in qmon โ gets passed to defined JSV instances as a parameter with the name N. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-noshellโ available only forqrshwith a command line.
Don't start the command line given to qrsh in the user's login shell, i.e. execute it without the wrapping shell.
This option can be used to speed up execution, since some overhead โ like the shell startup and sourcing the shell resource files โ is avoided. ๐๏ธ
This option can only be used if no shell-specific command line parsing is required. If the command line contains shell syntax like environment variable substitution or (back) quoting, a shell must be started. In this case, either don't use the -noshell option, or include the shell call in the command line.
Example:
qrsh echo '$HOSTNAME'
Alternative call with the -noshell option:
qrsh -noshell /bin/tcsh -f -c 'echo $HOSTNAME'
-nostdinโ available only forqrsh.
Suppress the input stream STDIN โ qrsh will pass the option -n to the rsh(1) command. This is especially useful if multiple tasks are executed in parallel using qrsh, e.g. in a make(1) process, where it would otherwise be undefined which process would get the input. ๐
-o [[hostname]:]path,...โ available forqsubandqalteronly, but currently silently ignored byqsh,qrsh, andqlogin.
Specify the path used for the standard output stream of the job. path is handled as described in the -e option for the standard error stream.
By default, the file name for standard output has the form job_name.ojob_id, or job_name.ojob_id.task_id for array job tasks (see the -t option below).
qalter lets you change this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, though.
If this option โ or a corresponding value in qmon โ is specified, then this value gets passed to defined JSV instances as a parameter with the name o. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-ot override_ticketsโ available forqalteronly.
Changes the number of override tickets for the specified job. Requires manager/operator privileges. ๐
-P project_nameโ available forqsub,qsh,qrsh,qloginandqalteronly.
Specifies the project to which this job is assigned. The administrator needs to give permission to individual users to submit jobs to a specific project (see the -aprj option to qconf(1)).
...and if you (or qmon) specify this option, then that value gets passed along to the defined JSV instances as a parameter with the name P. (peep the -jsv option above, or go read jsv(1) for the whole JSV deep-dive ๐)
-ppriority โ available forqsub,qsh,qrsh,qloginandqalteronly ๐
Defines or redefines the priority of the job relative to other jobs. priority is an integer in the range -1023 to 1024. The default priority value for jobs is 0.
Users may only decrease the priority of their own jobs. Grid Engine managers and administrators may also increase the priority associated with jobs. If a pending job has higher priority, it is eligible for being dispatched earlier by the Grid Engine scheduler. ๐
If this option or a corresponding value in qmon is specified and the priority is not 0 then this value will be passed to defined JSV instances as a parameter with the name p. (See -jsv option above or find more information concerning JSV in jsv(1).)
-peparallel_environmentn[-[m]]|[-]m,...โ available forqsub,qsh,qrsh,qloginandqalteronly โจ
Parallel programming environment (PE) to instantiate. For more detail about PEs, please see parallel_env in sge_types(5). ๐ฆ
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option or a corresponding value in qmon is specified then the parameters pe_name, pe_min and pe_max will be passed to configured JSV instances, where pe_name will be the name of the parallel environment and the values pe_min and pe_max represent the values n and m which have been provided with the -pe option. A missing specification of m will be expanded as value 9999999 in JSV scripts and it represents the value infinity. ๐ (See -jsv option above or find more information concerning JSV in jsv(1).)
-ptyy[es]|n[o] โ available forqrsh,qsubandqloginonly, and normally only effective for interactive jobs with the builtin remote startup method (seeremote_startup(5)) ๐
-pty yes starts the job in a pseudo terminal (pty). If no pty is available, the job start fails. -pty no starts the job without a pty. By default, qrsh without a command and qlogin start the job in a pty, and qrsh or qsub with a command starts the job without a pty.
This parameter is not available in the JSV context. (See -jsv option above or find more information concerning JSV in jsv(1).)
-qwc_queue_list โ available forqsub,qrsh,qsh,qloginandqalter๐
Defines or redefines a list of cluster queues, queue domains or queue instances which may be used to execute this job. Please find a description of wc_queue_list in sge_types(5). This parameter has all the properties of a resource request and will be merged with requirements derived from the -l option described above.
qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however.
If this option or a corresponding value in qmon is specified then these hard and soft resource requirements will be passed to defined JSV instances as parameters with the names q_hard and q_soft. If regular expressions will be used for resource requests, then these expressions will be passed as they are. Also shortcut names will not be expanded. (See -jsv option above or find more information concerning JSV in jsv(1).)
-Ry[es]|n[o] โ available forqsub,qrsh,qsh,qloginandqalter๐ฅ
Indicates whether a reservation for this job should be done. Reservation is never done for immediate jobs, i.e. jobs submitted using the -now yes option. Please note that regardless of the reservation request, job reservation might be disabled using max_reservation in sched_conf(5), and is limited to that number of the highest priority jobs.
By default jobs are submitted with -R n.
The value specified with this option or the corresponding value specified in qmon will only be passed to defined JSV instances if the value is yes. The name of the parameter will be R. The value will be y also when the long form yes was specified during submission. (See -jsv option above or find more information concerning JSV in jsv(1).)
-ry[es]|n[o] โ available forqsubandqalteronly ๐
Specifies whether a job can be rerun or not. If the value of -r is 'yes', the job will be rerun if it gets aborted without leaving a consistent exit state. (This is typically the case if the node on which the job is running crashes ๐). If -r is 'no' (the default), the job will not be rerun under such circumstances. It will still be rerun if it finishes with exit code 99 unless FORBID_RESCHEDULE is set in qmaster_params in sge_conf(5).
Interactive jobs submitted with qsh, qrsh, or qlogin are not rerunnable.
qalter allows changing this option even while the job executes.
The value specified with this option or the corresponding value specified in qmon will only be passed to defined JSV instances if the value is yes. The name of the parameter will be r. The value will be y also when the long form yes was specified during submission. (See -jsv option above or find more information concerning JSV in jsv(1).)
-scvariable[=value],... โ available forqsub,qsh,qrsh,qloginandqalteronly โจ
Sets the given name/value pairs as the job's context. value may be omitted. Grid Engine replaces the job's previously defined context with the one given as the argument. Multiple -ac, -dc, and -sc options may be given. The order is important.
Contexts provide a way to dynamically attach and remove meta-information to and from a job. The context variables are not passed to the job's execution context in its environment, but are available in its spool area. ๐ซถ
qalter allows changing this option even while the job executes.
The outcome of the evaluation of all -ac, -dc, and -sc options or corresponding values in qmon is passed to defined JSV instances as parameter with the name ac. (See -jsv option above or find more information concerning JSV in jsv(1).)
-shelly[es]|n[o] โ available only forqsub๐ธ
-shell n causes qsub to execute the command line directly, as if by exec(2). No command shell will be executed for the job. This option only applies when -b y is also used. Without -b y, -shell n has no effect.
This option can be used to speed up execution, as some overhead, like the shell startup and sourcing the shell resource files, is avoided. โก
This option can only be used if no shell-specific command line parsing is required. If the command line contains shell syntax, like environment variable substitution or (back) quoting, a shell must be started. In this case either do not use the -shell n option or execute the shell as the command line and pass the path to the executable as a parameter.
If a job executed with the -shell n option fails due to a user error, such as an invalid path to the executable, the job will enter the error state. ๐ญ
-shell y cancels the effect of a previous -shell n. Otherwise, it has no effect.
See -b and -noshell for more information.
The value specified with this option or the corresponding value specified in qmon will only be passed to defined JSV instances if the value is yes. The name of the parameter will be shell. The value will be y also when the long form yes was specified during submission. (See -jsv option above or find more information concerning JSV in jsv(1).)
-softโ available forqsub,qsh,qrsh,qloginandqalteronly ๐
Signifies that all resource requirements following in the command line will be soft requirements and are to be filled on an "as available" basis.
As Grid Engine scans the command line and script file for Grid Engine options and parameters, it builds a list of resources required by the job. All such resource requests are normally considered as absolutely essential for the job to commence. However, if the -soft option is encountered during the scan then all following resources are designated as "soft requirements" for execution, or "nice-to-have, but not essential" โจ. If the -hard flag (see above) is encountered at a later stage of the scan, all resource requests following it once again become essential. The -hard and -soft options in effect act as toggles during the scan. However, requests for consumable resources cannot be soft.
If this option or a corresponding value in qmon is specified then the corresponding -q and -l resource requirements will be passed to defined JSV instances as parameter with the names q_soft and l_soft. Find for information in the sections describing -q and -l. (See -jsv option above or find more information concerning JSV in jsv(1).)
-syncy[es]|n[o] โ available forqsub.
Okay so more tea on -sync, because this one has layers ๐
-sync y makes qsub literally wait for the job to finish before it exits. If the job completes successfully, qsub's exit code will be that of the completed job. If the job fails to complete successfully, qsub prints an error message to the standard error stream telling you exactly why it flopped, and has an exit code of 1. And if qsub gets interrupted, like with CTRL-C, before the job completes, the job will be canceled. No take-backsies.
With -sync n, qsub exits with an exit code of 0 as soon as the job is submitted successfully. -sync n is default for qsub. Slay, low-effort behavior.
If -sync y is used together with -now y, qsub behaves as though only -now y were given until the job has been successfully scheduled, and after that it behaves as though only -sync y were given. It's giving two-faced but in a useful way โจ
If -sync y is used together with -t, qsub waits for all the job's tasks to complete before exiting. If all the job's tasks complete successfully, qsub's exit code will be that of the first completed job task with a non-zero exit code, or 0 if all job tasks exited with an exit code of 0. If any of the job's tasks fail to complete successfully, qsub prints an error message to the standard error stream indicating why the job task(s) failed, and will have an exit code of 1. If qsub is interrupted, e.g. with CTRL-C, before the job completes, all of the job's tasks will be canceled.
Heads up bestie: information that this switch was specified during submission is not available in the JSV context. (See-jsvoption above or find more information concerning JSV injsv(1).)
-S [[hostname]:]pathname,...โ available forqsub,qshandqalter.
This one specifies the interpreting shell for the job. pathname must be an executable file which interprets command-line options -c and -s as /bin/sh does. Like, it has to actually speak that dialect, no posers.
Only one pathname component without a host specifier is valid, and only one path name for a given host is allowed. Shell paths with host assignments define the interpreting shell for the job if the host is the execution host. The shell path without host specification is used if the execution host matches none of the hosts in the list. Fallback queen ๐
Furthermore, the pathname can be constructed with pseudo environment variables as described for the -e option above. Cute.
In the case of qsh the specified shell path is used to execute the corresponding command interpreter in xterm(1) (via its -e option) started on behalf of the interactive job. Qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however. Patience, babe ๐ฆ
If this option or a corresponding value in qmon is specified then this value will be passed to defined JSV instances as parameter with the name S. (See -jsv option above or find more information concerning JSV in jsv(1).)
-t n[-m[:s]]โ available forqsubonly.
This submits a so called Array Job, i.e. an array of identical tasks being differentiated only by an index number and being treated by Grid Engine almost like a series of jobs. The argument of -t specifies the number of array job tasks and the index number which will be associated with the tasks in terms of the range's start (n), default 1, its end (m), and stride (s), default 1. The index numbers will be exported to the job tasks via the environment variable SGE_TASK_ID. The arguments n, m, and s will be available through the environment variables SGE_TASK_FIRST, SGE_TASK_LAST and SGE_TASK_STEPSIZE.
The following restrictions apply to the values n and m:
1 <= n <= MIN(2^31-1, max_aj_tasks)
1 <= m <= MIN(2^31-1, max_aj_tasks)
n <= m
max_aj_tasks is defined in the cluster configuration (see sge_conf(5)).
The task id range specified in the option argument may be a single number, a simple range of the form n-m or a range with a step size. Hence, the task id range specified by 2-10:2 would result in the task id indexes 2, 4, 6, 8, and 10, for a total of 5 identical tasks, each with the environment variable SGE_TASK_ID containing one of the 5 index numbers. Math ate, no cap ๐งฎ
All array job tasks inherit the same resource requests and attribute definitions as specified in the qsub or qalter command line, except for the -t option. The tasks are scheduled independently and, provided enough resources exist, concurrently, very much like separate jobs. However, an array job or a sub-array there of can be accessed as a single unit by commands like qmod(1) or qdel(1). See the corresponding manual pages for further detail.
Array jobs are commonly used to execute the same type of operation on varying input data sets correlated with the task index number. The number of tasks in an array job is unlimited. Go off ๐
STDOUT and STDERR of array job tasks will be written into different files with the default location
jobname.[e|o]job_id.task_id
In order to change this default, the -e and -o options (see above) can be used together with the pseudo environment variables $HOME, $USER, $JOB_ID, $JOB_NAME, $HOSTNAME, and $TASK_ID.
Note, that you can use the output redirection to divert the output of all tasks into the same file, but the result of this is undefined. Do not do this and expect nice things ๐
If this option or a corresponding value in qmon is specified then this value will be passed to defined JSV instances as parameters with the names t_min, t_max and t_step (See -jsv option above or find more information concerning JSV in jsv(1).)
-tc max_running_tasksโ available forqsubandqalteronly.
Used in conjunction with array jobs (see -t option) to set a self-imposed limit on the maximum number of concurrently running tasks per job. Setting boundaries for yourself? Growth ๐ฑ
If this option, or a corresponding value in qmon is specified, then this value will be passed to defined JSV instances as a parameter with the name tc. (See the -jsv option above or find more information concerning JSV in jsv(1).)
-terseโ available forqsubonly.
Causes qsub to display only the job-id of the job being submitted rather than the regular "Your job ..." string. In case of an error the error is reported on stderr as usual. This can be helpful for scripts which need to parse qsub output to get the job-id. Script girlies stay winning ๐
Information that this switch was specified during submission is not available in the JSV context. (See-jsvoption above or find more information concerning JSV injsv(1).)
-u username,...โ available forqalteronly.
Changes are only made on those jobs which were submitted by users specified in the list of usernames. For managers it is possible to use the qalter -u '*' command to modify all jobs of all users. Manager privileges, main character energy fr ๐
If you use the -u switch it is not permitted to specify an additional wc_job_range_list. Pick a lane.
-v variable[=value],...โ available forqsub,qrsh(with command argument) andqalter.
Defines or redefines the environment variables to be exported to the execution context of the job. If the -v option is present Grid Engine will add the environment variables defined as arguments to the switch and, optionally, values of specified variables, to the execution context of the job.
Qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however. Again โ patience, the vibes take a minute to land ๐
All environment variables specified with -v, -V or the DISPLAY variable provided with -display will be exported to the defined JSV instances only optionally when this is requested explicitly during the job submission verification. (See -jsv option above or find more information concerning JSV in jsv(1).)
-verboseโ available only forqrshandqmake(1).
Unlike qsh and qlogin, qrsh does not output any informational messages while establishing the session, compliant with the standard rsh(1) and rlogin(1) system calls. If the option -verbose is set, qrsh behaves like the qsh and qlogin commands, printing information about the process of establishing the rsh(1) or rlogin(1) session. It's giving chatty era โจ
-verifyโ available forqsub,qsh,qrsh,qloginandqalter.
Instead of submitting a job, prints detailed information about the would-be job as though qstat(1) -j were used, including the effects of command-line parameters and the external environment. A little dress rehearsal, we love a preview ๐ฆ
-Vโ available forqsub,qsh,qrshwith command andqalter.
Specifies that all environment variables active within the qsub utility be exported to the context of the job. Bring the whole friend group ๐ซถ
All environment variables specified with -v, -V or the DISPLAY variable provided with -display will be exported to the defined JSV instances only optionally when this is requested explicitly during the job submission verification. (See -jsv option above or find more information concerning JSV in jsv(1).)
-w e|w|n|p|vโ available forqsub,qsh,qrsh,qloginandqalter.
Specifies a validation level applied to the job to be submitted (qsub, qlogin, and qsh) or the specified queued job (qalter).
The specifiers e, w, n, p, and v define the following validation modes:
eโ error - jobs with invalid requests will be rejected.wโ warning - only a warning will be displayed for invalid requests.nโ none - switches off validation; the default forqsub,qalter,qrsh,qshandqlogin.pโ poke - does not submit the job but prints a validation report based on a cluster as is with all resource utilizations in place.vโ verify - does not submit the job but prints a validation report based on a dry scheduling run on an empty cluster, ignoring load values.
Resource requests exceeding the configured maximal thresholds or requests for unavailable resource attributes are possible causes for jobs to fail v validation. Vibe check failed, bestie ๐ญ
Okay bestie, quick lil heads-up before you get too excited about the <code>-w</code> verification thing: those checks? They're lowkey expensive โ they eat performance, so the checking is switched off by default. ๐ And ngl, load values don't even get factored into the verification, because they're assumed to be way too volatile to trust. So if you wanna make a -w e verification actually pass at submission time, you can specify non-volatile values (non-consumables) or maximum values (consumables) in complex_values. That's the move. โจ
If this option is specified โ or a corresponding value in qmon is โ then that value gets passed to defined JSV instances as a parameter named w. (Peep the -jsv option above, or go find more about JSV in jsv(1).)
-wdworking_dir โ available forqsub,qsh,qrshandqalteronly, bestie, don't try it elsewhere โ run the job from the directory you put in working_dir. This switch activates Grid Engine's path aliasing facility, but only if the corresponding configuration files are actually there (seesge_aliases(5)). ๐
qalter lets you change this option even while the job is executing. The modified parameter will only be in effect after a restart or migration of the job, however. ๐ The parameter value will be available in defined JSV instances as a parameter with the name cwd. (See the -cwd switch above, or find more about JSV in jsv(1).)
commandโ available forqsubandqrshonly โ it's the job's scriptfile or binary. If it's not present, or if the operand is the single-character string'-', thenqsubreads the script from standard input. ๐
The command will be available in defined JSV instances as a parameter with the name CMDNAME (see the -jsv option above, or find more about JSV in jsv(1)).
command_argsโ available forqsub,qrshandqalteronly โ these are the arguments to the job. Not valid if the script is entered from standard input, periodt. ๐
qalter lets you change this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however. (Yeah, same deal as before. ๐)
The number of command arguments is provided to configured JSV instances as a parameter with the name CMDARGS. Also, the argument values can be accessed โ argument names have the format CMDARGnumber, where number is an integer between 0 and CMDARGS - 1. (See the -jsv option above, or find more about JSV in jsv(1).)
xterm_argsโ available forqshonly โ these are the arguments to thexterm(1)executable, as defined in the configuration. For details, refer tosge_conf(5).
Info about xterm_args will be available in the JSV context as parameters with the names CMDARGS and CMDARGnumber. Find more above in the section on command_args. (See the -jsv option above, or find more about JSV in jsv(1).)
โจ ENVIRONMENT VARIABLES โจ
okay bestie these are the env vars that make the whole thing go ๐ซถ
SGE_ROOTโ tells everyone where the Grid Engine standard config files live.SGE_CELLโ if you set it, this is your default Grid Engine cell ๐ซ. When you want to talk to a cell withqsub,qsh,qloginorqalter, it uses the name inSGE_CELLif that's set, and if it's not set it falls back to the default cell name, which is literallydefault. iconic of it.SGE_DEBUG_LEVELโ set this and debug info gets written tostderr. it also decides how much detail the debug info has, so like, dial it up if you're nosy.SGE_QMASTER_PORTโ if set, this is the tcp port thatsge_qmaster(8)is expected to listen on for communication requests. most installs will use a services map entry for the service"sge_qmaster"instead to define that port, no cap.DISPLAYโ forqshjobs theDISPLAYhas to be specified at job submission. ifDISPLAYisn't set using the-displayor the-vswitch, then whatever's in theDISPLAYenvironment variable gets used as the default. ๐QRSH_WRAPPERโ wrapper forqrshcommands (see above).SGE_JSV_TIMEOUTโ if the response time of the client JSV is greater than this timeout value, then the JSV will attempt to be re-started. the default value is10seconds, and this value must be greater than 0. if the timeout has been reached, the JSV will only try to re-start once, and if the timeout is reached again an error will occur. ๐ญ one shot, no retries.
so beyond those env vars that get exported to the job via the -v or the -V option (see above), qsub, qsh, and qlogin also add several variables of the form SGE_O_NAME whose value is taken from NAME in the submission environment. for each one, a variable with the same value is added to the job context, but with a lower-case version of the name, i.e. xqs_name_sxx_o_home in the job context corresponds to xQS_NAME_Sxx_O_HOME in the job environment, and HOME in the submission environment, as follows. these context variables are displayed by qstat(1) with the -j option. โจ
SGE_O_HOME,SGE_O_HOST,SGE_O_MAIL,SGE_O_PATH,SGE_O_TZ,SGE_O_SHELL,SGE_O_TERMโ as in the description ofSGE_O_NAMEabove, but the SGE clients use a library call to determine to determine the host name ifHOSTis not set. note that there is no guarantee that these are in any way "correct", e.g. you should not rely onSGE_O_HOSTfor any sort of access control or auditing. ๐ fr fr, do not do that.SGE_O_LOGNAMEโ as above, but the corresponding context variable issge_log_name.SGE_O_WORKDIRโ the absolute path of the current working directory of the submitting client, reflected in the context assge_o_workdirand typically corresponding to theCWDenvironment variable.
Grid Engine sets other variables in the job's environment, as follows. ๐
ARC,SGE_ARCHโ the Grid Engine architecture name of the node on which the job is running. the name is compiled-in into thesge_execd(8)binary.SGE_BINDINGโ contains the selected operating system internal processor numbers. there might be more than the number of selected cores in the presence of SMT or CMT because each core could be represented by multiple processor identifiers. the processor numbers are space-separated.SGE_CKPT_ENVโ specifies the checkpointing environment (as selected with the-ckptoption) under which a checkpointing job executes. only set for checkpointing jobs.SGE_CKPT_DIRโ only set for checkpointing jobs. contains pathckpt_dir(seecheckpoint(5)) of the checkpoint interface.SGE_CWD_PATHโ specifies the current working directory where the job was started.SGE_STDERR_PATHโ the pathname of the file to which the standard error stream of the job is diverted. commonly used for enhancing the output with error messages from prolog, epilog, parallel environment start/stop or checkpointing scripts.SGE_STDOUT_PATHโ the pathname of the file to which the standard output stream of the job is diverted. commonly used for enhancing the output with messages from prolog, epilog, parallel environment start/stop or checkpointing scripts.SGE_STDIN_PATHโ the pathname of the file from which the standard input stream of the job is taken. this variable might be used in combination withSGE_O_HOSTin prolog/epilog scripts to transfer the input file from the submit to the execution host. ๐ฆSGE_JOB_SPOOL_DIRโ the directory used bysge_shepherd(8)to store job related data during job execution. this directory is owned by root or by a Grid Engine administrative account.SGE_TASK_IDโ the index number of the current array job task (see-toption above). this is a unique number in each array job and can be used to reference different input data records, for example. this environment variable is set to"undefined"for non-array jobs. it is possible to change the predefined value of this variable with-vor-V(see options above).SGE_TASK_FIRSTโ the index number of the first array job task (see-toption above). it is possible to change the predefined value of this variable with-vor-V(see options above).SGE_TASK_LASTโ the index number of the last array job task (see-toption above). it is possible to change the predefined value of this variable with-vor-V(see options above).SGE_TASK_STEPSIZEโ the step size of the array job specification (see-toption above). it is possible to change the predefined value of this variable with-vor-V(see options above).ENVIRONMENTโ theENVIRONMENTvariable is set toBATCHto identify that the job is being executed under Grid Engine control.HOMEโ the user's home directory path from thepasswd(5)database.HOSTNAMEโ the hostname of the node on which the job is running.JOB_IDโ a unique identifier assigned by thesge_qmaster(8)when the job was submitted. the job ID is a decimal integer in the range1to99999.JOB_NAMEโ the job name. for batch jobs or jobs submitted byqrshwith a command, the job name is the basename of theqsubscript/binary filename or theqrshcommand. for interactive jobs it is set to"INTERACTIVE"forqshjobs,"QLOGIN"forqloginjobs and"QRLOGIN"forqrshjobs without a command.
this default may be overwritten by the -N option.
JOB_SCRIPTโ the path to the job script which is executed. the value can not be overwritten by the-vor-Voption. ๐LOGNAMEโ the user's login name from the passwd database.NHOSTSโ the number of hosts in use by a parallel job.NQUEUESโ the number of queues allocated for the job (always1for serial jobs).NSLOTSโ the number of queue slots in use by a parallel job.PATHโ a default shell search path of:
/usr/local/bin:/usr/ucb:/bin:/usr/bin
SGE_BINARY_PATHโ the path where the Grid Engine binaries are installed. the value is the concatenation of the cluster configuration valuebinary_pathand the architecture name$SGE_ARCHenvironment variable.PEโ the parallel environment under which the job executes (for parallel jobs only).PE_HOSTFILEโ the path of a file containing the definition of the virtual parallel machine assigned to a parallel job by Grid Engine. see the description of the$pe_hostfileparameter insge_pe(5)for details on the format of this file. the environment variable is only available for parallel jobs.QUEUEโ the name of the cluster queue in which the job is running.REQUESTโ available for batch jobs only.
the request name of a job as specified with the -N switch (see above) or taken as the name of the job script file.
RESTARTEDโ this variable is set to1if a job was restarted after a system crash, or after migration of a non-application-level checkpointing job. it is set to2when a job with application-level checkpointing is restarted with a checkpoint available. otherwise its value is0.SHELLโ the user's login shell from the passwd database. Note: this is not necessarily the shell in use for the job. ๐TMPDIRโ the absolute path to the job's temporary working directory.TMPโ the same asTMPDIR; provided for compatibility with NQS.TERMโ the terminal type imported from the submission session (only for interactive jobs).TZโ the time zone variable imported fromsge_execd(8)if set.USERโ the user's login name from the passwd database.
an additional variable, SGE_JOBEXIT_STAT, is set to the job exit status in the epilog only (see also sge_conf(5)). ๐
๐ง RESTRICTIONS ๐ง
ngl bestie this is the part that eats people's jobs alive ๐ญ
without -pty y, there is no controlling terminal for batch jobs under Grid Engine, and any tests or actions on a controlling terminal will fail. if these operations are in your .login or .cshrc file, they may cause your job to abort. ๐
insert the following test before any commands that are not pertinent to batch jobs in your .login:
if ( $?JOB_NAME) then
echo "Grid Engine spooled job"
exit 0
endif
or in your .profile:
if [ ! -z "$JOB_NAME" ] then
echo "Grid Engine spooled job"
exit 0
fi
don't forget to set your shell's search path in your shell start-up before this code. ๐ order matters, bestie, always has.
๐ฅ EXIT STATUS ๐ฅ
ok so when you dip out, here's the tea on what your exit code is telling you:
0โ slay!! โจ the operation was executed successfully. no notes, ate and left no crumbs.25โ bestie ๐ญ it was not possible to register a new job because of the configuredmax_u_jobsormax_jobslimit. you've hit the ceiling, the limit said no more. extra info lives insge_conf(5)if you wanna dig.>0โ error occurred. something went sideways. ๐
๐ธ EXAMPLES ๐ธ
okay so here's the absolute simplest form of a Grid Engine script file. like, bare minimum, no frills, just vibes:
#!/bin/sh
./a.out
and here's a more complex Grid Engine script, because sometimes you want the whole menu, not just the appetizer:
#!/bin/sh
# Which account to be charged cpu time
#$ -A santa_claus
# date-time to run, format [[CC]yy]MMDDhhmm[.SS]
#$ -a 12241200
# to run I want 6 or more parallel processes
# under the PE pvm. the processes require
# 128M of memory
#$ -pe pvm 6- -l mem=128
# If I run on dec_x put stderr in /tmp/foo, if I
# run on sun_y, put stderr in /usr/me/foo
#$ -e dec_x:/tmp/foo,sun_y:/usr/me/foo
# Send mail to these users
#$ -M santa@nothpole,claus@northpole
# Mail at beginning/end/on suspension
#$ -m bes
# Export these environmental variables
#$ -v PVM_ROOT,FOOBAR=BAR
# The job is located in the current
# working directory.
#$ -cwd
not me reading through that whole thing and being like "yes santa_claus is the account being charged cpu time, iconic" ๐ ๐
๐ FILES ๐
here's every file you might bump into, bestie:
$REQUEST.oJID[.TASKID]โ STDOUT of job#JID$REQUEST.eJID[.TASKID]โ STDERR of job$REQUEST.poJID[.TASKID]โ STDOUT of par. env. of job$REQUEST.peJID[.TASKID]โ STDERR of par. env. of job
and the config-ish ones, all cozy in their homes:
$cwd/.sge_aliasesโ cwd path aliases$cwd/.sge_requestโ cwd default request$HOME/.sge_aliasesโ user path aliases$HOME/.sge_requestโ user default request<sge_root>/<cell>/common/sge_aliasesโ cluster path aliases<sge_root>/<cell>/common/sge_requestโ cluster default request<sge_root>/<cell>/common/act_qmasterโ Grid Engine master host file
๐ SEE ALSO ๐
go read these too, they're all part of the extended universe, no skips:
sge_intro(1), qconf(1), qdel(1), qhold(1), qmod(1), qrls(1), qstat(1), accounting(5), sge_aliases(5), sge_conf(5), sge_request(5), sge_pe(5), sge_shepherd(8), complex(5), sge_types(5).
ยฉ๏ธ COPYRIGHT ยฉ๏ธ
ok so this part is the legal one, but stay with me because it's kinda interesting ngl. if it's configured correspondingly, qrsh and qlogin contain portions of the rsh, rshd, telnet and telnetd code copyrighted by The Regents of the University of California. so because of that, the following note applies with respect to qrsh and qlogin:
This product includes software developed by the University of California, Berkeley and its contributors.
also check out sge_intro(1), plus the info provided in <sge_root>/3rd_party/qrsh and <sge_root>/3rd_party/qlogin for a statement of further rights and permissions. read those, fr fr, they're the receipts ๐ซถ
and that's the whole page, bestie!! ๐ you made it to the end, which is giving main character energy, no cap. this was SGE 8.1.3pre, dated 2011-11-27, and yes she's an older queen but she still runs the cluster ๐
bye babes, go submit something iconic โจ๐ฆ๐ธ
๐ฆ where this page comes from
- debian bookworm: gridengine-client 8.1.9+dfsg-10+b1 ยท SISSL
- debian trixie: gridengine-client 8.1.9+dfsg-13.1 ยท SISSL
- ubuntu jammy: gridengine-client 8.1.9+dfsg-10build1 ยท SISSL
- ubuntu noble: gridengine-client 8.1.9+dfsg-11build3 ยท SISSL
- ubuntu questing: gridengine-client 8.1.9+dfsg-13.1
- ubuntu resolute: gridengine-client 8.1.9+dfsg-13.2 ยท SISSL
- ubuntu stonking: gridengine-client 8.1.9+dfsg-13.2ubuntu1 ยท SISSL
- Copyright 2011 Univa Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms