Using the mpirun_dbg.idb Startup File

The latest mpich distribution should come with the idb startup file mpirun_dbg.idb. If it does not, or if you are using an older distribution of mpich, you can create the idb startup file by saving the following script as mpirun_dbg.idb in the directory in which mpirun resides:

 

#! /bin/sh

cmdLineArgs=""

p4pgfile=""

p4workdir=""

prognamemain=""

p4ssport=""

processedCmdLineArgs=""

#

# Extract -p4ssport info from the string passed in via -cmdlineargs.

#

function processCmdLineArgs()

{

    while [ 1 -le $# ] ; do

        arg=$1

        shift

        case $arg in

            -p4ssport)

               p4ssport="-p4ssport $1"

               shift

               ;;

            *)

               processedCmdLineArgs="$processedCmdLineArgs $arg"

               ;;

esac

    done

}

while [ 1 -le $# ] ; do

  arg=$1

  shift

  case $arg in

     -cmdlineargs)

        cmdLineArgs="$1"

        shift

;;

     -p4pg)

        p4pgfile="$1"

shift

;;

     -p4wd)

        p4workdir="$1"

shift

;;

     -progname)

        prognamemain="$1"

shift

;;

  esac

done

#

#

# Need to `eval echo $cmdLineArgs` to undo evil quoting done in mpirun.args

#

processCmdLineArgs `eval echo $cmdLineArgs`

#

if [ -n "$IDB_HOME" ] ; then

    ldbdir=$IDB_HOME

    idb=$ldbdir/idb

    if [ -f $ldbdir/idb.cat ] && [ -r $ldbdir/idb.cat ] ; then

      if [ -n "$NLSPATH" ];  then

 nlsmore=$NLSPATH

      else

 nlsmore=""

      fi

      NLSPATH=$ldbdir/$nlsmore

    fi

else

    idb="idb"

fi

#

$idb -parallel $prognamemain -p4pg $p4pgfile -p4wd $p4workdir -mpichtv $p4ssport $processedCmdLineArgs