From 22ad42bc0e39c33058fa8f47d3b41966a45ffa80 Mon Sep 17 00:00:00 2001 From: degomme Date: Mon, 13 Feb 2017 15:07:00 +0100 Subject: [PATCH 1/1] Fix for [#136] on github. We say clearly "# Don't use wc -l to compute it to avoid issues with trailing \n at EOF" But then we used it anyway... --- src/smpi/smpirun.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 07ba044bcb..65b9c1b11f 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -384,7 +384,6 @@ APPLICATIONHEAD ##---- cache hostnames of hostfile--------------- if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then hostnames=$(cat ${HOSTFILE} | tr '\n\r' ' ') - NUMHOSTS=$(cat ${HOSTFILE} | wc -l) fi if [ "${EXTOPT}" = "smpi_replay" ]; then @@ -428,7 +427,7 @@ done for i in ${SEQ} do - j=$(( $i % ${NUMHOSTS} + 1 )) + j=$(( $i % ${hostfile_procs} + 1 )) host=$(eval "echo \${$j}") ##---- optional display of ranks to process mapping -- 2.20.1