diff --git a/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1-foss-2023b.eb b/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1-foss-2023b.eb index 20a40cd3952..241ca8a7b98 100644 --- a/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1-foss-2023b.eb +++ b/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1-foss-2023b.eb @@ -40,6 +40,7 @@ sources = [SOURCELOWER_TAR_GZ] patches = [ 'GROMACS-2023.1_set_omp_num_threads_env_for_ntomp_tests.patch', 'GROMACS-2023.1_fix_tests_for_gmx_thread_mpi.patch', + 'GROMACS-2024.1_fix-tests-filesystem-race.patch', ] checksums = [ {'gromacs-2024.1.tar.gz': '937d8f12a36fffbf2af7add71adbb5aa5c5537892d46c9a76afbecab1aa0aac7'}, @@ -47,6 +48,8 @@ checksums = [ '7f41bda16c9c2837624265dda4be252f655d1288ddc4486b1a2422af30d5d199'}, {'GROMACS-2023.1_fix_tests_for_gmx_thread_mpi.patch': '6df844bb3bbc51180446a3595c61a4ef195e5f975533a04cef76841aa763aec1'}, + {'GROMACS-2024.1_fix-tests-filesystem-race.patch': + '25b933b37bc40576ee25ebae24442ae15fafe7cd5ac4b066e1dc8de488d58b4c'}, ] builddependencies = [ diff --git a/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1_fix-tests-filesystem-race.patch b/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1_fix-tests-filesystem-race.patch new file mode 100644 index 00000000000..f32de88e608 --- /dev/null +++ b/easybuild/easyconfigs/g/GROMACS/GROMACS-2024.1_fix-tests-filesystem-race.patch @@ -0,0 +1,152 @@ +diff --git a/api/gmxapi/cpp/tests/CMakeLists.txt b/api/gmxapi/cpp/tests/CMakeLists.txt +index ca741dc930b4ed9cbde2ba4c84e50d4579e1adc6..7c00e390a32e92926d08b006df4ad335273143fb 100644 +--- a/api/gmxapi/cpp/tests/CMakeLists.txt ++++ b/api/gmxapi/cpp/tests/CMakeLists.txt +@@ -107,4 +107,10 @@ if (GMX_MPI) + set_tests_properties(GmxapiMpiTests PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif () ++ if (TEST GmxapiExternalInterfaceTests AND TEST GmxapiMpiTests) ++ # Because the gmxapi tests depend on writing files whose names are not ++ # unique across test cases, prevent CTest from running these tests ++ # concurrently. See #4654 ++ set_tests_properties(GmxapiMpiTests PROPERTIES DEPENDS GmxapiExternalInterfaceTests) ++ endif() + endif () +diff --git a/src/programs/mdrun/tests/CMakeLists.txt b/src/programs/mdrun/tests/CMakeLists.txt +index 23dc2840aed9660f6fb84a4d5a295a2cb36feace..e24ae102d511b735257d60ce2c59e6a1d1956400 100644 +--- a/src/programs/mdrun/tests/CMakeLists.txt ++++ b/src/programs/mdrun/tests/CMakeLists.txt +@@ -113,6 +113,12 @@ gmx_add_gtest_executable(${exename} MPI + target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure) + gmx_register_gtest_test(MdrunTestsOneRank ${exename} MPI_RANKS 1 OPENMP_THREADS 2 INTEGRATION_TEST SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) + gmx_register_gtest_test(MdrunTestsTwoRanks ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) ++# Because the mdrun tests depend on writing files whose names are not ++# unique across test cases, prevent CTest from running these tests ++# concurrently. See #4654 ++if (TEST MdrunTestsTwoRanks AND TEST MdrunTestsOneRank) ++ set_tests_properties(MdrunTestsTwoRanks PROPERTIES DEPENDS MdrunTestsOneRank) ++endif() + + # The orires test is separate, as it supports only a single MPI rank + set(testname "MdrunSingleRankAlgorithmsTests") +@@ -129,13 +135,31 @@ gmx_add_gtest_executable(${exename} + target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure) + gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS SLOW_GPU_TEST) + ++set(exename "minimize-test") ++ ++gmx_add_gtest_executable(${exename} MPI ++ CPP_SOURCE_FILES ++ # files with code for tests ++ minimize.cpp ++ # pseudo-library for code for mdrun ++ $ ++ ) ++target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure) ++gmx_register_gtest_test(Minimize1RankTests ${exename} MPI_RANKS 1 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS QUICK_GPU_TEST) ++gmx_register_gtest_test(Minimize2RankTests ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS QUICK_GPU_TEST) ++# Because the minimizer tests depend on writing files whose names are not ++# unique across test cases, prevent CTest from running these tests ++# concurrently. See #4654 ++if (TEST Minimize2RankTests AND TEST Minimize1RankTests) ++ set_tests_properties(Minimize2RankTests PROPERTIES DEPENDS Minimize1RankTests) ++endif() ++ + set(testname "MdrunNonIntegratorTests") + set(exename "mdrun-non-integrator-test") + + gmx_add_gtest_executable(${exename} + CPP_SOURCE_FILES + # files with code for tests +- minimize.cpp + nonbonded_bench.cpp + normalmodes.cpp + rerun.cpp +@@ -169,7 +193,6 @@ gmx_add_gtest_executable(${exename} MPI + CPP_SOURCE_FILES + # files with code for tests + domain_decomposition.cpp +- minimize.cpp + mimic.cpp + # pseudo-library for code for mdrun + $ +@@ -177,6 +200,13 @@ gmx_add_gtest_executable(${exename} MPI + target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure) + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS QUICK_GPU_TEST) + ++# Because the mdrun tests depend on writing files whose names are not ++# unique across test cases, prevent CTest from running these tests ++# concurrently. See #4654. These test binaries both test aspects of MiMiC. ++if (TEST MdrunMpiTests AND TEST MdrunModulesTests) ++ set_tests_properties(MdrunMpiTests PROPERTIES DEPENDS MdrunModulesTests) ++endif() ++ + # Multi sim only makes sense with real MPI, and ideally at least 4 ranks, + # to allow for multiple simulations (>= 2 sims) each using DD (>= 2 ranks per sim) + set(testname "MdrunMultiSimTests") +@@ -235,6 +265,12 @@ gmx_add_gtest_executable(${exename} MPI + target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure) + gmx_register_gtest_test(MdrunMpi1RankPmeTests ${exename} MPI_RANKS 1 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS SLOW_GPU_TEST) + gmx_register_gtest_test(MdrunMpi2RankPmeTests ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS SLOW_GPU_TEST) ++# Because the mdrun tests depend on writing files whose names are not ++# unique across test cases, prevent CTest from running these tests ++# concurrently. See #4654 ++if (TEST MdrunMpi2RankPmeTests AND TEST MdrunMpi1RankPmeTests) ++ set_tests_properties(MdrunMpi2RankPmeTests PROPERTIES DEPENDS MdrunMpi1RankPmeTests) ++endif() + + # Slow-running tests that target testing multiple-rank coordination behaviors + # These tests are extremely slow without optimization or OpenMP, so only run them for +@@ -256,6 +292,12 @@ if (CMAKE_BUILD_TYPE MATCHES "Rel" AND GMX_OPENMP) + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 1 SLOW_TEST IGNORE_LEAKS QUICK_GPU_TEST) + set(testname "MdrunCoordinationBasicTests2Ranks") + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 SLOW_TEST IGNORE_LEAKS QUICK_GPU_TEST) ++ # Because the mdrun tests depend on writing files whose names are not ++ # unique across test cases, prevent CTest from running these tests ++ # concurrently. See #4654 ++ if (TEST MdrunCoordinationBasicTests2Ranks AND TEST MdrunCoordinationBasicTests1Rank) ++ set_tests_properties(MdrunCoordinationBasicTests2Ranks PROPERTIES DEPENDS MdrunCoordinationBasicTests1Rank) ++ endif() + endif() + + set(exename "mdrun-coordination-coupling-test") +@@ -274,6 +316,12 @@ if (CMAKE_BUILD_TYPE MATCHES "Rel" AND GMX_OPENMP) + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 1 SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) + set(testname "MdrunCoordinationCouplingTests2Ranks") + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) ++ # Because the mdrun tests depend on writing files whose names are not ++ # unique across test cases, prevent CTest from running these tests ++ # concurrently. See #4654 ++ if (TEST MdrunCoordinationCouplingTests2Ranks AND TEST MdrunCoordinationCouplingTests1Rank) ++ set_tests_properties(MdrunCoordinationCouplingTests2Ranks PROPERTIES DEPENDS MdrunCoordinationCouplingTests1Rank) ++ endif() + endif() + + set(exename "mdrun-coordination-constraints-test") +@@ -292,6 +340,12 @@ if (CMAKE_BUILD_TYPE MATCHES "Rel" AND GMX_OPENMP) + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 1 SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) + set(testname "MdrunCoordinationConstraintsTests2Ranks") + gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 SLOW_TEST IGNORE_LEAKS SLOW_GPU_TEST) ++ # Because the mdrun tests depend on writing files whose names are not ++ # unique across test cases, prevent CTest from running these tests ++ # concurrently. See #4654 ++ if (TEST MdrunCoordinationConstraintsTests2Ranks AND TEST MdrunCoordinationConstraintsTests1Rank) ++ set_tests_properties(MdrunCoordinationConstraintsTests2Ranks PROPERTIES DEPENDS MdrunCoordinationConstraintsTests1Rank) ++ endif() + endif() + + # Keeping the FEP tests separate for now to be able to judge runtime more easily +diff --git a/src/testutils/testinit.cpp b/src/testutils/testinit.cpp +index ca3ed8db2c52940a128701e2e5ae4999904a2802..5db9bb1af05631eab768c259e4e4f328e0efa7ff 100644 +--- a/src/testutils/testinit.cpp ++++ b/src/testutils/testinit.cpp +@@ -191,7 +191,7 @@ void initTestUtils(const std::filesystem::path& dataPath, + { + fprintf(stderr, + "NOTE: You are running %s on %d MPI ranks, " +- "but it is does not contain MPI-enabled tests. " ++ "but it does not contain MPI-enabled tests. " + "The test will now exit.\n", + context.programName(), + gmx_node_num());