diff --git a/bin/patches/qeomp-elapsed-time.patch b/bin/patches/qeomp-elapsed-time.patch new file mode 100644 index 000000000..fbc5f5748 --- /dev/null +++ b/bin/patches/qeomp-elapsed-time.patch @@ -0,0 +1,32 @@ +diff --git a/test-suite/testcode/lib/testcode2/__init__.py b/test-suite/testcode/lib/testcode2/__init__.py +index 223f3493e..5acd28305 100644 +--- a/test-suite/testcode/lib/testcode2/__init__.py ++++ b/test-suite/testcode/lib/testcode2/__init__.py +@@ -14,6 +14,7 @@ import os + import shlex + import shutil + import subprocess ++import time + import sys + + try: +@@ -268,8 +269,11 @@ class Test: + out, shlex.quote(test_files[ind])) + test_cmds = ['\n'.join(test_cmds)] + for (ind, test) in enumerate(test_cmds): ++ t_start = int(time.time()) + job = self.start_job(test, cluster_queue, verbose) + job.wait() ++ t_stop = int(time.time()) ++ t_elapsed = t_stop - t_start + # Analyse tests as they finish. + if cluster_queue: + # Did all of them at once. +@@ -303,6 +307,7 @@ class Test: + raise exceptions.RunError(err[0]) + else: + self.verify_job(test_input, test_arg, verbose, rundir) ++ print(f" time elapsed: {t_elapsed} s") + sys.stdout.flush() + except exceptions.RunError: + err = sys.exc_info()[1] diff --git a/bin/run_qe.sh b/bin/run_qe.sh index e7eebc264..712269608 100755 --- a/bin/run_qe.sh +++ b/bin/run_qe.sh @@ -437,6 +437,22 @@ run_pw_tests() { return "$ret" } +if cd "$QE_REPO"; then + echo "patching $QE_REPO" + patch="$thisdir/patches/qeomp-elapsed-time.patch" + if patch -p1 --merge --dry-run < "$patch"; then + patch -p1 --merge < "$patch" + mystat=$? + if [[ $mystat -eq 0 ]]; then + echo "PATCH SUCCESS $AOMP_QE_REPO_NAME" + else + echo "PATCH FAILED $AOMP_QE_REPO_NAME, mystat: $mystat" + fi + else + echo "PATCH SKIPPED $AOMP_QE_REPO_NAME" + fi +fi + # --- rerun: skip the build, just re-run the PW tests ----------------------- if [ "$1" == "rerun" ]; then run_pw_tests @@ -469,8 +485,12 @@ if [ "$1" != "nocmake" ]; then fi # --- Build PWscf ----------------------------------------------------------- +t_build_start_s=$(date +"%s") make -j"$AOMP_JOB_THREADS" pw ret=$? +t_build_stop_s=$(date +"%s") +t_build_diff_s=$((t_build_stop_s - t_build_start_s)) +echo "Build status: $ret, time elapsed: $t_build_diff_s s" if [ $ret -ne 0 ]; then echo "quantum-espresso-pw" >> make-fail.txt exit 1