This is a demo project to demonstrate a reasonable structure for CMake based projects, that use CTest to run unit tests via Catch, specifically demonstrating some uses of MPI.
This project was developed as a teaching aid for UCL's "Research Computing with C++" course developed by Dr. James Hetherington and Dr. Matt Clarkson.
On Linux/Mac, in a terminal:
git clone https://github.com/UCL-RITS/CMakeCatchMPI
mkdir CMakeCatchMPI-Build
cd CMakeCatchMPI-Build
cmake -DCMAKE_BUILD_TYPE=Debug ../CMakeCatchMPI
make
On Windows, run the CMake GUI to generate Visual Studio project files, and run the build therein.
Run the 'Hello World' example from a terminal with:
mpiexec -np 2 ./bin/ccmpiHelloWorld
If you want to run more processes than you have CPUs, you'll need to use:
mpiexec -np 4 --map-by core:OVERSUBSCRIBE ./bin/ccmpiHelloWorld