From 9aded2cb5e05f58624d84ca455b28c52f07d8be5 Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Mon, 7 Jul 2014 13:01:41 -0700
Subject: [PATCH] Add function to get MaxArraySize config param

---
 src/common/slurm_protocol_api.c | 18 ++++++++++++++++++
 src/common/slurm_protocol_api.h |  5 +++++
 2 files changed, 23 insertions(+)

diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c
index b399ef861bc..3a492b2afb8 100644
--- a/src/common/slurm_protocol_api.c
+++ b/src/common/slurm_protocol_api.c
@@ -405,6 +405,24 @@ extern int slurm_get_env_timeout(void)
 	return timeout;
 }
 
+/* slurm_get_max_array_size
+ * return MaxArraySize configuration parameter
+ */
+extern uint32_t slurm_get_max_array_size(void)
+{
+	int max_array_size = 0;
+	slurm_ctl_conf_t *conf;
+
+	if (slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		max_array_size = conf->max_array_sz;
+		slurm_conf_unlock();
+	}
+	return max_array_size;
+}
+
+
 /* slurm_get_mpi_default
  * get default mpi value from slurmctld_conf object
  * RET char *   - mpi default value from slurm.conf,  MUST be xfreed by caller
diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h
index 1aa6fd45430..349e425e6b7 100644
--- a/src/common/slurm_protocol_api.h
+++ b/src/common/slurm_protocol_api.h
@@ -164,6 +164,11 @@ uint32_t slurm_get_epilog_msg_time(void);
  */
 extern int slurm_get_env_timeout(void);
 
+/* slurm_get_max_array_size
+ * return MaxArraySize configuration parameter
+ */
+extern uint32_t slurm_get_max_array_size(void);
+
 /* slurm_get_mpi_default
  * get default mpi value from slurmctld_conf object
  * RET char *   - mpi default value from slurm.conf,  MUST be xfreed by caller
-- 
GitLab