/usr/share/gridengine/mpi/startmpi.sh is in gridengine-common 8.1.9+dfsg-7build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | #!/bin/sh
#
#
#___INFO__MARK_BEGIN__
##########################################################################
#
# The Contents of this file are made available subject to the terms of
# the Sun Industry Standards Source License Version 1.2
#
# Sun Microsystems Inc., March, 2001
#
#
# Sun Industry Standards Source License Version 1.2
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.2 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2001 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
##########################################################################
#___INFO__MARK_END__
#
# preparation of the mpi machine file
#
# usage: startmpi.sh [options] <pe_hostfile>
#
# options are:
# -catch_hostname
# force use of hostname wrapper in $TMPDIR when starting mpirun
# -catch_rsh
# force use of rsh wrapper in $TMPDIR when starting mpirun
# -unique
# generate a machinefile where each hostname appears only once
# This is needed to setup a multithreaded mpi application
#
PeHostfile2MachineFile()
{
cat $1 | while read line; do
# echo $line
host=`echo $line|cut -f1 -d" "|cut -f1 -d"."`
nslots=`echo $line|cut -f2 -d" "`
i=1
while [ $i -le $nslots ]; do
# add here code to map regular hostnames into ATM hostnames
echo $host
i=`expr $i + 1`
done
done
}
#
# startup of MPI conforming with the Grid Engine
# Parallel Environment interface
#
# on success the job will find a machine-file in $TMPDIR/machines
#
# useful to control parameters passed to us
echo $*
# parse options
catch_rsh=0
catch_hostname=0
unique=0
while [ "$1" != "" ]; do
case "$1" in
-catch_rsh)
catch_rsh=1
;;
-catch_hostname)
catch_hostname=1
;;
-unique)
unique=1
;;
*)
break;
;;
esac
shift
done
me=`basename $0`
# test number of args
if [ $# -ne 1 ]; then
echo "$me: got wrong number of arguments" >&2
exit 1
fi
# get arguments
pe_hostfile=$1
# ensure pe_hostfile is readable
if [ ! -r $pe_hostfile ]; then
echo "$me: can't read $pe_hostfile" >&2
exit 1
fi
# create machine-file
# remove column with number of slots per queue
# mpi does not support them in this form
machines="$TMPDIR/machines"
if [ $unique = 1 ]; then
PeHostfile2MachineFile $pe_hostfile | uniq >> $machines
else
PeHostfile2MachineFile $pe_hostfile >> $machines
fi
# trace machines file
cat $machines
#
# Make script wrapper for 'rsh' available in jobs tmp dir
#
if [ $catch_rsh = 1 ]; then
rsh_wrapper=$SGE_ROOT/mpi/rsh
if [ ! -x $rsh_wrapper ]; then
echo "$me: can't execute $rsh_wrapper" >&2
echo " maybe it resides at a file system not available at this machine" >&2
exit 1
fi
rshcmd=rsh
case "$ARC" in
hp|hp10|hp11|hp11-64) rshcmd=remsh ;;
*) ;;
esac
# note: This could also be done using rcp, ftp or s.th.
# else. We use a symbolic link since it is the
# cheapest in case of a shared filesystem
#
ln -s $rsh_wrapper $TMPDIR/$rshcmd
fi
#
# Make script wrapper for 'hostname' available in jobs tmp dir
#
if [ $catch_hostname = 1 ]; then
hostname_wrapper=$SGE_ROOT/mpi/hostname
if [ ! -x $hostname_wrapper ]; then
echo "$me: can't execute $hostname_wrapper" >&2
echo " maybe it resides at a file system not available at this machine" >&2
exit 1
fi
# note: This could also be done using rcp, ftp or s.th.
# else. We use a symbolic link since it is the
# cheapest in case of a shared filesystem
#
ln -s $hostname_wrapper $TMPDIR/hostname
fi
# signal success to caller
exit 0
|