test: add openmpi container test#17956
Conversation
7656479 to
41387c4
Compare
|
Test Logs openmpi_container_runtime_test_logs.txt |
There was a problem hiding this comment.
Pull request overview
This PR adds a new container-base runtime test case that validates OpenMPI on the image-under-test. It follows the existing @pytest.mark.dockerfile() pattern: a small Dockerfile layers OpenMPI on top of the base image, and the test suite exercises mpirun version reporting, multi-rank process launch, and a compiled two-rank send/receive program. The MPI send/receive assertions correctly track the per-tag non-overtaking ordering guaranteed by MPI, and the Dockerfile build context correctly includes the copied C source.
Changes:
- Adds
test_openmpi.pywith three tests (mpirun--version, 2-rank launch, and a tagged send/receive round-trip). - Adds
send_receive.c, a minimal MPI program exchanging tagged messages between two ranks. - Adds a
Dockerfilethat installsopenmpi,openmpi-devel, andgccand stages the C source under/opt/mpi-tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| base/images/tests/cases/runtime/container-base/test_openmpi/test_openmpi.py | New pytest cases for OpenMPI runtime; minor style deviations (E265/E302) and duplicated path literals vs. existing constants. |
| base/images/tests/cases/runtime/container-base/test_openmpi/send_receive.c | MPI two-rank tagged send/receive program; logic aligns with the test assertions. |
| base/images/tests/cases/runtime/container-base/test_openmpi/Dockerfile | Layers OpenMPI + gcc on BASE_IMAGE and copies the C source into the build context. |
41387c4 to
20dd24c
Compare
20dd24c to
2a64ca0
Compare
|
|
||
| if (rank == 0) { | ||
| dest = 1; | ||
| MPI_Send(outmsg0, (int)strlen(outmsg0) + 1, MPI_CHAR, dest, tag1, MPI_COMM_WORLD); |
There was a problem hiding this comment.
issue: A deadlock can occur if rank 0's first MPI_Send() with tag1 blocks waiting for a matching receive. Rank 0 then never sends tag2, while rank 1 is already blocked waiting to receive a tag2 message
Please either receive messages in send order or use nonblocking sends, like 4 MPI_Isend()s followed by MPI_Waitall().
Add Openmpi container test
Validates that OpenMPI runtime is installed and usable.
Runs mpirun --version with required OpenMPI runtime env configuration.
Fails fast if basic OpenMPI runtime wiring is broken.
Validates that mpirun actually launches two MPI ranks in the container.
Executes a two-rank command and checks exact rank output: rank=0 and rank=1.
Provides stable rank-launch verification without depending on version-string formatting.
Validates real MPI communication semantics, not just process launch.
Compiles the checked-in C program copied into the image, then runs it with two ranks.
Asserts tagged message exchange output, proving rank-to-rank send and receive behavior works end to end.