You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This MR makes all LPF functional tests use GoogleTest.
The main changes for CMake are:
- reorganize CMake to use GTest CMake package for compilation, and gtest_add_tests clause to define Gtests;
- remove all use of the run.sh script;
- make explicit the list of tests and do not use file(GLOB, ...) clauses to look for all files in test directories, as recommended by CMakesource files:
The main changes for source files are:
- every single test file needed to be modified to not include internal Test.h but gtest.h, and to use the assert/equal clauses of GoogleTest
- all death tests are slightly modified now to expect FAIL() after the expected fail condition
- some modernization of C to C++ was needed for a number of files, incl. use of new/delete instead of malloc/free, or string manipulation instead of C char * manipulation
A new Python wrapper script test_launcher.py is being employed now for more flexible checking of return codes, which is needed for death tests and normal tests alike. The expected return codes are still parsed from scanning the source files as before.
For the complete history, see GitHub PR #26 .
This MR also resolves bugs that have appeared on more modern cluster deployments compared to the previous main tag of LPF. This is hence a priority MR to base all further extensions and evolutions of LPF on. This MR was tested successfully for:
- x86_64, CentOS Stream 9, GCC 11.5.0, MPICH 4.1.1 (caveat 2)
- x86_64, CentOS Stream 9, GCC 11.5.0, OpenMPI 4.1.1 (caveats 1, 2, and 5)
- x86_64, Fedora, GCC 9.3.1, MPICH 3.3.2 (caveat 2)
- x86_64, Ubuntu 23.04, GCC 13.1.0, OpenMPI 4.1.6 (caveat 5)
- x86_64, openEuler 20.03 LTS, GCC 7.3, MPICH 3.2.1
- x86_64, Ubuntu 22.04 LTS, GCC 11.4.0, MPICH 4.3.0b1 (caveat 3, transient)
- ARM, Ubuntu 22.04 LTS, GCC 11.4.0, MPICH 4.3.0b1 (caveats 3 & 4)
These are under different variations of calls to `bootstrap.sh` to test all the above-described changes.
The following caveats apply:
1. with OpenMPI and default arguments to its `mpirun`, oversubscription to larger process counts may be limited, causing some tests to fail. Issue #37 has been raised to pass the appropriate flags to the OpenMPI `mpirun` during testing;
2. `make install` post-install checks fail (as they should) when: 1) tests are disabled, 2) ibverbs dev libraries are present, but 3) no IB card is present. On the machines with IB we tested on, all post-install checks succeed.
3. The hybrid backend on MPICH 4.3.0b1 does not pass the debug layer tests due to a segfault in MPICH's MPI_Abort. Issue #41 has been raised to track this. This error presently only is consistently reproducible on our cluster's ARM nodes and transient on our cluster's x86_64 nodes. They have not been observed outside our cluster.
4. With MPICH 4.3.0b1, we furthermore hit issues #43 and #44. Also these issues are only reproducible on ARM nodes.
5. With OpenMPI 4.1.6 and OpenMPI 4.1.1 on x86_64 we hit issue #45
6. At present, we have no CI flow that can run all build variations relevant to this MR. Issues #40 has been raised to (partially) address as well as to track this issue.
message( STATUS"Installation directory prefix is ${prefix}")
107
107
108
-
# C++ standard
109
-
find_file(TR1_ARRAY"tr1/array")
110
-
if (TR1_ARRAY)
111
-
message(STATUS"Governing C++ standard is C++98/TR1")
112
-
set(CMAKE_CXX_STANDARD 98)
113
-
set(CMAKE_CXX_STANDARD_REQUIREDYES)
114
-
else()
115
-
message(STATUS"Governing C++ standard is C++11")
116
-
set(CMAKE_CXX_STANDARD 11)
117
-
set(CMAKE_CXX_STANDARD_REQUIREDYES)
118
-
endif()
119
-
120
108
# Dependencies
121
109
set(ENGINES)
122
110
find_library( LIB_POSIX_THREADS
@@ -173,9 +161,6 @@ if ( MPI_FOUND )
173
161
if ( NOT MPI_IS_THREAD_COMPAT ORNOT MPI_IS_NOT_OPENMPI1 )
174
162
message( WARNING"MPI implementation does not tolerate any threading. Hybrid implementation will not be built")
175
163
endif()
176
-
if ( NOT MPI_OPEN_PORT )
177
-
message( WARNING"MPI implementation does not support dynamically connecting separate MPI processes. Hence, lpf_mpi_initialize_over_tcp will always fail.")
178
-
endif()
179
164
if ( NOT MPI_IBARRIER )
180
165
message( WARNING"MPI implementation does not have MPI_Ibarrier, which is required to use the dense all-to-all algorithm on large (> 2 GB) meta-data exchanges")
181
166
endif()
@@ -189,18 +174,37 @@ if ( LIB_MATH AND LIB_DL AND MPI_FOUND )
189
174
list(APPEND ENGINES "mpirma")
190
175
endif()
191
176
192
-
if (LIB_IBVERBS)
177
+
if (ENABLE_IBVERBS)
193
178
list(APPEND ENGINES "ibverbs")
194
179
endif()
195
180
196
181
endif()
197
182
198
183
#enable the hybrid engine
199
184
if ( LIB_POSIX_THREADS AND LIB_MATH AND LIB_DL AND MPI_FOUND
200
-
AND MPI_IS_THREAD_COMPAT AND MPI_IS_NOT_OPENMPI1
201
-
AND LIB_IBVERBS )
202
-
list(APPEND ENGINES "hybrid")
203
-
set(HYBRID_ENGINE_ENABLED on)
185
+
AND MPI_IS_THREAD_COMPAT AND MPI_IS_NOT_OPENMPI1 )
186
+
if( ENABLE_IBVERBS )
187
+
set(LPFLIB_HYBRID_MPI_ENGINE "ibverbs"CACHESTRING
188
+
"Choice of MPI engine to use for inter-process communication")
189
+
list(APPEND ENGINES "hybrid")
190
+
set(HYBRID_ENGINE_ENABLED on)
191
+
elseif( MPI_RMA )
192
+
set(LPFLIB_HYBRID_MPI_ENGINE "mpirma"CACHESTRING
193
+
"Choice of MPI engine to use for inter-process communication")
194
+
list(APPEND ENGINES "hybrid")
195
+
set(HYBRID_ENGINE_ENABLED on)
196
+
elseif( LIB_MATH AND LIB_DL AND MPI_FOUND )
197
+
set(LPFLIB_HYBRID_MPI_ENGINE "mpimsg"CACHESTRING
198
+
"Choice of MPI engine to use for inter-process communication")
199
+
list(APPEND ENGINES "hybrid")
200
+
set(HYBRID_ENGINE_ENABLED on)
201
+
endif()
202
+
if( HYBRID_ENGINE_ENABLED )
203
+
message( "Hybrid engine will be built using the ${LPFLIB_HYBRID_MPI_ENGINE} engine" )
204
+
else()
205
+
message( "No suitable inter-node communication engine found; "
206
+
"hybrid engine will not be built" )
207
+
endif()
204
208
endif()
205
209
206
210
message( STATUS"The following engines will be built: ${ENGINES}")
@@ -223,6 +227,7 @@ endif()
223
227
224
228
# When system is not Linux, enable conditionally compiled blocks
225
229
if (APPLE)
230
+
message( WARNING"LPF compilation on OS X is not regularly tested" )
message(STATUS"Unit and API tests will be built. This requires CMake version 3.29 or higher, since we use recent features of the GoogleTest package in CMake.")
392
+
393
+
if (NOT GTEST_AGREE_TO_LICENSE)
394
+
message(FATAL_ERROR"The user needs to agree with the GoogleTest license to use tests (option GTEST_AGREE_TO_LICENSE=TRUE)")
395
+
endif()
396
+
# Enable testing in CMake
397
+
enable_testing()
398
+
include(ProcessorCount)
399
+
ProcessorCount(processorCount)
400
+
find_package(GTest)
401
+
include(GoogleTest)
402
+
if(NOT GTest_FOUND) # if not found, download it and pull it in
0 commit comments