Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
@csegarragonz csegarragonz requested a review from Shillaker June 16, 2021 15:02
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 requested a review from Shillaker June 17, 2021 07:49
@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