Skip to content

Fix ntwx bug in GamdLogger#38

Open
alex-sbaq wants to merge 1 commit intoMiaoLab20:mainfrom
alex-sbaq:fix/ntwx-logging-calculation
Open

Fix ntwx bug in GamdLogger#38
alex-sbaq wants to merge 1 commit intoMiaoLab20:mainfrom
alex-sbaq:fix/ntwx-logging-calculation

Conversation

@alex-sbaq
Copy link
Copy Markdown
Contributor

Fix ntwx logging calculation

Problem

The ntwx parameter in GaMD log files was hardcoded to 1, causing incorrect logging intervals and potentially misleading statistics output.

Solution

Fixed write_to_gamd_log() in gamd/GamdLogger.py:

  • Before: ntwx = 1 (hardcoded)
  • After: ntwx = step // statistics_interval (calculated correctly)

Technical Details

  • Properly calculates logging interval based on current step and statistics interval
  • Maintains consistency with OpenMM's logging conventions
  • Preserves existing log file format and structure

Impact

  • Correctness: Log files now show accurate logging intervals
  • Compatibility: Maintains existing log file format
  • Minimal: Single line change with significant correctness improvement

Testing

  • Verified log output shows correct ntwx values
  • All existing functionality preserved
  • No breaking changes to log file format

- Add statistics_interval parameter to GamdLogger constructor
- Calculate ntwx correctly as step // statistics_interval
- Update both gamd_logger and gamd_reweighting_logger instantiations
- Fix hardcoded ntwx value of 1 that prevented proper log file indexing
- Maintain backward compatibility with default statistics_interval=500

Fixes issue where ntwx column always showed 1 instead of incrementing
properly with each statistics write interval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant