starts multiple commands (possibly on multiple hosts or on a multiprocessor environment)
labschedule [<option>] ... <executable> [<arguments>]
'labrun'
calls; the remaining loops will incorporated into
one experiment
(with executable labschedule --direct ... <executable> ...
)
'schedule'
)
./lab_log
)
ssh %host; cd %curdir
)
--log=%logdir
--name=%name-%1-%2-...
'
as command executed
~/.labrc
and ./labrc
With @FILE
or @ FILE
(some) command-line options are read
from FILE
(see section ).
For every combination of the words in each of the --for
commands, an
experiment is started. In addition to the log and output files
produced by labrun, labschedule keeps track of its own actions in
three files: a .log file that logs all relevant actions, a
.out file that holds the output of all successful runs, and a
.err file that holds the output of all failed runs.
:<PATTERN>
<PATTERN>
contains
parentheses,
only the match corresponding to the parentheses will be
taken.
Otherwise the first word after the regular expression
will be taken.
The <PATTERN>
may not contain spaces. Use
\s
instead. Some documentation for regular
expressions is given in Section
Furthermore, the characters ~
,*
or ?
in words will
be interpreted as a shell would.
eval(EXPRESSION) will be replaced by the evaluation of the python
EXPRESSION, range(X) is a shortcut for
eval(range(X)) and will be replaced by the words
. The functions of the python
modules ``random'' and ``math'' can be used.
ssh %host cd %curdir;
or an empty string
h)ead | (directory) | %1:h | /dir |
t)ail | (name) | %1:t | name.ext |
e)xt | (extension) | %1:e | ext |
r)oot | (skip ext) | %1:r | /dir/name |
s)ubst | (regular expression substitution /from/to/, any character may be delimiter) | %1:s-e(.)-\1E- |
/dir/nam.ExEt |
%idle=`%prefix vmstat 1 2`:(?s).*\D(\d+)
\D
is
[^0-9]
and (\d+)
returns the last number printed by
vmstat
.)
By default, every host gets assigned %maxtasks tasks. On multiuser systems it may be advisable to check if the host can accept a further task. This can be done with the --check switch:
The results of commands, contents of files, and values of environment variables can be incorporated into EXP in the same way they can for for loop values. (See two sections above).
--check=`ssh %host vmstat 1 2`:[^@]*([0-9]+) > 5
--check=`%prefix vmstat 1 2`:[^@]*([0-9]+) > 5
--check=%idle > 5
Nevertheless, the switch is useful for completely different things:
labschedule --direct --for=*.ps ps2pdf %1 %1:r.pdf
labschedule -d -f*.jpg sh -c 'djpeg %1|pnmscale 0.5|cjpeg>sml/%1'
labschedule --direct --for='hert polzin kettner schaefer' finger %1
s**2,range(100))) --for=range(2,11,2) calc %1 %2
labschedule --for="D E F" --for=/dat/%1/*.stp --nesting=1
--labrunflag=--cvs=~/src --labrunflag=--autocvs steiner %2
~/dat/D
,
~/dat/E
, and ~/dat/F
, start an experiment (with the
given labrun options. In each of these experiments, start
steiner with every *.stp file in the current
directory.
labschedule --for="eval(map(lambda s:randint(1,1000),range(20)))" gugl %1
gugl
with 20 random integers between 1 and 1000.