${MED_ROOT_DIR}/include/salome
)
+IF(PARAVIEW_USE_MPI)
+ ADD_DEFINITIONS("-DMEDREADER_USE_MPI")
+ENDIF(PARAVIEW_USE_MPI)
+
SET(MEDReader_CLASSES vtkMEDReader vtkExtractGroup vtkELNOMeshFilter vtkELNOSurfaceFilter vtkELNOFilter vtkExtractCellType)
SET(MEDReader_SRCS)
#include "MEDFileData.hxx"
#include "SauvReader.hxx"
+#ifdef MEDREADER_USE_MPI
+ #include "ParaMEDFileMesh.hxx"
+#endif
+
#include "vtkXMLUnstructuredGridWriter.h"//
#include "vtkUnstructuredGrid.h"
/*!
*
*/
-void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv)
+void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts)
{
if(isMEDOrSauv)
{
+#ifdef MEDREADER_USE_MPI
+ _ms=ParaMEDFileMeshes::New(iPart,nbOfParts,fileName);
+ _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values
+#else
_ms=MEDFileMeshes::New(fileName);
_fields=MEDFileFields::New(fileName,false);//false is important to not read the values
+#endif
}
else
{
vtkDataSet *buildVTKInstance(bool isStdOrMode, double timeReq, std::string& meshName, const TimeKeeper& tk) const;
void printMySelf(std::ostream& os) const;
//non const methods
- void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv);
+ void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts);
void removeEmptyLeaves();
// static methods
static bool IsFieldMeshRegardingInfo(const std::vector<std::string>& compInfos);
}
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
+ MPI_Comm_rank(MPI_COMM_WORLD,&iPart);
+ MPI_Comm_size(MPI_COMM_WORLD,&nbOfParts);
+#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());