Skip to content
README.md 5.4 KiB
Newer Older
# GADGET


## Summary Version
4.0 (2021)

## Purpose of Benchmark
GADGET simulation code, which is a parallel cosmological N-body and SPH code meant for simulations of cosmic structure formation and calculations relevant for galaxy evolution and galactic dynamics.


## Characteristics of Benchmark

GADGET-4 supports collisionless simulations and smoothed particle hydrodynamics on massively parallel computers. All communication between concurrent execution processes is done either explicitly by means of the message passing interface (MPI), or implicitly through shared-memory accesses on processes on multi-core nodes. The code is mostly written in ISO C++ (assuming the C++11 standard), and should run on all parallel platforms that support at least MPI-3. So far, the compatibility of the code with current Linux/UNIX-based platforms has been confirmed on a large number of systems.


## Mechanics of Building Benchmark
Complete Build instructions can be found at 

It requires a compiler with full C++11 support, MPI (e.g., MPICH, OpenMPI, IntelMPI), FFTW3, GSL, and HDF5.

### Download the source code

Latest Release can be downloaded from [https://gitlab.mpcdf.mpg.de/vrs/gadget4](https://gitlab.mpcdf.mpg.de/vrs/gadget4)
or get a cloned repository of the code by using 
git clone http://gitlab.mpcdf.mpg.de/vrs/gadget4
Source code used in the benchmarks (version of June 21, 2021) [./gadget/4.0/gadget4.tar.gz](./gadget/4.0/gadget4.tar.gz)


### Build the Executable

Environment software need in the system: MPI (e.g., MPICH, OpenMPI, IntelMPI), FFTW3, GSL, HDF5

1. Load the environment modules necessary to compile and run the code, e.g,

```
module load mpi/OpenMPI/4.0.3-GCC-9.3.0 data/HDF5/1.10.6-gompi-2020a \
numlib/FFTW/3.3.8-gompi-2020a numlib/GSL/2.6-GCC-9.3.0 
```

2. In Makefile.systype select the machine you are using

3. In folder buildsystem make sure you have the Makefile.comp.xxx and Makefile.path.xxx (xxx = cluster name)
set with the proper paths and compilation options, respectively.

4. Compile the code

make CONFIG=Config_CollGal.sh EXEC=gadget4-collgal
5. You need extra files to run the code, e.g., param.txt for all the runs, and TREECOOL for the Galaxies Collision test. These files are in the folder gadget4/examples/PROBLEM with PROBLEM being CollidingGalaxiesSFR, DM-L50-N128, and G2-gassphere
You may download the examples initial conditions from (./gadget/4.0/example_ics.tar.gz)

6. Make sure that in param.txt you set the path to the initial conditions file.
7. set your SLURM configuration file to your needs and launch the run.
        
### Mechanics of Running Benchmark
The general way to run the benchmarks, assuming SLURM Resource/Batch Manager is:

1. Set the environment modules (see Build the Executable section)

2. Submit a script to slurm

```
sbatch gadget_script.sh
```
where the gadget_script.sh has the form:

```
#!/bin/bash -l 
#SBATCH --time=04:00:00
#SBATCH --account=astro_00
#SBATCH --job-name=collgal-tMax=1.0-0512
#SBATCH --output=g_collgal_%j.out
#SBATCH --error=g_collgal_%j.error
#SBATCH --nodes=16
#SBATCH --ntasks=512
#SBATCH --cpus-per-task=1
#SBATCH --ntasks-per-socket=16
#SBATCH --exclusive
#SBATCH --partition=debug

echo
echo "Running on hosts: $SLURM_NODELIST"
echo "Running on $SLURM_NNODES nodes."
echo "Running on $SLURM_NPROCS processors."
echo "Current working directory is `pwd`"
echo

srun ./gadget4_collgal param.txt
```
Where:

* gadget4_collgal is the executable.
* param.txt is the input parameter file. 

### UEABS Benchmarks

**A) `Colliding galaxies with star formation`**

This simulation with setup in the folder CollidingGalaxiesSFR considers the collision of two compound galaxies made up of a dark matter halo, a stellar disk and bulge, and cold gas in the disk that undergoes star formation. Radiative cooling due to helium and hydrogen is included. Star formation and feedback is modelled with a simple subgrid treatment. 

[Download test Case A](./gadget/4.0/gadget4-caseA.tar.gz)


**B) `Cosmological DM-only simulation with IC creation`**

The setup in DM-L50-N128 simulates a small box of comoving side-length 50 Mpc/h using 128^3 dark matter particles. The initial conditions are created on the fly upon start-up of the code, using second order Lagrangian perturbation theory with a starting redshift of z=63. The LEAN option and 32-bit arithmetic are enabled to minimize memory consumption of the code.

Gravity is computed with the TreePM algorithm at expansion order p=3. Three output times are defined, for which FOF group finding is enabled, and power spectra are computed as well for the snapshots that are produced. Also, the code is asked to compute a power spectrum for each output.

[Download test Case B](./gadget/4.0/gadget4-caseB.tar.gz)
**C) `Adiabatic collapse of a gas sphere`**

This simulation in G2-gassphere considers the gravitational collapse of a self-gravitating sphere of gas which initially has a 1/r density profile and a very low temperature. The gas falls under its own weight to the centre, where it bounces back and a strong shock wave that moves outwards develops. The simulation uses Newtonian physics in a natural system of units (G=1).

[Download test Case C](./gadget/4.0/gadget4-caseC.tar.gz)

   
## Performance 
GADGET reports in log file both time and performance. 

** `Performance` in `ns/day` units : `grep Performance logfile | awk -F ' ' '{print $2}'`.  **

** `Execution Time` in `seconds` : `grep Time: logfile | awk -F ' ' '{print $3}'`**