CMakeLists.txt 2.54 KB
Newer Older
Alexander Danilov's avatar
Alexander Danilov committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
project(pmesh_test001)
set(SOURCE main.cpp)

add_executable(pmesh_test001 ${SOURCE})
target_link_libraries(pmesh_test001 inmost)

if(USE_MPI)
  message("linking pmesh_test001 with MPI")
  target_link_libraries(pmesh_test001 ${MPI_LIBRARIES}) 
  if(MPI_LINK_FLAGS)
    set_target_properties(pmesh_test001 PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
  endif() 
endif(USE_MPI)

if(USE_PARTITIONER_ZOLTAN)
  message("linking pmesh_test001 with Zoltan")
  target_link_libraries(pmesh_test001 ${ZOLTAN_LIBRARIES})
endif()
if(USE_PARTITIONER_PARMETIS)
  message("linking pmesh_test001 with ParMETIS")
  target_link_libraries(pmesh_test001 ${PARMETIS_LIBRARIES})
endif()

if( USE_MPI AND EXISTS ${MPIEXEC} )
  add_test(NAME pmesh_test001_internal_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 0)
  add_test(NAME pmesh_test001_internal_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 0)
  if(USE_PARTITIONER_PARMETIS)
    add_test(NAME pmesh_test001_parmetis_partition_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 1 0)
    add_test(NAME pmesh_test001_parmetis_partition_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 1 0)
  endif()
  if(USE_PARTITIONER_ZOLTAN)
    add_test(NAME pmesh_test001_zoltan_hsfc_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 2)
    add_test(NAME pmesh_test001_zoltan_hsfc_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 2)
    add_test(NAME pmesh_test001_zoltan_rib_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 3)
    add_test(NAME pmesh_test001_zoltan_rib_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 3)
    add_test(NAME pmesh_test001_zoltan_rcb_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 4)
    add_test(NAME pmesh_test001_zoltan_rcb_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 4)
    add_test(NAME pmesh_test001_zoltan_phg_np_2  COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 5)
    add_test(NAME pmesh_test001_zoltan_phg_np_4  COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:pmesh_test001> ${CMAKE_CURRENT_SOURCE_DIR}/menger9x9x9.vtk 5)
  endif()
endif()