From ad7100b8162de66e13e6488106b347d827c4a54a Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Wed, 2 Apr 2014 10:47:57 -0700
Subject: [PATCH] launch/poe - fix network value

if an job step's network value is set by poe, either by directly
executing poe or srun launching poe, that value was not being
propagated to the job step creation RPC and the network was not
being set up for the proper protocol (e.g. mpi, lapi, pami, etc.).
The previous logic would only work if the srun execute line
explicitly set the protocol using the --network option.
---
 NEWS                                       | 1 +
 src/plugins/switch/nrt/libpermapi/shr_64.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index a0c9eb5bbf8..3eca0aa52f7 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ documents those changes that are of interest to users and admins.
  -- Lock the /cgroup/freezer subsystem when creating files for tracking processes.
  -- Fix preempt/partition_prio to avoid preempting jobs in partitions with
     PreemptMode=OFF
+ -- launch/poe - Implicitly set --network in job step create request as needed.
 
 * Changes in Slurm 2.6.7
 ========================
diff --git a/src/plugins/switch/nrt/libpermapi/shr_64.c b/src/plugins/switch/nrt/libpermapi/shr_64.c
index c848187788d..511f6d599d4 100644
--- a/src/plugins/switch/nrt/libpermapi/shr_64.c
+++ b/src/plugins/switch/nrt/libpermapi/shr_64.c
@@ -1870,6 +1870,12 @@ int pe_rm_submit_job(rmhandle_t resource_mgr, job_command_t job_cmd,
 	debug2("usage_mode\t= %d", pe_job_req->node_usage);
 	debug2("network_usage protocols\t= %s",
 	       pe_job_req->network_usage.protocols);
+	if (!opt.network)
+		xstrcat(opt.network, pe_job_req->network_usage.protocols);
+	else if (!strstr(opt.network, pe_job_req->network_usage.protocols)) {
+		xstrcat(opt.network, ",");
+		xstrcat(opt.network, pe_job_req->network_usage.protocols);
+	}
 	debug2("network_usage adapter_usage\t= %s",
 	       pe_job_req->network_usage.adapter_usage);
 	debug2("network_usage adapter_type\t= %s",
-- 
GitLab