The OmpSs Environment

Our OmpSs implementation is composed of two main components: the Mercurium compiler and the Nanos++ runtime. If you want to get traces for the Paraver analysis tool you also need the Extrae library.

Installation

To install the OmpSs environment follow these steps:

  1. Choose and set target installation directory: TARGET=$HOME/ompss
  2. (Optional) Download and install the Extrae library from here with --prefix=$TARGET.
  3. Download and install the Nanos++ runtime following these instructions  using the following configure command: ./configure --prefix=$TARGET . Add --with-extrae if you want to enable Extrae instrumentation support.
  4. Download and install the Mercurium compiler following these instructions using the following configure command: ./configure --prefix=$TARGET --enable-ompss
  5. Add the $TARGET/bin directory to your PATH (possibly in your .login): PATH=$HOME/ompss/bin:$PATH

Compiling

There are currently four available compiler drivers:

Language Driver
C mcc
C++ mcxx
C & CUDA mnvcc
C++ & CUDA mnvcxx

To compile your application you need to use the --ompss compilation flag, so for example for a C application the compilation command could look like this:

mcc -o hello -O3 --ompss hello.c

Executing

To execute the previously compiled application with a given number of threads just run it setting the OMP_NUM_THREADS environment variable as with any other OpenMP program:

OMP_NUM_THREADS=4 ./hello

In addition to the regular OpenMP environment variables you can pass additional options to the Nanos++ runtime by means of the NX_ARGS environment variables. For example, to change the default task scheduler to use a cilk-like scheduler execute like this:

OMP_NUM_THREADS=4 NX_ARGS="--schedule cilk" ./hello

To see a complete list of the options that the runtime recognizes run the following command:

nanox --help

Instrumenting

To obtain a instrumented trace of an application you need to compile the application first with the --instrument compilation flag:

mcc -o hello_instr -O3 --ompss --instrumentation hello.c

This generates a version where the compiler has added instrumentation calls and also links with a Nanos++ instrumented version. To obtain a trace, when you run the application you need to specify the low-level instrumentation format using the NX_INSTRUMENTATION environment variable. For example, to get a trace with the Extrae library, to use with Paraver, use the following command:

NX_INSTRUMENTATION=extrae OMP_NUM_THREADS=4 ./hello_instr