-
Notifications
You must be signed in to change notification settings - Fork 391
Port MPI tests from SLI to Python, Part I #3102
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
Conversation
|
|
nicolossus
left a comment
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.
@heplesser I think this looks good as first version that can be expanded upon as needed. I have a few suggestions, see inline comments.
Co-authored-by: Nicolai Haug <39106781+nicolossus@users.noreply.github.com>
nicolossus
left a comment
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.
LGTM
terhorstd
left a comment
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.
I think, the concept is OK for now. There are some points that are not clear to me though. At least some intentions and limitations should be mentioned in the corresponding doc-strings. Since it took an hour of discussion for us yesterday, we should make it somehow possible for others and our future selves to remember/understand what the intentions were.
…nstead Co-authored-by: Dennis Terhorst <terhorstd@users.noreply.github.com>
terhorstd
left a comment
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.
This is much clearer! Thanks for the additions! 👍
This PR provides the infrastructure (
mpi_test_wrapper.py) and three tests following the classic SLI-base MPI testing paradigm of NEST, where we run code with different numbers of MPI processes and often a fixed number of virtual processes to check for consistency of results.mpi_test_wrapperprovides a decorator to be applied to each test. It might be possible to place more than one test in a single Python file, but that is as yet untested. The decorator receives a list of MPI process numbers to run with, and an optionaldebug=Trueto provide more output; temporary files will only be preserved when using Python 3.12 or later.The decorator writes the test function to a separate file in a tempdir, then executes this runner for all given numbers of processes. Each run must write data to CSV files (spike recorder, multimeter, or other). After all executions are done, the decorator will collect results from files and compare them. Currently, only comparison for equality across process numbers is implemented, more to come as further test will be ported. It is up to the test script to remove columns from data that will not be equal (e.g., thread numbers or port numbers for connections).
It is crucial that
nestis not imported in the testing process until the actual, temporary runner script ismpirunby the decorator. Thereforepytestmust be run with the--noconftestoptionimportstatements need by the test function must be placed inside the test functionSee also the solution in
do_tests.shto run these tests separate from the remaining Python-based tests.This is still in draft stage, but posted to facilitate discussion.