From 31bce4ba9cebea2306d59dc1eec3284c0db97817 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Fri, 13 Oct 2017 18:23:18 -0700 Subject: [PATCH] Update the scaling.pl script * check that the command succeeds when pre-positioning the file to ensure there isn't an error somewhere in the execution * properly define srun cmd line options * terminate the orte-dvm only when it is actually in operation so prun doesn't generate spurious error messages Signed-off-by: Ralph Castain --- contrib/scaling/scaling.pl | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/contrib/scaling/scaling.pl b/contrib/scaling/scaling.pl index 6b501953823..9d0a26cb3be 100755 --- a/contrib/scaling/scaling.pl +++ b/contrib/scaling/scaling.pl @@ -26,10 +26,10 @@ my @tests = qw(/bin/true ./orte_no_op ./mpi_no_op ./mpi_no_op ./mpi_no_op); my @options = ("", "", "", "-mca mpi_add_procs_cutoff 0 -mca pmix_base_async_modex 1", "-mca mpi_add_procs_cutoff 0 -mca pmix_base_async_modex 1 -mca async_mpi_init 1 -mca async_mpi_finalize 1"); my @starterlist = qw(mpirun prun srun aprun); -my @starteroptionlist = ("--novm", +my @starteroptionlist = (" --novm", "", - "--distribution=cyclic -N", - "-N"); + " --distribution=cyclic --ntasks-per-node=", + " -N"); # Set to true if the script should merely print the cmds # it would run, but don't run them @@ -130,7 +130,7 @@ push @starteroptions, $opt; } elsif ($usesrun && $starter eq "srun") { push @starters, $starter; - $opt = $starteroptionlist[$idx] . " " . $ppn; + $opt = $starteroptionlist[$idx] . $ppn; push @starteroptions, $opt; } } @@ -277,6 +277,10 @@ () } # give it a couple of seconds to start sleep 2; + } else { + if ($myresults) { + print FILE "\n\n"; + } } if ($myresults) { @@ -292,7 +296,15 @@ () if (!$SHOWME) { # pre-position the executable $cmd = $starter . $starteroptions[$index] . " $test 2>&1"; - system($cmd); + my $error; + $error = system($cmd); + if (0 != $error) { + if ($myresults) { + print FILE "Command $cmd returned error $error\n"; + $testnum = $testnum + 1; + next; + } + } } $n = 1; while ($n <= $num_nodes) { @@ -321,12 +333,18 @@ () print "\n--------------------------------------------------\n"; } $testnum = $testnum + 1; + if ($starter eq "srun" or $starter eq "aprun") { + if ($testnum ge 3) { + last; + } + } } if ($havedvm) { if (!$SHOWME) { $cmd = "prun --terminate"; system($cmd); } + $havedvm = 0; } $index = $index + 1; }