Commit 1a69d310 authored by niklas.baumgarten's avatar niklas.baumgarten

updated test routines

parent 77c2e782
......@@ -134,47 +134,26 @@ TEST(TestParallel, TestUnsignedIntMax) {
EXPECT_EQ(PPM->Max(a), 1);
}
TEST(TestParallel, TestNullComm) {
EXPECT_FALSE(PPM->master(NULLCOMM));
EXPECT_EQ(PPM->proc(NULLCOMM), -1);
EXPECT_EQ(PPM->size(NULLCOMM), 0);
EXPECT_EQ(PPM->GetComm(NULLCOMM)->Color(), NULLCOMM);
}
TEST(TestParallel, TestSplitProc) {
int partitions = 2;
int worldSize = PPM->size(WORLD);
PPM->SplitCommunicator(WORLD, partitions);
TEST(TestParallel, TestSplitCommunicators) {
PPM->SplitCommunicators();
EXPECT_EQ(PPM->size(1), PPM->size(0) / 2);
EXPECT_EQ(PPM->proc(1) + PPM->Color(1) * 2, PPM->proc(0));
PPM->GetComm(WORLD)->PrintInfo();
PPM->GetComm(0)->PrintInfo();
PPM->GetComm(1)->PrintInfo();
EXPECT_EQ(PPM->size(0), worldSize / partitions);
// EXPECT_EQ(PPM->size(1), worldSize / partitions);
// EXPECT_EQ(PPM->master(0), PPM->master(WORLD));
// EXPECT_EQ(PPM->master(1), PPM->master(WORLD) + partitions);
// if (PPM->master(-1)) EXPECT_EQ(PPM->proc(-1), 0);
// if (!PPM->master(-1)) EXPECT_NE(PPM->proc(-1), 0);
//
// if (PPM->master(0)) EXPECT_EQ(PPM->proc(0), 0);
// if (!PPM->master(0)) EXPECT_NE(PPM->proc(0), 0);
//
// int testSize;
// MPI_Comm_size(MPI_COMM_WORLD, &testSize);
// EXPECT_EQ(PPM->size(-1), testSize);
// EXPECT_EQ(PPM->size(0) * partitions, testSize);
// EXPECT_EQ(PPM->size(1) * partitions, testSize);
// PPM->SplitCommunicators();
// EXPECT_EQ(PPM->size(2), PPM->size(0) / 4);
// EXPECT_EQ(PPM->size(2), PPM->size(1) / 2);
// EXPECT_EQ(PPM->proc(2) + PPM->Color(2) * 4, PPM->proc(0));
// EXPECT_EQ(PPM->proc(2) + PPM->Color(2) * 2, PPM->proc(1));
}
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithPPM().
WithScreenLogging()
WithScreenLogging().
WithParallelListeners()
).RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment