From 42e3d200fe60ec43ab57a3f903fd80b031f83254 Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Fri, 10 Apr 2015 16:30:49 -0700
Subject: [PATCH] CRAY - Fix issue with scontrol reconfig

This is a correction to commit 1eb32d909034a4727f008547c3258edcdbb512b1
so the select/cray plugin can be built on non-Cray system (for testing).
bug 1587
---
 src/plugins/select/cray/select_cray.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/plugins/select/cray/select_cray.c b/src/plugins/select/cray/select_cray.c
index 2575a3a60f1..6d08d3767b2 100644
--- a/src/plugins/select/cray/select_cray.c
+++ b/src/plugins/select/cray/select_cray.c
@@ -151,15 +151,16 @@ static uint32_t blade_cnt = 0;
 static pthread_mutex_t blade_mutex = PTHREAD_MUTEX_INITIALIZER;
 static time_t last_npc_update;
 
-static alpsc_topology_t *topology = NULL;
-static size_t topology_num_nodes = 0;
-
 static int active_post_nhc_cnt = 0;
 static pthread_mutex_t throttle_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t throttle_cond = PTHREAD_COND_INITIALIZER;
 
-#ifdef HAVE_NATIVE_CRAY
+#if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
+static size_t topology_num_nodes = 0;
+static alpsc_topology_t *topology = NULL;
+#endif
 
+#ifdef HAVE_NATIVE_CRAY
 
 /* Used for aeld communication */
 alpsc_ev_app_t *app_list = NULL;	// List of running/suspended apps
@@ -1154,8 +1155,10 @@ extern int fini ( void )
 		_free_blade(&blade_array[i]);
 	xfree(blade_array);
 
+#if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
 	if (topology)
 		free(topology);
+#endif
 
 	slurm_mutex_unlock(&blade_mutex);
 
-- 
GitLab