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

On this page:

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.


1. Introduction

Top

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.

2. UPC on Franklin

Top

2.0.1 Programming Environments

UPC is available on Franklin using Cray C compiler through Cray programming environment software modules. First issue the following command:

Franklin% module swap PrgEnv-pgi PrgEnv-cray


Then compile code with:

Franklin% cc -h upc -o UPCProg UPCProg.c
The "-h upc" option is needed on the cc command line.


2.0.2 Batch Script

Use the aprun command to run jobs. This example uses 1 processor per node, with a total of 4 nodes.
#PBS -q debug
#PBS -l mppwidth=4
#PBS -l mppnppn=1
#PBS -l walltime=00:10:00
#PBS -j eo
#PBS -V

cd $PBS_O_WORKDIR
aprun -n 4 -N 1 ./UPCProg


Use the aprun command to run jobs. This example uses the default 4 processors per node, with a total of 1 node.

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

cd $PBS_O_WORKDIR
aprun -n 4 ./UPCProg

3. UPC on Jacquard

Top

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.


3.0.3 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

4. UPC on Bassi

Top

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

5. Trouble Shooting

Top

Report problems to: consult@nersc.gov

LBNL Home
Page last modified: Mon, 11 Jan 2010 21:25:16 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