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)

git cherry-pick 6624e61b9b82a8e6098bcf556d187a7fb9d7f492
  • move src/examples/swe_mpi.cpp to src/examples/swe_mpi_solution.cpp
  • copy src/examples/swe_simple.cpp src/examples/swe_mpi.cpp

Compile SWE with MPI

module load scons
module load python/2.7.2
scons copyenv=true compiler=cray parallelization=mpi

Compile SWE with OpenMP (Intel compiler)

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