Running the Code - hyschive/gamer-fork GitHub Wiki

This page covers the following topics:

It is highly recommended that you first follow the demos given in Quick Start .

Running Simulations

To run the code in a serial mode (i.e., no MPI and OpenMP), follow the steps below:

  1. Compile the code (See Installation for details)

    1. Turn on the compilation option SERIAL and turn off both LOAD_BALANCE and OPENMP
    2. Set CXX in the Makefile to a serial compiler (e.g., g++ or icpc)
    3. Recompile the code by make clean; make
  2. Set the runtime parameters (see Runtime Parameters for details)

    1. Put the required input files (e.g., Input__Parameter) in the same directory as the executable gamer
    2. Set parameters properly
  3. Launch the code

    > ./gamer
    
  4. Check the outputs

    • Simulation progress → stdout
    • Simulation log files Record__*
    • Simulation snapshots Data_??????

Further readings:

Restarting from a Snapshot

To restart a simulation from a snapshot (e.g., Data_000123), do the following steps:

  1. Set OPT__INIT =2
  2. Create a soft link named RESTART to a targeted snapshot: ln -s Data_000123 RESTART
  3. Run the code as usual

Note that many runtime parameters can be changed during restart (e.g., number of MPI processes and OpenMP threads, maximum refinement level, refinement criteria, time-step criteria). The next data dump ID will be automatically set to the ID of the restart file plus one (unless specified by INIT_DUMPID ).

Terminating or Pausing Simulations

Typically, a simulation ends when reaching either END_T or END_STEP . One can also forcibly terminate a simulation by creating a file named STOP_GAMER_STOP (e.g., using touch STOP_GAMER_STOP) in the same directory as the executable gamer. The program will check the existence of this file after every root-level update. If it is detected, the program will output the final data (assuming at least one of the output options described in Outputs is enabled), delete the file STOP_GAMER_STOP, and then be terminated. Note that this functionality is supported only when the runtime parameter OPT__MANUAL_CONTROL is on.

Similarly, one can create a file named PAUSE_GAMER_PAUSE to pause a simulation. To resume it, simply delete this file.

Taking Notes

One can put simulation notes in a text file named Input__Note. The content of this file will be automatically copied to the top of the log file Record__Note during code initialization. For example,

> cat Input__Note

~ PUT YOUR SIMULATION NOTES HERE ~

> ./gamer
> head Record__Note

Simulation Note
***********************************************************************************

~ PUT YOUR SIMULATION NOTES HERE ~

***********************************************************************************

Links