These examples generate bash scripts that can be used to benchmark Gromacs on your hardware.
# cpu_ids, gpu_ids, and gmx_version are mandatory. Options such as the number of trials and tpr to
# benchmark are easily configurable at the top of the output script.
# For Gromacs 2019:
gromax generate --num_cpus=4 --num_gpus=2 --gmx_version=2019 --run_file=benchmark_gmx2019.sh
# For Gromacs 2018:
gromax generate --num_cpus=4 --num_gpus=2 --gmx_version=2018 --run_file=benchmark_gmx2018.sh
The simplest use is to specify the number of CPUs and GPUs to be tested (see above example). This works great if the CPUs and GPUs you want to test on are indexed from 0 and don't skip. There are several alternative ways to customize hardware usage:
# It's easy to specify ranges of CPUs or GPUs. This example is for a 40 CPU system with 5 GPUs, with logical
# IDs starting from 0.
gromax generate --gmx_version=2020 --cpu_ids=0-39 --gpu_ids=0-4
# Colon-range syntax works as well.
gromax generate --gmx_version=2020 --cpu_ids=0:39 --gpu_ids=0:4
# Both of the above are equivalent to --num_cpus=40 --num_gpus=5.
# Comma separated values work as well, as long as they are evenly strided.
gromax generate --gmx_version=2018 --cpu_ids=0,1,2,3 --gpu_ids=0
# Use only GPUs 1 and 2 (e.g. if GPU 0 is dedicated to graphics)
gromax generate --gmx_version=2020, --num_cpus=8 --gpu_ids=1,2
# CPUs can be strided, if e.g. one has a hyperthreaded system and wants 1 thread per physical core.
# This will benchmark on cores 0,2,4,and 6.
# NOTE: This is experimental and not yet well tested.
gromax generate --gmx_version=2020 --cpu_ids=0:2:7 --gpu_ids=0
# If your workflows absolutely require a single long simulation, and you can't parallelize at all, you can have gromax
# ignore all the various possible hardware breakdowns for multiple concurrent simulations. Using this parameter will
# have gromax generate ONLY benchmarks for single simulations that use all of the given hardware.
gromax generate --gmx_version=2020 --cpu_ids=0:7 --gpu_ids=0 --single_sim_only
Since Gromax v1.1, the --generate_exhaustive_combinations
flag can be used to tune the number of configs Gromax
creates. It set to false by default, which adds the following limits:
- combinations of -pme and (where applicable to the Gromacs version) -bonded -update must be the same. E.g. a combination such as -pme gpu -bonded cpu -update cpu is not created.
- A cap of 2 simultaneous simulations per GPU is set.
This significantly cuts down on the number of combinations generated, while not sacrificing much in coverage. Exhaustive configs can still be generated by adding in the flag:
gromax generate --gmx_version=2020 --cpu_ids=0:7 --gpu_ids=0 --generate_exhaustive_combinations
NOTE: Each of these options can also easily be set in the first few lines of the benchmark script.
# Specify a gmx binary that isn't in your shell's PATH.
gromax generate --gmx_version=2020 --cpu_ids=0-39 --gpu_ids=0-4 --gmx_executable="/path/to/gmx"
# Use gmx_mpi rather than gmx - no guarantees that it'll work nicely with MPI.
gromax generate --gmx_version=2020 --cpu_ids=0-39 --gpu_ids=0-4 --gmx_executable="/path/to/gmx"
# Specify the number of trials to run per simulation group (defaults to 3).
gromax generate --gmx_version=2020 --cpu_ids=0-39 --gpu_ids=0-4 --trials_per_group=15
# Specify the tpr file that will be benchmarked (no default, so if not set you'll have to set in the benchmark script).
gromax generate --gmx_version=2020 --cpu_ids=0-39 --gpu_ids=0-4 --tpr=benchmark.tpr
# Equivalent to --directory=`pwd`, will only succeed if benchmark groups are directly under this folder.
gromax analyze
# Group results should be in /path/to/results.
gromax analyze --directory=/path/to/results