Skip to content

Commit 8e23866

Browse files
committed
Consolidate conditional branches to remove code duplication.
1 parent a611911 commit 8e23866

3 files changed

Lines changed: 180 additions & 248 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ somd2 perturbable_system.bss --terminal-flip-frequency "1 ps" --terminal-flip-an
245245
## Debugging with energy components
246246

247247
To help diagnose simulation instabilities, `SOMD2` can record the potential
248-
energy contribution from each OpenMM force group at every `energy-frequency`
249-
interval. This is enabled with the `--save-energy-components` flag:
248+
energy contribution from each OpenMM force group. This is enabled with the
249+
`--save-energy-components` flag:
250250

251251
```
252252
somd2 perturbable_system.bss --save-energy-components
@@ -256,6 +256,14 @@ One Parquet file per λ window is written to the output directory, named
256256
`energy_components_<lambda>.parquet`. Times are in nanoseconds and energies in
257257
kcal/mol; both are stored as schema metadata in the file.
258258

259+
The recording interval depends on the runner and active samplers:
260+
261+
- **Replica exchange**: always `energy-frequency`
262+
- **Standard runner, no MC**: `energy-frequency`
263+
- **Standard runner, with MC**: the shortest active MC frequency, i.e.
264+
`gcmc-frequency`, `terminal-flip-frequency`, or the smaller of the two
265+
when both are active
266+
259267
> [!NOTE]
260268
> Energy components are written more frequently than checkpoint files and are
261269
> not guarded by the file lock, so they may lead the checkpoint files by up

src/somd2/config/_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,9 @@ def __init__(
508508
save_energy_components: bool
509509
Whether to save per-force-group energy contributions to a Parquet file
510510
in the output directory. Energies are recorded at every 'energy_frequency'
511-
interval, or 'gcmc_frequency' when running with GCMC. Intended for
512-
debugging purposes.
511+
interval. When not running replica exchange, the interval is instead the
512+
shortest active MC frequency when running with GCMC or terminal flip moves.
513+
Intended for debugging purposes.
513514
514515
save_xml: bool
515516
Whether to write an XML file for the OpenMM system to the output

0 commit comments

Comments
 (0)