You copied the Doc URL to your clipboard.

9 Program input and output

Arm DDT collects and displays output from all processes under the Input/Output tab. Both standard output and error are shown, although on most MPI implementations, error is not buffered but output is and consequently can be delayed.

9.1 Viewing standard output and error


Figure 75: DDT Standard Output Window

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

The output may 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.

9.2 Saving output

By right-clicking on the text it is possible to save it to a file. You also have the option to copy a selection to the clipboard.

9.3 Sending standard input

Arm DDT provides an stdin file box in the Run window. This allows you to choose a file to be used as the standard input (stdin) for your program. Arm DDT will automatically add arguments to mpirun to ensure your input file is used.

Alternatively, you may enter the arguments directly in the mpirun Arguments box. 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 may add the same options to the mpirun Arguments box when starting your DDT session in the Run window.

It is also possible to enter input during a session. Start your program as normal, then switch to the Input/Output panel. Here you can see the output from your program and type input you wish to send. You may also use the More button 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.


Figure 76: DDT Sending Input

Note: If Arm DDT is running on a fork-based system such as Scyld, or a -comm=shared compiled MPICH 1, your program may not receive an EOF correctly from the input file. If your program seems to hang while waiting for the last line or byte of input, this is likely to be the problem. See the H General troubleshooting and known issues or contact Arm support at Arm support for a list of possible fixes.