The redirection of standard input, output, and error output (file descriptor 0, 1 and 2) is done automatically without any further user interaction. In particular, the following actions are performed:
The originally started process, which is the root process (first) of the parallel task, converts to a so called ParaStation MPI Logger process after spawning all child processes. It receives output from the spawned processes, or more precisely from the controlling Forwarder processes, and dispense it to its final destination. This might be the (virtual) terminal from which the root process was started or the file to which the output of the root process is redirected.
The child processes are started by the ParaStation MPI daemon psid(8) on request of the root process of the parallel task via a so called ParaStation MPI Forwarder process. These forwarder processes control the spawned child process and handle all input/output produced. This output then is forwarded to the Logger process on the starting node which will send it to its final destination.
Input data is handled in a quite similar way. The ParaStation MPI Logger process reads the input from the (virtual) terminal or the file from which the input is redirected and sends it to a forwarder or a group of forwarders. The default action is to send it to the forwarder of the process with rank 0. This behavior might be modified as discussed below.
The redirection of input and output can be configured by a number of environment variables:
Forward all input to the process with rank
rank or a list of processes
ranklist defined by this variable.
The rank of a process is unique within a parallel task. The rank of a
process can be determined via the PSE_getRank(3) library function. The rank of a process is
identical to the MPI rank within the
MPI_COMM_WORLD context which can be identified
using the MPI_Comm_rank(3) library call.
The default is to forward all input to the process with rank 0.
If this environment variable is defined, each fraction of
output is prepended with a tag providing the rank of the
process that was producing it. If the ParaStation MPI Logger is put into the verbose mode using
PSI_LOGGERDEBUG environment variable,
also the length of the output fraction to print is
Define this environment variable in order to suppress the message
Turn on verbose mode for the ParaStation MPI Logger process. This will produce messages about connecting and detaching forwarders, received output, sent input and received signals.
This variable is intended for internal use only.
Turn on verbose mode for the ParaStation MPI Forwarder process. This will print information about received input, output and signals.
This variable is also intended for internal use only.