From ae4ba5a0edca2856ee86691efef5c2e522b3edbc Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 4 Aug 2005 23:29:18 +0000
Subject: [PATCH] When slurmctld is cold-started use a random elan program id
 to start with instead of always using 1, which is prone to collisions.

---
 src/plugins/switch/elan/qsw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/switch/elan/qsw.c b/src/plugins/switch/elan/qsw.c
index aff0c5fa4bb..38953e2b8c7 100644
--- a/src/plugins/switch/elan/qsw.c
+++ b/src/plugins/switch/elan/qsw.c
@@ -379,7 +379,8 @@ qsw_init(qsw_libstate_t oldstate)
 	if (oldstate)
 		_copy_libstate(new, oldstate);
 	else {
-		new->ls_prognum = QSW_PRG_START;
+		new->ls_prognum = QSW_PRG_START + 
+			(lrand48() % (QSW_PRG_END - QSW_PRG_START + 1));
 		new->step_ctx_list = list_create(_step_ctx_del);
 	}
 	qsw_internal_state = new;
-- 
GitLab