#!/bin/sh
#

THIS_VERSION="CODINE"

check_version () {

    if test x"$QSUB_BASENAME" = "xqsub"; then
	qresub="$BATCH_BIN_PATH/qresub"
	if test -f "$resub" ; then
	    echo "CODINE"
	fi
    fi

}


set_version () {

    QSUB_BASENAME="qsub"
    if [ -z "$QCONF" ];then QCONF="$BATCH_BIN_PATH/qconf"; fi
    if [ -z "$BL1" ];then BL1="$ -l h_rt=CF_TIME"; fi
    if [ -z "$BL2" ];then BL2="$ -pe CF_PE CF_TCPU"; fi
    if [ -z "$BL3" ];then BL3="$ -N CF_BENCH"; fi
    if [ -z "$BL4" ];then BL4="$ -S /bin/sh"; fi
    if [ -z "$BL5" ];then BL5="$ -j y"; fi
    if [ -z "$BL6" ];then BL6=""; fi
    
}

get_properties () {
    NODEFILE="$TMPDIR"/machines
}

patch_submission () {
    JSUB="$QSUB"
}

find_queue () {

    generic_qname="parallel multi mpi mpp mpich lam para par batch default"
IFS="
"
    stat=`$QCONF -spl`
    for i in $stat; do
	IFS=" "
	for j in $generic_qname; do
	    if test x"$QUEUE" = "x"; then 
		check=`echo $i | grep $j`
		if test $? -eq 0; then
		    QUEUE=`echo $check | sed "/.*\(\W*$j\W*\) *.*/\1/"`
		fi
	    fi
	done
    done       
    if test x"$QUEUE" = "x"; then
	echo "ERROR: Can't find parallel QUEUE\n"
	exit 1
    fi

}
