Program input and output

The Input/Output tab is at the bottom of the window (by default).

View standard output and error

The output from all processes is collected and can be viewed on the Input/Output tab. Standard output and error are both displayed. However, on most MPI implementations, error is not buffered (output is buffered), so might be delayed.

Standard output

The output can be selected and copied to the clipboard.

MPI users should note that most MPI implementations place their own restrictions on program output. Some buffer it all until MPI_Finalize is called, and others may ignore it. If your program needs to emit output as it runs, try writing to a file.

Note

Many systems buffer stdout but not stderr. If you do not see your stdout appearing immediately, try adding fflush(stdout) or equivalent to your code.

Save output

Right-click on the text to either save it to a file or copy a selection to the clipboard.

Send standard input

You can use the stdin field in the Run window to choose the file to use as the standard input (stdin) for your program. Arguments will be automatically added to mpirun to ensure your input file is used.

Alternatively, you can enter the arguments directly in the mpirun Arguments field. For example, if using MPI directly from the command-line you would normally use an option to the mpirun such as -stdin filename, then you can add the same options to the mpirun Arguments field when you start your session in the Run window.

It is also possible to enter input during a session. To do this, start your program as normal, then open the Input/Output tab. Type the input you want to send.

Click More to send input from a file, or send an EOF character.

Note

Although input can be sent while your program is paused, the program must then be played to read the input and act upon it.

The input you type will be sent to all processes.

Sending input