From a0438dde6688871ebfac67bf86a8014df7a40e3a Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 15 Mar 2012 11:17:23 +0000 Subject: [PATCH] Warning hunting. --- .../MEDPARTITIONER_ConnectZone.cxx | 4 +- .../MEDPARTITIONER_JointFinder.cxx | 6 +- .../MEDPARTITIONER_MeshCollection.cxx | 95 ++++++++++--------- .../MEDPARTITIONER_MeshCollection.hxx | 1 + ...PARTITIONER_MeshCollectionMedXmlDriver.cxx | 2 +- .../MEDPARTITIONER_ParaDomainSelector.cxx | 22 ++--- .../MEDPARTITIONER_ParaDomainSelector.hxx | 4 +- .../MEDPARTITIONER_ParallelTopology.cxx | 2 +- src/MEDPartitioner/MEDPARTITIONER_Utils.cxx | 58 ++++++----- .../Test/MEDPARTITIONERTest.cxx | 38 ++++---- .../Test/MEDPARTITIONERTestPara.cxx | 28 ++++-- src/MEDPartitioner/medpartitioner_para.cxx | 9 +- 12 files changed, 148 insertions(+), 121 deletions(-) diff --git a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx index 3a1e99aff..ed685f2cc 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx @@ -24,8 +24,8 @@ MEDPARTITIONER::ConnectZone::ConnectZone(): _name("") ,_description("") - ,_distant_domain_number(0) ,_local_domain_number(0) + ,_distant_domain_number(0) ,_node_corresp(0) ,_face_corresp(0) { @@ -44,8 +44,8 @@ MEDPARTITIONER::ConnectZone::~ConnectZone() MEDPARTITIONER::ConnectZone::ConnectZone(const ConnectZone & myConnectZone): _name(myConnectZone._name) ,_description(myConnectZone._description) - ,_distant_domain_number(myConnectZone._distant_domain_number) ,_local_domain_number(myConnectZone._local_domain_number) + ,_distant_domain_number(myConnectZone._distant_domain_number) ,_node_corresp(myConnectZone._node_corresp) ,_face_corresp(myConnectZone._face_corresp) ,_entity_corresp(myConnectZone._entity_corresp) diff --git a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx index e5c7c22ae..252a7ec80 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx @@ -29,7 +29,7 @@ /*! * Method contributing to the distant cell graph */ -MEDPARTITIONER::JointFinder::JointFinder(const MeshCollection& mc):_mesh_collection(mc), _topology(mc.getTopology()),_domain_selector(mc.getParaDomainSelector()) +MEDPARTITIONER::JointFinder::JointFinder(const MeshCollection& mc):_mesh_collection(mc),_domain_selector(mc.getParaDomainSelector()),_topology(mc.getTopology()) { } @@ -96,7 +96,7 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() //retrieving target data for storage in commonDistantNodes array std::vector localCorrespondency; RecvIntVec(localCorrespondency, targetProc); - for (int i=0; irank() << itarget << "|" << isource << "|" << i << "|" << _node_node[itarget][isource][i].first << "-" << _node_node[itarget][isource][i].second; diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index 901e5f88f..7fe5a4f73 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -83,12 +83,12 @@ MEDPARTITIONER::MeshCollection::MeshCollection(MeshCollection& initialCollection Topology* topology, bool family_splitting, bool create_empty_groups) - : _name(initialCollection._name), - _topology(topology), + : _topology(topology), _owns_topology(false), _driver(0), _domain_selector( initialCollection._domain_selector ), _i_non_empty_mesh(-1), + _name(initialCollection._name), _driver_type(MEDPARTITIONER::MedXml), _subdomain_boundary_creates(false), _family_splitting(family_splitting), @@ -120,12 +120,13 @@ MEDPARTITIONER::MeshCollection::MeshCollection(MeshCollection& initialCollection //treating families //////////////////// - if (MyGlobals::_Is0verbose) - if (isParallelMode()) - std::cout << "ParallelMode on " << topology->nbDomain() << " Domains" << std::endl; - else - std::cout << "NOT ParallelMode on " << topology->nbDomain() << " Domains" << std::endl; - + if (MyGlobals::_Is0verbose) + { + if (isParallelMode()) + std::cout << "ParallelMode on " << topology->nbDomain() << " Domains" << std::endl; + else + std::cout << "NOT ParallelMode on " << topology->nbDomain() << " Domains" << std::endl; + } if (MyGlobals::_Is0verbose>10) std::cout<<"treating cell and face families"<convertGlobalCellList(&globalids[0],size,&ilocalnew[0],&ipnew[0]); new2oldIds[iold].resize(nbNewDomain); - for (int i=0; i meshes; - for (int i=0; i< splitMeshes[inew].size();i++) + for (int i=0;i<(int)splitMeshes[inew].size();i++) if (splitMeshes[inew][i]!=0) if (splitMeshes[inew][i]->getNumberOfCells()>0) meshes.push_back(splitMeshes[inew][i]); @@ -251,8 +252,9 @@ void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialColle _mesh[inew]->zipCoords(); } } - for (int i=0; i< splitMeshes[inew].size(); i++) - if (splitMeshes[inew][i]!=0) splitMeshes[inew][i]->decrRef(); + for (int i=0;i<(int)splitMeshes[inew].size();i++) + if (splitMeshes[inew][i]!=0) + splitMeshes[inew][i]->decrRef(); } if (MyGlobals::_Verbose>300) std::cout << "proc " << rank << " : castCellMeshes end fusing" << std::endl; @@ -352,9 +354,9 @@ void getNodeIds(ParaMEDMEM::MEDCouplingUMesh& meshOne, ParaMEDMEM::MEDCouplingUM coords=meshTwo.getCoords(); for (int inode=0; inodegetPointer()+inode*3; + double* coordsPtr2=coords->getPointer()+inode*3; vector elems; - tree->getElementsAroundPoint(coordsPtr,elems); + tree->getElementsAroundPoint(coordsPtr2,elems); if (elems.size()==0) continue; nodeIds[inode]=elems[0]; } @@ -425,7 +427,7 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle //are incremented for each target node //the face is considered as going to target domains if the counter of the domain //is equal to the number of nodes - for (int inode=0; inode,pair >::const_iterator MI; int mynode=nodes[inode]; @@ -443,7 +445,7 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle for (map::iterator iter=faces.begin(); iter!=faces.end(); iter++) { - if (iter->second==nodes.size()) + if (iter->second==(int)nodes.size()) //cvw eligible but may be have to be face of a cell of this->getMesh()[inew]? //it is not sure here... //done before writeMedfile on option?... see filterFaceOnCell() @@ -484,14 +486,16 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle for (int inew=0; inewisMyDomain(iold) && !_domain_selector->isMyDomain(inew)) - if (splitMeshes[inew][iold] != 0) - { - _domain_selector->sendMesh(*(splitMeshes[inew][iold]), _domain_selector->getProcessorID(inew)); - } - else - { - _domain_selector->sendMesh(*(empty), _domain_selector->getProcessorID(inew)); - } + { + if (splitMeshes[inew][iold] != 0) + { + _domain_selector->sendMesh(*(splitMeshes[inew][iold]), _domain_selector->getProcessorID(inew)); + } + else + { + _domain_selector->sendMesh(*(empty), _domain_selector->getProcessorID(inew)); + } + } if (!_domain_selector->isMyDomain(iold) && _domain_selector->isMyDomain(inew)) _domain_selector->recvMesh(splitMeshes[inew][iold], _domain_selector->getProcessorID(iold)); } @@ -545,7 +549,7 @@ void MEDPARTITIONER::MeshCollection::remapIntField(const ParaMEDMEM::MEDCoupling vector c; vector cI; tmpMesh->getNodeIdsNearPoints(targetCoords->getConstPointer(),targetMesh.getNumberOfCells(),1e-10,c,cI); - if (cI.size()!= targetMesh.getNumberOfCells()+1) + if ((int)cI.size()!= targetMesh.getNumberOfCells()+1) throw INTERP_KERNEL::Exception("Error in source/target projection"); for (int itargetnode=0; itargetnodesecond->getPointer(); } tmpMesh->getNodeIdsNearPoints(targetCoords->getConstPointer(),targetSize,1e-10,c,cI); - if (cI.size()!=targetSize+1) + if ((int)cI.size()!=targetSize+1) throw INTERP_KERNEL::Exception("Error in source/target projection"); for (int itargetnode=0; itargetnodegetNumberOfNodes() > 0 ) _i_non_empty_mesh = idomain; } @@ -896,13 +900,13 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, Para { try { - _driver=new MeshCollectionMedXmlDriver(this); //cvwat02 - _driver->read ( (char*)filename.c_str(), _domain_selector ); + _driver=new MeshCollectionMedXmlDriver(this); + _driver->read ( filename.c_str(), _domain_selector ); _driver_type = MedXml; } catch(...) { // Handle all exceptions - if ( _driver ) delete _driver; _driver=0; + delete _driver; throw INTERP_KERNEL::Exception("file .xml does not comply with any recognized format"); } } @@ -958,7 +962,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, Para try { _driver=new MeshCollectionMedXmlDriver(this); - _driver->read ( (char*)nameFileXml.c_str(), _domain_selector ); + _driver->read ( nameFileXml.c_str(), _domain_selector ); _driver_type = MedXml; } catch(...) @@ -972,7 +976,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, Para try { _driver=new MeshCollectionMedAsciiDriver(this); - _driver->read ( (char*)filename.c_str(), _domain_selector ); + _driver->read ( filename.c_str(), _domain_selector ); _driver_type=MedAscii; } catch(...) @@ -984,7 +988,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, Para } } // find non-empty domain mesh - for ( int idomain = 0; idomain < _mesh.size(); ++idomain ) + for ( int idomain = 0; idomain < (int)_mesh.size(); ++idomain ) if ( _mesh[idomain] && _mesh[idomain]->getNumberOfNodes() > 0 ) _i_non_empty_mesh = idomain; @@ -1031,12 +1035,12 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, Para * \param meshname name of the mesh that is to be read */ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, const std::string& meshname) - : _name(meshname), - _topology(0), + : _topology(0), _owns_topology(true), _driver(0), _domain_selector( 0 ), _i_non_empty_mesh(-1), + _name(meshname), _driver_type(MEDPARTITIONER::MedXml), _subdomain_boundary_creates(false), _family_splitting(false), @@ -1059,18 +1063,18 @@ MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, cons MEDPARTITIONER::MeshCollection::~MeshCollection() { - for (int i=0; i<_mesh.size();i++) + for (int i=0; i<(int)_mesh.size();i++) if (_mesh[i]!=0) _mesh[i]->decrRef(); - for (int i=0; i<_cell_family_ids.size();i++) + for (int i=0; i<(int)_cell_family_ids.size();i++) if (_cell_family_ids[i]!=0) _cell_family_ids[i]->decrRef(); - for (int i=0; i<_face_mesh.size();i++) + for (int i=0; i<(int)_face_mesh.size();i++) if (_face_mesh[i]!=0) _face_mesh[i]->decrRef(); - for (int i=0; i<_face_family_ids.size();i++) + for (int i=0; i<(int)_face_family_ids.size();i++) if (_face_family_ids[i]!=0) _face_family_ids[i]->decrRef(); @@ -1486,8 +1490,7 @@ ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::strin if (MyGlobals::_Verbose>200) std::cout << "proc " << rank << " : TO BE READ getField : " << descriptionIold << std::endl; std::string description, fileName, meshName, fieldName; - int idomain, typeField, DT, IT, entity; - idomain=iold; + int typeField, DT, IT, entity; fileName=MyGlobals::_File_Names[iold]; if (MyGlobals::_Verbose>10) std::cout << "proc " << MyGlobals::_Rank << " : in " << fileName << " " << iold << " " << descriptionIold << std::endl; @@ -1517,11 +1520,11 @@ void MEDPARTITIONER::MeshCollection::prepareFieldDescriptions() int nbfiles=MyGlobals::_File_Names.size(); //nb domains std::vector r2; //from allgatherv then vector(procs) of serialised vector(fields) of vector(description) data - for (int i=0; i<_field_descriptions.size(); i++) + for (int i=0; i<(int)_field_descriptions.size(); i++) { std::vector r1=DeserializeToVectorOfString(_field_descriptions[i]); - for (int i=0; i& inodesFace, std::vector< int >& inodesCel int ii=inodesFace[i]; if (ii<0) std::cout << "isFaceOncell problem inodeface<0" << std::endl; - for (int j=0; jgetMesh().size()); + sprintf(buff, "%d", (int)_collection->getMesh().size()); xmlNewProp(node2, BAD_CAST "number", BAD_CAST buff); node2=xmlNewChild(node,0,BAD_CAST "global_numbering",0); xmlNewProp(node2, BAD_CAST "present", BAD_CAST "yes"); diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx index 3c6cf0563..a492f3ca9 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx @@ -34,8 +34,8 @@ * \brief Constructor. Find out my rank and world size */ MEDPARTITIONER::ParaDomainSelector::ParaDomainSelector(bool mesure_memory) - :_rank(0),_world_size(1), _nb_result_domains(-1), _mesure_memory(mesure_memory), - _init_time(0.0), _init_memory(0), _max_memory(0) + :_rank(0),_world_size(1), _nb_result_domains(-1), _init_time(0.0), + _mesure_memory(mesure_memory), _init_memory(0), _max_memory(0) { #ifdef HAVE_MPI2 MPI_Comm_size(MPI_COMM_WORLD,&_world_size) ; @@ -182,10 +182,10 @@ void MEDPARTITIONER::ParaDomainSelector::gatherNbOf(const std::vector200) @@ -213,7 +213,7 @@ int *MEDPARTITIONER::ParaDomainSelector::getProcVtxdist() const evaluateMemory(); if (_nb_vert_of_procs.empty()) throw INTERP_KERNEL::Exception("_nb_vert_of_procs not set"); - return (int*) & _nb_vert_of_procs[0]; + return const_cast(& _nb_vert_of_procs[0]); } /*! @@ -267,13 +267,13 @@ std::auto_ptr MEDPARTITIONER::ParaDomainSelector::gatherG // --------------- std::vector index_size_of_proc( nbProcs() ); // index sizes - 1 - for ( int i = 1; i < _nb_vert_of_procs.size(); ++i ) + for ( std::size_t i = 1; i < _nb_vert_of_procs.size(); ++i ) index_size_of_proc[i-1] = _nb_vert_of_procs[ i ] - _nb_vert_of_procs[ i-1 ]; int index_size = 1 + _cell_shift_by_domain.back(); int *graph_index = new int[ index_size ]; const int *index = graph->getGraph()->getIndex(); - int *proc_index_displacement = (int*) & _nb_vert_of_procs[0]; + int *proc_index_displacement = const_cast( & _nb_vert_of_procs[0] ); MPI_Allgatherv((void*) (index+1), // send local index except first 0 (or 1) index_size_of_proc[_rank], // index size on this proc @@ -409,7 +409,7 @@ void MEDPARTITIONER::ParaDomainSelector::gatherNbCellPairs() #endif // check that the set nbs of cell pairs are correct, // namely that each joint is treated on one proc only - for ( int j = 0; j < _nb_cell_pairs_by_joint.size(); ++j ) + for ( std::size_t j = 0; j < _nb_cell_pairs_by_joint.size(); ++j ) if ( _nb_cell_pairs_by_joint[j] != send_buf[j] && send_buf[j]>0 ) throw INTERP_KERNEL::Exception("invalid nb of cell pairs"); } @@ -641,10 +641,10 @@ int MEDPARTITIONER::ParaDomainSelector::evaluateMemory() const used_memory = (( si.totalram - si.freeram + si.totalswap - si.freeswap ) * si.mem_unit ) / 1024; #endif if ( used_memory > _max_memory ) - ((ParaDomainSelector*) this)->_max_memory = used_memory; + _max_memory = used_memory; if ( !_init_memory ) - ((ParaDomainSelector*) this)->_init_memory = used_memory; + _init_memory = used_memory; } return _max_memory - _init_memory; } diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx index 0d1953415..ac33e6a15 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx @@ -112,8 +112,8 @@ namespace MEDPARTITIONER double _init_time; bool _mesure_memory; - int _init_memory; - int _max_memory; + mutable int _init_memory; + mutable int _max_memory; }; } #endif diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx index bca8b4b89..9089f8530 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx @@ -212,7 +212,7 @@ ParallelTopology::ParallelTopology(const std::vectorgetNumberOfNodes(); INTERP_KERNEL::HashMap > local2distant; _node_loc_to_glob[idomain].resize(_nb_nodes[idomain]); - for (int icz=0; iczgetLocalDomainNumber() == idomain && cz[icz]->getLocalDomainNumber()>cz[icz]->getDistantDomainNumber()) diff --git a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx index 6cae22b52..46b5f14ff 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx @@ -93,7 +93,7 @@ double MEDPARTITIONER::StrToDouble(const std::string& s) bool MEDPARTITIONER::TestArg(const char *arg, const char *argExpected, std::string& argValue) { argValue=""; - int i; + std::size_t i; for (i=0; i vec=DeserializeToVectorOfString(fromStr); std::vector res; - for (int i=0; i > MEDPARTITIONER::DevectorizeToMa std::istringstream iss(enTete.substr(foundSizeVector+1,posmax-foundSizeVector)); iss >> sizeVector; std::string keymap=enTete.substr(foundKey+7,foundSizeVector-foundKey-7); - for (int i=1; i<=sizeVector; i++) - res[keymap].push_back(vs[i]); //add unconditionnaly,so merge duplicates in second vector + for (int ii=1; ii<=sizeVector; ii++) + res[keymap].push_back(vs[ii]); //add unconditionnaly,so merge duplicates in second vector } return res; } @@ -627,21 +627,21 @@ std::vector MEDPARTITIONER::BrowseAllFields(const std::string& myfi std::vector res; std::vector meshNames=MEDLoader::GetMeshNames(myfile.c_str()); - for (int i=0; i fieldNames= MEDLoader::GetAllFieldNamesOnMesh(myfile.c_str(),meshNames[i].c_str()); - for (int j = 0; j < fieldNames.size(); j++) + for (std::size_t j = 0; j < fieldNames.size(); j++) { std::vector< ParaMEDMEM::TypeOfField > typeFields= MEDLoader::GetTypesOfField(myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str()); - for (int k = 0; k < typeFields.size(); k++) + for (std::size_t k = 0; k < typeFields.size(); k++) { std::vector< std::pair< int, int > > its= MEDLoader::GetFieldIterations(typeFields[k], myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str()); if (MyGlobals::_Is0verbose>100) std::cout<< "fieldName " << fieldNames[j] << " typeField " << typeFields[k] << " its.size() " << its.size() << std::endl; - for (int m = 0; m < its.size(); m++) + for (std::size_t m = 0; m < its.size(); m++) { std::vector resi; resi.push_back("fileName="); resi.back()+=myfile; @@ -1112,7 +1112,7 @@ void MEDPARTITIONER::TestVectorOfStringMpi() std::vector res=DeserializeToVectorOfString(s0); if (res.size()!=myVector.size()) throw INTERP_KERNEL::Exception("Problem in (de)serialise VectorOfString incoherent sizes"); - for (int i=0; i9) { res="0K"; - if (nb!=taille) + if (nbb!=taille) res="KO"; std::cout << res << k << " "; } @@ -1403,13 +1405,17 @@ void MEDPARTITIONER::TestPersistantMpiRing(int taille, int nb) MPI_Wait(&requete1, &statut1); //Traitement sequentiel dependant de "y" //...=f(y) - int nb=0; + int nbb=0; for (int i=0; i9) { - res="0K"+IntToStr(rank); if (nb!=taille) res="KO"+IntToStr(rank); + res="0K"+IntToStr(rank); + if (nbb!=taille) + res="KO"+IntToStr(rank); std::cout << res << k << " "; } MPI_Wait(&requete0, &statut2); @@ -1480,14 +1486,16 @@ void MEDPARTITIONER::TestPersistantMpiRingOnCommSplit(int size, int nb) MPI_Wait(&requete1, &statut1); //Traitement sequentiel dependant de "y" //...=f(y) - int nb=0; + int nbb=0; for (int i=0; i9) { res="0K"+IntToStr(rank); - if (nb!=size) + if (nbb!=size) res="KO"+IntToStr(rank); std::cout << res << k << " "; } diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index a229cb674..ab4333bfe 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -135,16 +135,18 @@ ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh() if (false) //(_verbose) { - cout<<"\nnb coor "<<(_ni+1)*(_nj+1)*(_nk+1)*3<<" "<decrRef(); - MEDFileUMesh * mf; - mf->New(_fileName.c_str(),_meshName.c_str(),-1,-1); + MEDFileUMesh * mf = MEDFileUMesh::New(_fileName.c_str(),_meshName.c_str(),-1,-1); vector lev; lev=mf->getNonEmptyLevels(); if (_verbose) diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx index ac6cd984c..83f176c7a 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx @@ -81,13 +81,15 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() std::vectorcellMeshes=collection.getMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size()); int nbcells=0; - for (int i = 0; i < cellMeshes.size(); i++) nbcells+=cellMeshes[i]->getNumberOfCells(); + for (std::size_t i = 0; i < cellMeshes.size(); i++) + nbcells+=cellMeshes[i]->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells); std::vectorfaceMeshes=collection.getFaceMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size()); int nbfaces=0; - for (int i = 0; i < faceMeshes.size(); i++) nbfaces+=faceMeshes[i]->getNumberOfCells(); + for (std::size_t i=0; i < faceMeshes.size(); i++) + nbfaces+=faceMeshes[i]->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), nbfaces); //merge split meshes and test equality @@ -127,7 +129,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells()); meshes.resize(0); - for (int i = 0; i < corr.size(); i++) corr[i]->decrRef(); + for (std::size_t i = 0; i < corr.size(); i++) + corr[i]->decrRef(); corr.resize(0); meshes.push_back(faceMesh); refusedFaceMesh->tryToShareSameCoordsPermute(*faceMesh, 1e-9); @@ -135,7 +138,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() MEDCouplingUMesh* fusedFace=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), fusedFace->getNumberOfCells()); - for (int i = 0; i < corr.size(); i++) corr[i]->decrRef(); + for (std::size_t i = 0; i < corr.size(); i++) + corr[i]->decrRef(); fusedFace->decrRef(); refusedFaceMesh->decrRef(); faceMesh->decrRef(); @@ -205,7 +209,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnCells() { cout<<"\nf1 : "<reprZip(); cout<<"\nf2 : "<reprZip(); //field2->advancedRepradvancedRepr(); - for (int i = 0; i < corr.size(); i++) cout<<"\ncorr "<reprZip(); + for (std::size_t i = 0; i < corr.size(); i++) + cout << "\ncorr " << i << " : " << corr[i]->reprZip(); } int nbequal=0; @@ -225,7 +230,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnCells() } CPPUNIT_ASSERT_EQUAL(nbcells*nbcomp, nbequal); - for (int i = 0; i < corr.size(); i++) corr[i]->decrRef(); + for (std::size_t i = 0; i < corr.size(); i++) + corr[i]->decrRef(); field1->decrRef(); field2->decrRef(); fusedCell->decrRef(); @@ -289,9 +295,10 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnGaussNe() DataArrayDouble* f2=field2->getArray(); if (_verbose) { - cout<<"\nf1 : "<reprZip(); //123.4 for 12th cell,3rd component, 4th gausspoint - cout<<"\nf2 : "<reprZip(); //field2->advancedRepradvancedRepr(); - for (int i = 0; i < corr.size(); i++) cout<<"\ncorr "<reprZip(); + cout << "\nf1 : " << f1->reprZip(); //123.4 for 12th cell,3rd component, 4th gausspoint + cout << "\nf2 : " << f2->reprZip(); //field2->advancedRepradvancedRepr(); + for (std::size_t i = 0; i < corr.size(); i++) + cout << "\ncorr " << i << " : " << corr[i]->reprZip(); } int nbequal=0; @@ -312,7 +319,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnGaussNe() } CPPUNIT_ASSERT_EQUAL(nbcells*nbcomp*nbptgauss, nbequal); - for (int i = 0; i < corr.size(); i++) corr[i]->decrRef(); + for (std::size_t i = 0; i < corr.size(); i++) + corr[i]->decrRef(); field1->decrRef(); field2->decrRef(); fusedCell->decrRef(); diff --git a/src/MEDPartitioner/medpartitioner_para.cxx b/src/MEDPartitioner/medpartitioner_para.cxx index 6e3124560..1c49d484d 100644 --- a/src/MEDPartitioner/medpartitioner_para.cxx +++ b/src/MEDPartitioner/medpartitioner_para.cxx @@ -266,7 +266,8 @@ int main(int argc, char** argv) r2=SelectTagsInVectorOfString(r2,"meshName="); if (r2.size()==(collection.getMesh()).size()) { - for (int i=0; i