Skip to content

First simulation

This example runs the supplied settings.ini as a small relativistic ΛCDM simulation. It uses Ngrid = 64, which is compatible with a 2 x 2 process grid.

Smaller documentation examples are available as ΛCDM settings and Newtonian settings.

Build

Create a local build configuration, review the CUDA architecture and optional features, then build:

cp config/local.mk.example config/local.mk
# Edit config/local.mk for the target system.
make print-config
make -j
mkdir -p output

See Installation for the required libraries and compiler options.

Run

export OMP_NUM_THREADS=1
mpirun -np 4 ./gevolution -n 2 -m 2 -s settings.ini

Ensure the MPI launcher assigns one visible GPU to each rank.

Follow the workstation MPS instructions, then run four ranks on the shared GPU.

The command-line process-grid dimensions multiply to the number of compute ranks:

\[ N_{\mathrm{MPI}} = n \times m. \]

Expected signs of success

At startup, the code should report:

  • version 2.0 alpha;
  • running on 4 tasks;
  • the visible CUDA device;
  • settings parsing and initial-condition generation;
  • initialization complete.

During the run it writes progress information and output requested by settings.ini. The supplied example writes into output/, including:

  • lcdm_settings_used.ini;
  • lcdm_background.dat;
  • metric and particle snapshots;
  • power spectra;
  • particle and metric light-cone output.

Note

The output directory must exist before launch. gevolution does not create it automatically.

Minimal Newtonian variant

Start from the downloadable Newtonian example, or copy the ΛCDM settings and change:

gravity theory = Newton
snapshot outputs = phi, Gadget2
Pk outputs = phi, delta

The same executable supports GR and Newtonian simulations. Newtonian mode is useful for controlled comparisons, but the code remains a uniform-mesh particle-mesh solver.