Annotation of badi/public_scripts/parallelstarter/biogeme/parallelstarter.prepare_process_start, revision 1.1

1.1     ! adi         1: # prepare to execute a single biogeme run
        !             2: 
        !             3: # prepare environment
        !             4: STARTMSG="Starting $RUN_BIN with arguments $RUN_ARGS"
        !             5: id="$(($RUN_COUNT+1+$RUN_COUNT_OFFSET))"
        !             6: myargs="$(sed -n "${id}p" "$BIOGEME_ARGS_FILE")"
        !             7: RUN_NAME="`echo $(echo "$myargs" | awk -F ':' '{print $1}')`"
        !             8: MODEL_NAME="`echo $(echo "$myargs" | awk -F ':' '{print $2}')`"
        !             9: DATA_FILENAME="`echo $(echo "$myargs" | awk -F ':' '{print $3}')`"
        !            10: mydir="$RUN_NAME""$RUN_DIR_PREFIX"
        !            11: 
        !            12: # move old dirs out of the way
        !            13: if [ -e "$mydir" ]; then
        !            14:        $SPEAK && echo "$RUN_BIN directory exists: $mydir. Renaming directory."
        !            15:        mv "$mydir" "$mydir.$(basename `mktemp -u`)"
        !            16: fi
        !            17: 
        !            18: # create process home
        !            19: mkdir "$mydir"
        !            20: 
        !            21: # create links
        !            22: ln -s "../$MODEL_DIRNAME/$MODEL_NAME.mod" "$mydir/$RUN_NAME.mod"
        !            23: ln -s "../$DATA_DIRNAME/$DATA_FILENAME" "$mydir/$RUN_NAME.dat"
        !            24: # check for special parameter file
        !            25: if [ -e "../$MODEL_DIRNAME/$MODEL_NAME.par" ]; then
        !            26:        ln -s "../$MODEL_DIRNAME/$MODEL_NAME.par" "$mydir/$RUN_NAME.par"
        !            27: elif [ -e "$MODEL_DIRNAME/default.par" ]; then
        !            28:        ln -s "../$MODEL_DIRNAME/default.par" "$mydir/default.par"
        !            29: fi
        !            30: 
        !            31: cd "$mydir"

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