Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand EX correctness testing #26776

Merged
merged 6 commits into from
Feb 25, 2025
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
9 changes: 9 additions & 0 deletions test/runtime/configMatters/launch/slurm.skipif
Original file line number Diff line number Diff line change
@@ -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")
5 changes: 5 additions & 0 deletions test/runtime/configMatters/launch/slurm/hello.chpl
Original file line number Diff line number Diff line change
@@ -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=" ");
4 changes: 4 additions & 0 deletions test/runtime/configMatters/launch/slurm/hello.good
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/runtime/configMatters/launch/slurm/hello.notest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tested by the sub_test script
62 changes: 62 additions & 0 deletions test/runtime/configMatters/launch/slurm/sub_test
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 6 additions & 1 deletion util/cron/test-hpe-cray-ex-ofi.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}