|
20 | 20 | my $runall = 0;
|
21 | 21 | my $rawoutput = 0;
|
22 | 22 | my $myresults = "myresults";
|
| 23 | +my $ppn = 1; |
23 | 24 | my @csvrow;
|
24 | 25 |
|
25 | 26 | my @tests = qw(/bin/true ./orte_no_op ./mpi_no_op ./mpi_no_op ./mpi_no_op);
|
26 | 27 | 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");
|
27 |
| -my @starters = qw(mpirun orterun srun aprun); |
28 |
| -my @starteroptions = ("--pernode --novm", |
29 |
| - "--hnp file:dvm_uri --pernode", |
30 |
| - "--distribution=cyclic", |
31 |
| - "-N 1"); |
| 28 | +my @starterlist = qw(mpirun orterun srun aprun); |
| 29 | +my @starteroptionlist = ("--novm", |
| 30 | + "--hnp file:dvm_uri", |
| 31 | + "--distribution=cyclic -N", |
| 32 | + "-N"); |
32 | 33 |
|
33 | 34 | # Set to true if the script should merely print the cmds
|
34 | 35 | # it would run, but don't run them
|
|
51 | 52 | "all" => \$runall,
|
52 | 53 | "results=s" => \$myresults,
|
53 | 54 | "rawout" => \$rawoutput,
|
| 55 | + "ppn=s" => \$ppn, |
54 | 56 | ) or die "unable to parse options, stopped";
|
55 | 57 |
|
56 | 58 | if ($HELP) {
|
|
60 | 62 | --quiet | -q Only output critical messages to stdout
|
61 | 63 | --showme Show the actual commands without executing them
|
62 | 64 | --reps=s Number of times to run each test (for statistics)
|
63 |
| ---mpirun Use only mpirun (or its equivalent orterun) |
64 |
| ---dvm Use only orte-dvm to execute the test |
65 |
| ---srun Use only srun (if available) to execute the test |
66 |
| ---arpun Use only aprun (if available) to execute the test |
| 65 | +--mpirun Use mpirun (or its equivalent orterun) |
| 66 | +--dvm Use orte-dvm to execute the test |
| 67 | +--srun Use srun (if available) to execute the test |
| 68 | +--arpun Use aprun (if available) to execute the test |
67 | 69 | --myapp=s In addition to the standard tests, run this specific application (including any args)
|
68 | 70 | --all Use all available start commands [default]
|
69 | 71 | --results=file File where results are to stored in comma-separated value format
|
70 | 72 | --rawout Provide raw timing output to the file
|
| 73 | +--ppn=n Run n procs/node |
71 | 74 | ";
|
72 | 75 | exit(0);
|
73 | 76 | }
|
|
84 | 87 | my $idx;
|
85 | 88 | my $option;
|
86 | 89 | my $havedvm = 0;
|
| 90 | +my @starters; |
| 91 | +my @starteroptions; |
| 92 | + |
| 93 | +# if they asked for all, then set all starters to requested |
| 94 | +if ($runall) { |
| 95 | + $useaprun = 1; |
| 96 | + $usempirun = 1; |
| 97 | + $usesrun = 1; |
| 98 | + $usedvm = 1; |
| 99 | +} |
87 | 100 |
|
88 | 101 | # see which starters are available
|
89 | 102 | my @path = split(":", $ENV{PATH});
|
90 | 103 | my $exists = 0;
|
| 104 | +my $opt; |
91 | 105 | $idx=0;
|
92 |
| -while ($idx <= $#starters) { |
93 |
| - $starter = $starters[$idx]; |
| 106 | +foreach $starter (@starterlist) { |
94 | 107 | $exists = 0;
|
95 | 108 | foreach my $path (@path) {
|
96 | 109 | if ( -x "$path/$starter") {
|
97 | 110 | $exists = 1;
|
98 | 111 | last;
|
99 | 112 | }
|
100 | 113 | }
|
101 |
| - unless ($exists) { |
102 |
| - # remove this one from the list |
103 |
| - splice @starters, $idx, 1; |
104 |
| - splice @starteroptions, $idx, 1; |
105 |
| - # adjust the index |
106 |
| - $idx = $idx - 1; |
107 |
| - } elsif ($usedvm && $starter ne "orterun") { |
108 |
| - # remove this one from the list |
109 |
| - splice @starters, $idx, 1; |
110 |
| - splice @starteroptions, $idx, 1; |
111 |
| - # adjust the index |
112 |
| - $idx = $idx - 1; |
113 |
| - } elsif ($usesrun && $starter ne "srun") { |
114 |
| - # remove this one from the list |
115 |
| - splice @starters, $idx, 1; |
116 |
| - splice @starteroptions, $idx, 1; |
117 |
| - # adjust the index |
118 |
| - $idx = $idx - 1; |
119 |
| - } elsif ($useaprun && $starter ne "aprun") { |
120 |
| - # remove this one from the list |
121 |
| - splice @starters, $idx, 1; |
122 |
| - splice @starteroptions, $idx, 1; |
123 |
| - # adjust the index |
124 |
| - $idx = $idx - 1; |
125 |
| - } elsif ($usempirun && $starter ne "mpirun") { |
126 |
| - # remove this one from the list |
127 |
| - splice @starters, $idx, 1; |
128 |
| - splice @starteroptions, $idx, 1; |
129 |
| - # adjust the index |
130 |
| - $idx = $idx - 1; |
| 114 | + if ($exists) { |
| 115 | + if ($usedvm && $starter eq "orterun") { |
| 116 | + push @starters, $starter; |
| 117 | + $opt = $starteroptionlist[$idx] . " --npernode " . $ppn; |
| 118 | + push @starteroptions, $opt; |
| 119 | + } elsif ($usempirun && $starter eq "mpirun") { |
| 120 | + push @starters, $starter; |
| 121 | + $opt = $starteroptionlist[$idx] . " --npernode " . $ppn; |
| 122 | + push @starteroptions, $opt; |
| 123 | + } elsif ($useaprun && $starter eq "aprun") { |
| 124 | + push @starters, $starter; |
| 125 | + $opt = $starteroptionlist[$idx] . " " . $ppn; |
| 126 | + push @starteroptions, $opt; |
| 127 | + } elsif ($usesrun && $starter eq "srun") { |
| 128 | + push @starters, $starter; |
| 129 | + $opt = $starteroptionlist[$idx] . " " . $ppn; |
| 130 | + push @starteroptions, $opt; |
| 131 | + } |
131 | 132 | }
|
132 | 133 | $idx = $idx + 1;
|
133 | 134 | }
|
|
150 | 151 |
|
151 | 152 | # determine the number of nodes - doesn't
|
152 | 153 | # matter which starter we use
|
153 |
| -$cmd = $starters[0] . " " . $starteroptions[0] . " hostname"; |
154 |
| -print "CMD: $cmd\n"; |
| 154 | +$cmd = "mpirun --novm --pernode hostname"; |
155 | 155 | $output = `$cmd`;
|
156 |
| -print "$output\n"; |
157 | 156 | @lines = split(/\n/, $output);
|
158 | 157 | $num_nodes = $#lines + 1;
|
159 | 158 |
|
160 |
| -# collect the complete list of starters |
161 |
| -my $mystarters; |
162 |
| -$idx=1; |
163 |
| -$mystarters = $starters[0]; |
164 |
| -while ($idx < $#starters) { |
165 |
| - $mystarters = $mystarters . "," . $starters[$idx]; |
166 |
| - $idx = $idx + 1; |
167 |
| -} |
168 |
| - |
169 | 159 | # get the local date and time
|
170 | 160 | my ($sec,$min,$hour,$day,$month,$yr19,@rest) = localtime(time);
|
171 | 161 |
|
| 162 | +my $pstarts = join(", ", @starters); |
172 | 163 | # start by printing out the resulting configuration
|
173 | 164 | print "\n--------------------------------------------------\n";
|
174 | 165 | print "\nTest configuration:\n";
|
175 | 166 | print "\tDate:\t" . "$day-".++$month. "-".($yr19+1900) . " " . sprintf("%02d",$hour).":".sprintf("%02d",$min).":".sprintf("%02d",$sec) . "\n";;
|
176 | 167 | print "\tNum nodes:\t" . $num_nodes . "\n";
|
177 |
| -print "\tStarters:\t" . $mystarters . "\n"; |
| 168 | +print "\tStarters:\t" . $pstarts . "\n"; |
178 | 169 | print "\n--------------------------------------------------\n";
|
179 | 170 |
|
180 | 171 | # and tag the output file as well
|
181 | 172 | if ($myresults) {
|
182 | 173 | print FILE "Test configuration:\n";
|
183 | 174 | print FILE "Date:\t" . "$day-".++$month. "-".($yr19+1900) . " " . sprintf("%02d",$hour).":".sprintf("%02d",$min).":".sprintf("%02d",$sec) . "\n";;
|
184 | 175 | print FILE "Num nodes:\t" . $num_nodes . "\n";
|
185 |
| - print FILE "Starters:\t" . $mystarters . "\n"; |
| 176 | + print FILE "Starters:\t" . $pstarts . "\n"; |
186 | 177 | }
|
187 | 178 |
|
188 | 179 | my $index = 0;
|
|
268 | 259 | }
|
269 | 260 |
|
270 | 261 | foreach $starter (@starters) {
|
| 262 | + print "STARTER: $starter\n"; |
271 | 263 | # if we are going to use the dvm, then we
|
272 | 264 | if ($starter eq "orterun") {
|
273 | 265 | # need to start it
|
|
289 | 281 | }
|
290 | 282 |
|
291 | 283 | if ($myresults) {
|
292 |
| - print FILE "$starter\n\n"; |
| 284 | + print FILE "$starter $starteroptions[$index]\n\n"; |
293 | 285 | }
|
294 | 286 | my $testnum = 0;
|
295 | 287 | foreach $test (@tests) {
|
|
306 | 298 | $n = 1;
|
307 | 299 | while ($n <= $num_nodes) {
|
308 | 300 | push @csvrow,$n;
|
309 |
| - $cmd = "time " . $starter . " " . $starteroptions[$index] . " -n $n $option $test 2>&1"; |
| 301 | + $cmd = "time " . $starter . " " . $starteroptions[$index] . " $option $test 2>&1"; |
310 | 302 | print $cmd . "\n";
|
311 | 303 | if (!$SHOWME) {
|
312 | 304 | runcmd();
|
|
0 commit comments