Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions bin/patches/qeomp-elapsed-time.patch
Original file line number Diff line number Diff line change
@@ -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]
20 changes: 20 additions & 0 deletions bin/run_qe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading