diff --git a/test/runtime/configMatters/launch/slurm.skipif b/test/runtime/configMatters/launch/slurm.skipif new file mode 100755 index 000000000000..38a2a26c2c93 --- /dev/null +++ b/test/runtime/configMatters/launch/slurm.skipif @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os + +launcher = os.getenv('CHPL_LAUNCHER', 'none') +if 'slurm' not in launcher: + print("True") +else: + print("False") diff --git a/test/runtime/configMatters/launch/slurm/hello.chpl b/test/runtime/configMatters/launch/slurm/hello.chpl new file mode 100644 index 000000000000..4a6918716042 --- /dev/null +++ b/test/runtime/configMatters/launch/slurm/hello.chpl @@ -0,0 +1,5 @@ +config const numTasks = 2; +for l in Locales do + on l do + for tid in 0..#numTasks do + writeln("Hello from task", tid, "on locale", here.id, sep=" "); diff --git a/test/runtime/configMatters/launch/slurm/hello.good b/test/runtime/configMatters/launch/slurm/hello.good new file mode 100644 index 000000000000..109c88964be9 --- /dev/null +++ b/test/runtime/configMatters/launch/slurm/hello.good @@ -0,0 +1,4 @@ +Hello from task 0 on locale 0 +Hello from task 1 on locale 0 +Hello from task 0 on locale 1 +Hello from task 1 on locale 1 diff --git a/test/runtime/configMatters/launch/slurm/hello.notest b/test/runtime/configMatters/launch/slurm/hello.notest new file mode 100644 index 000000000000..4078374a8f55 --- /dev/null +++ b/test/runtime/configMatters/launch/slurm/hello.notest @@ -0,0 +1 @@ +Tested by the sub_test script diff --git a/test/runtime/configMatters/launch/slurm/sub_test b/test/runtime/configMatters/launch/slurm/sub_test new file mode 100755 index 000000000000..5d08052fe24d --- /dev/null +++ b/test/runtime/configMatters/launch/slurm/sub_test @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +import os +import subprocess as sp +import sys + +def main(): + print("[Starting subtest]") + d = os.path.dirname(os.path.abspath(__file__)) + chpl_home = os.getenv("CHPL_HOME") + if chpl_home is None: + print("[Error: CHPL_HOME not set]") + sys.exit(1) + + bin_subdir=sp.check_output([os.path.join(chpl_home, "util", "chplenv", "chpl_bin_subdir.py")], encoding='utf-8').strip() + chpl = os.path.join(chpl_home, "bin", bin_subdir, "chpl") + + # force this test to use sbatch + os.environ["CHPL_LAUNCHER_USE_SBATCH"] = "true" + + # compile hello.chpl and run it using chpl_launchcmd + ret = sp.call([chpl, "-o", "hello", "hello.chpl"]) + if ret != 0: + print("[Error compiling hello.chpl]") + sys.exit(1) + + launchcmd = os.path.join(chpl_home, "util", "test", "chpl_launchcmd.py") + outfile = os.path.join(d, "hello.exec.tmp") + with open(outfile, "w") as f: + ret = sp.call([launchcmd, "./hello", "-nl", "2"], stdout=f, stderr=sp.STDOUT) + if ret != 0: + print("[Error running hello.chpl]") + sys.exit(1) + + # check that the output is as expected + goodfile = os.path.join(d, "hello.good") + ret = sp.call(["diff", goodfile, outfile]) + if ret != 0: + print("[Error matching good file]") + sys.exit(1) + + print("[Success matching hello.chpl output]") + + print("[Finished subtest {}]".format(d)) + +def cleanup(ret): + def rm(file): + try: + os.unlink(file) + except: + pass + + rm("hello") + # only delete good file on success + if ret == 0: + rm("hello.exec.tmp") + +if __name__ == "__main__": + ret = main() + cleanup(ret) + + sys.exit(ret) diff --git a/util/cron/test-hpe-cray-ex-ofi.bash b/util/cron/test-hpe-cray-ex-ofi.bash index a06d7ec4531f..d2c2ef28c459 100755 --- a/util/cron/test-hpe-cray-ex-ofi.bash +++ b/util/cron/test-hpe-cray-ex-ofi.bash @@ -11,4 +11,9 @@ export CHPL_NIGHTLY_TEST_CONFIG_NAME="hpe-cray-ex-ofi" export CHPL_RT_COMM_OFI_EXPECTED_PROVIDER="cxi" export CHPL_RT_MAX_HEAP_SIZE=16g -$UTIL_CRON_DIR/nightly -cron -examples -blog ${nightly_args} + +# test a small subset of all tests due to limited resources +# ideally, we should run the whole suite +export CHPL_NIGHTLY_TEST_DIRS="release/examples/ runtime/configMatters/ multilocale/" + +$UTIL_CRON_DIR/nightly -cron -blog ${nightly_args}