From 171dc1ade59b1475007833f3bcab9e311f6bf49a Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Wed, 21 Aug 2013 14:32:28 -0700
Subject: [PATCH] CRAY - Make new variable CLUSTER_FLAG_CRAY by combining
 CLUSTER_FLAG_CRAY_A and CLUSTER_FLAG_CRAY_N

---
 slurm/slurmdb.h              | 5 +++++
 src/common/working_cluster.c | 3 +--
 src/smap/grid_functions.c    | 7 ++-----
 src/sview/grid.c             | 9 +++------
 4 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/slurm/slurmdb.h b/slurm/slurmdb.h
index 9833a468ef0..4fdd46051b0 100644
--- a/slurm/slurmdb.h
+++ b/slurm/slurmdb.h
@@ -176,6 +176,11 @@ typedef enum {
 #define CLUSTER_FLAG_FE     0x00000200 /* This cluster is a front end system */
 #define CLUSTER_FLAG_CRAY_N 0x00000400 /* This cluster is a Native cray */
 
+
+/* Cluster Combo flags */
+#define CLUSTER_FLAG_CRAY   0x00000500 /* This cluster is a cray.
+					  Combo of CRAY_A | CRAY_N */
+
 /* Define assoc_mgr_association_usage_t below to avoid including
  * extraneous slurmdb headers */
 #ifndef __assoc_mgr_association_usage_t_defined
diff --git a/src/common/working_cluster.c b/src/common/working_cluster.c
index 20d7668e3c5..8af72ca291b 100644
--- a/src/common/working_cluster.c
+++ b/src/common/working_cluster.c
@@ -72,8 +72,7 @@ extern int *slurmdb_setup_cluster_dim_size(void)
 extern bool is_cray_system(void)
 {
 	if (working_cluster_rec)
-		return working_cluster_rec->flags &
-			(CLUSTER_FLAG_CRAY_A | CLUSTER_FLAG_CRAY_N);
+		return working_cluster_rec->flags & CLUSTER_FLAG_CRAY;
 #if defined HAVE_ALPS_CRAY || defined HAVE_NATIVE_CRAY
 	return true;
 #endif
diff --git a/src/smap/grid_functions.c b/src/smap/grid_functions.c
index fd7432a3cb4..fd540061849 100644
--- a/src/smap/grid_functions.c
+++ b/src/smap/grid_functions.c
@@ -65,8 +65,7 @@ extern int *get_cluster_dims(node_info_msg_t *node_info_ptr)
 {
 	int *dim_size = slurmdb_setup_cluster_dim_size();
 
-	if ((params.cluster_flags & (CLUSTER_FLAG_CRAY_A | CLUSTER_FLAG_CRAY_N))
-	    && dim_size) {
+	if ((params.cluster_flags & CLUSTER_FLAG_CRAY) && dim_size) {
 		static int cray_dim_size[3] = {-1, -1, -1};
 		/* For now, assume one node per coordinate all
 		 * May need to refine. */
@@ -214,9 +213,7 @@ extern void init_grid(node_info_msg_t *node_info_ptr, int cols)
 						node_ptr->name[j] - '0';
 					j++;
 				}
-			} else if (params.cluster_flags
-				   & (CLUSTER_FLAG_CRAY_A |
-				      CLUSTER_FLAG_CRAY_N)) {
+			} else if (params.cluster_flags & CLUSTER_FLAG_CRAY) {
 				int len_a, len_h;
 				len_a = strlen(node_ptr->node_addr);
 				len_h = strlen(node_ptr->node_hostname);
diff --git a/src/sview/grid.c b/src/sview/grid.c
index 495dd70fb7a..d30e0785927 100644
--- a/src/sview/grid.c
+++ b/src/sview/grid.c
@@ -554,8 +554,7 @@ static int *_get_cluster_dims(void)
 {
 	int *my_dim_size = slurmdb_setup_cluster_dim_size();
 
-	if ((cluster_flags & (CLUSTER_FLAG_CRAY_A | CLUSTER_FLAG_CRAY_N))
-	    && my_dim_size) {
+	if ((cluster_flags & CLUSTER_FLAG_CRAY) && my_dim_size) {
 		static int cray_dim_size[3] = {-1, -1, -1};
 		/* For now, assume four nodes per coordinate all in
 		 * the same cage. Need to refine. */
@@ -606,8 +605,7 @@ static int _add_button_to_list(node_info_t *node_ptr,
 				g_error("bad node name %s\n", node_ptr->name);
 				return SLURM_ERROR;
 			}
-			if (cluster_flags
-			    & (CLUSTER_FLAG_CRAY_A | CLUSTER_FLAG_CRAY_N)) {
+			if (cluster_flags & CLUSTER_FLAG_CRAY) {
 				len_a = strlen(node_ptr->node_addr);
 				if (len_a < cluster_dims) {
 					g_error("bad node addr %s\n",
@@ -661,8 +659,7 @@ static int _add_button_to_list(node_info_t *node_ptr,
 	} else if (cluster_dims == 3) {
 		int x, y, z;
 		if (node_ptr) {
-			if (cluster_flags
-			    & (CLUSTER_FLAG_CRAY_A | CLUSTER_FLAG_CRAY_N)) {
+			if (cluster_flags & CLUSTER_FLAG_CRAY) {
 				x = select_char2coord(
 					node_ptr->node_addr[len_a-3]);
 				y = select_char2coord(
-- 
GitLab