Skip to content

Instantly share code, notes, and snippets.

@cinek810
Last active November 23, 2018 21:28
Show Gist options
  • Save cinek810/bf1bacc1278a21e429811f20c9034fa8 to your computer and use it in GitHub Desktop.
Save cinek810/bf1bacc1278a21e429811f20c9034fa8 to your computer and use it in GitHub Desktop.
Patch for Open XDMoD mitigating the issue with suspended jobs wall time beeing overestimated(Interested? Check whole article:https://funinit.wordpress.com/2018/11/23/notes-from-the-xdmod-patch-mitigating-the-issue-with-overestimated-wall-time-for-suspended-jobs/)
diff --git a/classes/OpenXdmod/Shredder.php b/classes/OpenXdmod/Shredder.php
index 1a55a57b..951baf48 100644
--- a/classes/OpenXdmod/Shredder.php
+++ b/classes/OpenXdmod/Shredder.php
@@ -810,6 +810,14 @@ class Shredder
$errorMessages[] = 'Job start time as after job end time.';
$valid = false;
}
+ elseif ( $startTime !== null
+ && $endTime != null
+ && $walltime != null
+ && ($endTime - $startTime) > $walltime ) {
+ $this->logger->debug('Found difference between end time and start time ('.$endTime-$startTime.') bigger than walltime ('.$walltime.') reported by scheduler. Probably job was suspended or gang scheduled');
+ $errorMessages[] = 'Difference between job end and start times is bigger than wall time reported by scheduler. Probably job was suspended or gang scheduled.';
+ $valid = false;
+ }
return array($valid, $errorMessages);
}
@@ -872,6 +880,14 @@ class Shredder
$startTime = $endTime - $walltime;
$this->logger->debug("Setting start time to $startTime");
}
+ elseif ( ($endTime - $startTime) > $walltime)
+ {
+ // Fix end time to startTime + walltime.
+ //If those doesn't match duratin is probably overestimated -
+ // because of job suspention or gang scheduling mechanisms
+ $endTime = $startTime + $walltime;
+ $this->logger->debug("Setting end time to $endTime");
+ }
return array($startTime, $endTime, $walltime);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment