From 9ba6d0bd644fba1df53f4251f0669d66e1466ebb Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Fri, 28 May 2010 18:09:23 +0000
Subject: [PATCH] fix bug in calculation of available CPUs for a job step

---
 src/plugins/gres/gpu/gres_gpu.c | 2 ++
 src/plugins/gres/nic/gres_nic.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/plugins/gres/gpu/gres_gpu.c b/src/plugins/gres/gpu/gres_gpu.c
index 4cd5ae6445f..5eda6f11aee 100644
--- a/src/plugins/gres/gpu/gres_gpu.c
+++ b/src/plugins/gres/gpu/gres_gpu.c
@@ -1219,6 +1219,8 @@ extern uint32_t step_test(void *step_gres_data, void *job_gres_data,
 		gres_cnt /= step_gres_ptr->gpu_cnt_alloc;
 	else if (step_gres_ptr->gpu_cnt_alloc > gres_cnt)
 		gres_cnt = 0;
+	else
+		gres_cnt = NO_VAL;
 
 	return gres_cnt;
 }
diff --git a/src/plugins/gres/nic/gres_nic.c b/src/plugins/gres/nic/gres_nic.c
index c6127d8e8ab..37060fe5b49 100644
--- a/src/plugins/gres/nic/gres_nic.c
+++ b/src/plugins/gres/nic/gres_nic.c
@@ -1219,6 +1219,8 @@ extern uint32_t step_test(void *step_gres_data, void *job_gres_data,
 		gres_cnt /= step_gres_ptr->nic_cnt_alloc;
 	else if (step_gres_ptr->nic_cnt_alloc > gres_cnt)
 		gres_cnt = 0;
+	else
+		gres_cnt = NO_VAL;
 
 	return gres_cnt;
 }
-- 
GitLab