Skip to content
Snippets Groups Projects
Commit b9293d04 authored by Nikhil Shetty's avatar Nikhil Shetty
Browse files

Implement add_test_mpi macro.

- The macro takes one of more files to create a test which will run using MPI.
- A few more comments are added as well.
- seperate_arguments are added for a few variables (taken from old vtk)

Change-Id: I54353aeb414d5f61609a32d3f4a9344057622d68
parent 3b1ae910
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,9 @@ find_package(MPI REQUIRED)
mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY)
set(vtkParallelMPI_SYSTEM_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
#-----------------------------------------------------------------------------
# =============================================================================
# This following block should probably go into a seperate cmake file
# --------------------------------------------------- MPI-Testing-Support-BEGIN
# Configure MPI testing support.
# FLAGS used and set for MPI testing
# VTK_MPIRUN_EXE - full path to mpirun command
......@@ -44,6 +46,30 @@ mark_as_advanced(
VTK_MPI_MAX_NUMPROCS
)
separate_arguments(VTK_MPI_PRENUMPROC_FLAGS)
separate_arguments(VTK_MPI_PREFLAGS)
separate_arguments(VTK_MPI_POSTFLAGS)
# -----------------------------------------------------------------------------
# add_test_mpi macro take one or more files. It uses the files name for the name
# of the test. The test will be run using MPI.
macro (add_test_mpi fileName)
get_filename_component(name ${fileName} NAME_WE)
vtk_module_test_executable(
${name}
${name}.cxx
${ARGN})
add_test(
NAME ${vtk-module}Cxx-${name}
COMMAND ${VTK_MPIRUN_EXE}
${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} ${VTK_MPI_MAX_NUMPROCS}
${VTK_MPI_PREFLAGS}
$<TARGET_FILE:${name}>
${VTK_MPI_POSTFLAGS})
endmacro()
# ----------------------------------------------------- MPI-Testing-Support-END
# =============================================================================
set(Module_SRCS
vtkMPICommunicator.cxx
vtkMPIController.cxx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment