File:  [Local Repository] / badi / public_scripts / parallelstarter / matsim / parallelstarter.prepare_process_start
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 18 11:49:04 2011 UTC (13 years, 4 months ago) by adi
Branches: ik, MAIN
CVS tags: main, HEAD
from IVT CVS

# prepare for matsim benchmark test

# prepare environment
if [ -z "$RUNDIR_BASENAME" ]; then
	TEMPLATE_DIRNAME="matsim"
else
	TEMPLATE_DIRNAME="$RUNDIR_BASENAME"
fi
STARTMSG="Starting matsim with arguments $RUN_ARGS"
id="$(($RUN_COUNT+1+$RUN_COUNT_OFFSET))"
mydir="$TEMPLATE_DIRNAME""$RUN_DIR_PREFIX""_run-""$id"

# move old dirs out of the way
if [ -e "$mydir/output" ]; then
	$SPEAK && echo "Matsim directory exists: $mydir/output. Renaming directory."
	mv "$mydir/$ARGS_LOG" "$mydir/output" 2>&1 > /dev/null
	mv "$mydir/output" "$mydir/output.$(basename `mktemp -u`)"
elif [ ! -e "$mydir" ]; then
	# create process home
	mkdir "$mydir"

	# create links
	ln -s "../$TEMPLATE_DIRNAME/Benchmark.jar" "$mydir/Benchmark.jar"
	ln -s "../$TEMPLATE_DIRNAME/MATSim_r6528.jar" "$mydir/MATSim_r6528.jar"
	ln -s "../$TEMPLATE_DIRNAME/libs" "$mydir/libs"

	# config file variation -> use matsim's command line switches
	ln -s "../$TEMPLATE_DIRNAME/input" "$mydir/input"
fi

cd "$mydir"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>