#!/bin/sh
#------------------------->  Bourne shell - script  <-------------------------#
#- Copyright (C) 199x by International Computer Science Institute            -#
#- This file is part of the GNU Sather package. It is free software; you may -#
#- redistribute  and/or modify it under the terms of the  GNU General Public -#
#- License (GPL)  as  published  by the  Free  Software  Foundation;  either -#
#- version 3 of the license, or (at your option) any later version.          -#
#- This  program  is distributed  in the  hope that it will  be  useful, but -#
#- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY -#
#- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/GPL for more details.        -#
#- The license text is also available from:  Free Software Foundation, Inc., -#
#- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     -#
#------------->  Please email comments to <bug-sather@gnu.org>  <-------------#

# define here how to start the different nodes. Note that
# node 0 is already running and should NOT be started 
# here. The number of nodes to run is passed into this 
# script as the first parameter. The second paramter
# is the program to start on each node (this may be an
# absolute pathname or a relative pathname), and the
# rest are the arguments for this program

# PWD=`pwd | sed "s/.*$LOGNAME/\/u\/$LOGNAME/"`
nodes=$1
shift
prog=`echo $1 | sed "s/.*$LOGNAME/\/u\/$LOGNAME/"`
shift
options="$prog $*"
echo $options
start() {
   if expr $nodes \>= $2 > /dev/null
   then
#	xhost +$1 > /dev/null
        /usr/local/bin/export -attr $1 -force sh -c "$options" & 
#        /usr/local/bin/export -attr $1 -force xterm -fn 7x13 -T "$1: $prog" -exec sh -c "$options" & 
#       /usr/local/bin/export -attr $1 -force xterm -fn 7x13 -T "$1: $prog" -exec sh -c "gdb $prog" & 
   fi
}

start samosa	 2
start icsib18	 3
start icsib8	 4
start icsib95	 5
start kimchi	 6
start icsib92	 7
exit 0
