NERSCPowering Scientific Discovery Since 1974

UPC (Unified Parallel C)


Unified Parallel C is a partitioned global address space (PGAS) language and an extension of the C programming language.


UPC is available on Edison and Hopper via the Cray compilers.

Using UPC

To compile a UPC source file you must first swap the Cray compiler with the default compiler.

On Hopper:

% module swap PrgEnv-pgi PrgEnv-cray

On Edison:

% module swap PrgEnv-intel PrgEnv-cray

Then compile the code like this:

% cc -h upc -o UPCProg UPCProg.c

The "-h upc" option is needed on the cc command line.


For questions about using UPC at NERSC contact the consultants at