File:  [Local Repository] / badi / public_scripts / parallelstarter / biogeme / generate_arglist
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 biogeme to be run with parallelstarter:
# generate arglist from $BIOGEME_ARGS_FILE

if [ -e "$ARGLIST_FILE" ]; then
	rm "$ARGLIST_FILE"
fi

if [ ! -e "$BIOGEME_ARGS_FILE" ]; then
	echo "Parallelstarter needs a configuration file for the biogeme runs you intend to execute."
	echo "File not found: $BIOGEME_ARGS_FILE"
	exit 1
fi

while read biogeme_argline; do

	# ignore comment and empty lines
	if [ $(echo "$biogeme_argline" | egrep -c "^[ \t]*#.*$") -gt 0 ]; then
 	       continue
	fi
	
	# ignore empty lines or malformed lines
	if [ $(echo "$biogeme_argline" | sed 's/[^:]//g' | wc -m) -ne 3 ]; then
		continue
	fi

        RUN_NAME="`echo $(echo "$biogeme_argline" | awk -F ':' '{print $1}')`"

	echo "$RUN_NAME $RUN_NAME.dat" >> "$ARGLIST_FILE"
	

done < "$BIOGEME_ARGS_FILE"

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