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:
-
Compile the code (See Installation for details)
- Turn on the compilation option SERIAL and turn off both LOAD_BALANCE and OPENMP
- Set
CXX
in theMakefile
to a serial compiler (e.g.,g++
oricpc
) - Recompile the code by
make clean; make
-
Set the runtime parameters (see Runtime Parameters for details)
- Put the required input files (e.g.,
Input__Parameter
) in the same directory as the executablegamer
- Set parameters properly
- Put the required input files (e.g.,
-
Launch the code
> ./gamer
-
Check the outputs
Further readings:
Restarting from a Snapshot
To restart a simulation from a snapshot (e.g., Data_000123
),
do the following steps:
- Set OPT__INIT =2
- Create a soft link named
RESTART
to a targeted snapshot:ln -s Data_000123 RESTART
- 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 ~
***********************************************************************************