// ============================================================================
void MEDPARTITIONERTest::setUp()
{
- this->_verbose=1;
+ this->_verbose=0;
#if defined(HAVE_MPI2)
if (MyGlobals::_Rank==-1) //do once only
{
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
+ }
}
// ============================================================================
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++)
}
cout << endl;
}
+ */
MEDCouplingUMesh *mesh=MEDCouplingUMesh::New();
mesh->setMeshDimension(3);
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;
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;
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;
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()
{
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 );
void tearDown();
void testMeshCollectionSingle();
void testMeshCollectionXml();
+#if defined(MED_ENABLE_METIS)
void testMeshCollectionSinglePartitionMetis();
void testMeshCollectionComplexPartitionMetis();
void testMetisSmallSize();
+#endif
#if defined(HAVE_MPI2)
void testMpirunSmallSize();
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 \
-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) \
-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)
CLEANFILES = UnitTestsResult
clean-local:
- rm -rf *.med *.xml
+ rm -rf *.med *.xml
\ No newline at end of file