Setup the development environment on orion.ec.oakland.edu

  1. Read the document Compiler and Runtime Interfaces, Section 1.5 and 1.7 for a high-level overview of how an OpenMP program are transformed into runtime calls.

  2. You will be working on orion.ec.oakland.edu machine for the development and experiments. Login in orion using ssh (you need VPN to access orion from off-campus locations).

  3. Under your home folder, download the official OpenMP runtime from https://github.com/llvm-mirror/openmp via git cloning of the repository:

    git clone https://github.com/llvm-mirror/openmp.git
    

    The source code will be downloaded in the openmp folder under your home directory (only need to download once for this assignment).

  4. Setup the building environment (only need to do once per each downloaded source repo)

    cd openmp
    mkdir BUILD
    cd BUILD
    cmake -DCMAKE_BUILD_TYPE=Debug -DLIBOMP_OMPT_TRACE=on ..
    

    The -DCMAKE_BUILD_TYPE=Debug configuration turns on runtime tracing so you can generating the tracing output when setting the environment variable in your shell session through KMP_A_DEBUG=20

  5. Build the OpenMP runtime library by issuing the make command (need to do this each time after you make changes of your source code and want to give it a try)

  6. export the LLVM/Clang compiler and the runtime library to use (you need to run this command each time you login in orion):

     export PATH=/opt/llvm/llvm-ompt-install/bin:$PATH
     export LD_LIBRARY_PATH=~/openmp/BUILD/runtime/src:$LD_LIBRARY_PATH
    
  7. Make changes of the source codes and rebuild the library by issuing the make command. You need to rebuild the library each time you make changes to the source and want to try it out.

  8. To experiment your changes to the runtime source code, you will need to compile and execute a test program. Test program are given and include axpy, sum, fib, matvec, and matmul programs parallelized using both OpenMP parallel for and task (fib is only parallelized using task). You can clone the repo from https://github.com/passlab/CSE436536Project (only need to clone once).

      git clone https://github.com/passlab/CSE436536Project
      cd CSE436536Project/examples
    
      clang -fopenmp axpy_omp_parallel.c -o axpy_omp_parallel
      ./axpy_omp_parallel 1024000
    
      clang -fopenmp axpy_omp_task.c -o axpy_omp_task
      export KMP_A_DEBUG=20   # Turn on runtime tracing
      ./axpy_omp_task 1024000
    

    You can use ldd command to check whether your axpy_omp_parallel will use the runtime library you just modified by issuing the ldd axpy_omp_parallel command, which will list all the needed runtime library and their path for axpy_omp_parallel.