1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _MPIACCESSTEST_HXX_
21 #define _MPIACCESSTEST_HXX_
23 #include <cppunit/extensions/HelperMacros.h>
30 // (ABN]: too many text output in the MPIAccesTest - this renders
31 // the analysis complicated:
32 #define MPI_ACCESS_VERBOSE 0
34 if (!MPI_ACCESS_VERBOSE) {} \
37 class MPIAccessTest : public CppUnit::TestFixture
39 CPPUNIT_TEST_SUITE( MPIAccessTest );
40 CPPUNIT_TEST( test_MPI_Access_Send_Recv ) ;
41 CPPUNIT_TEST( test_MPI_Access_Cyclic_Send_Recv ) ;
42 CPPUNIT_TEST( test_MPI_Access_SendRecv ) ;
43 CPPUNIT_TEST( test_MPI_Access_ISend_IRecv ) ;
44 CPPUNIT_TEST( test_MPI_Access_Cyclic_ISend_IRecv ) ;
45 CPPUNIT_TEST( test_MPI_Access_ISendRecv ) ;
46 CPPUNIT_TEST( test_MPI_Access_Probe ) ;
47 CPPUNIT_TEST( test_MPI_Access_IProbe ) ;
48 CPPUNIT_TEST( test_MPI_Access_Cancel ) ;
49 CPPUNIT_TEST( test_MPI_Access_Send_Recv_Length ) ;
50 CPPUNIT_TEST( test_MPI_Access_ISend_IRecv_Length ) ;
51 CPPUNIT_TEST( test_MPI_Access_ISend_IRecv_Length_1 ) ;
52 CPPUNIT_TEST( test_MPI_Access_Time ) ;
53 CPPUNIT_TEST( test_MPI_Access_Time_0 ) ;
54 CPPUNIT_TEST( test_MPI_Access_ISend_IRecv_BottleNeck ) ;
55 CPPUNIT_TEST_SUITE_END();
60 MPIAccessTest():CppUnit::TestFixture(){}
64 void test_MPI_Access_Send_Recv() ;
65 void test_MPI_Access_Cyclic_Send_Recv() ;
66 void test_MPI_Access_SendRecv() ;
67 void test_MPI_Access_ISend_IRecv() ;
68 void test_MPI_Access_Cyclic_ISend_IRecv() ;
69 void test_MPI_Access_ISendRecv() ;
70 void test_MPI_Access_Probe() ;
71 void test_MPI_Access_IProbe() ;
72 void test_MPI_Access_Cancel() ;
73 void test_MPI_Access_Send_Recv_Length() ;
74 void test_MPI_Access_ISend_IRecv_Length() ;
75 void test_MPI_Access_ISend_IRecv_Length_1() ;
76 void test_MPI_Access_Time() ;
77 void test_MPI_Access_Time_0() ;
78 void test_MPI_Access_ISend_IRecv_BottleNeck() ;
83 // to automatically remove temporary files from disk
84 class MPIAccessTest_TmpFilesRemover
87 MPIAccessTest_TmpFilesRemover() {}
88 ~MPIAccessTest_TmpFilesRemover();
89 bool Register(const std::string theTmpFile);
92 std::set<std::string> myTmpFiles;
96 * Tool to print array to stream.
99 void MPIAccessTest_DumpArray (std::ostream & stream, const T* array, const int length, const std::string text)
101 stream << text << ": {";
104 for (int i = 1; i < length; i++) {
105 stream << ", " << array[i];
108 stream << "}" << std::endl;