Commit bc18ac79 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Add vtkMPIMultiBlockPLOT3DReader -- MPI-IO enabled reader for Plot3D.

Adding new vtkMPIMultiBlockPLOT3DReader which uses MPI-IO to read plot3D
files in parallel. vtkMPIMultiBlockPLOT3DReader overrides
vtkMultiBlockPLOT3DReader using vtkObjectFactory mechanisms. It only
supports reading binary 3D-Plot3D files.
parent d3dee7d6
include(vtkMPI)
# We don't build the parallel WindBlade reader on windows
# We don't build the parallel readers on windows
# because there's problems with the MPI_File_open()
# function when there's paths in the filenames.
set(PWindBladeReader vtkPWindBladeReader.cxx)
set (vtk_module_overrides)
if(WIN32)
set(PWindBladeReader)
endif()
set(Module_SRCS
${PWindBladeReader}
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set(Module_SRCS)
else()
set(Module_SRCS
vtkPWindBladeReader.cxx
vtkMPIMultiBlockPLOT3DReader.cxx
)
set_source_files_properties(
${vtk-module}ObjectFactory
WRAP_EXCLUDE
)
vtk_add_override(vtkWindBladeReader vtkPWindBladeReader)
vtk_add_override(vtkMultiBlockPLOT3DReader vtkMPIMultiBlockPLOT3DReader)
endif()
# Now to generate our object factory.
set( vtk_module_overrides
WindBladeReader
vtk_object_factory_configure("${vtk_module_overrides}")
list(APPEND Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
if(WIN32)
set( vtk_module_overrides )
endif()
foreach(_class ${vtk_module_overrides})
set(_override vtkP${_class})
set(_vtk_override_includes "${_vtk_override_includes} #include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"vtk${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
vtk_module_library(${vtk-module} ${Module_SRCS})
vtk_mpi_link(${vtk-module})
......@@ -5,9 +5,10 @@ vtk_module(vtkIOMPIParallel
MPI
DEPENDS
vtkIOGeometry
vtkParallelMPI
vtkIOParallel
PRIVATE_DEPENDS
vtksys
vtkParallelMPI
TEST_DEPENDS
vtkRendering${VTK_RENDERING_BACKEND}
vtkTestingRendering
......
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkMPIMultiBlockPLOT3DReader.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkMPIMultiBlockPLOT3DReader - vtkMultiBlockPLOT3DReader subclass that
// uses MPI-IO to efficiently read binary files for 3D domains in parallel using
// MPI-IO.
// .SECTION Description
// vtkMPIMultiBlockPLOT3DReader extends vtkMultiBlockPLOT3DReader to use MPI-IO
// instead of POSIX IO to read file in parallel.
#ifndef vtkMPIMultiBlockPLOT3DReader_h
#define vtkMPIMultiBlockPLOT3DReader_h
#include "vtkMultiBlockPLOT3DReader.h"
#include "vtkIOMPIParallelModule.h" // For export macro
class VTKIOMPIPARALLEL_EXPORT vtkMPIMultiBlockPLOT3DReader : public vtkMultiBlockPLOT3DReader
{
public:
static vtkMPIMultiBlockPLOT3DReader* New();
vtkTypeMacro(vtkMPIMultiBlockPLOT3DReader, vtkMultiBlockPLOT3DReader);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Use this to override using MPI-IO. When set to false (default is true),
// this class will simply forward all method calls to the superclass.
vtkSetMacro(UseMPIIO, bool);
vtkGetMacro(UseMPIIO, bool);
vtkBooleanMacro(UseMPIIO, bool);
protected:
vtkMPIMultiBlockPLOT3DReader();
~vtkMPIMultiBlockPLOT3DReader();
// Description:
// Determines we should use MPI-IO for the current file. We don't use MPI-IO
// for 2D files or ASCII files.
bool CanUseMPIIO();
virtual int OpenFileForDataRead(void*& fp, const char* fname);
virtual void CloseFile(void* fp);
virtual int ReadIntScalar(
void* vfp,
int extent[6], int wextent[6],
vtkDataArray* scalar, vtkTypeUInt64 offset);
virtual int ReadScalar(
void* vfp,
int extent[6], int wextent[6],
vtkDataArray* scalar, vtkTypeUInt64 offset);
virtual int ReadVector(
void* vfp,
int extent[6], int wextent[6],
int numDims, vtkDataArray* vector, vtkTypeUInt64 offset);
bool UseMPIIO;
private:
vtkMPIMultiBlockPLOT3DReader(const vtkMPIMultiBlockPLOT3DReader&); // Not implemented.
void operator=(const vtkMPIMultiBlockPLOT3DReader&); // Not implemented.
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment