Enable kernel compiler cache for SYCL DPC++
[alexxy/gromacs.git] / admin / ci-scripts / gromacs-base-test.sh
1 #!/usr/bin/env bash
2 set -e
3 CMAKE=${CMAKE:-$(which cmake)}
4 cd $BUILD_DIR
5 export UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=$CI_PROJECT_DIR/admin/ubsan-suppressions.txt
6 # Needed to run MPI enabled code in the docker images, until we set up different users
7 export OMPI_ALLOW_RUN_AS_ROOT=1
8 export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
9 export ASAN_OPTIONS="check_initialization_order=1:detect_invalid_pointer_pairs=1:strict_init_order=true:strict_string_checks=true:detect_stack_use_after_return=true"
10 # If $GMX_TEST_REQUIRED_NUMBER_OF_DEVICES is not set and we have GPUs, set it
11 if [ -z $GMX_TEST_REQUIRED_NUMBER_OF_DEVICES ] && [ -n $KUBERNETES_EXTENDED_RESOURCE_NAME ] ; then
12     if grep -q '/gpu$' <<< "$KUBERNETES_EXTENDED_RESOURCE_NAME"; then
13         echo "export GMX_TEST_REQUIRED_NUMBER_OF_DEVICES=\"$KUBERNETES_EXTENDED_RESOURCE_LIMIT\"";
14         export GMX_TEST_REQUIRED_NUMBER_OF_DEVICES="$KUBERNETES_EXTENDED_RESOURCE_LIMIT";
15     fi
16 fi
17 if grep -qF 'nvidia.com/gpu' <<< "$KUBERNETES_EXTENDED_RESOURCE_NAME"; then
18     nvidia-smi || true;
19 fi
20 if grep -qF 'amd.com/gpu' <<< "$KUBERNETES_EXTENDED_RESOURCE_NAME"; then
21     clinfo -l || true;
22 fi
23 if grep -qF 'intel.com/gpu' <<< "$KUBERNETES_EXTENDED_RESOURCE_NAME"; then
24     sycl-ls || true;
25     export SYCL_CACHE_PERSISTENT=1; # Issue #4218
26 fi
27 ctest -D $CTEST_RUN_MODE --output-on-failure | tee ctestLog.log || true
28 awk '/The following tests FAILED/,/^Errors while running CTest|^$/' ctestLog.log | tee ctestErrors.log
29 xsltproc $CI_PROJECT_DIR/scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/*.xml > JUnitTestResults.xml
30 if [ -s ctestErrors.log ] ; then
31     echo "Error during running ctest";
32     exit 1;
33 fi
34 cd .