intrepid.com



Cray XT3 GCC UPC Compiler

Posted on Mon, 2007-09-03 20:40

Cray logoGCC UPC  supports the Catamount and CNL (compute node linux)  computing nodes and is designed to work with Berkeley UPCR runtime.

NOTE 1: GCCUPC is not available in traditional software module form.

Build the GCC UPC Compiler

The procedure for building the GCC UPC compiler is detailed bellow. Basic system tools available on the service node are used to build GCC UPC. 

  • Create working directory
               mkdir upcdir
  • Download the GCC 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)
               gunzip -c < gcc-upc-REL_NO.tar.gz | tar xf -
  • Decide where to install executables (upcdir_release_path). By default /usr/local/upc directory is used.
  • Make sure GNU tools are used to recompile GCC UPC source code

                  module unload PrgEnv-pgi
                  module add PrgEnv-gnu

  • Make sure default login node gcc is used to rebuild GCC UPC source code

                  setenv CC /usr/bin/gcc        (csh shells)
                  CC=/usr/bin/gcc ; export CC   (bourne shells

  • Configure the distribution using the configure script, supplying switches as required.

                   mkdir build
                   cd build
                   ../configure --prefix=/upcdir_release_path \
                   --host=x86_64-[catamount,cnl]-linux-gnu

  • Build and install the compiler.
               make; make install

You are now ready to use the GCC UPC compiler.

Installing Berkeley's runtime for XT

Download the latest release of the Berkeley UPC runtime. Please review the INSTALL document for an overall description of the installation process. Check the section "GCC UPC BINARY COMPILER SUPPORT" for particulars in choosing the GCC UPC compiler as a back-end UPCR compiler.

Please review README.CrayXT3 that comes with the latest Berkeley's runtime for Cray XT3.

Compile and Run a simple UPC test program

The following example is for the system where GCC UPC is used as a back-end compiler for Berkeley's UPC runtime.

Once the compiler has been built and installed (both GCC UPC and UPCR), make sure that upcc command (from UPCR) is on your path (and gcc upc is NOT) 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
> upcc -o hello hello.upc
> qsub -I -l -size 2
> upcrun -n 2 ./hello
UPCR: UPC thread 0 of 2 on guppy (process 0 of 2, pid=5)
UPCR: UPC thread 1 of 2 on guppy (process 1 of 2, pid=6)
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.