From ff4a5be13d8bcdb874de08e111b7c07caf8ffb32 Mon Sep 17 00:00:00 2001
From: "Christopher J. Morrone" <morrone2@llnl.gov>
Date: Tue, 17 Apr 2007 01:59:07 +0000
Subject: [PATCH] Apply Mark's patch to fix MPIRUN_PORT.

---
 NEWS                              | 1 +
 src/plugins/mpi/mvapich/mvapich.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 57d64284f79..74693796100 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ documents those changes that are of interest to users and admins.
 
 * Changes in SLURM 1.2.6
 ========================
+ -- Fix MPIRUN_PORT env variable in mvapich plugin
 
 * Changes in SLURM 1.2.5
 ========================
diff --git a/src/plugins/mpi/mvapich/mvapich.c b/src/plugins/mpi/mvapich/mvapich.c
index e50b33b458b..dc2637f45b5 100644
--- a/src/plugins/mpi/mvapich/mvapich.c
+++ b/src/plugins/mpi/mvapich/mvapich.c
@@ -1070,7 +1070,7 @@ extern mvapich_state_t *mvapich_thr_create(const mpi_plugin_client_info_t *job,
 	 *  Set some environment variables in current env so they'll get
 	 *   passed to all remote tasks
 	 */
-	env_array_overwrite_fmt(env, "MPIRUN_PORT",   "%d", port);
+	env_array_overwrite_fmt(env, "MPIRUN_PORT",   "%hu", port);
 	env_array_overwrite_fmt(env, "MPIRUN_NPROCS", "%d", st->nprocs);
 	env_array_overwrite_fmt(env, "MPIRUN_ID",     "%d", st->job->jobid);
 	if (st->connect_once) {
-- 
GitLab