Peano
Loading...
Searching...
No Matches
peano4::parallel::tests::PingPongTest Class Reference

This is a ping pong test for our application-specific data types. More...

#include <PingPongTest.h>

Inheritance diagram for peano4::parallel::tests::PingPongTest:
Collaboration diagram for peano4::parallel::tests::PingPongTest:

Public Member Functions

 PingPongTest ()
virtual void run () override
 Build up suite of test routines.
Public Member Functions inherited from tarch::tests::TestCase
 TestCase (const std::string &testCaseName)
 Constructor.
virtual ~TestCase ()
 Destructor.
int getNumberOfErrors () const
std::string getTestCaseName () const

Private Member Functions

void testBuiltInType ()
void testDaStGenTypeIntegerMessage ()
 It is really important that we test - for the DaStGen-generated data types - both the built-in operation and the usage with MPI_Send and MPI_Recv.
void testDaStGenTypeStartTraversalMessage ()
void testDaStGenArray ()
void testDaStGenArrayTreeManagementMessage ()
void testMultithreadedPingPongWithBlockingReceives ()
void testMultithreadedPingPongWithBlockingSends ()
void testMultithreadedPingPongWithBlockingSendsAndReceives ()
void testMultithreadedPingPongWithNonblockingReceives ()
void testMultithreadedPingPongWithNonblockingSends ()
void testMultithreadedPingPongWithNonblockingSendsAndReceives ()

Static Private Attributes

static tarch::logging::Log _log
 Logging device.

Additional Inherited Members

Protected Member Functions inherited from tarch::tests::TestCase
 TestCase ()=delete
Protected Attributes inherited from tarch::tests::TestCase
const std::string _testCaseName
 Name of the test case.
int _errors
 Error counter.
bool _error
 Indicate within macro if one specific validation failed.

Detailed Description

This is a ping pong test for our application-specific data types.

Definition at line 21 of file PingPongTest.h.

Constructor & Destructor Documentation

◆ PingPongTest()

peano4::parallel::tests::PingPongTest::PingPongTest ( )

Definition at line 24 of file PingPongTest.cpp.

References tarch::tests::TestCase::TestCase().

Here is the call graph for this function:

Member Function Documentation

◆ run()

void peano4::parallel::tests::PingPongTest::run ( )
overridevirtual

Build up suite of test routines.

We protect the multithreaded calls with a call with a comparison of tarch::mpi::Rank::getInstance().getProvidedThreadLevelSupport() to MPI_THREAD_MULTIPLE. In principle, we know that Peano cannot work properly without MPI's multithreaded support. However, even if the MPI implementation supports multithreading, tools such as MUST (http://www.itc.rwth-aachen.de/MUST) will artifically lower the thread level support for correctness check and then report a deadlock here (wrongly). To avoid this, we remove the unit tests, as I really wanna use the thread-checkers with our unit tests.

Implements tarch::tests::TestCase.

Definition at line 393 of file PingPongTest.cpp.

References tarch::mpi::Rank::getInstance(), logTraceIn, logTraceOut, testBuiltInType(), testDaStGenArray(), testDaStGenArrayTreeManagementMessage(), testDaStGenTypeIntegerMessage(), testDaStGenTypeStartTraversalMessage(), testMethod, testMultithreadedPingPongWithBlockingReceives(), testMultithreadedPingPongWithBlockingSends(), testMultithreadedPingPongWithBlockingSendsAndReceives(), testMultithreadedPingPongWithNonblockingReceives(), testMultithreadedPingPongWithNonblockingSends(), and testMultithreadedPingPongWithNonblockingSendsAndReceives().

Here is the call graph for this function:

◆ testBuiltInType()

void peano4::parallel::tests::PingPongTest::testBuiltInType ( )
private

Definition at line 29 of file PingPongTest.cpp.

References tarch::mpi::Rank::getInstance(), and validateEquals.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testDaStGenArray()

void peano4::parallel::tests::PingPongTest::testDaStGenArray ( )
private

Definition at line 329 of file PingPongTest.cpp.

References peano4::parallel::StartTraversalMessage::getGlobalCommunciationDatatype(), tarch::mpi::Rank::getInstance(), peano4::parallel::StartTraversalMessage::setStepIdentifier(), toString(), and validateEqualsWithParams8.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testDaStGenArrayTreeManagementMessage()

◆ testDaStGenTypeIntegerMessage()

void peano4::parallel::tests::PingPongTest::testDaStGenTypeIntegerMessage ( )
private

It is really important that we test - for the DaStGen-generated data types - both the built-in operation and the usage with MPI_Send and MPI_Recv.

I had the case that the generated datatypes had a vtable, i.e. an addition four bytes. These bytes are then added to the object (at the front), but I had situations where they seem not to be incorporated into the this pointer. In any case, programmmers should not try to exchange data types with vtables, but if they do then we'll see bugs when we try to exchange the generated MPI_Send with a send() call on the DaStGen object.

Definition at line 299 of file PingPongTest.cpp.

References tarch::mpi::IntegerMessage::getGlobalCommunciationDatatype(), tarch::mpi::Rank::getInstance(), tarch::mpi::IntegerMessage::getValue(), tarch::mpi::IntegerMessage::receive(), tarch::mpi::IntegerMessage::send(), tarch::mpi::IntegerMessage::setValue(), tarch::mpi::IntegerMessage::toString(), and validateEqualsWithParams2.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testDaStGenTypeStartTraversalMessage()

void peano4::parallel::tests::PingPongTest::testDaStGenTypeStartTraversalMessage ( )
private

◆ testMultithreadedPingPongWithBlockingReceives()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithBlockingReceives ( )
private

◆ testMultithreadedPingPongWithBlockingSends()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithBlockingSends ( )
private

◆ testMultithreadedPingPongWithBlockingSendsAndReceives()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithBlockingSendsAndReceives ( )
private

◆ testMultithreadedPingPongWithNonblockingReceives()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithNonblockingReceives ( )
private

◆ testMultithreadedPingPongWithNonblockingSends()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithNonblockingSends ( )
private

◆ testMultithreadedPingPongWithNonblockingSendsAndReceives()

void peano4::parallel::tests::PingPongTest::testMultithreadedPingPongWithNonblockingSendsAndReceives ( )
private

Field Documentation

◆ _log

tarch::logging::Log peano4::parallel::tests::PingPongTest::_log
staticprivate

Logging device.

Definition at line 26 of file PingPongTest.h.


The documentation for this class was generated from the following files: