From 9f6b1da05797f744293db0759702eef8d3f1fb83 Mon Sep 17 00:00:00 2001 From: degomme Date: Sun, 13 Nov 2016 12:11:19 -0700 Subject: [PATCH] get rid of most of the awfully slow cut commands in smpirun. Those for smpi_replay are still here, though, as the set solution only works one list at a time. Let's hope this works everywhere. --- src/smpi/smpirun.in | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 80611b075c..ff707818fa 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -406,22 +406,24 @@ else done fi +set -- $hostnames ##---- generate tags------------------------------ for i in ${SEQ} do if [ -n "${HOSTFILE}" ]; then - j=$(( $i % ${NUMHOSTS} + 1 )) + j=$(( $i % ${NUMHOSTS} + 1 )) + fi + + host=$(eval "echo \${$j}") + + if [ -z $host ]; then + host="host"$($j) fi ##---- optional display of ranks to process mapping if [ -n "${MAPOPT}" ]; then - echo "[rank $i] -> $(echo $hostnames|cut -d' ' -f$j)" + echo "[rank $i] -> $host" fi - if [ -z "$(echo $hostnames|cut -d' ' -f$j)" ]; then - host="host"$($j) - else - host="$(echo $hostnames|cut -d' ' -f$j)" - fi echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} echo " " >> ${APPLICATIONTMP} -- 2.20.1