Skip to content

Swe performance exercise

fomics edited this page Jul 16, 2013 · 12 revisions

Prepare your Git repository

Start by cloning a clean version of the SWE.git repository master branch

git clone --recursive https://github.com/fomics/SWE.git

... and apply a patch (adds an OpenMP option to scons)

cd SWE
git cherry-pick 6624e61b9b82a8e6098bcf556d187a7fb9d7f492

Add parallel for to initialization

Compile SWE with MPI using the GNU compiler (with Cray compiler wrapper)

module swap PrgEnv-cray PrgEnv-gnu
module load scons
module load python/2.7.2
scons copyenv=true compiler=cray parallelization=mpi

This is

Compile SWE with MPI/OpenMP hybrid

module load scons
module load python/2.7.2
module swap PrgEnv-cray PrgEnv-intel
scons copyenv=true compiler=intel openmp=yes

Get the reference solution

  • Switch to the master branch
  • Add the patch for the SConstruct file:
git cherry-pick 6624e61b9b82a8e6098bcf556d187a7fb9d7f492
  • Open the file src/blocks/SWE_WavePropagation.cpp
    • Add the line #define LOOP_OPENMP before
#ifdef LOOP_OPENMP
#include <omp.h>
#endif
  • Remove the line that starts with solver::Hybrid<float>

Compile Vectorized Version (Intel Compiler)

module load scons
module load python/2.7.2
module swap PrgEnv-xyz PrgEnv-intel

Open the file 'SConstruct' in the main directory. Search for '-xHost' and replace it with '-mavx'.

scons copyenv=yes compiler=intel solver=fwavevec vectorize=yes showVectorization=yes
Clone this wiki locally