From 6928251a5c4a4399f2d486d385ecbc45d64784e4 Mon Sep 17 00:00:00 2001 From: cvw Date: Tue, 27 Mar 2012 13:04:35 +0000 Subject: [PATCH] *** empty log message *** --- .../Test/MEDPARTITIONERTest.cxx | 42 +++++++++++++++---- .../Test/MEDPARTITIONERTest.hxx | 6 ++- .../Test/MEDPARTITIONERTestPara.cxx | 3 +- src/MEDPartitioner/Test/Makefile.am | 34 ++++++++++----- 4 files changed, 63 insertions(+), 22 deletions(-) diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index 754e8efb7..4f6bca8d2 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -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)"<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() { diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx index 5801915fb..ace139cbf 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx @@ -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(); diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx index f7ff89290..4671c179f 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx @@ -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 diff --git a/src/MEDPartitioner/Test/Makefile.am b/src/MEDPartitioner/Test/Makefile.am index 979abdbdf..68dbbdaee 100644 --- a/src/MEDPartitioner/Test/Makefile.am +++ b/src/MEDPartitioner/Test/Makefile.am @@ -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 -- 2.39.2