How mantevo/minimd works
Project type and purpose
• miniMD is a micro-application for parallel molecular-dynamics (MD) simulation.
• It’s written in C++ and designed for benchmarking and portability experiments on CPUs, GPUs, and other architectures.
• The top-level has four self-contained variants (ref, kokkos, mpi-spec, target), a test harness, and formatting utilities.
File structure
• Top-level directories:
• ref – reference MPI+OpenMP variant
• kokkos – MPI + Kokkos backends (Pthreads/OpenMP/CUDA) variant
• mpi-spec – specification snapshot of the ref code
• target – production-tuned build with offload, intrinsics, and extra headers
• tests – test scripts and reference outputs
• util – code formatting tool
• Common modules in each variant:
• atom.*, types.h, variant.h – data structures for atoms
• input.cpp – parse input scripts
• setup.cpp – initialize domain decomposition, neighbor bins
• neighbor.* – build neighbor lists
• force_eam.*, force_lj.*, force.h – compute pairwise or EAM interactions
• integrate.* – advance positions/velocities
• comm.* – exchange ghost atoms via MPI
• thermo.* – compute thermodynamic properties
• timer.* – high-precision timing
• output.* – write logs, performance summary
• Build/configuration:
• Makefile(.default, .<platform>) or CMakeLists.txt (in kokkos)
• MPI-Stubs for non-MPI builds
• Platform flags: MPI, OpenMP, CUDA, KNC, AVX, etc.
• Testing:
• run_one_test, run_tests scripts invoke the built binary, run sample inputs, compare to reference_output.
Key insights from the README
• Parallelism: domain (spatial) decomposition with MPI ranks; optional intra-rank threading (OpenMP or Kokkos).
• Two force styles: Lennard-Jones (LJ) and Embedded Atom Method (EAM).
• Designed for weak scaling; minimal feature set for performance studies.
• Multiple build options to target CPU cores, Intel Xeon Phi, GPUs via CUDA or OpenCL (kokkos variant).
Detail without over-splitting
• Every module in the main simulation engine.
• How variants reuse the same modules but swap in different backends (e.g., MPI+OpenMP vs. MPI+Kokkos).
• Loop structure of the MD timestep and where timers and thermodynamics hooks insert.
• Test harness as an integral component for regression and performance validation.