#!/bin/bash

CLIENT=/home/arch/skumar2/charm/net-linux/pgms/scheduler/client

if [ "x$SCHEDULER_PATH" != "x" ]
    then CLIENT=$SCHEDULER_PATH/client;
fi

HOST=localhost
PORT=1999
DIR=$(/bin/pwd)

if [ "x$1" = "x" ]  || [ "$1" = "-help" ] || [ "$1" = "-h" ];
	then echo "ufsub <program_name> [<options>] [<arguments>]"
	echo "ufsub submits a batch job to the Queuing System"	
	echo "program_name is the name of your compiled executable or script,"
	echo "Options"
	echo "-stdout <filename>: The Std. Output file of the job"
	echo "-stderr <filename>: The Std. Error file of the job"
	echo "-stdin <filename>: The Std. Input file of the job"
	echo "-pwd <directory name>: Process Working Directory, default is current directory"
	echo "-time <hh:mm:ss> : time requested for the job";
	echo "For Example:
	ufsub /bin/ls -stdout out -time 0:1:0
	runs ls for atmost 1 min"	

else
   $CLIENT $HOST $PORT job -pwd $DIR -type uni -stdout null -stdin null -stderr null $*
fi
	
