Revision: 2125
http://cogkit.svn.sourceforge.net/cogkit/?rev=2125&view=rev
Author: b_z_c
Date: 2008-07-31 15:51:51 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
round up seconds in walltimes instead of round down; in the case of sub-one-minute walltimes, this was getting rounded to 0.
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java 2008-07-31 15:12:59 UTC (rev 2124)
+++ trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java 2008-07-31 15:51:51 UTC (rev 2125)
@@ -487,7 +487,7 @@
}
/** Takes walltime of the form mm or hh:mm or hh:mm:ss and returns the
- number of minutes, discarding the seconds. */
+ number of minutes, rounding up the seconds. */
public static Long wallTimeToMinutes(Object time) {
long n;
String[] s = time.toString().split(":");
@@ -495,8 +495,10 @@
if (s.length == 1) {
n = Integer.parseInt(s[0]);
}
- else if (s.length == 2 || s.length == 3) {
+ else if (s.length == 2) {
n = Integer.parseInt(s[1]) + 60 * Integer.parseInt(s[0]);
+ } else if (s.length == 3) {
+ n = Integer.parseInt(s[1]) + 60 * Integer.parseInt(s[0]) + 1;
}
else {
throw new IllegalArgumentException("Invalid time specification: " + time);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|