Skip to content
Snippets Groups Projects
Commit d260fac5 authored by Morris Jette's avatar Morris Jette
Browse files

Bug fixes in srun2aprun wrapper for quoted options

This fixes the parsing in the srun wrapper for aprun (Cray systems)
when arguments on the command line are quoted. Fixes Cray bugs
774536 and 774544
parent 4224c25c
No related branches found
No related tags found
No related merge requests found
...@@ -198,11 +198,16 @@ foreach (keys %ENV) { ...@@ -198,11 +198,16 @@ foreach (keys %ENV) {
# Make fully copy of execute line. This is needed only so that srun can run # Make fully copy of execute line. This is needed only so that srun can run
# again and get the job's memory allocation for aprun (which is not available # again and get the job's memory allocation for aprun (which is not available
# until after the allocation has been made. # until after the allocation has been made). Add quotes if an argument contains
# spaces (e.g. --alps="-r 1" needs to be treadted as a single argument).
my ($i, $len, $orig_exec_line); my ($i, $len, $orig_exec_line);
if ($ARGV[0]) { if ($ARGV[0]) {
foreach (@ARGV) { foreach (@ARGV) {
$orig_exec_line .= "$_ "; if (index($_, " ") == -1) {
$orig_exec_line .= "$_ ";
} else {
$orig_exec_line .= "\"$_\" ";
}
} }
} }
...@@ -344,7 +349,7 @@ my %node_opts; ...@@ -344,7 +349,7 @@ my %node_opts;
my $command; my $command;
if ($have_job == 0) { if ($have_job == 0) {
for ($memory_per_cpu) { if ($memory_per_cpu) {
$i = index($memory_per_cpu, "hs"); $i = index($memory_per_cpu, "hs");
if ($i >= 0) { if ($i >= 0) {
$memory_per_cpu = substr($memory_per_cpu, 0, $i); $memory_per_cpu = substr($memory_per_cpu, 0, $i);
......
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