Skip to content
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

Fix MPI world creation of size 1 #114

Merged
merged 3 commits into from
Jun 17, 2021
Merged

Fix MPI world creation of size 1 #114

merged 3 commits into from
Jun 17, 2021

Conversation

csegarragonz
Copy link
Collaborator

@csegarragonz csegarragonz commented Jun 16, 2021

Running MPI applications with world size 1 would not work as we'd call callFunctions with an empty protobuf message, and the library would raise an error.

Adding a simple check, and a test that (surprisingly) failed before and now passes.

@csegarragonz csegarragonz self-assigned this Jun 16, 2021
@csegarragonz csegarragonz added bug Something isn't working mpi Related to the MPI implementation labels Jun 16, 2021
@@ -43,6 +43,19 @@ TEST_CASE_METHOD(MpiBaseTestFixture, "Test world creation", "[mpi]")
world.destroy();
}

TEST_CASE_METHOD(MpiBaseTestFixture, "Test creating world of size 1", "[mpi]")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this test could be a bit more specific in checking the effect we're trying to avoid (i.e. initialising the world but not sending messages). It would look a lot like the test above where we check a valid world initialisation.

// Create a world of size 1
MpiWorld world;
world.create(msg, worldId, 1);

// Check details are set up properly
REQUIRE(world.getSize() == 1);
REQUIRE(world.getId() == worldId);
REQUIRE(world.getUser() == user);
REQUIRE(world.getFunction() == func);

// Check no messages are sent
REQUIRE(sch.getRecordedMessagesAll().empty());

@csegarragonz csegarragonz merged commit 0605083 into master Jun 17, 2021
@csegarragonz csegarragonz deleted the fix-1-proc branch June 17, 2021 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mpi Related to the MPI implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants