Unified Parallel C (UPC)



Unified Parallel C (UPC) is an extension of the C programming language designed for high performance computing on large-scale parallel machines. The language provides a uniform programming model for both shared and distributed memory hardware. The programmer is presented with a single shared, partitioned address space, where variables may be directly read and written by any processor, but each variable is physically associated with a single processor. UPC uses a Single Program Multiple Data (SPMD) model of computation in which the amount of parallelism is fixed at program startup time, typically with a single thread of execution per processor.
In order to express parallelism, UPC extends ISO C 99 with the following constructs:

  • An explicitly parallel execution model
  • A shared address space
  • Synchronization primitives and a memory consistency model
  • Memory management primitives


Under UPC, memory is composed of a shared memory space and a private memory space. A number of threads work independently and each of them can reference any address in the shared space, but only its own private space. The total number of threads is THREADS and each thread can identify itself using MYTHREAD, where THREADS and MYTHREAD can be seen as special constants. The shared space, however, is logically divided into partitions each with a special association (affinity) to a given thread. The idea is to make UPC enable the programmers, with proper declarations, to keep the shared data that will be dominantly processed by a given thread associated with that thread. Thus, a thread and the data that has affinity to it can likely be mapped by the system into the same physical node.
Since UPC is an explicit parallel extension of ISO C, all language features of C are already embodied in UPC. In addition, UPC declarations give the programmer control of the distribution of data across the threads. In addition, UPC supports dynamic shared memory allocations. There is generally no implicit synchronization in UPC. Therefore, the language offers a rich range of synchronization and memory consistency control constructs.


There have been found demos and some applications, mainly scientific, which use UPC. Some demos are here: http://upc.lbl.gov/demos/ and some applications are here: http://www.upc.mtu.edu/applications.html .
There are compilers for UPC implemented by Cray, IBM and HP. There are also compilers implemented by UC Berkeley and Michigan Tech. There is also a GCC UPC compiler that extends the capabilities of the GNU GCC compiler.
License: Open-source (the exact license type varies for each implementation)

Additional Information


W. Carlson, J. Draper, D. Culler, K. Yelick, E. Brooks, and K. Warren. Introduction to UPC and Language Specification. CCS-TR-99-157, IDA Center for Computing Sciences, 1999