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...
##---- cache hostnames of hostfile---------------
if [ -n "${HOSTFILE}" ] && [ -f ${HOSTFILE} ]; then
hostnames=$(cat ${HOSTFILE} | tr '\n\r' ' ')
##---- 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
fi
if [ "${EXTOPT}" = "smpi_replay" ]; then
- j=$(( $i % ${NUMHOSTS} + 1 ))
+ j=$(( $i % ${hostfile_procs} + 1 ))
host=$(eval "echo \${$j}")
##---- optional display of ranks to process mapping
host=$(eval "echo \${$j}")
##---- optional display of ranks to process mapping