job
job [ -i check_interval ] [ -q queue ]
job ( -l | -L ) [ -q queue ]
job -Q
job -r ( id | last )
job [ -f ] -s ( id | last )
job -p ( id | last )
job -a [ -q queue ]
job -c ( id | last )
This command can be used to serialize jobs on a UNIX system within the environment of the current user (in the user context of the user).
It has a similar user interface to the at command.
To define a new job, start job, then add the commands to be executed interactively in the job> prompt.
To end adding commands to a job, press [Ctrl] + [D] or enter a . (dot) as last command.
The advantages of this command are multiple queue support, execution of jobs in the current user environment and a logging facility.
Be aware, that the directories edrc/bin/ and edrc/lib/ are added to the $PATH environment variable and therefore all WA2L/edrc commands are also available for use in defined jobs without the need to alter the environment beforehand.
The command was developed to optimize simulation calculations where only a number of licenses are available to simultaneously perform calculation runs.
The situation was, that a user needed
to wait until the calculation of a coworker has been finished
to start the own calculation.
This meant that the time during off-office hours were lost when
a calculation ended after office hours.
Using the
job
sequencer
the calculations could be en-queued and when one calculation
finished, the following job started automatically.
For each simultaneous calculation an own queue was used.
So the licenses could be used most efficiently and also
night times were efficiently used to run calculations.
The job sequencer was developed in year 2000 as a stand alone utility and then later integrated into WA2L/edrc.
To pretty-print the CSV output, use:
job -a | csv list
To select a specific project (e.g. APOLLO), the 'csv where projectname' command could be used:
job -a | csv where APOLLO | csv list
To show specific columns of the CSV output, the 'csv select columns' command could be used in addition:
job -a | csv where APOLLO | csv select "TAG;DURATION_S" | csv list
This can be used to re-run a job using:
job -c 10123 | job
Therefore all WA2L/edrc commands are available for use in jobs.
Currently available FUNCTIONs are:
Allowed characters for a tag are: a-Z, 0-9, /, =, -, _, . and ,.
: job>JOBCOMPLETED "/opt/mycalc/bin/checkflag" :
whereas the command needs to return 0 when the job is completed and a value different to 0 when the job is not jet completed.
If the command is not set, the commands to check job completion need to be provided thru stdin, as for example:
: job>JOBCOMPLETED <<EOC job> if [ -f /tmp/mycalc.flag ]; then job> exit 0 job> else job> exit 1 job> fi job>EOC :
The job completion critera needs to be set in cases where for instance the commands defined in the job run in the background. In this case the job command would report the done state too early.
The JOBCOMPLETED function should be set prior to the job workload commands.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.