ICC Home Privacy and Legal Notice LC User Documents Banner

UCRL-WEB-201386

SLURM Reference Manual


I/O Redirection Alternatives

SRUN I/O options -i (--input), -o (--output), and -e (--error) all take as arguments any of five I/O redirection alternatives ("modes") summarized in this table and explained in more detail below it:


Redirection
Alternatives
File-Naming
Subchoices
Tasks
Covered
I/O Goes
To or From

all [default] all tasks SRUN (terminal)
none all tasks /dev/null (ignored)
taskid one selected task SRUN (terminal)
filename all tasks one specified file
fstring many separate tasks: many separate files:
%J [uc] all with jobid.stepid 1 file per jobid.stepid
%j [lc] all with jobid 1 file per jobid
%s [lc] all with stepid 1 file per stepid
%N [uc] all on hostname 1 file per node
%n [lc] all on node n 1 file per node
%t [lc] each separate task 1 file per task

The I/O redirection alternatives compared in the table work in detail as follows:

all
redirects STDOUT and STDERR from all job tasks to SRUN (and hence to the attached terminal), and broadcasts STDIN from SRUN (the terminal) to all remote tasks (this is SRUN's default behavior for handling I/O).
none
redirects STDOUT and STDERR from all job tasks to /dev/null (i.e., SRUN receives no I/O from any task), and sends no STDIN to any task (closes STDIN).
taskid
redirects to SRUN (and hence to the attached terminal) STDOUT and STDERR from the single specified task whose relative ID is taskid, where the range for integer taskid starts at 0 (the first task) and runs through the total number of tasks in the current job step. This choice also redirects STDIN from SRUN (the terminal) to this single specified task.
filename
redirects STDOUT and STDERR from all job tasks into a single file called filename, and broadcasts STDIN from that same file to all remote tasks. To subdivide the I/O among separate files, use the fstring alternative below.
fstring ["format string"]
uses a parameterized "format string" to systematically generate unique names for (usually) multiple I/O files, each of which receives some job I/O depending on the naming scheme that you choose. You can subdivide the received I/O into separate files by job ID, step ID, node (name or sequence number), or individual task. In each case, SRUN opens the appropriate number of files and associates each with the appropriate subset of tasks.

Available parameters with which to construct fstring (and thereby to split the I/O among separate files) include:

%J
(uppercase) creates one file for each jobID/stepID combination for this running job, and imbeds jobid.stepid in each file's name (for example, out%J might yield files out4812.0, out4812.1, etc.).
%j
(lowercase) creates one file for each jobID and imbeds jobid in its name (for example, job%j might yield file job4812).
%s
(lowercase) creates one file for each stepID and imbeds stepid in its name (for example, step%s.out would yield files step0.out, step1.out, etc.). SRUN does not support job steps on BlueGene/L.
%N
(uppercase) creates one file for each node on which this job runs and imbeds that node's short hostname in the file name (for example, node.%N might yield files node.mcr347, node.mcr348, etc.).
%n
(lowercase) creates one file for each node on which this job runs and imbeds that node's numerical identifier relative to the job (where the each job's first node is 0, then 1, etc.) in the file name (for example, node%n would yield files node0, node1, etc.).
%t
(lowercase) creates one file for each separate task in this running job and imbeds that task's numerical identifier relative to the job (the first task is 0) in the file name (for example, job%j-%t.out might yield files job4812-0.out, job4812-1.out, etc.).
For all fstring parameters except the nonnumeric case of %N, you can insert an integer between the percent character and the letter (such as %3t) to "zero-pad" the resulting file names, that is, to always use the integer number of character positions and to fill any empty positions with zeros from the left. Thus job%j-%3t.out might yield files job4812-000.out, job4812-001.out, etc.



Navigation Links: [ Document List ] [ HPC Home ] [ Next ]