Skip to content

Commit 5a0e8fd

Browse files
committed
test: add simple MPI scaling script to src/test/scaling
Problem: A reusable script to drive MPI scaling tests has been written but is not available so it can be conveniently reused. Add src/test/scaling/mpi-scale.sh - a script that uses the timing mode of t/mpi/hello to generate a table of MPI init/barrier/finalize timing results as the number of tasks scale up.
1 parent 7d11ecc commit 5a0e8fd

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/test/scaling/mpi-scale.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
##############################################################
3+
# Copyright 2024 Lawrence Livermore National Security, LLC
4+
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
5+
#
6+
# This file is part of the Flux resource manager framework.
7+
# For details, see https://github.com/flux-framework.
8+
#
9+
# SPDX-License-Identifier: LGPL-3.0
10+
##############################################################
11+
12+
NNODES=$(flux resource list -no {nnodes})
13+
NCORES=$(flux resource list -no {ncores})
14+
CPN=$((${NCORES}/${NNODES}))
15+
16+
printf "MPI scale testing on ${LCSCHEDCLUSTER:-$(hostname)}\n"
17+
printf "TIME: $(date -Is)\n"
18+
printf "INFO: $(flux resource info)\n"
19+
printf "TOPO: $(flux getattr tbon.topo)\n"
20+
printf "\n"
21+
printf "%6s %8s %14s %14s %14s %14s\n" NODES NTASKS INIT BARRIER FINALIZE TOTAL
22+
23+
seq2()
24+
{
25+
local start=$1
26+
local end=$2
27+
local printend=1
28+
29+
while [[ $start -lt $end ]]; do
30+
printf "$start\n"
31+
[[ $start = $end ]] && printend=0
32+
((start*=2))
33+
done
34+
[[ $printend = 1 ]] && printf "$end\n"
35+
}
36+
37+
flux bulksubmit --watch --progress --quiet --nodes={0} --tasks-per-node={1} \
38+
--exclusive \
39+
--env=FLUX_MPI_TEST_TIMING=t \
40+
./t/mpi/hello \
41+
::: $(seq2 1 ${NNODES}) \
42+
::: $(seq2 1 ${CPN})
43+
44+
# vi: ts=4 sw=4 expandtab

0 commit comments

Comments
 (0)