Skip to content
Public template

About

C++/CMake template for the lab course 'Solar System Simulation'

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

LabCourse: Solar System Simulation - C++ CMake Template

TODO: add your own descriptions

This template repository can be used as baseline for the lab course Solar System Simulation https://github.com/SCTeaching-NBody/LabCourse_Slides.

Building the Code

cd "path_to_cloned_directory"
mkdir build && cd build
cmake ..
cmake --build .

Running the Code

The dummy example code can be run via SLURM:

OMP_NUM_THREADS=4 srun -N 4 ./simulate

and should output something like (note that the order may change in each run):

Hello from OpenMP thread 0 out of 4 from MPI process 3 out of 4
Hello from OpenMP thread 1 out of 4 from MPI process 3 out of 4
Hello from OpenMP thread 2 out of 4 from MPI process 3 out of 4
Hello from OpenMP thread 3 out of 4 from MPI process 3 out of 4
Hello from OpenMP thread 0 out of 4 from MPI process 1 out of 4
Hello from OpenMP thread 1 out of 4 from MPI process 1 out of 4
Hello from OpenMP thread 2 out of 4 from MPI process 1 out of 4
Hello from OpenMP thread 3 out of 4 from MPI process 1 out of 4
Hello from OpenMP thread 0 out of 4 from MPI process 2 out of 4
Hello from OpenMP thread 1 out of 4 from MPI process 2 out of 4
Hello from OpenMP thread 3 out of 4 from MPI process 2 out of 4
Hello from OpenMP thread 2 out of 4 from MPI process 2 out of 4
Hello from OpenMP thread 0 out of 4 from MPI process 0 out of 4
Hello from OpenMP thread 2 out of 4 from MPI process 0 out of 4
Hello from OpenMP thread 1 out of 4 from MPI process 0 out of 4
Hello from OpenMP thread 3 out of 4 from MPI process 0 out of 4
a + b = c is correct!

Testing

The tests can be build using

cmake -DWITH_TESTS=ON ..

which is on by default. It automatically builds the GoogleTest framework (can be changed to another framework if desired).

To run the tests use

ctest

About

C++/CMake template for the lab course 'Solar System Simulation'

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages