[Swift-commit] Cog update

swift at ci.uchicago.edu swift at ci.uchicago.edu
Sat Apr 28 00:15:02 CDT 2012


------------------------------------------------------------------------
r3339 | davidkelly999 | 2011-12-23 16:30:53 -0600 (Fri, 23 Dec 2011) | 2 lines

Add optional job submission delay

------------------------------------------------------------------------
Index: modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/Properties.java
===================================================================
--- modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/Properties.java	(revision 3338)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/Properties.java	(working copy)
@@ -17,10 +17,11 @@
 	public static final String PROPERTIES = "provider-sge.properties";
 	public static final String POLL_INTERVAL = "poll.interval";
 	public static final String QSUB = "qsub";
-	public static final String QSTAT = "qstat -xml";
+	public static final String QSTAT = "qstat";
 	public static final String QDEL = "qdel";
 	public static final String QCONF = "qconf";
 	public static final String DEFAULT_PE = "parallel.environment"; 
+	public static final String SUBMISSION_DELAY = "submission.delay";
 	private static Properties properties;
 
 	/**
@@ -67,6 +68,15 @@
 	}
 
 	/**
+	 * getSubmissionDelay - Get length to sleep before submitting a job
+	 * Value as a string representing milliseconds
+	 * @return Submission delay as String in milliseconds
+	 */
+	public String getSubmissionDelay() {
+		return getProperty(SUBMISSION_DELAY);
+	}
+	
+	/**
 	 * getSubmitCommandName - Get submit command
 	 * @return String of submit command
 	 */
@@ -100,5 +110,14 @@
 		setRemoveCommand("qdel");
 		setDefaultPE("threaded");
 		setConfigCommand("qconf");
+		setSubmissionDelay("0");
 	}
+
+	/**
+	 * setSubmissionDelay - set the submission delay
+	 * @param delay String representing milliseconds to sleep 
+	 */
+	private void setSubmissionDelay(String delay) {
+		setProperty(SUBMISSION_DELAY, delay);
+	}
 }
Index: modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/SGEExecutor.java
===================================================================
--- modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/SGEExecutor.java	(revision 3338)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/sge/SGEExecutor.java	(working copy)
@@ -8,6 +8,7 @@
 
 import java.io.BufferedReader;
 import java.io.CharArrayReader;
+import java.io.File;
 import java.io.IOException;
 import java.io.Writer;
 import java.text.DecimalFormat;
@@ -24,11 +25,14 @@
 import org.globus.cog.abstraction.impl.scheduler.common.AbstractProperties;
 import org.globus.cog.abstraction.impl.scheduler.common.AbstractQueuePoller;
 import org.globus.cog.abstraction.impl.scheduler.common.Job;
+import org.globus.cog.abstraction.impl.scheduler.common.ProcessException;
 import org.globus.cog.abstraction.impl.scheduler.common.ProcessListener;
 import org.globus.cog.abstraction.impl.scheduler.pbs.PBSExecutor;
 import org.globus.cog.abstraction.interfaces.FileLocation;
 import org.globus.cog.abstraction.interfaces.JobSpecification;
 import org.globus.cog.abstraction.interfaces.Task;
+import org.globus.gsi.gssapi.auth.AuthorizationException;
+import org.ietf.jgss.GSSException;
 
 /**
  * Java CoG interface for Sun/Oracle Grid Engine
@@ -179,6 +183,20 @@
     }
 
     /**
+     * @see AbstractExecutor#start()
+     */
+    public void start() throws AuthorizationException, GSSException,
+           IOException, ProcessException {
+    	try {
+    		Thread.sleep(Integer.valueOf(getSGEProperties().getSubmissionDelay()));
+    	}
+    	catch (InterruptedException e) {
+    		logger.error(e.getStackTrace());
+    	}
+    	super.start();
+    }
+    
+    /**
      * Check that job specification values are valid for this system
      * @throws IllegalArgumentException
      */
Index: modules/provider-localscheduler/etc/provider-sge.properties
===================================================================
--- modules/provider-localscheduler/etc/provider-sge.properties	(revision 3338)
+++ modules/provider-localscheduler/etc/provider-sge.properties	(working copy)
@@ -13,14 +13,13 @@
 #
 # The path to qstat. The default assumes that qstat is in PATH
 #
-qstat=qstat
+qstat=qstat -xml
 
 #
 # The path to qdel. The default assumes that qdel is in PATH
 #
 qdel=qdel
 
-
 #
 # If the jobType attribute is specified, then the SGE provider
 # will look for a property named "wrapper.<jobType>" and prepend
@@ -36,6 +35,10 @@
 # a default parallel environment. It can be overriden using
 # the "pe" job attribute
 #
-
 parallel.environment=1way
 
+# Some systems (notably Ranger) may not adequately handle
+# a rapid submission of jobs. Use this setting to introduce
+# a delay. The value is in milliseconds (1000ms = 1s)
+#
+submission.delay=1000



More information about the Swift-commit mailing list