Recovered these files from old source.
This commit is contained in:
parent
a7225a15da
commit
082eb13225
4 changed files with 248 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
EXTRA_DIST fgfs-launch-clients fgfs-launch-server genworklist.sh
|
||||||
|
|
||||||
bin_PROGRAMS = fgfs-tools-server fgfs-tools-client
|
bin_PROGRAMS = fgfs-tools-server fgfs-tools-client
|
||||||
|
|
||||||
fgfs_tools_server_SOURCES = server.cxx
|
fgfs_tools_server_SOURCES = server.cxx
|
||||||
|
|
130
src/BuildTiles/Parallel/fgfs-launch-clients
Executable file
130
src/BuildTiles/Parallel/fgfs-launch-clients
Executable file
|
@ -0,0 +1,130 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# fgfs-launch-clinets -- script to launch fgfs scenery construction clients
|
||||||
|
#
|
||||||
|
# Written by Curtis Olson, started May 1999.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 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 the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
CLIENT=fgfs-tools-client
|
||||||
|
HOSTNAME=`uname -n`
|
||||||
|
|
||||||
|
# check usage
|
||||||
|
if [ $# != 1 ]; then
|
||||||
|
echo "Usage: $0 base_dir"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
BASE_DIR=$1
|
||||||
|
CLIENT_LIST_RUDE="${BASE_DIR}/clients.rude"
|
||||||
|
CLIENT_LIST_NICE="${BASE_DIR}/clients.nice"
|
||||||
|
WORK_BASE="${BASE_DIR}/Work"
|
||||||
|
OUTPUT_DIR="${BASE_DIR}/FlightGear"
|
||||||
|
LOG_DIR="${WORK_BASE}/Status"
|
||||||
|
SERVER_LOG_FILE=${LOG_DIR}/server.log
|
||||||
|
echo "Base directory is $BASE_DIR"
|
||||||
|
echo "Client list files are $CLIENT_LIST_RUDE $CLIENT_LIST_NICE"
|
||||||
|
echo "Work base is $WORK_BASE"
|
||||||
|
echo "Output base is $OUTPUT_DIR"
|
||||||
|
echo "Logging to $LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SERVER_HOST=`grep "Server launched" $SERVER_LOG_FILE | awk '{ print $5 }'`
|
||||||
|
if [ "x$SERVER_HOST" = "x" ]; then
|
||||||
|
echo "Can't find server host name in $SERVER_LOG_FILE"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Server hostname is $SERVER_HOST"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SERVER_PORT=`grep port $SERVER_LOG_FILE | awk '{ print $7 }'`
|
||||||
|
if [ "x$SERVER_PORT" = "x" ]; then
|
||||||
|
echo "Can't find server port number in $SERVER_LOG_FILE"
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "Server port number is $SERVER_PORT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if client binary exists
|
||||||
|
if type $CLIENT > /dev/null; then
|
||||||
|
echo "client: `type $CLIENT`"
|
||||||
|
else
|
||||||
|
echo "cannot locate $CLIENT"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# read client lists
|
||||||
|
if [ -f $CLIENT_LIST_RUDE ]; then
|
||||||
|
TMP=`cat $CLIENT_LIST_RUDE`
|
||||||
|
CLIENTS_RUDE=`echo $TMP`
|
||||||
|
fi
|
||||||
|
if [ -f $CLIENT_LIST_NICE ]; then
|
||||||
|
TMP=`cat $CLIENT_LIST_NICE`
|
||||||
|
CLIENTS_NICE=`echo $TMP`
|
||||||
|
fi
|
||||||
|
echo "Rude clients = $CLIENTS_RUDE"
|
||||||
|
echo "Nice clients = $CLIENTS_NICE"
|
||||||
|
|
||||||
|
# check if log directory exists, and if not, make it
|
||||||
|
if [ ! -d $LOG_DIR ]; then
|
||||||
|
mkdir -p $LOG_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# launch a copy of the client process on each specified machine
|
||||||
|
|
||||||
|
for i in $CLIENTS_RUDE; do
|
||||||
|
if ping -c 1 -i 5 $i > /dev/null; then
|
||||||
|
echo "Launching client process on $i"
|
||||||
|
else
|
||||||
|
echo "client $i is currently down, skipping"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_FILE="${LOG_DIR}/client-$i.log"
|
||||||
|
|
||||||
|
# KILL_COMMAND="killall $CLIENT"
|
||||||
|
# ssh -n $i "$KILL_COMMAND"
|
||||||
|
|
||||||
|
RMT_COMMAND="source ~/.profile; nice $CLIENT $SERVER_HOST $SERVER_PORT $WORK_BASE $OUTPUT_DIR -r"
|
||||||
|
echo "client command:"
|
||||||
|
echo ""
|
||||||
|
echo "$RMT_COMMAND"
|
||||||
|
echo ""
|
||||||
|
ssh -n $i "$RMT_COMMAND > $LOG_FILE 2>&1 &"
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in $CLIENTS_NICE; do
|
||||||
|
if ping -c 1 -i 5 $i > /dev/null; then
|
||||||
|
echo "Launching client process on $i"
|
||||||
|
else
|
||||||
|
echo "client $i is currently down, skipping"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_FILE="${LOG_DIR}/client-$i.log"
|
||||||
|
|
||||||
|
# KILL_COMMAND="killall $CLIENT"
|
||||||
|
# ssh -n $i "$KILL_COMMAND"
|
||||||
|
|
||||||
|
RMT_COMMAND="source ~/.profile; nice $CLIENT $SERVER_HOST $SERVER_PORT $WORK_BASE $OUTPUT_DIR"
|
||||||
|
echo "client command:"
|
||||||
|
echo ""
|
||||||
|
echo "$RMT_COMMAND"
|
||||||
|
echo ""
|
||||||
|
ssh -n $i "$RMT_COMMAND > $LOG_FILE 2>&1 &"
|
||||||
|
done
|
106
src/BuildTiles/Parallel/fgfs-launch-server
Executable file
106
src/BuildTiles/Parallel/fgfs-launch-server
Executable file
|
@ -0,0 +1,106 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# fgfs-launch-server -- script to launch fgfs scenery construction server
|
||||||
|
#
|
||||||
|
# Written by Curtis Olson, started May 1999.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License as
|
||||||
|
# published by the Free Software Foundation; either version 2 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 the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
|
||||||
|
SERVER=fgfs-tools-server
|
||||||
|
|
||||||
|
# check usage
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo "Usage: $0 base_dir chunk1 chunk2 ..."
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
BASE_DIR=$1
|
||||||
|
shift
|
||||||
|
WORK_BASE="${BASE_DIR}/Work"
|
||||||
|
OUTPUT_DIR="${BASE_DIR}/FlightGear"
|
||||||
|
MASTER_ON="${WORK_BASE}/Status/MASTER_ON"
|
||||||
|
LOG_DIR="${WORK_BASE}/Status"
|
||||||
|
LOG_FILE="${LOG_DIR}/server.log"
|
||||||
|
echo "Base directory is $BASE_DIR"
|
||||||
|
echo "Work base is $WORK_BASE"
|
||||||
|
echo "Output base is $OUTPUT_DIR"
|
||||||
|
echo "Logging to $LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if server binary exists
|
||||||
|
if type $SERVER > /dev/null; then
|
||||||
|
echo "server: `type $SERVER`"
|
||||||
|
else
|
||||||
|
echo "cannot locate $SERVER"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if log directory exists, and if not, make it
|
||||||
|
if [ ! -d $LOG_DIR ]; then
|
||||||
|
mkdir -p $LOG_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# kill any existing copies of the server
|
||||||
|
killall $SERVER
|
||||||
|
|
||||||
|
# expand arguments as needed
|
||||||
|
TODO=""
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
LEN=`echo $1 | wc -c`
|
||||||
|
if [ $LEN -eq 5 ]; then
|
||||||
|
echo "expanding $1"
|
||||||
|
for i in s80 s70 s60 s50 s40 s30 s20 s10 n00 n10 n20 n30 n40 n50 n60 \
|
||||||
|
n70; do
|
||||||
|
TODO="$TODO ${1}${i}"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
TODO="$TODO ${1}"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
echo Work List = $TODO
|
||||||
|
|
||||||
|
# launch the server in the background
|
||||||
|
SERVER_HOST=`hostname -f`
|
||||||
|
COMMAND="$SERVER $WORK_BASE $OUTPUT_DIR $TODO"
|
||||||
|
echo "Launching the server with the following options:"
|
||||||
|
echo ""
|
||||||
|
echo "$COMMAND"
|
||||||
|
echo ""
|
||||||
|
echo "Server launched on host: $SERVER_HOST" > $LOG_FILE
|
||||||
|
$COMMAND >> $LOG_FILE 2>&1 &
|
||||||
|
|
||||||
|
# grab the PID
|
||||||
|
SERVER_PID=`echo $!`
|
||||||
|
|
||||||
|
# wait for a moment
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# grab the port number
|
||||||
|
SERVER_PORT=`grep port $LOG_FILE | awk '{ print $7 }'`
|
||||||
|
|
||||||
|
# turn on the master switch
|
||||||
|
echo $SERVER_PORT > $MASTER_ON
|
||||||
|
|
||||||
|
# finish
|
||||||
|
echo "server is now running in background:"
|
||||||
|
echo " host = $SERVER_HOST"
|
||||||
|
echo " pid = $SERVER_PID"
|
||||||
|
echo " port = $SERVER_PORT"
|
10
src/BuildTiles/Parallel/genworklist.sh
Executable file
10
src/BuildTiles/Parallel/genworklist.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
for lat in s90 s80 s70 s60 s50 s40 s30 s20 s10 n00 n10 n20 n30 n40 n50 n60 \
|
||||||
|
n70 n80; do
|
||||||
|
for lon in w180 w170 w160 w150 w140 w130 w120 w110 w100 w090 w080 w070 \
|
||||||
|
w060 w050 w040 w030 w020 w010 e000 e010 e020 e030 e040 e050 \
|
||||||
|
e060 e070 e080 e090 e100 e110 e120 e130 e140 e150 e160 e170; do
|
||||||
|
echo "${lon}${lat}"
|
||||||
|
done
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue