-
Notifications
You must be signed in to change notification settings - Fork 53
Guide to parameters
Although many of the parameters in the params.txt
file are self explanatory and commented, this page aims to provide a comprehensive description of all the non-problem-specific parameters available in the existing examples.
A useful pdf guide on this topic from the latest GRChombo training day can be found in Useful resources.
A useful feature in GRChombo is the ability to run a quick check on the validity of the parameters before a job is submitted to the batch system. Such a check is small enough to run on the login nodes of most systems without creating too much of a load, and ensures the job will not fail immediately due to parameter related errors.
This is done by passing the -check_params flag i.e. by running something like the following command:
mpiexec /path/to/exec.ex /path/to/params.txt -check_params
Note that the checks mostly just ensure that the simulation will run and in particular don't tell you if you are doing something very inefficient with regard to the parallelisation of the run. More detailed information about load balancing using the grid parameters is provided on the performance optimisation page. These parameters are essential for using computing time efficiently, so this is highly recommended reading!
Most parameters can in principle be updated on restart from checkpoint, except those related to the Grid Setup and any initial conditions (which obviously require a restart from t=0).
However, one should take care when updating block_factor
and max_grid_size
as this can cause issues with regridding at later times (usually seen as the boxes becoming "stuck" at certain positions). Also changing the gauge or dissipation parameters will generally cause unphysical transients and so is not recommended (although we do not prohibit it).
For the purposes of this page, we will refer to the params.txt in the current BinaryBH example. See also Running the BinaryBH example.
Note that a hash #
denotes a comment and the rest of the line will not be read, so to activate a parameter this should be removed at the start of the line. Parameters that are unlikely to change are set to defaults, and the corresponding values are commented out in the params.txt
file so they are easy to identify.
-
verbosity
can be set to 0, 1, 2,... . Generally, the higher it is set, the more information is output to thepout
file from each MPI rank (or juststdout
if running in serial). GRChombo currently does not do anything different above 2 but the underlying Chombo library may output more up to 5. -
chk_prefix
andplot_prefix
are the directory and filename prefixes for the checkpoint and plot hdf5 files respectively, which will be output during the simulation. -
checkpoint_interval
is the number of coarse time steps to wait before outputting a checkpoint file. Since checkpoint files are bigger than plot files, this should be greater thanplot_interval
. -
plot_interval
is the number of coarse time steps to wait before outputting a plot file. - Checkpoint files contain all grid values for all evolution variables on the grid, hence simulations can be restarted from them. Plot files contain all grid values only for evolution and/or diagnostic variables specified in advance. For the
BinaryBH
example, this is justnum_plot_vars=3
- the conformal factorchi
and the real and imaginary parts of the Weyl Scalar, as specified byplot_vars
. As a result, plot files tend to be significantly smaller than checkpoint files and can be output more frequently. One can choose towrite_plot_ghosts
but this is usually not necessary unless one plans to use them as checkpoints for another run. - Each checkpoint/plot filename prefix will be appended with a 6 digit number corresponding to the time step on the coarsest level, the number of spatial dimensions (which should be 3 for these examples) and the hdf5 file extension. For example if the prefix is set to
BinaryBH_
, then a checkpoint file from the 10th coarse time step will have nameBinaryBH_000010.3d.hdf5
. - If a directory is not explicitly specified, then files will be output to the directory in which the binary has been executed. The can be overwritten but providing a base directory in
output_path
, which needs to exist at runtime. Generally, when running on a cluster, you'll want to change it to some local scratch storage or a space with fast I/O. Refer to your cluster documentation/administrator for help with this. - Note that Unix style relative paths, for example
../filename-prefix
, will probably not work and you should use absolute paths. - If you need to restart a run from a checkpoint file for whatever reason (usually because you ran out of time or the system crashed), uncomment (remove the
#
) beforerestart_file
and set it to the full checkpoint filename (including the absolute path if different from where the binary is executed). - By default 3 folders will be created in
output_path
to store the hdf5 files for checkpoints and plot fileshdf5
, the output from processorspout
and any data files generateddata
. These names can be amended by passing values forhdf5_subpath
,pout_subpath
anddata_subpath
. These subfolders do not need to exist at runtime and will be created. - During the simulation each MPI process outputs data on what it is doing to the
pout
folder. Settingprint_progress_only_to_rank_0
to 1 is usually a sensible thing to do as a lot of the output is duplicated between processors. Note that since each processor acts on a different part of the grid, different processors may encounter different issues - e.g. in detecting Nans - so you should check all pout files if your job stops suddenly (a useful command isgrep -r 'Nan' pout/
). This command just stops the output of data which indicates the current speed and time step on each level, which in general is redundant between processes.
-
N1
,N2
andN3
are the number of cells on the coarsest level along each dimension. Note that this needs to be a multiple of theblock_factor
(minimum box size). For general 3-dimensional problems, you'll probably want to set them to the same value but for problems that are essentially 2 or 1-dimensional dynamically, you can set different values appropriately. -
L
is the coordinate length of the longest side of the grid. The spatial step sizedx
on the coarsest level isL
/Nmax
whereNmax
is the maximum ofN1
,N2
andN3
. Note thatdx
is the same along each dimension, even if the N values differ. - There is an option to specify alternatively
N_full
andL_full
which provide the values ignoring the imposition of symmetries. So for example, for a single black hole in a domain of lengthL=128
with the black hole at the centre, but where symmetries are used to reduce the actual width of the simulation domain toL=64
with the black hole at the edge (ie, only evolving half the grid),L_full
would remain set to 128, butL
would need to be set to 64. A similar logic applies toN_full
andN
. These symmetries are also taken into account by thecenter
parameter, which can usually be left to default.
For more information on GRChombo's implementation of the Berger-Rigoutsos AMR algorithm, see §3.1.2 of Katy Clough's PhD thesis. The following bullet points will assume some familiarity with it.
-
max_level
is the maximum number of refinement levels above the coarsest level, so there aremax_level
+ 1 levels in total. -
regrid_interval
is the number of time steps to wait before tagging/regridding occurs on each level. On coarser levels, you don't need to regrid as frequently and for almost static problems, you may not even need to regrid at all (setregrid_interval
to 0 0 0 ...), since the mesh is always refined initially anyway. Note thatmax_level
values are needed (as no regrinding occurs on the top level). -
regrid_threshold
is the overall threshold which is used to decide whether or not to tag the cell. For more information on tagging criteria see AMR and tagging. -
ref_ratio
is the ratio of the spatial step size between levels. This should just be left as 2 2 2 ... as it's possible there are parts of the code which won't work with other values. Note thatmax_level
+ 1 values are needed. -
max_grid_size
, alias 'max_box_size' is the maximum number of cells along each dimension of a box (the boxes are the subsets of the grid which are shared between processors). This should definitely be greater than or equal to 8 and probably around 16 or 32 but no larger. -
block_factor
, alias 'min_box_size' is the minimum number of cells along each dimension of a box. This should ideally be an integer multiple of the vector width for doubles e.g. 8 for AVX-512 (assuming you've compiled with the appropriate flags) and probably shouldn't be smaller as then the high number of ghost cells can cause memory issues. It must be a power of 2 (for aref_ratio
of 2). - You may want to set
max_grid_size
andblock_factor
to the same value (e.g. 16) so that you know exactly how large each box is going to be. This will make it easier to optimise load balancing. -
tag_buffer_size
is the number of additional cells that are added to tagged regions to smooth them out, and defaults to 3. -
grid_buffer_size
controls the number of cells between the boundaries of the AMR grids at different resolutions. It defaults to 8. This can be set higher to "space out" the grid hierarchy more - it will tend to increase the size of coarser levels to achieve this, rather than reducing the size of finer ones. -
fill_ratio
is the minimum proportion of cells in a box that need to be tagged for regridding to occur. -
num_ghosts
is the number of ghost cells in each direction for each level. Three are required to enable the 6th order spatial derivatives used for Kreiss Oliger and the 4th order finite difference stencils. (If 6th order stencils are selected it should default to 4 automatically.) -
center
should default to the centre of the grid, taking into account any symmetries, but can be overwritten.
-
isPeriodic
is a vector of boolean values corresponding to whether the grid boundaries along each dimension are periodic or not. If one wants to have periodic boundary conditions it should be set to 1 1 1. However, GRChombo has also implemented fixed, sommerfeld, reflective and extrapolating boundary conditions in which case isPeriodic should be be 0 0 0 and the precise condition must be chosen by using the additional parameters below. -
hi_boundary
andlo_boundary
are two 3d vectors that each component carries information about the boundary conditions of the coordinate at the high and low part of the simulation box. They should be set to 0 for static, 1 for sommerfeld, 2 for reflective, 3 for extrapolating and 4 for mixed. For example, if one wanted to have reflective boundary condition in$z=0$ with sommerfeld at$x=y=0$ and all fixed for$x=y=z=L$ , the vectors should be set tolo_boundary = 1 1 2
andhi_boundary = 0 0 0
.-
vars_asymptotic_values
: If Sommerfeld or extrapolating boundary conditions are chosen the user must specify thenum_nonzero_asymptotic_vars
and their namesnonzero_asymptotic_vars
and valuesnonzero_asymptotic_values
in the corresponding order for those using Sommerfeld conditions. -
vars_parity
: If reflective boundary conditions are chosen the user must specify the parity of each variable at each boundary in vars_parity. 1,2,3 = odd$x$ ,$y$ ,$z$ and 4,5,6 = odd$xy$ ,$yz$ ,$xz$ . If a variable is even under all xyz directions it is set tovars_parity = 0
. Each component of the vector corresponds to a variable in UserVariables.hpp. Note that the order should be the same as the one in UserVariables.hpp. The same should be provided forDiagnosticVariables
. - If mixed boundaries are selected, the number of extrapolating variables
num_extrapolating_vars
and their namesextrapolating_vars
should be specified along with the order of extrapolationextrapolation_order
. The remaining variables will be assumed to be Sommerfeld and so any asymptotic values for these must also be provided as above.
-
-
dt_multiplier
is the factor you need to multiply the level spatial step sizedx
to get the time step sizedt
. This is sometimes known as the CFL (Courant-Friedrichs-Lewy) or just Courant factor. For most GR problems, this will probably need to be less than 0.5 for stability and usually 0.25 is a reasonable choice. -
stop_time
is the coordinate time up to which the simulation is run. -
max_steps
is a cut-off for the maximum number of coarse time steps so that the program does not run out of control. -
max_spatial_derivative_order
defines the order of the spatial finite differencing stencils, and can be 4 or 6. The latter is probably required for obtaining high quality waveforms. (Note that the time evolution is always 4th order Kreiss-Oliger, and that the 6th order stencils will only be used for the evolution, and not diagnostics.) -
nan_check
is a bool, and usually set to 1 to make sure the code checks for instabilities and exits normally. You may wish to turn this off (ie, set it to 0) for debugging or for final (well-tested) production runs, but it is strongly advised during development.
- The included CCZ4 class uses the following slicing condition:
-
lapse_power
is the power$a_3$ .$a_3$ = 1.0 corresponds to 1+log slicing. -
lapse_coeff
is the coefficient$a_2$ on the right hand side.$a_2$ = 2.0 corresponds to 1+log slicing. -
lapse_advec_coeff
is the coefficient of advection terms$a_1$ in the lapse condition. To use the "advective" version of 1+log slicing (which is covariant), set this to 1.0 and to use the more conventional version set it to 0.0. - The included CCZ4 class uses the following shift condition:
-
shift_advec_coeff
is the coefficient of advection terms b₁ in the shift condition. You'll usually want to set this to 0.0 or 1.0. -
shift_Gamma_coeff
is the coefficient b₂ on the right hand side of the first equation. The default is 0.75 which sets the speeds of the gauge modes to 1.0 asymptotically far away. -
eta
is the coefficient$\eta$ of the damping term in the second equation. For the hyperbolic Gamma-driver shift condition, set this to something on the order of$1/(2M)$ where$M$ is the ADM mass of the spacetime.
For more information about CCZ4 and the conventions used, see arXiv:1106.2254 and arXiv:1307.7391.
-
formulation = 1
corresponds to BSSN andformulation = 0
corresponds to CCZ4. -
kappa1
,kappa2
andkappa3
correspond to the 3 kappa values in arXiv:1106.2254 for CCZ4. To run BSSN they must be set to zero (GRChombo enforces this at runtime ifformulation = 1
).- Constraint violating modes are damped for
kappa1
> 0 andkappa2
> -1. -
kappa3 = 1
corresponds to a fully covariant formulation but, in general, is not stable for spacetimes with black holes or ones where black holes form dynamically in the evolution (although see below).
- Constraint violating modes are damped for
-
covariantZ4 = 0
corresponds to the original CCZ4 system in arXiv:1106.2254. Setting it to 1, replaces$\kappa_1$ with$\kappa_1/\alpha$ as described in equation 27 of arXiv:1307.7391. This allows the stable evolution of black hole spacetimes with$\kappa_3 = 1$ which means you can keep spatial covariance. -
sigma
is the coefficient for Kreiss-Oliger numerical dissipation and should be$\mathcal{O}(\Delta x/\Delta t)$ . For details on GRChombo's implementation, see §3.2.3 of Katy Clough's PhD thesis. It cannot be made arbitrarily large as above a certain value it affects the solution. In order to guarantee stability, it must not exceed$2\Delta x/\Delta t$ (see Eq. (9.9.7) in Alcubierre) but even close to that value it can cause instability. (PRO TIP: In general more dissipation is always helpful in reducing boundary errors, but if you see the "checkerboard of death" - an instability in which alternate cells are growing in opposite directions - you probably have it set too high.) -
min_chi
andmin_lapse
set floors for these components of the CCZ4 evolution. In general these quantities should be positive definite. Note that for cosmological spacetimes, where the value of the lapse and shift are related to the scale factor and may change exponentially, these limits may need to be disabled or lowered. -
G_Newton
is the Gravitational Constant,$G$ , in geometric units. The default is 1.0, but if you have a field with a very small energy density, you may wish to keep the field values of order 1 and absorb the smallness into$G$ .
See the guidance at Extraction and integration.
Copyright GRChombo 2018. Contact us for further details.