UPC is a PGAS parallel extension to the C standard.
Basic Usage on LRZ HPC systems
The Intel C based version of the Berkeley UPC compiler can be used by loading the module
A simple example program
Compile it under the dynamic translation environment by GCC UPC with the command
The resulting executable can then run using e.g., 4 threads via the command
producing its output lines in random order (since no explicit synchronization measures are provided to ensure a particular ordering).
For Berkeley UPC, the compilation is done with
and the executable is then run under the control of upcrun:
Under the static translation environment, a fixed number of threads is specified at compile time. This allows more optimization, and the THREADS and MYTHREADS macro can then also be used to define other static quantities via the preprocessor. However, the resulting executable will then run only with a fixed number of threads. For GCC UPC, compilation is done via
The resulting executable will then run using 4 threads always:
For Berkeley UPC, compilation is done with
Execution still requires the use of upcrun: