#!/bin/csh # set running=`ps -ef | grep gridsubmit-daemon |grep -v grep | wc -l` # # Limit the number of submission deamons running # if ($running <= 3) then set ncount = `ls -1 ./ |grep gridjob |grep -v csrgrid |grep jdl | wc -l` >&/dev/null setenv HOMED `pwd` # # IS THERE WORK TO BE DONE? # if ($ncount > 0) then # # YES - PROCESS THEN THE JDL FILES IF NOT LOCKED ALREADY (.process) # foreach i(gridjob*.jdl) set jobroot = $i:r if (-e $jobroot.process) continue if (! -e $jobroot.tar.gz || ! -e $jobroot.sh || ! -e $jobroot.dir) then \rm $jobroot.* continue endif touch $jobroot.process # # SUBMIT THE JOB (multiple WMS defined to avoid problems) # foreach WMS ( https://wms-enmr.science.uu.nl:7443/glite_wms_wmproxy_server https://graspol.nikhef.nl:7443/glite_wms_wmproxy_server https://prod-wms-01.pd.infn.it:7443/glite_wms_wmproxy_server https://wms-enmr.cerm.unifi.it:7443/glite_wms_wmproxy_server https://graszode.nikhef.nl:7443/glite_wms_wmproxy_server) setenv GLITE_WMS_WMPROXY_ENDPOINT $WMS date glite-wms-job-submit -o $jobroot.jobid -a $jobroot.jdl if (! -e $jobroot.jobid) then set submitted=0 else set submitted=1 break endif end if ($submitted == 0) then \rm $jobroot.process >&/dev/null endif end endif set ncount = `ls -1 ./ |grep process | wc -l` if ($ncount > 0) then foreach i (*.process) if (! -e $i:r.jobid) \rm $i end endif else echo `date` "gridsubmit-daemon already running... exiting" endif