diff --git a/bin/rocm-test/scripts/parse_LLNL.sh b/bin/rocm-test/scripts/parse_LLNL.sh index 0692b04a3..e6a1a18e2 100755 --- a/bin/rocm-test/scripts/parse_LLNL.sh +++ b/bin/rocm-test/scripts/parse_LLNL.sh @@ -16,8 +16,14 @@ testname_regex='.*(test_\S*)' compile_regex='Compilation.*failed' runtime_regex='Running.+\.\.\.\s+([A-Z]*[a-z]*)' -cd "$aompdir/test/LLNL/openmp5.0-tests" -infile=`ls | grep "LLNL.run.log"` +cd "$aompdir/test/LLNL/openmp5.0-tests" || exit 1 +declare -a infiles +infiles=( LLNL.run.log* ) +if [ "${#infiles[@]}" -ne 1 ]; then + echo "Expected to find a single result file, bailing out" >&2 + exit 1 +fi +infile=${infiles[0]} # Clean up before parsing if [ -e passing-tests.txt ]; then @@ -26,6 +32,9 @@ fi if [ -e failing-tests.txt ]; then rm failing-tests.txt fi +if [ -e xfail-tests.txt ]; then + rm xfail-tests.txt +fi if [ -e make-fail.txt ]; then rm make-fail.txt fi @@ -49,6 +58,10 @@ function parse(){ fi [[ "$line" =~ $testname_regex ]] llnltest=${BASH_REMATCH[1]} + if [ "$outfile" = "failing-tests.txt" ] && \ + grep -Fq "$llnltest" xfail-list; then + outfile="xfail-tests.txt" + fi echo "$llnltest" >> $outfile fi done < "$infile" diff --git a/test/LLNL/openmp5.0-tests/check_LLNL.sh b/test/LLNL/openmp5.0-tests/check_LLNL.sh index 9062a0bad..03c34d1cd 100755 --- a/test/LLNL/openmp5.0-tests/check_LLNL.sh +++ b/test/LLNL/openmp5.0-tests/check_LLNL.sh @@ -50,7 +50,15 @@ if [ "$1" == "log" ]; then log="LLNL.run.log.$date" fi echo "Log enabled: $log" - timeout 120 ./test.py $AOMP $AOMP_GPU 2>&1 | tee $log + timeout 480 ./test.py $AOMP $AOMP_GPU 2>&1 | tee $log + if [ ${PIPESTATUS[0]} -eq 124 ]; then + echo "WARNING: Testing timed out!" >&2 + exit 1 + fi else - timeout 120 ./test.py $AOMP $AOMP_GPU + timeout 480 ./test.py $AOMP $AOMP_GPU + if [ $? -eq 124 ]; then + echo "WARNING: Testing timed out!" >&2 + exit 1 + fi fi diff --git a/test/LLNL/openmp5.0-tests/test.py b/test/LLNL/openmp5.0-tests/test.py index 784733cf7..9c3096b70 100755 --- a/test/LLNL/openmp5.0-tests/test.py +++ b/test/LLNL/openmp5.0-tests/test.py @@ -35,16 +35,20 @@ def run(tests): cmd="./"+t cmd_s=cmd.split() p4=subprocess.Popen(cmd_s,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - for lines in p4.stdout.readlines(): + stdout,stderr = p4.communicate() + stdout = stdout.decode('utf-8') + for lines in stdout.splitlines(): #print(lines) - if b"error" in lines: + if "error" in lines: print("Failed") passs=False break - if b"FAIL" in lines: + if "FAIL" in lines: print("Failed") passs=False break + if p4.returncode != 0: + passs=False if passs: print ("Passed") pass_count+=1 @@ -61,14 +65,18 @@ def compile(CC,LIBS, tests): cmd=CC+" -c "+ v cmd_s=cmd.split() p2=subprocess.Popen(cmd_s,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - for lines in p2.stdout.readlines(): - efile.write(lines.decode('utf8')) - if b"error" in lines: + stdout,stderr = p2.communicate() + stdout = stdout.decode('utf-8') + for lines in stdout.splitlines(): + efile.write(lines) + if "error" in lines: fail=True print("Compilation of ",v," failed") passs = passs and not fail break passs = passs and not fail + if p2.returncode != 0: + passs=False if passs: print("Compiling ",key) @@ -79,12 +87,15 @@ def compile(CC,LIBS, tests): #print("Final compile command is ",cmd) cmd_s=cmd.split() p3=subprocess.Popen(cmd_s,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - for lines in p3.stdout.readlines(): - print(lines.decode('utf8')) - if b"error" in lines: + stdout, stderr = p3.communicate() + stdout = stdout.decode('utf-8') + for lines in stdout.splitlines(): + print(lines) + if "error" in lines: print("Linking of ",v," failed\n") break - runnables.append(key) + if p3.returncode == 0: + runnables.append(key) return runnables def main(): tests=get_tests("test_list") diff --git a/test/LLNL/openmp5.0-tests/xfail-list b/test/LLNL/openmp5.0-tests/xfail-list new file mode 100644 index 000000000..e1a5abf68 --- /dev/null +++ b/test/LLNL/openmp5.0-tests/xfail-list @@ -0,0 +1 @@ +test_imperfect_loop run diff --git a/test/smoke-fails/imperfect-loop-collapse-usm/Makefile b/test/smoke-fails/imperfect-loop-collapse-usm/Makefile new file mode 100644 index 000000000..7b09b6a44 --- /dev/null +++ b/test/smoke-fails/imperfect-loop-collapse-usm/Makefile @@ -0,0 +1,25 @@ +include ../../Makefile.defs + +TESTNAME = imperfect_loop_collapse_usm +TESTSRC_MAIN = imperfect_loop_collapse_usm.cpp +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) + +CLANG ?= clang++ +OMP_BIN = $(AOMP)/bin/$(CLANG) +CC = $(OMP_BIN) $(VERBOSE) + +HSA_XNACK ?= 1 +SUPPORTED = $(SUPPORTS_USM) + +# Our "run" target gets overridden. Make sure we run with HSA_XNACK set +# appropriately. +RUNENV += HSA_XNACK=${HSA_XNACK} + +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules + +run: + HSA_XNACK=${HSA_XNACK} ./$(TESTNAME) diff --git a/test/smoke-fails/imperfect-loop-collapse-usm/imperfect_loop_collapse_usm.cpp b/test/smoke-fails/imperfect-loop-collapse-usm/imperfect_loop_collapse_usm.cpp new file mode 100644 index 000000000..4be83e0a5 --- /dev/null +++ b/test/smoke-fails/imperfect-loop-collapse-usm/imperfect_loop_collapse_usm.cpp @@ -0,0 +1,35 @@ +#include + +#define N 1024 + +#pragma omp requires unified_shared_memory + +int main() { + double *a = new double[N*N]; + + #pragma omp parallel for collapse(2) + for(int i = 0; i < N; i++) + for(int j = 0; j < N; j++) + a[i*N+j] = (double) (i*N+j); + + #pragma omp target teams distribute parallel for collapse(2) + for(int i = 0; i < N; i++) { + double k = i*3.14; + for(int j = 0; j < N; j++) + a[i*N+j] += k; + } + + //check + int err = 0; + for(int i = 0; i < N; i++) { + double k = i*3.14; + for(int j = 0; j < N; j++) + if (a[i*N+j] != (double) (i*N+j) + k) { + err++; + printf("Error at (%d,%d): got %lf expected %lf\n", i, j, a[i*N+j], (double) (i*N+j) + k); + if (err > 10) return err; + } + } + + return err; +} diff --git a/test/smoke-fails/imperfect-loop-collapse/Makefile b/test/smoke-fails/imperfect-loop-collapse/Makefile index eb0665a22..7edc5fa32 100644 --- a/test/smoke-fails/imperfect-loop-collapse/Makefile +++ b/test/smoke-fails/imperfect-loop-collapse/Makefile @@ -9,13 +9,10 @@ CLANG ?= clang++ OMP_BIN = $(AOMP)/bin/$(CLANG) CC = $(OMP_BIN) $(VERBOSE) -HSA_XNACK ?= 1 -SUPPORTED = $(SUPPORTS_USM) - #-ccc-print-phases #"-\#\#\#" include ../Makefile.rules run: - HSA_XNACK=${HSA_XNACK} ./$(TESTNAME) + ./$(TESTNAME) diff --git a/test/smoke-fails/imperfect-loop-collapse/imperfect_loop_collapse.cpp b/test/smoke-fails/imperfect-loop-collapse/imperfect_loop_collapse.cpp index 4be83e0a5..11818bb4b 100644 --- a/test/smoke-fails/imperfect-loop-collapse/imperfect_loop_collapse.cpp +++ b/test/smoke-fails/imperfect-loop-collapse/imperfect_loop_collapse.cpp @@ -2,8 +2,6 @@ #define N 1024 -#pragma omp requires unified_shared_memory - int main() { double *a = new double[N*N]; @@ -12,7 +10,8 @@ int main() { for(int j = 0; j < N; j++) a[i*N+j] = (double) (i*N+j); - #pragma omp target teams distribute parallel for collapse(2) + #pragma omp target teams distribute parallel for collapse(2) \ + map(tofrom: a[0:N*N]) for(int i = 0; i < N; i++) { double k = i*3.14; for(int j = 0; j < N; j++)