]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorcvw <cvw>
Tue, 27 Mar 2012 13:04:35 +0000 (13:04 +0000)
committercvw <cvw>
Tue, 27 Mar 2012 13:04:35 +0000 (13:04 +0000)
src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx
src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx
src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx
src/MEDPartitioner/Test/Makefile.am

index 754e8efb75e18136613d8830355e3eff83e9252b..4f6bca8d2e8ed686b538e8bc2cbab174d6ebd1f4 100644 (file)
@@ -88,7 +88,7 @@ void MEDPARTITIONERTest::setbigSize()
 // ============================================================================
 void MEDPARTITIONERTest::setUp()
 {
-  this->_verbose=1;
+  this->_verbose=0;
 #if defined(HAVE_MPI2)
   if (MyGlobals::_Rank==-1)  //do once only
     {
@@ -101,6 +101,30 @@ void MEDPARTITIONERTest::setUp()
   MyGlobals::_World_Size=1;
   MyGlobals::_Rank=0;
 #endif
+
+  if (_verbose>10)
+    {
+#if defined(HAVE_MPI2)
+      cout<<"\ndefined(HAVE_MPI2)"<<endl;
+#else
+      cout<<"\nNOT defined(HAVE_MPI2)"<<endl;
+#endif
+#if defined(MED_ENABLE_PARMETIS)
+      cout<<"defined(MED_ENABLE_PARMETIS)"<<endl;
+#else
+      cout<<"NOT defined(MED_ENABLE_PARMETIS)"<<endl;
+#endif
+#if defined(MED_ENABLE_METIS)
+      cout<<"defined(MED_ENABLE_METIS)"<<endl;
+#else
+      cout<<"NOT defined(MED_ENABLE_METIS)"<<endl;
+#endif
+#if defined(MED_ENABLE_SCOTCH)
+      cout<<"defined(MED_ENABLE_SCOTCH)"<<endl;
+#else
+      cout<<"NOT defined(MED_ENABLE_SCOTCH)"<<endl;
+#endif
+    }
 }
 
 // ============================================================================
@@ -145,7 +169,8 @@ ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh()
           conn.push_back(ii-1);
         }
 
-  if (false) //(_verbose)
+  /*
+  if (_verbose)  //only for debug
     {
       cout<< "\nnb coor " << (_ni+1)*(_nj+1)*(_nk+1)*3 << " " << coor.size() << endl;
       for (int i=0; i<(int)coor.size(); i++)
@@ -160,6 +185,7 @@ ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh()
         }
       cout << endl;
     }
+  */
   
   MEDCouplingUMesh *mesh=MEDCouplingUMesh::New();
   mesh->setMeshDimension(3);
@@ -775,9 +801,9 @@ void MEDPARTITIONERTest::testMeshCollectionXml()
   CPPUNIT_ASSERT_EQUAL(0,collection.getNbOfLocalFaces());
 }
 
