Parallel Programming Guide for HP-UX Systems

UPC
Running
Chapter 5 101
Running
You can run UPC programs in one of three ways:
Single-threaded execution
Multithreaded execution on an AlphaServer SC system using the prun command
Multithreaded execution on an SMP system (or on a single-CPU system) using the UPC
Run-Time Environment
Running programs in single thread mode
If a UPC program has been compiled with -fthreads set to 1, or without having specified a
value for -fthreads , then it may be run in single thread mode by simply executing the
program image directly, as with any normal UNIX program.
Single thread mode is useful for basic testing and debugging of UPC programs. Single thread
mode can be used on HP-UX or on Tru64 Unix Version 5.1 or later systems; the AlphaServer
SC software is not needed.
Running programs in multithread mode using Quadrics RMS
The prun (parallel run) command is included as part of the the software provided with the
AlphaServer SC system, and provides access to the Resource Management Services (RMS)
databases and system management services. For detailed information on the prun command,
refer to the reference page for prun and the RMS User Manual, provided with the
AlphaServer SC software documentation.
Example 5-1 prun
prun -n 4 upc_loadtest3
This command runs the executable program upc_loadtest3 in the default parallel partition,
using four threads, on four CPUs. All prun options can be used to run UPC programs on
whatever configuration of CPUs and Nodes are desired. Output from each thread's stdout is
buffered and displayed at the terminal where the prun is executed. Diagnostics output to
stderr is not buffered---it is sent immediately and displayed at the same terminal.
If any inconsistencies are found, the UPCRTS issues a diagnostic message describing the
problem and exits before running the main function. (Inconsistencies are found in such areas
as: the declaration of a shared array in different modules; the value specified for -fthreads in
different modules; the value specified for -fthreads and the value used for the -n option to the