diff --git a/.gitlab-ci.d/cmake-tests.gitlab-ci.yml b/.gitlab-ci.d/cmake-tests.gitlab-ci.yml index dac02bac2c676aa94b2b4c2613adfc825c40d4fa..554ff724fa8e8b4d76fd199dbcc29609933557a6 100644 --- a/.gitlab-ci.d/cmake-tests.gitlab-ci.yml +++ b/.gitlab-ci.d/cmake-tests.gitlab-ci.yml @@ -8,10 +8,9 @@ include: CTEST_PARALLEL_LEVEL: 16 CMAKE_BUILD_PARALLEL_LEVEL: 16 SCHEDULER_PARAMETERS: "--ntasks=1 --cpus-per-task=16 --reservation=jacamar1 $SLURM_VERBOSITY" - BUILD_DIR: cmake-build-ci-$CMAKE_PRESET + BUILD_PREFIX: /var/tmp/ + BUILD_DIR: ${BUILD_PREFIX}cmake-build-ci-$CMAKE_PRESET CHECK_REPORT: "${CI_JOB_NAME_SLUG}_${CI_COMMIT_SHA}" - TEMPDIRPATH: "/var/tmp" - TMPDIR: "/var/tmp" script: - git submodule update --init --recursive @@ -30,7 +29,15 @@ include: - unset FCFLAGS - echo -e "\e[0Ksection_start:`date +%s`:configure[collapsed=true]\r\e[0KConfigure call (preset $CMAKE_PRESET)" - - cmake --preset $CMAKE_PRESET --fresh + - cmake --preset $CMAKE_PRESET --fresh || failed=true + - > + rsync --ignore-missing-args + $BUILD_DIR/src/include/config.h + $BUILD_DIR/Octopus.info + $BUILD_DIR/CMakeCache.txt + $BUILD_DIR/CMakeFiles/CMakeConfigureLog.yaml + _ci_artifacts/ + - if [ $failed ]; then echo configure failed; rm -rf $BUILD_DIR; exit 1; fi - echo -e "\e[0Ksection_end:`date +%s`:configure\r\e[0K" - echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=true]\r\e[0KCompile octopus" @@ -42,11 +49,19 @@ include: - echo -e "\e[0Ksection_start:`date +%s`:test[collapsed=true]\r\e[0KRun tests (ctest --preset `echo $CMAKE_PRESET`)" - ulimit -s unlimited - ulimit -t 7200 - - ctest --preset $CMAKE_PRESET --output-junit ctest-junit.xml + - ctest --preset $CMAKE_PRESET --output-junit $CI_PROJECT_DIR/ctest-junit.xml || failed=true + - > + rsync --ignore-missing-args + $BUILD_DIR/testsuite/runtime_warnings + $BUILD_DIR/testsuite/${CHECK_REPORT}.yaml + _ci_artifacts/ + - if [ $failed ]; then echo tests failed; rm -rf $BUILD_DIR; exit 1; fi - echo -e "\e[0Ksection_end:`date +%s`:test\r\e[0K" + # cleanup + - rm -rf $BUILD_DIR # report 5 slowest tests, and fail if tests run too long - - venv/bin/python3 scripts/testsuite-runtime.py --max_runtime 1000 $BUILD_DIR/ctest-junit.xml + - venv/bin/python3 scripts/testsuite-runtime.py --max_runtime 1000 $CI_PROJECT_DIR/ctest-junit.xml after_script: - CHECK_REPORT_FILE="${BUILD_DIR}/testsuite/${CHECK_REPORT}.yaml" @@ -55,17 +70,9 @@ include: when: always paths: - _ci_artifacts/ - # configure - - "$BUILD_DIR/src/include/config.h" - - "$BUILD_DIR/Octopus.info" - - "$BUILD_DIR/CMakeCache.txt" - - "$BUILD_DIR/CMakeFiles/CMakeConfigureLog.yaml" - # ctest - - "$BUILD_DIR/results.xml" - - $BUILD_DIR/testsuite/runtime_warnings reports: # upload JUnit's test summary to Gitlab's JUnit reporting - junit: $BUILD_DIR/ctest-junit.xml + junit: ctest-junit.xml dependencies: [] tags: - mpsd-sandybridge @@ -111,11 +118,9 @@ foss_cmake_ceph: MPIEXEC: "orterun --map-by socket --oversubscribe" # temporary directory on ceph file system to catch bugs that are only # visible on the slower network file system - TEMPDIRPATH: "${CI_PROJECT_DIR}/../tmp" - TMPDIR: "${CI_PROJECT_DIR}/../tmp" + BUILD_PREFIX: "${CI_PROJECT_DIR}/" before_script: - mpsd-show-job-resources - - mkdir -p "$TMPDIR" - !reference [.load-modules] when: manual diff --git a/cmake/CMakePresets-buildbot.json b/cmake/CMakePresets-buildbot.json index a45a2d3e353abc84bdce4ab5da7f17456233da44..63bf1a124ad8e4cc2657e6ff5d588a5a0c774647 100644 --- a/cmake/CMakePresets-buildbot.json +++ b/cmake/CMakePresets-buildbot.json @@ -150,7 +150,7 @@ "_serial", "_min" ], - "binaryDir": "cmake-build-ci-foss-min" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-min" }, { "name": "foss-min-mpi", @@ -160,7 +160,7 @@ "_buildbot-foss", "_min" ], - "binaryDir": "cmake-build-ci-foss-min-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-min-mpi" }, { "name": "foss-full", @@ -170,7 +170,7 @@ "_serial", "_full-required" ], - "binaryDir": "cmake-build-ci-foss-full" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full" }, { "name": "foss-full-cuda", @@ -181,7 +181,7 @@ "_full-required", "_cuda" ], - "binaryDir": "cmake-build-ci-foss-full-cuda" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-cuda" }, { "name": "foss-full-opencl", @@ -192,7 +192,7 @@ "_full-required", "_opencl" ], - "binaryDir": "cmake-build-ci-foss-full-opencl" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-opencl" }, { "name": "foss-full-mpi", @@ -202,7 +202,7 @@ "_buildbot-foss", "_full-mpi-required" ], - "binaryDir": "cmake-build-ci-foss-full-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-mpi" }, { "name": "foss-full-cuda-mpi", @@ -213,7 +213,7 @@ "_full-mpi-required", "_cuda" ], - "binaryDir": "cmake-build-ci-foss-full-cuda-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-cuda-mpi" }, { "name": "foss-full-opencl-mpi", @@ -224,7 +224,7 @@ "_full-mpi-required", "_opencl" ], - "binaryDir": "cmake-build-ci-foss-full-opencl-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-opencl-mpi" }, { "name": "foss-full-cuda-mpi-omp", @@ -236,7 +236,7 @@ "_cuda", "_openmp" ], - "binaryDir": "cmake-build-ci-foss-full-cuda-mpi-omp", + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-cuda-mpi-omp", "cacheVariables": { "CMAKE_DISABLE_FIND_PACKAGE_DftbPlus": { "type": "BOOL", @@ -258,7 +258,7 @@ "_opencl", "_openmp" ], - "binaryDir": "cmake-build-ci-foss-full-opencl-mpi-omp", + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-foss-full-opencl-mpi-omp", "cacheVariables": { "CMAKE_DISABLE_FIND_PACKAGE_DftbPlus": { "type": "BOOL", @@ -278,7 +278,7 @@ "_serial", "_min" ], - "binaryDir": "cmake-build-ci-intel-min" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-min" }, { "name": "intel-min-mpi", @@ -288,7 +288,7 @@ "_buildbot-intel", "_min" ], - "binaryDir": "cmake-build-ci-intel-min-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-min-mpi" }, { "name": "intel-full", @@ -298,7 +298,7 @@ "_serial", "_full-required" ], - "binaryDir": "cmake-build-ci-intel-full" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full" }, { "name": "intel-full-cuda", @@ -309,7 +309,7 @@ "_full-required", "_cuda" ], - "binaryDir": "cmake-build-ci-intel-full-cuda" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-cuda" }, { "name": "intel-full-opencl", @@ -320,7 +320,7 @@ "_full-required", "_opencl" ], - "binaryDir": "cmake-build-ci-intel-full-opencl" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-opencl" }, { "name": "intel-full-mpi", @@ -330,7 +330,7 @@ "_buildbot-intel", "_full-mpi-required" ], - "binaryDir": "cmake-build-ci-intel-full-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-mpi" }, { "name": "intel-full-cuda-mpi", @@ -341,7 +341,7 @@ "_full-mpi-required", "_cuda" ], - "binaryDir": "cmake-build-ci-intel-full-cuda-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-cuda-mpi" }, { "name": "intel-full-opencl-mpi", @@ -352,7 +352,7 @@ "_full-mpi-required", "_opencl" ], - "binaryDir": "cmake-build-ci-intel-full-opencl-mpi" + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-opencl-mpi" }, { "name": "intel-full-cuda-mpi-omp", @@ -364,7 +364,7 @@ "_cuda", "_openmp" ], - "binaryDir": "cmake-build-ci-intel-full-cuda-mpi-omp", + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-cuda-mpi-omp", "cacheVariables": { "CMAKE_DISABLE_FIND_PACKAGE_DftbPlus": { "type": "BOOL", @@ -386,7 +386,7 @@ "_opencl", "_openmp" ], - "binaryDir": "cmake-build-ci-intel-full-opencl-mpi-omp", + "binaryDir": "$penv{BUILD_PREFIX}cmake-build-ci-intel-full-opencl-mpi-omp", "cacheVariables": { "CMAKE_DISABLE_FIND_PACKAGE_DftbPlus": { "type": "BOOL", diff --git a/testsuite/CMakeLists.txt b/testsuite/CMakeLists.txt index 2364dd949984efc6ca5ed73bd3538c69e8a0a326..b2fc2b64a8974a0db06c8b3f656d28daa71127f9 100644 --- a/testsuite/CMakeLists.txt +++ b/testsuite/CMakeLists.txt @@ -87,10 +87,18 @@ function(Octopus_add_test name) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) set_tests_properties(${ARGS_TEST_NAME} PROPERTIES - ENVIRONMENT "OCTOPUS_SHARE=${PROJECT_BINARY_DIR}/share" LABELS "${tags_list};${ARGS_LABELS}" SKIP_RETURN_CODE 254 ) + set_property(TEST ${ARGS_TEST_NAME} APPEND + PROPERTY ENVIRONMENT + # OCTOPUS_SHARE is necessary to be able to run from build directory + "OCTOPUS_SHARE=${PROJECT_BINARY_DIR}/share" + # TEMPDIRPATH is used by octopus perl script + "TEMPDIRPATH=${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TEST_NAME}" + # TMPDIR is used by OpenMPI (and maybe other tools) + "TMPDIR=${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TEST_NAME}" + ) # Set the appropriate parallelization properties # Note: In principle these should be done dynamically using `TEST_INCLUDE_FILE`, however this functionality cannot diff --git a/testsuite/oct-run_regression_test.pl b/testsuite/oct-run_regression_test.pl index 0d9901ee38336a7b3d2c82bba652d6ea80ea146e..cb42a7614641fda7587b1052c0734b1736f832c7 100755 --- a/testsuite/oct-run_regression_test.pl +++ b/testsuite/oct-run_regression_test.pl @@ -28,6 +28,7 @@ use Fcntl qw(:mode :flock); use Time::HiRes qw(gettimeofday tv_interval); use Scalar::Util qw(looks_like_number); use File::Temp qw/tempdir/; +use File::Path qw(make_path); sub usage { @@ -176,7 +177,7 @@ my $failures = 0; my $tempdirpath = get_env("TEMPDIRPATH"); if ("$tempdirpath" eq "") { $tempdirpath = '/tmp'; } -if (! -d $tempdirpath) { mkdir $tempdirpath; } +if (! -d $tempdirpath) { make_path($tempdirpath); } set_precision("default"); @@ -282,7 +283,7 @@ if (!$opt_m) { chomp($workdir); system ("rm -rf $workdir"); - mkdir $workdir; + make_path($workdir); $scriptname = "$workdir/matches.sh"; open(SCRIPT, ">$scriptname") or die255("Could not create '$scriptname'."); @@ -643,7 +644,7 @@ while ($_ = ) { # copy all files of this run to archive directory with the name of the # current input file - mkdir "$workdir/$input_base"; + make_path("$workdir/$input_base"); @wfiles = `ls -d $workdir/* | grep -v inp`; $workfiles = join("",@wfiles); $workfiles =~ s/\n/ /g;