HERA-Team / hera_sim

Simple simulation code for HERA-like redundant interferometric arrays
Other
16 stars 8 forks source link

Allow hera_sim test scripts to use MPI #123

Open hughbg opened 3 years ago

hughbg commented 3 years ago

hera_sim will likely be MPI enabled in the future (there's a pull request pending that adds MPI to hera_sim). It would be useful to have a test script that tests the MPI implementation, e.g., test that an MPI script runs without error and produces the same result no matter how many processes are used. This would require that mpi4py and mpiexec/mpirun are available. It also might require a design decision about how test scripts should be constructed. The problem is that an MPI script has to be invoked from outside itself, so something else would have to run the script and check results if necessary.

steven-murray commented 3 years ago

Thanks @hughbg.

@mkolopanis and/or @bhazelton, do you have any experience with this? I seem to recall that neither Travis nor Actions are able to use MPI, but perhaps I'm wrong.

mkolopanis commented 3 years ago

looks like it should be possible on travis but this is all I can find with a quick search. I do not know off hand about github and mpi.

aelanman commented 3 years ago

If it's any help, I spent some time last spring on using pytest hooks to run tests with mpi enabled. These work on github actions.

The setup is in the tests of pyuvsim. The hooks are defined in conftest.py, and tests marked with @pytest.mark.parallel() are run in parallel. The trick is to spawn a subprocess that runs the test using mpirun. There are some other details to ensure stack traces and errors are reported properly.

steven-murray commented 3 years ago

Thanks @aelanman, that is indeed helpful.

On Mon, Jan 25, 2021 at 2:57 PM Adam Lanman notifications@github.com wrote:

If it's any help, I spent some time last spring on using pytest hooks to run tests with mpi enabled. These work on github actions.

The setup is in the tests of pyuvsim. The hooks are defined in conftest.py, and tests marked with @pytest.mark.parallel() are run in parallel. The trick is to spawn a subprocess that runs the test using mpirun. There are some other details to ensure stack traces and errors are reported properly.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/HERA-Team/hera_sim/issues/123#issuecomment-767138626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJWRXTHOID6JJKFLSZZDF3S3XSLTANCNFSM4WQ2GU6A .