1 # Copyright (C) 2012-2020 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 ADD_DEFINITIONS(${MPI_DEFINITIONS} ${CPPUNIT_DEFINITIONS})
24 ${CPPUNIT_INCLUDE_DIRS}
25 ${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDLoader
26 ${CMAKE_CURRENT_SOURCE_DIR}/../ParaMEDMEM
27 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
28 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
29 ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
30 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
31 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
32 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNELTest # for TestIKUtils.hxx
35 SET(ParaMEDMEMTest_SOURCES
37 ParaMEDMEMTest_MPIProcessorGroup.cxx
38 ParaMEDMEMTest_BlockTopology.cxx
39 ParaMEDMEMTest_InterpKernelDEC.cxx
40 ParaMEDMEMTest_StructuredCoincidentDEC.cxx
41 ParaMEDMEMTest_ICoco.cxx
42 ParaMEDMEMTest_Gauthier1.cxx
43 ParaMEDMEMTest_FabienAPI.cxx
44 ParaMEDMEMTest_NonCoincidentDEC.cxx
45 ParaMEDMEMTest_OverlapDEC.cxx
49 test_AllToAllTimeDEC.cxx
50 test_AllToAllvTimeDEC.cxx
51 test_AllToAllvTimeDoubleDEC.cxx
53 test_MPI_Access_Send_Recv.cxx
54 test_MPI_Access_Cyclic_Send_Recv.cxx
55 test_MPI_Access_SendRecv.cxx
56 test_MPI_Access_ISend_IRecv.cxx
57 test_MPI_Access_Cyclic_ISend_IRecv.cxx
58 test_MPI_Access_ISendRecv.cxx
59 test_MPI_Access_Probe.cxx
60 test_MPI_Access_IProbe.cxx
61 test_MPI_Access_Cancel.cxx
62 test_MPI_Access_Send_Recv_Length.cxx
63 test_MPI_Access_ISend_IRecv_Length.cxx
64 test_MPI_Access_ISend_IRecv_Length_1.cxx
65 test_MPI_Access_Time.cxx
66 test_MPI_Access_Time_0.cxx
67 test_MPI_Access_ISend_IRecv_BottleNeck.cxx
70 ADD_LIBRARY(ParaMEDMEMTest ${ParaMEDMEMTest_SOURCES})
71 SET_TARGET_PROPERTIES(ParaMEDMEMTest PROPERTIES COMPILE_FLAGS "")
72 TARGET_LINK_LIBRARIES(ParaMEDMEMTest paramedmem paramedloader medcouplingremapper InterpKernelTestUtils ${CPPUNIT_LIBRARIES})
73 INSTALL(TARGETS ParaMEDMEMTest DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
76 SET(TestParaMEDMEM_SOURCES
79 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} TestParaMEDMEM)
81 SET(TestMPIAccessDEC_SOURCES
84 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} TestMPIAccessDEC)
86 SET(TestMPIAccess_SOURCES
89 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} TestMPIAccess)
94 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} test_perf)
97 SET(ParaMEDMEMTestMPI2_1_SOURCES
99 ParaMEDMEMTestMPI2_1.cxx
101 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} ParaMEDMEMTestMPI2_1)
103 SET(ParaMEDMEMTestMPI2_2_SOURCES
105 ParaMEDMEMTestMPI2_2.cxx
107 SET(TESTSParaMEDMEM ${TESTSParaMEDMEM} ParaMEDMEMTestMPI2_2)
110 FOREACH(bintestparamem ${TESTSParaMEDMEM})
111 ADD_EXECUTABLE(${bintestparamem} ${${bintestparamem}_SOURCES})
112 TARGET_LINK_LIBRARIES(${bintestparamem} ParaMEDMEMTest)
113 ENDFOREACH(bintestparamem ${TESTSParaMEDMEM})
115 # Now add CMake tests - test_perf, ParaMEDMEMTestMPI2_1 and ParaMEDMEMTestMPI2_2
116 # are left aside, as they are too specific
118 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
120 # -- some tests require 2, 3, 4 or 5 procs --
121 # MPICH does not support --oversubscribe:
122 IF(NOT ${MPIEXEC_EXECUTABLE} MATCHES "mpich")
123 SET(_oversub_opt "--oversubscribe")
126 ADD_TEST(NAME TestParaMEDMEM_Proc2 COMMAND ${MPIEXEC} -np 2 ${_oversub_opt} $<TARGET_FILE:TestParaMEDMEM>)
127 SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
128 ADD_TEST(NAME TestParaMEDMEM_Proc3 COMMAND ${MPIEXEC} -np 3 ${_oversub_opt} $<TARGET_FILE:TestParaMEDMEM>)
129 SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc3 PROPERTIES ENVIRONMENT "${tests_env}")
130 ADD_TEST(NAME TestParaMEDMEM_Proc4 COMMAND ${MPIEXEC} -np 4 ${_oversub_opt} $<TARGET_FILE:TestParaMEDMEM>)
131 SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
132 ADD_TEST(NAME TestParaMEDMEM_Proc5 COMMAND ${MPIEXEC} -np 5 ${_oversub_opt} $<TARGET_FILE:TestParaMEDMEM>)
133 SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
135 ADD_TEST(NAME TestMPIAccess_Proc2 COMMAND ${MPIEXEC} -np 2 ${_oversub_opt} $<TARGET_FILE:TestMPIAccess>)
136 SET_TESTS_PROPERTIES(TestMPIAccess_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
137 ADD_TEST(NAME TestMPIAccess_Proc3 COMMAND ${MPIEXEC} -np 3 ${_oversub_opt} $<TARGET_FILE:TestMPIAccess>)
138 SET_TESTS_PROPERTIES(TestMPIAccess_Proc3 PROPERTIES ENVIRONMENT "${tests_env}")
140 ADD_TEST(NAME TestMPIAccessDEC_Proc4 COMMAND ${MPIEXEC} -np 4 ${_oversub_opt} $<TARGET_FILE:TestMPIAccessDEC>)
141 SET_TESTS_PROPERTIES(TestMPIAccessDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
144 INSTALL(TARGETS ${TESTSParaMEDMEM} DESTINATION ${MEDCOUPLING_INSTALL_BINS})
145 SET(COMMON_HEADERS_HXX
152 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})