Add EK species/container tau cross-check#5383
Merged
jngrad merged 3 commits intoJun 23, 2026
Merged
Conversation
…19) EKContainer::add_in_core validated only floating-point precision and the MPI Cartesian-communicator observer, never comparing the new species' tau against the container's tau. An EKSpecies derives all of its MD<->lattice conversion factors (diffusion, flux, energy, external e-field) from its own tau, while the integrator and the MD-tau veto use the container tau. When the two differ, effective diffusion/flux/mobility are wrong by a factor of tau_species/tau_container with no error raised: ekcontainer.add(species) succeeded silently. Add a tau comparison inside the existing parallel_try_catch lambda, next to the precision/observer checks, throwing std::runtime_error when the species tau differs from the container tau. The check runs under the same coordinated parallel_try_catch on every rank, so it cannot diverge. This PREVENTs the inconsistent input rather than silently rescaling baked-in conversion factors, matching how every other add-time mismatch in this path is treated and the documented contract that tau must be an integer multiple of the MD time step on both classes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ies-tau-crosscheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EKContainer::add_in_core validated only floating-point precision and the
MPI Cartesian-communicator observer, never comparing the new species' tau
against the container's tau. An EKSpecies derives all of its MD<->lattice
conversion factors (diffusion, flux, energy, external e-field) from its own
tau, while the integrator and the MD-tau veto use the container tau. When
the two differ, effective diffusion/flux/mobility are wrong by a factor of
tau_species/tau_container with no error raised: ekcontainer.add(species)
succeeded silently.
Add a tau comparison inside the existing parallel_try_catch lambda, next to
the precision/observer checks, throwing std::runtime_error when the species
tau differs from the container tau. The check runs under the same
coordinated parallel_try_catch on every rank, so it cannot diverge. This
PREVENTs the inconsistent input rather than silently rescaling baked-in
conversion factors, matching how every other add-time mismatch in this path
is treated and the documented contract that tau must be an integer multiple
of the MD time step on both classes.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
🤖 Generated with Claude Code