From a0a70c13378fe9c7d2c2ed795682ced239965b94 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Tue, 10 Aug 2004 03:35:17 +0000 Subject: [PATCH] * Per conversations with Dennis today, make the last ssh wait until the app exits so that mpirun doesn't return until the app exits. Of course, this will force a cntl-c if the app hangs and still does no cleanup. But should prevent a flood of MPI apps when a test suite is run. This commit was SVN r1996. --- src/tools/mpirun/mpirun | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/tools/mpirun/mpirun b/src/tools/mpirun/mpirun index b9ee338ada..350a752405 100755 --- a/src/tools/mpirun/mpirun +++ b/src/tools/mpirun/mpirun @@ -149,11 +149,16 @@ do_prep_environ() { do_start_proc() { local rmt_hostname=$1 ; shift local rmt_vpid=$1 ; shift + local should_wait=$1 ; shift local argv="$*" local rmt_boot="${ompi_mydir}/mpiboot" local cmd="" - cmd="ssh ${rmt_hostname} -f -n ${rmt_boot} " + cmd="ssh ${rmt_hostname}" + if test "$should_wait" = "0" ; then + cmd="${cmd} -f " + fi + cmd="${cmd} -n ${rmt_boot} " cmd="${cmd} -cellid 1 -jobid ${ompi_jobid} -procid ${rmt_vpid}" cmd="${cmd} -numprocs ${ompi_numprocs}" cmd="${cmd} -pwd ${ompi_cwd} ${ompi_prepped}" @@ -172,6 +177,7 @@ do_start_proc() { cmd="${cmd} -commdir ${OMPI_MCA_oob_cofs_dir}" fi cmd="${cmd} -- ${argv}" + debug_echo "executing: ${cmd}" ${cmd} } @@ -227,13 +233,17 @@ launch_procs() { do_prep_environ - for (( i=0 ; i < ${ompi_numprocs} ; i++)) ; do - do_start_proc "${1}" "${i}" "${args}" + # do N - 1 procs in the loop not waiting around + for (( i=0 ; i < ${ompi_numprocs} - 1 ; i++)) ; do + do_start_proc "${1}" "${i}" "0" "${args}" shift if test -z "${1}" ; then set -- ${ompi_hosts} fi done + + # do the Nth proc and wait around + do_start_proc "${1}" "${i}" "1" "${args}" }