Tutorial

Build

RamsesGPU uses the Autotools as the build system; you don’t need to know anything about it to build the code. You will be required a minimal knowledge if you want to modify the source code.

RamsesGPU always builds a reference CPU only executable; you must provide information about the location of your CUDA toolchain to make sure it will also build a separate GPU executable.

There are two stages to get the code running : configure and make.

  • configure

    • create a build directory: mkdir build

    • cd build

    • example configure line for a CPU only build

      ../configure --with-cuda=no --enable-timing

    • example configure line for both CPU and GPU build, and several other features

      ../configure --with-cuda=/usr/local/cuda-6.0 --enable-timing

    • to get a multi-GPU executable (with MPI+CUDA), you just need to add --enable-mpi to the configure line

    • example configure line to have almost all features (multi-GPU, double precision, parallel-IO, timing instrumentation):

      ../configure --with-cuda=/usr/local/cuda-6.0 --enable-timing --with-vtk-version=-5.8 --enable-mpi --enable-double --with-cuda-fast-math=no --with-pnetcdf=/home/pkestene/local/pnetcdf/gnu47 --with-hdf5=/home/pkestene/local/phdf5_gnu47/bin/h5pcc

Note

It may be a good idea to create multiple build directory corresponding to different configuration (no-GPU, GPU enabled, GPU and MPI enabled, ...)

Note

Type configure --help to have the entire list of configure’s options.

  • make
    • just type make at top level of your build directory
    • the built executables are located in sud-directory src :

Run

To run RamsesGPU executable you must provide a parameter file containing required input information: problem name (for initial condition), is MHD enabled or not, domain size, number of time steps, time steps between two outputs, etc ...

  • example input parameter files are located in the data sub-directory from top-level source directory. They all use the INI file format.
  • A single GPU run in double precision for the MHD turbulence problem can be launched like this from build directory

    ./euler_gpu_double --param turbulence_mhd.ini*

  • The corresponding line for a multi-GPU run:

    mpirun -np X ./euler_gpu_mpi_double --param turbulence_mhd_mpi.ini

Note

Please note that in the MPI run, the number of MPI processes X must be equal to mx times my times mz where mx, my and mz are the sizes of the 3D domain decomposition used and specified in the parameter file.

Develop with RamsesGPU

If you are unfamiliar with the GNU Autotools and want to know how to add new source files in RamsesGPU,
you may consider reading an Autotools tutorial first, like this one

Basically, you just need to modify a Makefile.am (never try to hand modify Makefile.in or configure which are generated by GNU autotools), and after that type make in the build directory, Autotools’s Makefiles are capable of calling the right tools to re-generate themselves.

TODO:

  • Give an example
  • How to change initial conditions
  • How to add a new physics module