mfh
mhoemmen@c122:~$ upcc -network=smp -T=2 test.upc
mhoemmen@c122:~$ upcrun -n 2 ./a.out
UPC Runtime error: program ./a.out was compiled with 2 static threads,
but executed with 1 threads.
mhoemmen@c122:~$ upcrun -n 1 ./a.out
upcrun: Requested thread count (1) differs from compiled static thread
count (2)
mhoemmen@c122:~$ upcrun ./a.out
UPC Runtime error: program ./a.out was compiled with 2 static threads,
but executed with 1 threads.
mhoemmen@c122:~$ ./a.out
UPC Runtime error: program ./a.out was compiled with 2 static threads,
but executed with 1 threads.
mhoemmen@c122:~$ upcc -network=smp test.upc
mhoemmen@c122:~$ upcrun -n 1 ./a.out
main: thread 0
mhoemmen@c122:~$ upcrun -n 2 ./a.out
main: thread 0
mhoemmen@c122:~$ upcrun -n 4 ./a.out
main: thread 0
mhoemmen@c122:~$ ./a.out
main: thread 0
Here is the source code of test.upc:
#include <upc.h>
#include <stdio.h>
int
main()
{
printf ("main: thread %d\n", MYTHREAD);
return 0;
}
mfh
There's an undocumented dependency, I guess. You need both
the -network=smp flag and the -pthreads flag.
Jason
--