Source code description

The major files contained in the MuPC source code distribution are:

rts.c   Run time system interface implementation
mem.c   Memory management subsystem implementation
cache.c   A cache for shared scalar references   EDG front end binary for Tru64 platforms   EDG front end binary for Linux platforms
INSTALL   Descriptions of how to install and configure MuPC
README   System requirements and a brief introduction to MuPC

Using MuPC

Source code must include #include <upc.h>. It is assumed that source code files have a ".c" suffix, e.g., upc_hello_world.c below:
#include <upc.h>
#include <stdio.h>
int main (){
  printf ("Hello world from thread %d.\n", MYTHREAD);


mupcc -f 4 upc_hello_world.c -o upc_hello_world


MuPC is actually an MPI program. Running an executable compiled by MuPC is the same as running an MPI executable. MuPC provides a mupcrun script to run simple executables, but users may feel free to replace it with mpirun or prun or any other appropriate parallel program run command for the platform in use. This is especially necessary when advanced command line options or controls are needed at run time.

To run an executable with mupcrun, just:

mupcrun -n 4 upc_hello_world


Hello world from thread 0.
Hello world from thread 3.
Hello world from thread 2.
Hello world from thread 1.

Here's what happens behind the scenes.

The basic relationship to remember is that each UPC thread is implemented as one Unix process that spawns two Pthreads. One of these Pthreads contains the translated version of the user's UPC code and the other is the MPI interprocessor communication system. The following sketch represents this design for the case of 2 UPC threads.

© 2004 Michigan Technological University
Last modified 7/6/4