From: imn Date: Mon, 25 May 2015 09:59:28 +0000 (+0300) Subject: 22875: debug continue X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5f6dde55bb0d42b5d1a7899cbee7b1c615b6b6cc;p=tools%2Fmedcoupling.git 22875: debug continue --- diff --git a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx index 3185a5495..0290e75eb 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx @@ -46,8 +46,14 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const std::string& filename, int { ParaDomainSelector parallelizer(mesure_memory); _input_collection=new MeshCollection(filename,parallelizer); - parallelizer.evaluateMemory(); + + MEDPARTITIONER::ParallelTopology* aPT = + (MEDPARTITIONER::ParallelTopology*) _input_collection->getTopology(); + aPT->setGlobalNumerotationDefault( _input_collection->getParaDomainSelector() ); + _input_collection->prepareFieldDescriptions(); createPartitionCollection(ndomains, library, creates_boundary_faces, create_joints, mesure_memory); + + parallelizer.evaluateMemory(); } MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory) @@ -61,8 +67,9 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* fi (MEDPARTITIONER::ParallelTopology*) _input_collection->getTopology(); aPT->setGlobalNumerotationDefault( _input_collection->getParaDomainSelector() ); _input_collection->prepareFieldDescriptions(); - createPartitionCollection(ndomains, library, creates_boundary_faces, create_joints, mesure_memory); + + parallelizer.evaluateMemory(); } void MEDPARTITIONER::MEDPartitioner::createPartitionCollection(int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory) diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index da9ce71d7..bfc02aa66 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -2239,6 +2239,10 @@ void MEDPARTITIONER::MeshCollection::prepareFieldDescriptions() //filter _field_descriptions to be in all procs compliant and equal { int nbfiles=MyGlobals::_File_Names.size(); //nb domains + if (nbfiles==0) + { + nbfiles=_topology->nbDomain(); + } std::vector r2; //from allgatherv then vector(procs) of serialised vector(fields) of vector(description) data for (int i=0; i<(int)_field_descriptions.size(); i++) diff --git a/src/MEDPartitioner_Swig/MEDPartitionerTest.py b/src/MEDPartitioner_Swig/MEDPartitionerTest.py index 71a53f49d..773bb0fdb 100644 --- a/src/MEDPartitioner_Swig/MEDPartitionerTest.py +++ b/src/MEDPartitioner_Swig/MEDPartitionerTest.py @@ -22,22 +22,26 @@ from MEDLoader import * import unittest class MEDPartitionerTest(unittest.TestCase): - -# @unittest.skipUnless("BOOST" in RenumberAvailableMethods -#(),"requires BOOST prerequisite !") - def test1(self): + # def test1(self): from MEDCoupling import MEDCouplingCMesh - #ren=RenumberingFactory("BOOST") arr=DataArrayDouble(100) ; arr.iota() c=MEDCouplingCMesh() ; c.setCoords(arr,arr) m=c.buildUnstructured() d=MEDFileData.New("/dn20/salome/imn/SALOME7YA/MED_BUILD/src/MEDLoader/Swig/splitted_blade1.med") - #mfd1 = MEDFileData.New() p=MEDPartitioner.New(d,2); part=p.Graph(m.generateGraph()) part.partGraph(2) #a=part.getGraph() - #n2o,o2n=ren.renumber(a,b) + pass + def test2(self): + from MEDCoupling import MEDCouplingCMesh + arr=DataArrayDouble(100) ; arr.iota() + c=MEDCouplingCMesh() ; c.setCoords(arr,arr) + m=c.buildUnstructured() + p=MEDPartitioner.New("/dn20/salome/imn/SALOME7YA/MED_BUILD/src/MEDLoader/Swig/splitted_blade1.med"); + part=p.Graph(m.generateGraph()) + part.partGraph(2) + #a=part.getGraph() pass unittest.main()