The current version of GCC UPC for SGI Mips based systems is 4.2.3.3. Before attempting to build the GCC UPC compiler, we recommend that you first build and install the versions of the GNU tools listed below:
- GNU C Compiler [1] (version 3.3.2)
- GNU patch [2] (version 2.5.4)
- GNU make [3] (version 3.79.1)
- Bison [4] (version 1.875)
- gperf [5] (version 2.7.2)
The tool version numbers shown are the versions of the tools that were used to initially develop the compiler and runtime. You should be able to safely use later versions of the GNU tools.
We recommend that you use a recent version of patch because versions earlier than 2.5.4 do not support the set time/date option, which is required to properly establish source file dependencies.
Compile and Run a simple UPC test program
Once the compiler has been built and installed, try running the following simple test program:
mkdir ~/upctest
cd ~/upctest cat > hello.upc << EOF
#include <upc.h>
#include <stdio.h>
int main (int argc, char *argv[])
{
int i;
for (i = 0; i < THREADS; ++i)
{
upc_barrier;
if (i == MYTHREAD)
printf ("Hello world from thread: %d\n", MYTHREAD);
}
return 0;
}
EOF
$ upc -fupc-threads-4 hello.upc -o hello
$ ./hello
The output should appear as follows:
Hello world from thread: 0
Hello world from thread: 1
Hello world from thread: 2
Hello world from thread: 3
Known Problems and Issues
To report bugs or get the latest news concerning bug fixes, subscribe or send email to the GCC UPC mailing list [6].
Limitations
The following limitations apply to number of threads and maximum layout specifier (block size) based on the shared pointer layout (packed or structure):
| address size |
packed |
structure | |
| 64 (-mabi=64) |
number of threads | 2^12 (12 bits) |
2^16 (16 bits) |
| block size | 2^16-1 (16 bits) | 2^48-1 (48 bits) |
|
| 32 (-mabi=32) | number of threads | 2^12 (12 bits) | 2^8 (8 bits) |
| block size | 2^16-1 (16 bits) | 2^24-1 (24 bits) |
An operating system process is created for each UPC thread. Therefore, the maximum number of supported threads is further constrained by system capacity limitations, such as available swap space and process load. Typically, a UPC program will fail with the diagnostic "UPC initialization failed. Reason: Resource temporarily unavailable" if there are insufficient system resources to create the requested number of threads.