File: mpirun.ch_shmem.in

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (101 lines) | stat: -rwxr-xr-x 3,104 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#! /bin/sh
if [ "$MPIR_HOME" = "" ] ; then 
    MPIR_HOME=#MPIR_HOME#
fi
if [ "$MPIR_HOME" = "#""MPIR_HOME""#" ] ; then
    MPIR_HOME=`pwd`/..
fi
if [ "#MPIRUN_BIN#" = "#""MPIRUN_BIN""#" ] ; then 
    MPIRUN_HOME=$MPIR_HOME/bin
else
    MPIRUN_HOME=$MPIR_HOME/#MPIRUN_BIN#
fi
if [ "$argsset" = "" ] ; then
   . $MPIRUN_HOME/mpirun.args
   argsset=1
fi
# ch_shmem device
#
# Pass to mpirun that this is a shared memory device.  Since there
# may be several, try using the default value.
# This may not be what we want....
MPIRUN_DEVICE=$default_device
export MPIRUN_DEVICE
#
#
# Handle debuggers
#
#startpgm="eval"
startpgm="$progname $cmdLineArgs -np $np"

if [ "$debugger" != "" ] ; then
    if [ "$debugger" = "totalview" ] ; then
        if [ "$TOTALVIEW" = "" ] ; then
	   TOTALVIEW="totalview"
        fi
        startpgm="$TOTALVIEW $progname -a $cmdLineArgs -np $np -mpichtv"
    else
	# There should be a way to specify a debugger startup method, for
        # special vendor-specific debuggers (like SGI's cvd) etc.
	# gdb or dbx-like debuggers
        dbgfile=$PWD_TRIAL/PId$$
        echo "Test" > $dbgfile
        if [ -s $dbgfile ] ; then
	    /bin/rm -f $dbgfile
        else
            dbgfile=$HOME/PId$$
        fi
        # If gdb has an equivalent, the documentation is well hidden.
        #  - .gdbinit - and the documentation IS well hidden.  Fortunately,
        # the .gbdinit file is read; gdb provides the -nx (instead of -x)
        # command if you don't want to read the default init file.
        if [ "$debugger" = "dbx" -a -r $HOME/.dbxinit ] ; then
	    cat $HOME/.dbxinit > $dbgfile
        fi
        # Regretably, xxgdb does NOT provide this argument (even though it
        # claims to).
    #    if [ "$debugger" = "xxgdb" -a -r $HOME/.gdbinit ] ; then
    #	cat $HOME/.gdbini > $dbgfile
    #    fi
        # handle USR1 pass for gdb; add an initial break 
        if [ "$debugger" = "gdb" -o "$debugger" = "xxgdb" -o \
	     "$debugger" = "ddd" ] ; then
	    echo "handle SIGUSR1 nostop pass" >> $dbgfile
	    echo "br MPI_Init" >> $dbgfile
	    echo "set args $cmdLineArgs -np $np" >> $dbgfile
	    echo "run" >> $dbgfile
        else 
            echo "ignore USR1" >> $dbgfile
            # This may not work, depending on when the symbol table is read.
            # An alternative is to use the startup file to load the 
            # program with "debug $progname" ,followed with this, followed
	    # with run command args.
	    echo "debug $progname" >> $dbgfile
   	    echo "stop in MPI_Init" >> $dbgfile
	    echo "run $cmdLineArgs -np $np" >> $dbgfile
        fi
    #	cat >> $dbgfile <<.
    ## Use this command to start your programm:
    #run  $cmdLineArgs -p4pg $p4pgfile
    #.
	    commandfile=`echo $commandfile | sed -e s@%f@$dbgfile@g`
	    startpgm="$debugger $commandfile $progname"
    fi
fi

#
# Build a suitable command for the whole thing
#
if [ $just_testing = 1 ] ; then
  doitall="echo"
else
  doitall=""
fi
#
# Add rsh'ery if requested
#
if [ $nolocal = 1 ] ; then
    doitall="$doitall $rshcmd $machinehead"
fi

$doitall $startpgm