+#if defined(MED_ENABLE_METIS)
 void MEDPARTITIONERTest::testMeshCollectionSinglePartitionMetis()
 {
-//#if defined(MED_ENABLE_PARMETIS) || defined(MED_ENABLE_METIS)
   setSmallSize();
   createTestMeshes();
   //MyGlobals::_Verbose=500;
@@ -809,12 +835,10 @@ void MEDPARTITIONERTest::testMeshCollectionSinglePartitionMetis()
   CPPUNIT_ASSERT_EQUAL(ndomains,new_collection.getNbOfGlobalMeshes());
   CPPUNIT_ASSERT_EQUAL(collection.getNbOfLocalCells(),new_collection.getNbOfLocalCells());
   CPPUNIT_ASSERT_EQUAL(collection.getNbOfLocalFaces(),new_collection.getNbOfLocalFaces());
-//#endif
 }
 
 void MEDPARTITIONERTest::testMeshCollectionComplexPartitionMetis()
 {
-//#if defined(MED_ENABLE_PARMETIS) || defined(MED_ENABLE_METIS)
   setSmallSize();
   createHugeTestMesh(_ni, _nj, _nk, 2, 2, 2, 32); //xml on 2*2*2 meshes but not so huge
   string fileName=_file_name_huge_xml;
@@ -826,7 +850,7 @@ void MEDPARTITIONERTest::testMeshCollectionComplexPartitionMetis()
   MEDPARTITIONER::ParallelTopology* aPT = (MEDPARTITIONER::ParallelTopology*) collection.getTopology();
   aPT->setGlobalNumerotationDefault(collection.getParaDomainSelector());
   
-  for (int ndomains=1 ; ndomains<=16 ; ndomains++)
+  for (int ndomains=2 ; ndomains<=16 ; ndomains++)
     {
       //Creating the graph and partitioning it
       auto_ptr< MEDPARTITIONER::Topology > new_topo;
@@ -839,20 +863,20 @@ void MEDPARTITIONERTest::testMeshCollectionComplexPartitionMetis()
       CPPUNIT_ASSERT_EQUAL(collection.getNbOfLocalCells(),new_collection.getNbOfLocalCells());
       CPPUNIT_ASSERT_EQUAL(collection.getNbOfLocalFaces(),new_collection.getNbOfLocalFaces());
     }
-//#endif
 }
 
 void MEDPARTITIONERTest::testMetisSmallSize()
 {
-//#if defined(MED_ENABLE_PARMETIS) || defined(MED_ENABLE_METIS)
+#if !defined(HAVE_MPI2)
   setSmallSize();
   createTestMeshes();
   launchMetisMedpartitionerOnTestMeshes();
   verifyMetisMedpartitionerOnSmallSizeForMesh();
   verifyMetisMedpartitionerOnSmallSizeForFieldOnCells();
   verifyMetisMedpartitionerOnSmallSizeForFieldOnGaussNe();
-//#endif
+#endif
 }
