From: degomme Date: Sun, 13 Nov 2016 19:11:19 +0000 (-0700) Subject: get rid of most of the awfully slow cut commands in smpirun. X-Git-Tag: v3_14~207^2~4 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9f6b1da05797f744293db0759702eef8d3f1fb83?ds=sidebyside 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. --- 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}