-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to calc energy contrib for single bond #5040
base: python
Are you sure you want to change the base?
Conversation
assert(1 == boost::mpi::all_reduce(comm, static_cast<int>(!!result), | ||
std::plus<>()) && | ||
"Incorrect number of return values"); | ||
if (boost::mpi::all_reduce(comm, static_cast<int>(!!result), | ||
std::plus<>())!=1) { | ||
throw std::runtime_error("Internal error. Incorrect number of return values when collecting values from MPI ranks"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you really sure about this change? We use assertions in almost all MPI reductions so that we get code coverage for the assertion. By turning it into an exception, we get zero code coverage for the body of the conditional, because it's impossible for the testsuite to enter it when there is no bug.
I'm always developing code with -D CMAKE_BUILD_TYPE=RelWithAssert
builds, which is almost as fast as Release
builds except for a few momentum-conservation tests, and has the advantage of enabling all assertions. By selectively turning a few critical assertions into exceptions, we are decreasing incentives for other ESPResSo developers to adopt RelWithAssert
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like my answer via email ditn't work. I reverted the change in reuduce_optoinal()
via
system.analysis.particle_bond_energy(particle,bond)
This also
particle.bonds
Utils::MPI::reduce_optional()
to an exception. This should never happen to end users in any case, but is easier on developers who trigger it...