The file descriptor string assigns one or more of the following attributes to a file descriptor:
r - File descriptor is to be read from.
w - File descriptor is to be written to.
p - File descriptor is to be attached to a pseudo-terminal (pty).
You must specify either r or w for each file descriptor--that is, whether the file descriptor is to be written to or read from.
Thus, the string
5w
means that the stream associated with file descriptor 5 is to be written. And
0rp
means that the standard input is to be read from the pseudo-terminal.
If you use the p (pty) attribute, you must have one rp and one wp in the complete series of file descriptor strings. In other words, you must specify both reading from and writing to the pty. No other attributes can be associated with rp and wp.
The following attributes are output-related and thus can only be used in conjunction with w:
l - Line-buffered output.
t - Tag the line-buffered output with process rank information.
a - Stream is to be appended to the specified file.
NFS does not support append operations.
Use the l attribute in combination with the w attribute to line-buffer the output of multiple processes. This takes care of the situation in which output from one process arrives in the middle of output from another process. For example,
% mprun -np 2 echo "Hello" HelHello lo
With the l attribute, you ensure that processes don't intrude on each other's output. The following example shows how using the l attribute could prevent the problem illustrated in the previous example:
% mprun -np 2 -I "0r, 1wl" echo "Hello" Hello Hello
Use the t attribute in place of l to force line-buffering and, additionally, to prefix each line with the rank of the process producing the output. For example,
% mprun -np 2 -I "0r, 1wt" echo "Hello" r0:Hello r1:Hello
The b attribute is input-related and thus can be used only in combination with r. In multiprocess jobs, the b attribute specifies that input is to go only to the first process, rather than to all processes, which is the default behavior.
The m attribute pertains to reading from a pseudo-terminal and thus can be used only with rp. The m attribute in combination with rp causes keystrokes to be echoed multiple times when multiple processes are running. The default is to display multiple keystrokes only once.