Skip to content

Split mdsteps#371

Draft
suemni wants to merge 21 commits into
masterfrom
split_step
Draft

Split mdsteps#371
suemni wants to merge 21 commits into
masterfrom
split_step

Conversation

@suemni

@suemni suemni commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Mdsteps are split into two half timesteps when criteria is met. Steps that are split are noted with a warning message.

@suemni suemni requested a review from cnegre as a code owner May 19, 2026 15:21
@suemni suemni requested a review from mewall May 19, 2026 15:38

@mewall mewall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The energy is drifting when I run the Mac1 system on Perlmutter. Needs debugging.

@mewall mewall marked this pull request as draft June 1, 2026 19:33
mewall and others added 5 commits July 1, 2026 12:01
Scale kappa with (timestep)^2 as required by κ = Δt²ω². Result: Stable through 100+ split-step cycles. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed MD loop to continue until print_mdstep reaches the requested
number of steps, rather than using a fixed internal step count. This
ensures that MDSteps= in input.in controls the number of output steps
at the user timestep, regardless of how many split-steps occur.

Before: MDSteps=50 with frequent splits would give < 50 output steps
After: MDSteps=50 always gives exactly 50 output steps

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add interpolation-based approach for handling non-uniform timesteps.
When timesteps vary, interpolate historical charges n_0...n_5 from non-uniform
grid to uniform grid, then apply fixed coefficients C0-C5. This is mathematically
equivalent to recomputing adaptive coefficients but simpler to implement.

Key changes:
- Add dt_history(5) and nsteps_taken to xlbo_type for tracking timesteps
- Implement prg_xlbo_interpolate_charges() using 5th-order Lagrange polynomial
- Modify prg_xlbo_nint, prg_xlbo_nint_kernel, prg_xlbo_nint_kernelTimesRes
  to use interpolation when nsteps >= 6 and dt provided
- Automatic activation after 6 MD steps, graceful fallback for early steps

Test results:
- Uniform timesteps (0.25 fs): Identical to original (0.0 eV difference)
- Variable timesteps (0.5 fs, 60 split-steps): Same accuracy as recomputing
  coefficients (0.0 eV difference), confirming mathematical equivalence

Builds on kappa scaling fix from commit 7f62eec.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

3 participants