From eb34f0d02bf3419712771567c3c20307acd1b9bc Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Wed, 2 Apr 2008 22:21:29 +0000
Subject: [PATCH] make backfill scheduler enforce licenses

---
 src/plugins/sched/backfill/backfill.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c
index 8826eba4231..b165bb78058 100644
--- a/src/plugins/sched/backfill/backfill.c
+++ b/src/plugins/sched/backfill/backfill.c
@@ -66,6 +66,7 @@
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
 #include "src/slurmctld/job_scheduler.h"
+#include "src/slurmctld/licenses.h"
 #include "src/slurmctld/locks.h"
 #include "src/slurmctld/node_scheduler.h"
 #include "src/slurmctld/slurmctld.h"
@@ -171,7 +172,7 @@ extern void *backfill_agent(void *args)
 		READ_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK };
 
 	while (!stop_backfill) {
-		sleep(1);		/* don't run continuously */
+		sleep(2);		/* don't run continuously */
 
 		now = time(NULL);
 		/* Avoid resource fragmentation if important */
@@ -243,6 +244,9 @@ static void _attempt_backfill(void)
 		if ((part_ptr->root_only) && filter_root)
 			continue;
 
+		if (license_job_test(job_ptr) != SLURM_SUCCESS)
+			continue;
+
 		/* Determine minimum and maximum node counts */
 		min_nodes = MAX(job_ptr->details->min_nodes,
 				part_ptr->min_nodes);
-- 
GitLab