GCC UPC Installation
Linux x86_64
Linux ia64
Linux x86
Mac OS X x86
SGI (32/64bits)
Cray XT3
Cray T3E
Papers & Documents
GCC UPC manual page
Berkeley UPCR Runtime
Report an error
FAQ

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
To report bugs or get the latest news concerning bug fixes, subscribe or send email to the GCC UPC mailing list.
|
packed |
structure | |
| 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.
On Linux platforms, the user's main program is renamed to upc_main to work around a restriction in the linker. The actual main program entry is in the UPC runtime library.