2 i/o redirection alternatives – HP XC System 2.x Software User Manual

Page 79

Advertising
background image

commands let you choose from among any of five I/O redirection alternatives (modes) that
are explained in the next section.

-o mode

(

--output=mode

)

The

-o

option redirects standard output

stdout

for this job to mode, one of five alternative

ways to display, capture, or subdivide the job’s I/O, explained in the next section. By default,

srun

collects

stdout

from all job tasks and line buffers it to the attached terminal.

-i mode

(

--input=mode

)

The

-i

option redirects standard input

stdin

for this job from mode, one of five alternative

ways to display, capture, or subdivide the job’s I/O, explained in the next section. By default,

srun

redirects

stdin

from the attached terminal to all job tasks.

-e mode

(

--error=mode

)

The

-e

option redirects standard error

stderr

for this job to mode, one of five alternative

ways to display, capture, or subdivide the job’s I/O, explained in the next section. By default,

srun

collects

stderr

from all job tasks and line buffers it to the attached terminal, just

as with

stdout

. But you can request that

srun

handle standard output and standard error

differently by invoking

-e

and

-o

with different redirection modes.

-l

(

--label

)

The

-l

option prepends the remote task ID number to each line of standard output and standard

error. By default,

srun

line buffers this I/O to the terminal (or to specified files) without any

task labels. Options

-l

and

-u

are mutually exclusive.

-u

(

--unbuffered

)

The

-u

option prevents line buffering of standard output from remote tasks (buffering is the

srun

default). Options

-l

and

-u

are mutually exclusive.

6.4.6.2 I/O Redirection Alternatives

The

srun

I/O options

-i

(

-input

),

-o

(

-output

), and

-e

(

-error

), all take any of five

I/O redirection alternatives (modes) as arguments. These arguments are explained in this section.

all

The all argument 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

The none argument redirects

stdout

and

stderr

from all job tasks to

/dev/null

(receives

no I/O from any task) and sends no

stdin

to any task (closes

stdin

).

taskid

The taskid argument 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

The filename argument redirects

stdout

or

stderr

from all job tasks into a single file called

filename, or broadcasts

stdin

from that same file to all remote tasks, depending upon the

I/O command.

Using SLURM

6-9

Advertising