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





