From: eap Date: Wed, 14 Mar 2012 15:20:31 +0000 (+0000) Subject: 0021208: Performance issue when loading SMESH with an hdf file containing a big mesh X-Git-Tag: V6_5_0a1~49 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c668696b879fff0dcdfa68d8698cf980c8963df8;p=modules%2Fsmesh.git 0021208: Performance issue when loading SMESH with an hdf file containing a big mesh Fix reading nodes from a new HDF file (attempt #2) --- diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 50652425c..f3c8c27db 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -342,23 +342,24 @@ void SMESH_PreMeshInfo::hdf2meshInfo( const std::string& name, HDFdataset* dataset = new HDFdataset( name.c_str(), hdfGroup ); dataset->OpenOnDisk(); - // hdf_size datasetSize[ 1 ]; - // HDFarray *array = new HDFarray(dataset); - // array->GetDim( datasetSize ); - int size = dataset->GetSize(); + // // hdf_size datasetSize[ 1 ]; + // // HDFarray *array = new HDFarray(dataset); + // // array->GetDim( datasetSize ); + // int size = dataset->GetSize(); - int info[ SMDSEntity_Last * 2 ]; - dataset->ReadFromDisk( info ); + vector info( SMDSEntity_Last * 2, 0 ); + dataset->ReadFromDisk( &info[0] ); dataset->CloseOnDisk(); const Tmed2smeshElemTypeMap& med2smesh = med2smeshElemTypeMap(); Tmed2smeshElemTypeMap::const_iterator me2sme, me2smeEnd = med2smesh.end(); - for ( int i = 0; i < size /**datasetSize*/; ) + for ( size_t i = 0; i < info.size(); ) { int medType = info[i++]; int nbElems = info[i++]; + if ( !nbElems ) break; me2sme = med2smesh.find( (MED::EGeometrieElement) medType ); - if ( me2sme != me2smeEnd && nbElems ) + if ( me2sme != me2smeEnd ) setNb( me2sme->second, nbElems ); } }