Practical work with MPI/OpenMP
Data distributions for sparse systems
are considered in combination with an example.
Data distributions:
- rowise/columnwise
- block wise
- overlapping / non-overlapping nodes
- overlapping / non-overlapping elements
Have a look at §5 of exercise and download
the
template for the sequential Jacobi
solver (, further you may continue with §6
and download the template for the sequential multigrid
solver).
- untar the template in a different subdirectory than the sequential
example
- cd jacobi.template
- make
- Avoid warnings causes by OpenMPI:
make 2>&1 | grep
-v openmpi
- You can swich between GNU- and Intel-compiler by changing the line
(not supported currently)
COMPILER=GCC_
in the Makefile
- The following targets/calls are available in the Makefile:
- make : Compiles and links
the code
- make run : Recompiles the whole code and
runs it
- make cache : Profiles the code wrt. cache performance
- make prof : Profiles the code
- make mem : Checks the code for correct data
accesses, pointers alloc/deallocs, memory leaks
- doc
:
Generates documentation, see html/index.html
afterwards
- clean
: Cleans temporary files
- clean_all : Cleans everything
- tar
:
Cleans everything and packs the remainding files into a tar-file in
the root directory
Available compilers:
- GNU:
- Performance analyzer: gprof (kprof); valgrind
(kcachegrind)
- Memory analyzer: valgrind
- Intel:
- Quick
Reference Card, non-commercial
license available, academic
pricing
- Performance analyzer: amplifier (amplxe-gu)
- Memory/Thread analyzer: inspector (inspxe-gui)
MPI:
- OpenMPI(home, doc),
excellent LLNL-tutorial on MPI
- MPICH distribution (required by PGI compiler)
Combining MPI and OpenMP: