Skip to content
Snippets Groups Projects
Commit 1a6286cf authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Streamline test and make more compatible with proctrack/linuxproc

parent 4a636447
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ source ./globals ...@@ -36,7 +36,7 @@ source ./globals
set test_id "1.46" set test_id "1.46"
set exit_code 0 set exit_code 0
set file_in "test$test_id.input" set file_in "test$test_id.prog"
set matches 0 set matches 0
print_header $test_id print_header $test_id
...@@ -45,19 +45,29 @@ print_header $test_id ...@@ -45,19 +45,29 @@ print_header $test_id
# Delete left-over input script # Delete left-over input script
# Build input script file # Build input script file
# #
# We have multiple sleep commands because if using proctrack/linuxproc, # We have the last of the tasks exit. proctrack/linuxproc will not
# the first sleep will be killed before the shell, which would # signal processes named "slurmstepd" and later user tasks could still
# immediately execute the echo. # be named "slurmstepd" when the termination signal comes in.
# #
exec $bin_rm -f $file_in exec $bin_rm -f $file_in
exec echo "#!$bin_bash" >$file_in set fd [open "$file_in.c" w]
exec echo "if ((\$SLURM_PROCID== 1))" >>$file_in puts $fd {
exec echo " then exit 2" >>$file_in #include <stdio.h>
exec echo "fi" >>$file_in #include <stdlib.h>
exec echo "$bin_sleep 4" >>$file_in #include <unistd.h>
exec echo "$bin_sleep 4" >>$file_in
exec echo "$bin_sleep 4" >>$file_in main()
exec echo "$bin_echo SHOULD_NOT_BE_HERE" >>$file_in {
char *id = getenv("SLURM_PROCID");
if (atoi(id) == 9) {
exit(2);
}
sleep(15);
printf("SHOULD_NOT_BE_HERE\n");
}
}
close $fd
exec $bin_make -f /dev/null $file_in
exec $bin_chmod 700 $file_in exec $bin_chmod 700 $file_in
# #
...@@ -92,6 +102,7 @@ if {$matches != 1} { ...@@ -92,6 +102,7 @@ if {$matches != 1} {
} }
if {$exit_code == 0} { if {$exit_code == 0} {
exec $bin_rm -f $file_in exec $bin_rm -f $file_in
#exec $bin_rm -f $file_in.c
send_user "\nSUCCESS\n" send_user "\nSUCCESS\n"
} }
exit $exit_code exit $exit_code
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment