IBM Power Systems 775 Manual page 124

For aix and linux hpc solution
Table of Contents

Advertisement

Thread 0
c[0]
c[4]
c[8]
b
a
Figure 2-3 Memory allocation and data affinity
Figure 2-3 shows that a thread-local instance of the scalar variable a is allocated in the
private memory space of each thread. The shared scalar variable b is allocated in the shared
memory space of thread 0. The array elements of the shared array c are allocated in the
shared memory space in a round-robin manner among all threads.
Compiler commands
This section provides information about invoking the XL UPC compiler and setting the target
execution environment for the program.
Invocation command
To compile a UPC program, use the xlupc command to invoke the compiler. By default, a .c
file is compiled as a UPC program unless the option -qsourcetype=c is specified.
Important: If you want to mix .c files with .upc files in your application, .c files must be
compiled and linked with xlupc.
Execution environments
The execution environment of a UPC program is static or dynamic. In the static execution
environment, the number of threads for the target program is known at compile time. In the
dynamic execution environment, the number of threads and the number of nodes are not
known at compile time.
To set the number of threads for a program in the static environment, you use the
-qupc=threads option. For example, to compile the test.upc program that runs with four
threads, enter the following command:
xlupc -o test1 -qupc=threads=4 test.upc
110
IBM Power Systems 775 for AIX and Linux HPC Solution
Thread 1
Thread 2
c[1]
c[2]
c[5]
c[6]
c[9]
a
a
Thread 3
c[3]
c[7]
Shared
space
Private
space
a

Advertisement

Table of Contents
loading

Table of Contents