+#endif
 
 void MEDPARTITIONERTest::launchMetisMedpartitionerOnTestMeshes()
 {
index 5801915fbf93a2f43365001182022e880e117174..ace139cbf08e4262be69bab958f78060249b019d 100644 (file)
@@ -35,11 +35,13 @@ class MEDPARTITIONERTest : public CppUnit::TestFixture
   CPPUNIT_TEST_SUITE( MEDPARTITIONERTest );
   CPPUNIT_TEST( testMeshCollectionSingle );
   CPPUNIT_TEST( testMeshCollectionXml );
+#if defined(MED_ENABLE_METIS)
   CPPUNIT_TEST( testMeshCollectionSinglePartitionMetis );
   CPPUNIT_TEST( testMeshCollectionComplexPartitionMetis );
   CPPUNIT_TEST( testMetisSmallSize );
+#endif
   
-#if defined(HAVE_MPI2) && defined(MED_ENABLE_PARMETIS)
+#if defined(HAVE_MPI2)
   //test with mpi on system
   CPPUNIT_TEST( testMpirunSmallSize );
   CPPUNIT_TEST( testMpirunMedianSize );
@@ -96,9 +98,11 @@ public:
   void tearDown();
   void testMeshCollectionSingle();
   void testMeshCollectionXml();
+#if defined(MED_ENABLE_METIS)
   void testMeshCollectionSinglePartitionMetis();
   void testMeshCollectionComplexPartitionMetis();
   void testMetisSmallSize();
+#endif
   
 #if defined(HAVE_MPI2)
   void testMpirunSmallSize();
index f7ff8929059fb201af3848792022442da1d2f12b..4671c179f6a64eb2776387993b0baa0d2c8969b2 100644 (file)
@@ -49,6 +49,7 @@ using namespace std;
 using namespace ParaMEDMEM;
 using namespace MEDPARTITIONER;
 
+#if defined(HAVE_MPI2)
 void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh()
 {
   int res;
@@ -431,4 +432,4 @@ void MEDPARTITIONERTest::testMpirunHugeSize()
   createHugeTestMesh(_ni, _nj, _nk, 2, 2, 2, 32); //it is now to know how far we are going to test
   launchMedpartitionerOnHugeTestMeshes();
 }
-
+#endif
index 979abdbdf72686d32217eda31d25af9e9ed89890..68dbbdaee29277a61fa8df12506d959d59a8ec89 100644 (file)
@@ -23,22 +23,20 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 lib_LTLIBRARIES = libMEDPARTITIONERTest.la
 
-dist_libMEDPARTITIONERTest_la_SOURCES = \
-       MEDPARTITIONERTest.cxx
+dist_libMEDPARTITIONERTest_la_SOURCES = MEDPARTITIONERTest.cxx
 
 if MPI_IS_OK
   dist_libMEDPARTITIONERTest_la_SOURCES += MEDPARTITIONERTestPara.cxx
 endif
 
-salomeinclude_HEADERS = \
-       MEDPARTITIONERTest.hxx
+salomeinclude_HEADERS = MEDPARTITIONERTest.hxx
 
 libMEDPARTITIONERTest_la_CPPFLAGS = \
        @CPPUNIT_INCLUDES@ \
+       $(MPI_INCLUDES) \
        $(MED3_INCLUDES) \
        $(HDF5_INCLUDES) \
-       $(LIBXML_CXXFLAGS) \
-       $(MPI_INCLUDES) \
+       $(LIBXML_INCLUDES) \
        -I$(srcdir)/.. \
        -I$(srcdir)/../../MEDCoupling \
        -I$(srcdir)/../../MEDLoader \
@@ -46,7 +44,23 @@ libMEDPARTITIONERTest_la_CPPFLAGS = \
        -I$(srcdir)/../../INTERP_KERNEL/GaussPoints \
        -I$(srcdir)/../../INTERP_KERNEL
 
-libMEDPARTITIONERTest_la_LDFLAGS = \
+libMEDPARTITIONERTest_la_LDFLAGS=  
+
+if MED_ENABLE_PARMETIS
+  libMEDPARTITIONERTest_la_CPPFLAGS+= $(PARMETIS_CPPFLAGS)
+  libMEDPARTITIONERTest_la_LDFLAGS+= $(PARMETIS_LIBS)
+else
+if MED_ENABLE_METIS
+  libMEDPARTITIONERTest_la_CPPFLAGS += $(METIS_CPPFLAGS)
+  libMEDPARTITIONERTest_la_LDFLAGS += $(METIS_LIBS)
+endif
+if MED_ENABLE_SCOTCH
+  libMEDPARTITIONERTest_la_CPPFLAGS += $(SCOTCH_CPPFLAGS)
+  libMEDPARTITIONERTest_la_LDFLAGS += $(SCOTCH_LIBS)
+endif
+endif
+
+libMEDPARTITIONERTest_la_LDFLAGS += \
        $(MED3_LIBS_C_ONLY) \
        $(HDF5_LIBS) \
        $(MPI_LIBS) \
@@ -65,9 +79,7 @@ TestMEDPARTITIONER_CPPFLAGS = $(libMEDPARTITIONERTest_la_CPPFLAGS) \
        -I$(srcdir)/../../INTERP_KERNELTest
 
 if MPI_IS_OK
-  TestMEDPARTITIONER_CPPFLAGS +=
-       $(MPI_INCLUDES) \
-       $(PARMETIS_CPPFLAGS)
+  TestMEDPARTITIONER_CPPFLAGS +=$(MPI_INCLUDES) $(PARMETIS_CPPFLAGS)
 else
 if MED_ENABLE_METIS
   TestMEDPARTITIONER_CPPFLAGS += $(METIS_CPPFLAGS)
@@ -90,4 +102,4 @@ check: tests
 CLEANFILES = UnitTestsResult
 
 clean-local:
-       rm -rf *.med *.xml
+       rm -rf *.med *.xml
\ No newline at end of file