This package is designed for simulating atoms using a simplified MD (Molecular Dynamics) code with multi-threading parallelization, specifically optimized for a Lennard-Jones potential.
The examples
directory includes three sets of example input decks, and the reference
directory contains the corresponding outputs.
In the CMakeList.txt make sure that the following options are configured based on your requirements:
- option(USE_OMP "Building with OPENMP" ON/OFF): Activate OpenMP support.
- option(USE_MPI "Building with MPI" ON/OFF): Activate MPI support.
- option(ENABLE_TESTING "Enable building unit tests" ON)/OFF: Enable to compile tests.
This package contains simplified MD code with multi-threading parallelization for simulating atoms with a Lennard-Jones potential. The examples directory contains 3 sets of example input decks and the reference directory the corresponding outputs. How to compile:
- Navigate to the project's root folder.
- Run the following commands:
cmake -S . -B build
cmake --build build
or use the bmake.sh script (./bmake.sh build). To run the code, cd to the created build folder then you can run:
- Serial one:
./main < input_file.inp
- OpenMP support
OMP_NUM_THREADS=#threads ./main < input_file.inp
- MPI support
mpirun -np #mpitaks ./main < input_file.inp
- Hybrid OpenMP & MPI
OMP_NUM_THREADS=#threads mpirun -np #mpitaks ./main < input_file.inp
Where #threads, and #mpitaks stands for the desired number of threads and the number of MPI tasks, respectively.
We would like to mention that this project uses gtest library. Unit tests are configured using googletest, and they automatically detect whether OpenMP and/or MPI are present or not and test accordingly. All the test can be run by typing "make test" from the build folder.
NB. On macOS with Clang, additional settings are applied to address specific warnings and OpenMP support.
Our report is in the file Benchmark_report_MHPC_FZB-1.pdf.
We split the work in the following way:
- Serial optimization: Behzad Salmassian
- MPI implementation: Francesco Andreucci
- OpenMP implementation: Zakaria Dahbi
- Hybrid MPI-OpenMP: Francesco and Zakaria
The various commits begin with the name of the commiter. The commits up to Sunday 29/11 (included) refer to the group assignments, the ones after refer to the individual tasks.