From 6e345d96f2ced55659143c55b3dbed8c9b710ea0 Mon Sep 17 00:00:00 2001 From: Xavier Pillons Date: Mon, 30 Mar 2020 14:18:51 +0200 Subject: [PATCH] added half option to test 1 to all --- apps/imb-mpi/ringpingpong.sh | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/apps/imb-mpi/ringpingpong.sh b/apps/imb-mpi/ringpingpong.sh index a1481e24..11a7d1e9 100755 --- a/apps/imb-mpi/ringpingpong.sh +++ b/apps/imb-mpi/ringpingpong.sh @@ -1,5 +1,6 @@ #!/bin/bash MPI=$1 +MODE=${2-ring} set -o pipefail source /etc/profile module use /usr/share/Modules/modulefiles @@ -54,15 +55,31 @@ sort -u $PBS_NODEFILE > $hostlist # remove .internal.cloudapp.net from node names sed -i 's/.internal.cloudapp.net//g' $hostlist -src=$(tail -n 1 $hostlist) -# -msglog 9:10 is for 512 and 1024 bytes message size only -for dst in $(<$hostlist); do - mpirun $host_option $src,$dst \ - $mpi_options $numactl_options \ - $IMB_ROOT/IMB-MPI1 PingPong -msglog 9:10 > ${src}_to_${dst}_ringpingpong.$PBS_JOBID.log - src=$dst -done - +case $MODE in + ring) # one to neighbour + src=$(tail -n 1 $hostlist) + # -msglog 9:10 is for 512 and 1024 bytes message size only + for dst in $(<$hostlist); do + mpirun $host_option $src,$dst \ + $mpi_options $numactl_options \ + $IMB_ROOT/IMB-MPI1 PingPong -msglog 9:10 > ${src}_to_${dst}_ringpingpong.$PBS_JOBID.log + src=$dst + done + ;; + half) # one to each one way + cp $hostlist desthosts.$PBS_JOBID + for src in $(<$hostlist); do + # delete the first line + sed -i '1d' desthosts.$PBS_JOBID + for dst in $( ${src}_to_${dst}_ringpingpong.$PBS_JOBID.log + done + done + rm desthosts.$PBS_JOBID + ;; +esac # clean up rm $hostlist