Skip to content

test: add openmpi container test#17956

Open
bhagyapathak wants to merge 1 commit into
4.0from
bhaya/openmpi-container-test
Open

test: add openmpi container test#17956
bhagyapathak wants to merge 1 commit into
4.0from
bhaya/openmpi-container-test

Conversation

@bhagyapathak

@bhagyapathak bhagyapathak commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Add Openmpi container test

  1. test_openmpi_mpirun_version
    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.
  2. test_openmpi_runs_multiple_ranks
    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.
  3. test_openmpi_send_receive_between_two_ranks
    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.

Copilot AI review requested due to automatic review settings July 9, 2026 08:23
@bhagyapathak bhagyapathak requested a review from a team as a code owner July 9, 2026 08:23
@bhagyapathak bhagyapathak force-pushed the bhaya/openmpi-container-test branch from 7656479 to 41387c4 Compare July 9, 2026 08:25
@bhagyapathak bhagyapathak changed the title test add openmpi container test test: add openmpi container test Jul 9, 2026
@bhagyapathak

Copy link
Copy Markdown
Contributor Author

Test Logs openmpi_container_runtime_test_logs.txt

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py with 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 Dockerfile that installs openmpi, openmpi-devel, and gcc and 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.

Comment thread base/images/tests/cases/runtime/container-base/test_openmpi/test_openmpi.py Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings July 9, 2026 08:39
@bhagyapathak bhagyapathak force-pushed the bhaya/openmpi-container-test branch from 41387c4 to 20dd24c Compare July 9, 2026 08:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread base/images/tests/cases/runtime/container-base/test_openmpi/test_openmpi.py Outdated
Comment thread base/images/tests/cases/runtime/container-base/test_openmpi/test_openmpi.py Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 10:04
@bhagyapathak bhagyapathak force-pushed the bhaya/openmpi-container-test branch from 20dd24c to 2a64ca0 Compare July 9, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


if (rank == 0) {
dest = 1;
MPI_Send(outmsg0, (int)strlen(outmsg0) + 1, MPI_CHAR, dest, tag1, MPI_COMM_WORLD);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants