This command forw ards the standard output and error messages
from the running job w ith SLURM ID 6543 to the attachin g srun
command to reveal the job’s current status, and (with -j) also joins
the job so that you can send it signals as if this srun command had
initiated the job. Omit -j for r ead-only attachments. Because you
are attaching to a running job whose resources have already been
allocated, the srun resource-allocation options (such as -N)are
incompatible with -a.
Batch ( with LSF) You can submit a script to LSF that contains (simple) srun
commands within it to execute parallel jobs later. In this case, LSF
takes the place of the srun -b option for indirect, across-machine
job-queue management.
6.4.2 srun Signal Handling
Signals sent to srun are automatically forwarded to the tasks that srun controls, with a few
special cases. srun hand les the Ctrl/C sequence d ifferently, depending on h ow many times
it receives Ctrl/C in one second. The following defines how Ctrl/C is handled b y srun:
•Ifsrun receives one Ctrl/C, it reports the state of all tasks associated with srun.
•Ifsrun receives a second Ctrl/C within one second, it sends the SIGINT signal to all
associated srun tasks.
•Ifsrun receives a third Ctrl/C wi thi n one second, it terminates the job at o nce, without
waiting for remote tasks to exit.
6.4.3 srun Run-Mode Options
This section e xplains the mutually exclusive srun options that enable i ts different run modes.
-b (--batch)
This option runs a script in batch mode. The script n a me must appear at the end of the srun
execute line, not as an argument to -b. You cannot use -b with -A or -a.
srun copies the script, submits the request to run (with your specified resource allocation) to
the l ocal SLURM-manage d job queue, and ends. When resources become available and no
higher priority job is pending, SLURM runs the script on the first node allocated to the job,
with stdin redirected from /dev/null and stdout and stderr redirected to a file called
jobname.out in the current working dir ectory (unless yo u r equest a different name or a more
elaborate set of output files by using -J or -o).
The -b option has the following script requirements:
• You must use the script’s absolute path name, or a path name relative to th e current working
directory (srun ignores your search path).
• srun interpre ts the script using your de fault shell unless the file b egin s with the character
pair #! followed by th e absolute pathname of a valid shell.
• The script must contain MPI co mm and s or other (simple) srun commands to initiate
parallel tasks.
-A (--allocate)
The-A option allocates compute resources (as specified by other srun options) and starts
(spawns) a subshell that has access to those allocated resources. No remote tasks are started.
Yo u cannot use -A with -b or -a.
6-4 Using SLURM
Commentaires sur ces manuels