Configuration Overview#
BATTER’s configuration layer is driven by batter.config.run.RunConfig,
the user-facing schema that describes the system to build, the FE protocol to
execute, runtime options, and execution settings. Derived simulation knobs are
produced by RunConfig.resolved_sim_config(); the resulting
SimulationConfig is documented in the
developer guide (BATTER Developer Guide).
Run Configuration Schema#
The run YAML file is divided into three sections grouped inside
RunConfig:
runExecution controls that include runtime behaviour, SLURM settings, notification preferences, and artifact destination.
run.output_folderis required and becomes the base path for<run.output_folder>/executions/<run_id>/.run.system_typeoptionally overrides the builder selection inferred from the protocol (MABFEfor ABFE/MD,MASFEfor ASFE). This section is validated bybatter.config.run.RunSection. Setrun.clean_failures: trueto removeFAILEDsentinels,job_attempt.txtretry counters, and progress caches before rerunning an existing execution.createInputs required for system staging (protein/topology paths, ligands, force fields, optional restraints). The structure maps directly to
batter.config.run.CreateArgs.fe_simOverrides and controls for free-energy simulation stages. For ABFE/ASFE runs these map to
batter.config.run.FESimArgs. MD-only runs automatically coerce this section intobatter.config.run.MDSimArgs, so fields likelambdasor SDR restraints are no longer required. Equilibration controls are expressed viaeq_stepswhich now represents the total equilibration steps. The value is written intomdin-templateas! total_steps=<total>, letting runtime scripts determine the target length without regenerating inputs. Legacy production extend knobs (num_fe_extends) are rejected; setn_stepsto total steps instead.analysis_rangeis likewise disallowed—useanalysis_start_stepto skip early production frames. FE production no longer chunks into extends; setn_stepsto the total per-window production steps. Those mdin templates also include! total_steps=<total>;run-local*.bashreads that marker plus the firstnstlimit finds to choose the segment length. Each invocation runs one segment, updatesmd-current.rst7/md-previous.rst7plusmd-*.out, and returns; rerun the script to continue untiltotal_stepsis reached.
See Quick Reference below for links to individual config classes.
Per-component steps and lambdas#
Component steps are supplied via fe_sim.n_steps as dicts keyed by the
single-letter component (e.g. z: 100000). Keys like y_n_steps are also
accepted and folded into this map automatically. Each protocol enforces the
required components: ABFE fills z defaults if omitted, and ASFE fills
y/m defaults.
Lambda schedules can be customized per component using fe_sim.component_lambdas
(or <comp>_lambdas keys). When a component is missing from that map, it
inherits the top-level fe_sim.lambdas list. Values can be written as YAML lists
or comma/space separated strings; validation ensures ascending order.
RBFE mapping options#
For protocol: rbfe, the rbfe block controls network planning and atom mapping.
rbfe.mapping– mapping strategy (for exampledefaultorkonnektor).rbfe.mapping_file– explicit pair list file; takes precedence overmapping.rbfe.konnektor_layout– optional Konnektor layout whenmapping: konnektor.rbfe.both_directions– when true, run both directions for each mapped edge.rbfe.atom_mapper– atom mapper backend used for RBFE mapping:kartograf(default), configured asKartografAtomMapper(atom_max_distance=0.95, map_hydrogens_on_hydrogens_only=True, atom_map_hydrogens=False, map_exact_ring_matches_only=True, allow_partial_fused_rings=True, allow_bond_breaks=False, additional_mapping_filter_functions=[filter_element_changes])during network planning.lomap, usingLomapAtomMapper(time=20, threed=True, max3d=1.5, element_change=False, shift=True).
Mapper constructor options can be overridden in nested blocks. Omitted values keep BATTER’s previous Kartograf/LoMap defaults documented in RBFE Guide.
rbfe:
atom_mapper: lomap
lomap:
time: 7
max3d: 2.0
shift: false
kartograf:
atom_max_distance: 1.1
allow_bond_breaks: true
filter_element_changes: false
See RBFE Guide for RBFE-specific examples.
Component-Specific Inputs#
Although the create block is shared by ABFE, MASFE, and MD pipelines, some fields
are consumed only by particular builders. The table below highlights the ones that
feed into the low-level ops documented in Implementing Internal Builders:
Field |
Used by |
Purpose |
|---|---|---|
|
|
Controls rectangular solvent box sizing. |
|
|
Sets cubic padding for standalone ligands. |
|
|
Selects the |
|
|
Define ion names that |
|
|
Drives salt concentration when |
|
|
Toggles between neutralisation-only or salt+neutralisation workflows. |
|
Restraint ops |
Adds positional restraints for ABFE builders. |
|
Restraint ops |
JSON specification for conformational restraints. |
|
Build/ops helpers |
Identifies membrane residues when trimming waters. |
Linking configuration fields to their downstream consumers makes it easier to reason about which parts of the file structure (build directories, solvation scripts, restraint writers) are affected when you toggle individual knobs.
The buffer_z value also determines the SDR translation distance: ligands are
shifted so they sit near the midpoint of the solvent slab, with an extra 5 Å of
clearance (see batter.systemprep.helpers.get_sdr_dist()). For membrane systems
the builder enforces a minimum effective buffer_z of ~25 Å to keep the ligand in
bulk solvent above the membrane even if the YAML specifies a smaller buffer.
Equilibration options#
Two frequently toggled equilibration knobs live under fe_sim and flow into the
resolved SimulationConfig:
hmr–"yes"enables hydrogen mass repartitioning. The builder swaps in HMR parameter files and switches equilibration/production mdins to the HMR topology (full.hmr.prmtop).enable_mcwat–"yes"(default) enables Monte Carlo water moves during equilibration. The flag populates themcwatsetting in AMBER input decks viabatter._internal.ops.amber.write_amber_templates().
REMD runs#
REMD inputs (mdins/groupfiles) are always written during preparation so you can decide at
submit time whether to run them. Use fe_sim.remd.nstlim to set the exchange interval
and segment length; the exchange count is derived from the remaining steps so total
runtime is controlled by n_steps. Control execution with run.remd (yes or
no); when run.remd: no the files are still generated but no REMD jobs are
scheduled. REMD jobs submit one Slurm job per component via SLURMM-BATCH-remd and
monitor FINISHED/FAILED sentinels in the component folder. See
REMD submission flow for operational details.
SLURM header templates#
BATTER renders SLURM scripts by combining a user-editable header with a packaged body.
Headers are copied into ~/.batter on first use.
You can also seed them explicitly:
batter seed-headers # seeds into ~/.batter
batter seed-headers --dest /path/to/dir
batter seed-headers --force # overwrite existing headers
To check how your headers differ from the packaged defaults:
batter diff-headers # compares ~/.batter headers to defaults
batter diff-headers --dest /path/to/dir
Edit the headers to match your cluster defaults (queue/partition, env exports, executable paths). Bodies remain managed by the package. Header files:
SLURMM-Am.header(equil/FE runs)SLURMM-BATCH-remd.header(REMD runs)job_manager.header(manager script forbatter run --slurm-submit)
The header lookup/seed location is controlled by run.slurm_header_dir; when omitted it
defaults to ~/.batter.
Per-run SLURM overrides#
Simulation submit scripts inherit the header settings above, but you can also control SLURM
resources per run via the run.slurm block (partition, time, nodes, ntasks_per_node, mem, etc.).
Those values are substituted into SLURM scripts when rendered. Combine the two mechanisms by
setting cluster defaults in the headers and per-run overrides in the YAML when needed.
SLURM configuration block#
The run.slurm block maps directly onto sbatch flags. All fields are optional; if a
value is omitted it will not be added to the submission command. You can also use
run.slurm_header_dir to point at a custom header directory seeded with
batter seed-headers. Keep backend: local in the YAML; submit the manager
through SLURM with batter run ... --slurm-submit when you want cluster execution.
Example:
backend: local
run:
slurm_header_dir: /path/to/slurm_headers
slurm:
partition: gpu
time: "08:00:00"
nodes: 2
ntasks_per_node: 8
mem_per_cpu: "8G"
gres: "gpu:8"
account: my-account
qos: normal
constraint: "a100"
extra_sbatch:
- "--exclusive"
- "--mail-type=FAIL"
Supported keys in run.slurm:
partition– SLURM partition/queue name (-p).time– Walltime inHH:MM:SS(-t).nodes– Node count (-N).ntasks_per_node– Tasks per node (--ntasks-per-node).mem_per_cpu– Memory per CPU (--mem-per-cpu).gres– Generic resources, e.g. GPUs (--gres).account– Account/project string (--account).qos– QoS string (--qos).constraint– Constraint string (--constraint).extra_sbatch– Additionalsbatchflags appended verbatim.
Run notifications#
Set run.email_on_completion to receive a best-effort email when the BATTER
manager finishes normally or exits with an uncaught failure. BATTER sends that
message through localhost SMTP and uses run.email_sender as the sender
address (default: nobody@stanford.edu).
Batch mode (single allocation)#
If you prefer to request a multi-GPU allocation once and submit per-window jobs from a
manager process, set run.batch_mode: true. The manager will render SLURMM-BATCH
scripts into executions/<run_id>/batch_run and submit them with sbatch; each script
cd``s into the component/window folder and runs ``run-local.bash (or run-local-remd.bash).
Equilibration and FE-equil run as normal per-ligand submits; FE production is bundled into a
single batch submission per ligand when REMD is disabled.
Set run.batch_gpus to request GPUs on the sbatch line (via --gres gpu:<batch_gpus>)
for the per-ligand FE batch submission; run.batch_gpus_per_task controls the per-task
allocation used inside the batch helper.
The batch wrapper header is seeded to ~/.batter/SLURMM-BATCH.header (similar to other
headers); edit it to match your cluster defaults (GPUs, partition, modules).
Remember to request GPUs in your job manager header (job_manager.header) so the manager
allocation has the resources it needs.
Executable resolution#
BATTER launches external tools by name (e.g., pmemd.cuda, pmemd.cuda.MPI,
pmemd, sander, tleap, antechamber, cpptraj, parmchk2,
obabel, vmd). Ensure they are on PATH or exported in your SLURM headers
if cluster modules are required. The package ships USalign internally and calls
it via the baked-in path. For the Python-side tooling you can override executables
via environment variables so overrides propagate into subprocesses:
BATTER_ANTECHAMBER(default:antechamber)BATTER_TLEAP(default:tleap)BATTER_CPPTRAJ(default:cpptraj)BATTER_PARMCHK2(default:parmchk2)BATTER_CHARMM_LIPID2AMBER(default:charmmlipid2amber.py)BATTER_USALIGN(default: packagedUSalign)BATTER_OBABEL(default:obabel)BATTER_VMD(default:vmd)
Quick Reference#
Top-level YAML config. |
|
Inputs for system creation and staging. |
|
Free-energy simulation knobs loaded from the |
|
Simulation overrides used when |
|
Run-related settings, including where outputs land. |
|
Simulation configuration for ABFE/ASFE/RBFE workflows. |
|
Read a run-level YAML file and return a validated configuration. |
|
Serialize a run configuration to YAML. |
|
Load a simulation configuration from YAML. |
|
Write a simulation configuration to YAML. |