Commit 77c2e782 authored by niklas.baumgarten's avatar niklas.baumgarten

new test routines

parent cc6db747
......@@ -17,8 +17,8 @@ TEST(TestParallel, TestBroadcastInt) {
}
TEST(TestParallel, TestBroadcastInt2) {
// if (PPM->master()) PPM->Broadcast(1);
// if (!PPM->master()) EXPECT_EQ(1, PPM->Broadcast<int>());
if (PPM->master()) PPM->Broadcast(1);
if (!PPM->master()) EXPECT_EQ(1, PPM->Broadcast<int>());
}
struct BroadcastStruct {
......@@ -134,10 +134,30 @@ 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;
// PPM->SplitCommunicator(-1, partitions);
//
int partitions = 2;
int worldSize = PPM->size(WORLD);
PPM->SplitCommunicator(WORLD, partitions);
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);
//
......
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