X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FIO%2FvtkMEDReader.cxx;h=68add794dc13c89ae5f74dad9eab8619e394ce21;hb=f50743d07c99b985dd078aad0fb4bbf7337851cc;hp=c5c5fc556cb167a04a8cc59940c30c7ea7f6f776;hpb=1d6fe1344be14cbab6bff5cfca040709ac56d51b;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx index c5c5fc55..68add794 100644 --- a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx +++ b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx @@ -44,6 +44,9 @@ #include "vtkCellArray.h" #include "vtkDoubleArray.h" #include "vtkObjectFactory.h" +#ifdef MEDREADER_USE_MPI +#include "vtkMultiProcessController.h" +#endif #include "MEDFileFieldRepresentationTree.hxx" @@ -257,7 +260,16 @@ void vtkMEDReader::SetFileName(const char *fname) } if(this->Internal->Tree.getNumberOfLeavesArrays()==0) { - this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),this->Internal->IsMEDOrSauv); + int iPart(-1),nbOfParts(-1); +#ifdef MEDREADER_USE_MPI + vtkMultiProcessController *vmpc(vtkMultiProcessController::GetGlobalController()); + if(vmpc) + { + iPart=vmpc->GetLocalProcessId(); + nbOfParts=vmpc->GetNumberOfProcesses(); + } +#endif + this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),this->Internal->IsMEDOrSauv,iPart,nbOfParts); if(!this->Internal->PK.arePropertiesOnTreeToSetAfter()) this->Internal->Tree.activateTheFirst();//This line manually initialize the status of server (this) with the remote client. this->Internal->TK.setMaxNumberOfTimeSteps(this->Internal->Tree.getMaxNumberOfTimeSteps()); @@ -292,7 +304,6 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect try { vtkInformation *outInfo(outputVector->GetInformationObject(0)); - //outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1); outInfo->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkMultiBlockDataSet"); this->UpdateSIL(outInfo); // @@ -301,7 +312,13 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect } catch(INTERP_KERNEL::Exception& e) { - std::cerr << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl; + std::ostringstream oss; + oss << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl; + if(this->HasObserver("ErrorEvent") ) + this->InvokeEvent("ErrorEvent",const_cast(oss.str().c_str())); + else + vtkOutputWindowDisplayErrorText(const_cast(oss.str().c_str())); + vtkObject::BreakOnError(); return 0; } return 1;