NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 

Unified Parallel C (UPC) at NERSC

UPC is supported on a number of platforms at NERSC and the below documentation gives basic instructions for running UPC programs. For more detailed UPC information please see the Berkeley UPC Project webpage and the UPC language website.

Contents


Introduction

Unified Parallel C is a partitioned global address space (PGAS) language and an extension of the C programming language. It is designed for HPC systems and allows the programmer to view a single shared partitioned address space where each variable is associated with a single processor, but can be directly read and written by any processor. Although not a language specification, low overhead, one sided communication models are important for obtaining good performance results from UPC codes whose programming paradigm facilitates low level communication transactions. See the GASNet webpage for more information about the low level networking layer used in UPC implementations.

UPC on Franklin

Programming Environments

UPC is available on Franklin through programming environment software modules. Use the following command to use PGI UPC environment:

Franklin% module swap PrgEnv-pgi PrgEnv-upc-pgi


Compile code with:

Franklin% upcc -o UPCProg UPCProg.c
Users can link to the GNU-compiled binaries and libraries with the UPC GNU programming environment.
Franklin% module swap PrgEnv-pgi PrgEnv-upc-pgi

The Intrepid GCC/UPC source-to-assembly front end is available in the GNU UPC programming environment only and can be access by adding the -gccupc flag to the compile line.

Franklin% upcc -gccupc -o UPCProg UPCProg.c


Batch Script Use the upcrun command to run jobs. This example uses 1 processor per node.

#PBS -q debug
#PBS -l mppwidth=2
#PBS -l mppnppn=1
#PBS -l walltime=00:10:00
#PBS -j eo
#PBS -V

cd $PBS_O_WORKDIR
upcrun -n 2 -N 2 ./UPCProg


Use the upcrun command to run jobs. This example uses the default 2 processors per node.

#PBS -q debug
#PBS -l mppwidth=2
#PBS -l walltime=00:10:00
#PBS -j eo
#PBS -V

cd $PBS_O_WORKDIR
upcrun -n 2 -N 1 ./UPCProg

Pthreads and upcrun options

  • To create a pthreaded UPC application on Franklin compile with the -pthreads[=N] option. The user can set the number of pthreads per process either statically at compile time or override the compiled setting with the UPC_PTHREADS_PER_PROC environment variable or the -p N upcrun option. See the upcc and upcrun man pages for full documentation.
  • The -n upcrun option specifies the total number of UPC threads to spawn in the program
  • The -N upcrun option specifies the number of physical nodes on which to run
  • The -c upcrun option specifies the number of tasks per node
  • Two of the above three flags, -n, -N, -c should be passed as arguments to the upcrun command

UPC on Jacquard

On Jacquard to use UPC, load the UPC module, provided by the Berkeley UPC Group.

Jacquard% module load upc

Compile code with:

Jacquard% upcc -o UPCProg UPCProg.c
For compiler options see the upcc man page available when the upc module is loaded.


Batch Script

Below is an example batch script to run a UPC program on Jacquard. Note the upcrun command which is used in place of mpirun
#PBS -l nodes=8:ppn=1,walltime=00:30:00
#PBS -N UPCTest
#PBS -o UPCTest.out
#PBS -e UPCTest.err
#PBS -q debug 
#PBS -V

cd $PBS_O_WORKDIR

upcrun -n 8 -nodes 8 ./UPCProg

Some tips for running on Jacquard:

  • Set ppn=1 so running only one task per node
  • It is not possible to create a UPC Pthreaded executable on Jacquard

UPC on Bassi

UPC on Bassi is not currently working. We expect to install a fix shortly.

Trouble Shooting

Report problems to: consult@nersc.gov

LBNL Home
Page last modified: Mon, 28 Jan 2008 19:21:18 GMT
Page URL: http://www.nersc.gov/nusers/resources/software/upc.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science