Commit 560fc1a6 authored by Berk Geveci's avatar Berk Geveci
Browse files

Enabled and fixed parallel examples.

It looks like parallel examples have been disabled since
modularization. Fixed.
parent fc131831
...@@ -51,9 +51,9 @@ else() ...@@ -51,9 +51,9 @@ else()
if(VTK_RENDERING_BACKEND STREQUAL "OpenGL" AND vtkTestingCore_LOADED) if(VTK_RENDERING_BACKEND STREQUAL "OpenGL" AND vtkTestingCore_LOADED)
add_subdirectory(LIC/Cxx) add_subdirectory(LIC/Cxx)
endif() endif()
# if(vtkParallelCore_LOADED) if(vtkParallelMPI_LOADED AND vtkRenderingParallel_LOADED)
# add_subdirectory(ParallelProcessing/Generic) add_subdirectory(ParallelProcessing/Generic)
# endif() endif()
# This may have been already built as part of the VTK build. # This may have been already built as part of the VTK build.
# If so we cannot create the target "vtkLocalExample" because # If so we cannot create the target "vtkLocalExample" because
# an imported target of the same name already exists in the # an imported target of the same name already exists in the
......
INCLUDE_REGULAR_EXPRESSION("^(lex|vtk|png|j|Task|Pipe).*$") INCLUDE_REGULAR_EXPRESSION("^(lex|vtk|png|j|Task|Pipe).*$")
IF (VTK_USE_MPI) include(vtkMPI)
find_package(MPI REQUIRED)
INCLUDE_DIRECTORIES(${MPI_C_INCLUDE_PATH})
# Needed for mpich 2 find_package(VTK COMPONENTS
ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK") vtkImagingCore
vtkImagingGeneral
vtkFiltersCore
vtkFiltersSources
vtkParallelMPI
vtkRenderingCore
vtkRenderingParallel
vtkTestingCore
vtkTestingRendering
)
include(${VTK_USE_FILE})
IF (VTK_USE_RENDERING) # Needed for mpich 2
ADD_EXECUTABLE(ParallelIso ParallelIso.cxx) ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK")
TARGET_LINK_LIBRARIES(ParallelIso vtkParallel vtkHybrid
${MPI_C_LIBRARIES})
if (MPI_CXX_LIBRARIES)
TARGET_LINK_LIBRARIES(ParallelIso ${MPI_CXX_LIBRARIES})
endif()
ENDIF ()
SET(TaskPara_SRCS TaskParallelism.cxx task1.cxx task2.cxx) ADD_EXECUTABLE(ParallelIso ParallelIso.cxx)
TARGET_LINK_LIBRARIES(ParallelIso LINK_PRIVATE ${VTK_LIBRARIES})
VTK_MPI_LINK(ParallelIso)
ADD_EXECUTABLE(TaskParallelism ${TaskPara_SRCS}) SET(TaskPara_SRCS TaskParallelism.cxx task1.cxx task2.cxx)
TARGET_LINK_LIBRARIES (TaskParallelism vtkParallel)
ADD_EXECUTABLE(TaskParallelism ${TaskPara_SRCS})
TARGET_LINK_LIBRARIES (TaskParallelism ${VTK_LIBRARIES})
# ADD_EXECUTABLE(SimpleBenchmark SimpleBenchmark.cxx) # ADD_EXECUTABLE(SimpleBenchmark SimpleBenchmark.cxx)
# TARGET_LINK_LIBRARIES(SimpleBenchmark vtkParallel ${MPI_LIBRARIES} ) # TARGET_LINK_LIBRARIES(SimpleBenchmark vtkParallel ${MPI_LIBRARIES} )
ENDIF ()
...@@ -80,7 +80,7 @@ void SetIsoValueRMI(void *localArg, void* vtkNotUsed(remoteArg), ...@@ -80,7 +80,7 @@ void SetIsoValueRMI(void *localArg, void* vtkNotUsed(remoteArg),
vtkContourFilter *iso = args->ContourFilter; vtkContourFilter *iso = args->ContourFilter;
val = iso->GetValue(0); val = iso->GetValue(0);
iso->SetValue(0, val + ISO_STEP); iso->SetValue(0, val + ISO_STEP);
args->Elevation->Update(myid, numProcs, 0)); args->Elevation->UpdatePiece(myid, numProcs, 0);
contrl->Send(args->Elevation->GetOutput(), 0, ISO_OUTPUT_TAG); contrl->Send(args->Elevation->GetOutput(), 0, ISO_OUTPUT_TAG);
} }
...@@ -168,7 +168,7 @@ void MyMain( vtkMultiProcessController *controller, void *arg ) ...@@ -168,7 +168,7 @@ void MyMain( vtkMultiProcessController *controller, void *arg )
{ {
// set the local value // set the local value
iso->SetValue(0, iso->GetValue(0) + ISO_STEP); iso->SetValue(0, iso->GetValue(0) + ISO_STEP);
elev->Update(myid, numProcs, 0)); elev->UpdatePiece(myid, numProcs, 0);
for (int i = 1; i < numProcs; ++i) for (int i = 1; i < numProcs; ++i)
{ {
......
Supports Markdown
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