#include "vtkCellArray.h"
#include "vtkDoubleArray.h"
#include "vtkObjectFactory.h"
+#ifdef MEDREADER_USE_MPI
+#include "vtkMultiProcessController.h"
+#endif
#include "MEDFileFieldRepresentationTree.hxx"
}
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());
try
{
vtkInformation *outInfo(outputVector->GetInformationObject(0));
- outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1);
outInfo->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkMultiBlockDataSet");
this->UpdateSIL(outInfo);
//
}
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<char *>(oss.str().c_str()));
+ else
+ vtkOutputWindowDisplayErrorText(const_cast<char *>(oss.str().c_str()));
+ vtkObject::BreakOnError();
return 0;
}
return 1;
}
catch(INTERP_KERNEL::Exception& e)
{
- std::cerr << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl;
+ std::cerr << "Exception has been thrown in vtkMEDReader::RequestData : " << e.what() << std::endl;
return 0;
}
return 1;