Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Jun 9, 2021
1 parent c41304b commit a283e83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
4 changes: 1 addition & 3 deletions tests/test/scheduler/test_mpi_world.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#include <catch.hpp>

#include <faabric/mpi/mpi.h>
#include <faabric/scheduler/FunctionCallServer.h>
#include <faabric/scheduler/MpiWorldRegistry.h>
#include <faabric/scheduler/Scheduler.h>
#include <faabric/scheduler/MpiWorld.h>
#include <faabric/util/bytes.h>
#include <faabric/util/macros.h>
#include <faabric/util/network.h>
#include <faabric/util/random.h>
#include <faabric_utils.h>

Expand Down
27 changes: 0 additions & 27 deletions tests/test/scheduler/test_remote_mpi_worlds.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <catch.hpp>

#include <faabric/mpi/mpi.h>
#include <faabric/scheduler/FunctionCallServer.h>
#include <faabric/scheduler/MpiWorldRegistry.h>
#include <faabric/scheduler/Scheduler.h>
#include <faabric/util/bytes.h>
Expand Down Expand Up @@ -32,11 +31,6 @@ TEST_CASE_METHOD(RemoteMpiTestFixture, "Test rank allocation", "[mpi]")

TEST_CASE_METHOD(RemoteMpiTestFixture, "Test send across hosts", "[mpi]")
{
// Start a server on this host
FunctionCallServer server;
server.start();
usleep(1000 * 100);

// Register two ranks (one on each host)
this->setWorldsSizes(2, 1, 1);
int rankA = 0;
Expand All @@ -53,19 +47,6 @@ TEST_CASE_METHOD(RemoteMpiTestFixture, "Test send across hosts", "[mpi]")
rankB, rankA, BYTES(messageData.data()), MPI_INT, messageData.size());
usleep(1000 * 100);

SECTION("Check queueing")
{
REQUIRE(localWorld.getLocalQueueSize(rankB, rankA) == 1);

// Check message content
faabric::MPIMessage actualMessage =
*(localWorld.getLocalQueue(rankB, rankA)->dequeue());
REQUIRE(actualMessage.worldid() == worldId);
REQUIRE(actualMessage.count() == messageData.size());
REQUIRE(actualMessage.sender() == rankB);
REQUIRE(actualMessage.destination() == rankA);
}

SECTION("Check recv")
{
// Receive the message for the given rank
Expand All @@ -85,18 +66,12 @@ TEST_CASE_METHOD(RemoteMpiTestFixture, "Test send across hosts", "[mpi]")
// Destroy worlds
localWorld.destroy();
remoteWorld.destroy();

server.stop();
}

TEST_CASE_METHOD(RemoteMpiTestFixture,
"Test collective messaging across hosts",
"[mpi]")
{
FunctionCallServer server;
server.start();
usleep(1000 * 100);

// Here we rely on the scheduler running out of resources, and overloading
// the localWorld with ranks 4 and 5
int thisWorldSize = 6;
Expand Down Expand Up @@ -292,7 +267,5 @@ TEST_CASE_METHOD(RemoteMpiTestFixture,
// Destroy worlds
localWorld.destroy();
remoteWorld.destroy();

server.stop();
}
}

0 comments on commit a283e83

Please sign in to comment.