intrepid.com



CRAY T3E GCC UPC Compiler

Posted on Fri, 2006-02-24 15:49

Cray logoBefore attempting to build the GCC UPC compiler, we recommend that you first check and install modules required:

  • CC Compiler (version 6.6.0.2)
  • CLD Linker (version 3.0.0.20)
  • Cray open source package
  • Cray mpp package

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 those tools.

Build the GCC UPC Compiler

The procedure for building the GCC UPC compiler is detailed bellow.

  • Create working directory
               mkdir upcdir
  • Download the GNU UPC Compiler latest source code .
  • Unpack the distribution (assuming that file was downloaded in upcdir and REL_NO is the file name bellow is replaced with the actual upc release version number)
               mkdir build
    cd build
    gunzip -c ../upc-REL_NO.src.tar.gz | tar xf -
  • Decide where to install executables (upcdir_release_path). By default /usr/local/upc directory is used.
  • Configure the distribution using the configure script, supplying switches as required.
               ./configure --prefix=/upcdir_release_path  \
    --with-as=/opt/ctl/bin/cam \
    --with-ld=/opt/ctl/bin/cld --enable-languages="upc"
  • Build and install the compiler.
               make LD="/opt/ctl/bin/cld" CFLAGS_FOR_TARGET=\
    "-g -O2" CFLAGS="-g -h tolerant"

    Review the log file for any changes and install the compiler if no errors were reported.

               make LD=/opt/ctl/bin/cld CFLAGS_FOR_TARGET=\
    "-g -O2" CFLAGS="-g -h tolerant" install

You are ready to use the GCC UPC compiler.

Installing the Cray T3E Binary Release

A pre-built binary release built for the Cray T3-E can be downloaded. This binary release is built to install under /usr/local/upc. The tar file itself has path's that are relative to the root directory, "/". To install in /usr/local/upc, issue the following commands:



% cd /
% gunzip -c < alpha-cray-t3e-unicosmk-upc-3.4.4.1.binary.tar.gz | tar xpf -

The commands above, need to be issued from a sysadmin account that has write access to /usr/local/upc.

If you want to install and run the compiler somewhere else, then you'll need to
set the UPC_EXEC_PREFIX environment variable (note: the directory name must end with a "/"). Here's an example, where the compiler was installed in "/upc/test":



% cd /upc/test

% gunzip -c < alpha-cray-t3e-unicosmk-upc-3.4.4.1.binary.tar.gz | tar xpf -
% setenv UPC_EXEC_PREFIX /upc/test/bin/
% /upc/test/bin/upc -o hello hello.upc
% mpp -n 2 ./hello
Hello world from thread: 0
Hello world from thread: 1

Compile and Run a simple UPC test program

Once the compiler has been built and installed, make sure that upc command is on your path and 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 -o hello hello.upc
> mpprun -n 2 ./hello
Hello world from thread: 0
Hello world from thread: 1
> upc -o hello -fupc-threads-2 hello.upc
> ./hello
Hello world from thread: 0
Hello world from thread: 1
>


Reporting Problems and Issues

To report problems or get the latest news concerning bug fixes, subscribe or send email to the GCC UPC mailing list.


Limitations

The maximum number of threads is limited to number of available processors.

Global memory management is implemented by using a shared memory (shmem) library. Consequently, upc_global_alloc() and upc_global_lock_alloc() are not supported and would return an error if called.

upc_all_alloc () is supported and returns a memory allocated from the shared memory space. However, release of memory allocated by it (upc_free()) does not return memory to the shared pool and if used without any precaution could lead to global memory exhaustion.

login to post comments