Commit 414d65f2 authored by Chris Harris's avatar Chris Harris
Browse files

Move Cosmo classes into vtkFiltersCosmo module

The third party module vtkCosmo can be build with or without
MPI. Rather than building a MPI and non MPI version we still
need the ability to switch between the two implementations. This
can use done by move the Cosmo class into a single module and
providing VTK_COSMO_USE_MPI. This break with rule of not having
a module change it behaviour based on complie options but unless
the third party library is refactored we will have to live with this.

Change-Id: Id36de477d52d1d9b69cc4f2baeabbbdac00c8aaa
parent 6214dd05
if(VTK_COSMOS_USE_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
else()
add_definitions(-DUSE_SERIAL_COSMO)
endif()
set(Module_SRCS
vtkPCosmoReader.cxx
vtkPCosmoHaloFinder.cxx
)
vtk_module_library(vtkFiltersCosmo ${Module_SRCS})
vtk_module(vtkFiltersCosmo
DEPENDS
vtkCommonExecutionModel
vtkParallelCore
vtkCosmo
)
......@@ -67,12 +67,12 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __vtkPCosmoHaloFinder_h
#define __vtkPCosmoHaloFinder_h
#include "vtkFiltersParallelModule.h" // For export macro
#include "vtkIOParallelModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
class vtkMultiProcessController;
class VTKFILTERSPARALLEL_EXPORT vtkPCosmoHaloFinder : public vtkUnstructuredGridAlgorithm
class VTKIOPARALLEL_EXPORT vtkPCosmoHaloFinder : public vtkUnstructuredGridAlgorithm
{
public:
static vtkPCosmoHaloFinder *New();
......
......@@ -83,13 +83,13 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef __vtkPCosmoReader_h
#define __vtkPCosmoReader_h
#include "vtkIOParallelModule.h" // For export macro
#include "vtkParallelIOModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
class vtkMultiProcessController;
class vtkStdString;
class VTKIOPARALLEL_EXPORT vtkPCosmoReader : public vtkUnstructuredGridAlgorithm
class VTKPARALLELIO_EXPORT vtkPCosmoReader : public vtkUnstructuredGridAlgorithm
{
public:
static vtkPCosmoReader *New();
......@@ -153,4 +153,3 @@ private:
};
#endif
......@@ -14,7 +14,6 @@ set(Module_SRCS
vtkExtractUserDefinedPiece.cxx
vtkPassThroughFilter.cxx
vtkPCellDataToPointData.cxx
vtkPCosmoHaloFinder.cxx
vtkPExtractArraysOverTime.cxx
vtkPieceRequestFilter.cxx
vtkPieceScalars.cxx
......
......@@ -3,7 +3,6 @@ vtk_module(vtkFiltersParallel
MPI
DEPENDS
vtkParallelMPI
vtkCosmo
vtkFiltersExtraction
vtkRenderingCore
vtkFiltersModeling
......
......@@ -5,7 +5,6 @@ set(Module_SRCS
vtkEnSightWriter.cxx
# vtkExodusIIWriter.cxx needs vtkMultiProcessController
vtkPChacoReader.cxx
vtkPCosmoReader.cxx
vtkPDataSetReader.cxx
vtkPDataSetWriter.cxx
vtkPImageWriter.cxx
......
......@@ -5,10 +5,15 @@ set(vtkCosmo_THIRD_PARTY 1)
set(vtkCosmo_LIBRARIES Cosmo)
vtk_module_impl()
#SET(Cosmo_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
# Build with or without MPI, for now do this rather compiling a
# parallel and non parallel version
option(VTK_COSMO_USE_MPI "Build Cosmo with MPI" OFF)
mark_as_advanced(VTK_COSMO_USE_MPI)
#SET(Cosmo_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
SET(Cosmo_LIBS)
IF(VTK_USE_MPI)
if(VTK_COSMO_USE_MPI)
find_package(MPI REQUIRED)
INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
IF(MPI_EXTRA_LIBRARY)
SET(Cosmo_LIBS ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
......@@ -16,9 +21,9 @@ IF(VTK_USE_MPI)
SET(Cosmo_LIBS ${MPI_LIBRARY})
ENDIF(MPI_EXTRA_LIBRARY)
ADD_DEFINITIONS(-DMPICH_IGNORE_CXX_SEEK -DUSE_VTK_COSMO)
ELSE(VTK_USE_MPI)
else()
ADD_DEFINITIONS(-DUSE_SERIAL_COSMO -DUSE_VTK_COSMO)
ENDIF(VTK_USE_MPI)
endif()
# Needed for mpich 2
CONFIGURE_FILE (${Cosmo_SOURCE_DIR}/CosmoDefinition.h.in
......
......@@ -64,7 +64,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BasicDefinition.h"
#ifndef USE_SERIAL_COSMO
#include "vtkMPI.h"
#include <mpi.h>
#endif
#endif
vtk_module(vtkCosmo
DEPENDS
vtkCommonCore
vtkParallelMPI
EXCLUDE_FROM_WRAPPING
)
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