# Advanced

## Testing / debugging

The following inputs must be preceded by “mfix.”

| Description | Type | Default
--- | --- | --- | ---
verbose | Verbosity in MFIX-Exa routines | Int | 0
ooo_debug | If true then print the name of the routine we are in | Bool | False
only_print_grid_report | Do not time-march the simulation. Simply generate the grid report and exit. | Bool | False

The following inputs must be preceded by “amrex.”

| Description | Type | Default
--- | --- | --- | ---
fpe_trap_invalid | Abort if an invalid floating point exception is encountered. | Int | 0
fpe_trap_zero | Abort if a division by zero is computed. | Int | 0
fpe_trap_overflow | Abort if an overflow is detected. | Int | 0

## GPU memory

The following inputs must be preceded by “amrex.”

| Description | Type | Default
--- | --- | --- | ---
the_arena_is_managed | Use managed memory for the main arena. | Int | 0
the_arena_init_size | Main memory arena’s initial size in bytes. | Int | 3/4 of system device memory
abort_on_out_of_gpu_memory | Abort if free device memory is less than the amount an arena is asked to allocate. | Int | 0

## Load balancing

Note that when running a granular simulation, i.e., no fluid phase, `mfix.dual_grid` must be 0. Hence, the `particles.max_grid_size` (in each direction) have no meaning. Therefore the fluid grid and tile sizes should be set for particle load balancing. It may also be necessary to set the blocking factors to 1.

The following inputs must be preceded by “mfix.” and determine how we load balance:

| Description | Type | Default
--- | --- | --- | ---
dual_grid | If true then use the “dual_grid” approach for load balancing | Bool | False
regrid_int | How often to regrid (in number of steps at level 0) if regrid_int = -1 then no regridding will occur | Int | -1
load_balance_fluid | Only relevant if (dual_grid); if so do we also regrid mesh data | Int | 0
load_balance_type | What strategy to use for load balancing Options are “KnapSack”, “SFC”, or “Greedy” | String | KnapSack
knapsack_weight_type | What weighting function to use if using Knapsack load balancing Options are “RunTimeCosts” or “NumParticles”” | String | RunTimeCosts
knapsack_nmax | Maximum number of grids per MPI process if using knapsack algorithm | Int | 128
greedy_dir | The direction in which the greedy algorithm cuts overloaded boxes | Int | 0
greedy_min_grid_size | The minimum particle grid size in the greedy load balance algorithm | Int | 2
greedy_3d | Partition particle grids in 3D with the greedy algorithhm | Bool | False
overload_tolerance* | The ratio between the maximum workload and the average workload in the greedy algorithm | Real | 1.2
underload_tolerance* | The ratio between the minimum workload and the average workload in the greedy algorithm | Real | 0.8
grid_pruning | Remove all covered grids from the base mesh; this may result in disjoined grids | Bool | False

* The greedy partitioning algorithm uses the tolerances to set the expected workload range for each rank but doesn’t strictly enforce them. The algorithm creates a partition as balance as possible even if the partition doesn’t meet the tolerances.

To allow a user to verify the breakdown of fluid grids created before running a full simulation, an input option, `mfix.only_print_grid_report` is supported. By default, it is `False`. When set to `True`, the run uses minimal memory to print the grid coverage report and exits immediately after that.

The following inputs are defined using the `particles` prefix.

| Description | Type | Default
--- | --- | --- | ---
max_grid_size_x | Maximum number of cells at level 0 in each grid in x-direction for grids in the ParticleBoxArray if dual_grid is true | Int | 32
max_grid_size_y | Maximum number of cells at level 0 in each grid in y-direction for grids in the ParticleBoxArray if dual_grid is true | Int | 32
max_grid_size_z | Maximum number of cells at level 0 in each grid in z-direction for grids in the ParticleBoxArray if dual_grid is true. | Int | 32