From 49462e511dd285d0afab554fd93184474fb2e755 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Thu, 14 Jul 2011 15:47:42 -0700
Subject: [PATCH] BLUEGENE - moved some #defines within the bluegene plugin
 that aren't needed anywhere else

---
 src/common/node_select.c                | 28 ------------------------
 src/common/node_select.h                | 18 +--------------
 src/plugins/select/bluegene/ba_common.c | 29 +++++++++++++++++++++++++
 src/plugins/select/bluegene/ba_common.h | 16 ++++++++++++++
 4 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/src/common/node_select.c b/src/common/node_select.c
index 122e29946b8..537d1f23c09 100644
--- a/src/common/node_select.c
+++ b/src/common/node_select.c
@@ -1386,31 +1386,3 @@ extern int select_g_ba_remove_block(List mps, bool is_small)
 	return (*(select_context[plugin_id].ops.ba_remove_block))
 		(mps, is_small);
 }
-
-extern char *select_g_ba_passthroughs_string(uint16_t passthrough)
-{
-	char *pass = NULL;
-
-	if (passthrough & PASS_FOUND_A)
-		xstrcat(pass, "A");
-	if (passthrough & PASS_FOUND_X) {
-		if (pass)
-			xstrcat(pass, ",X");
-		else
-			xstrcat(pass, "X");
-	}
-	if (passthrough & PASS_FOUND_Y) {
-		if (pass)
-			xstrcat(pass, ",Y");
-		else
-			xstrcat(pass, "Y");
-	}
-	if (passthrough & PASS_FOUND_Z) {
-		if (pass)
-			xstrcat(pass, ",Z");
-		else
-			xstrcat(pass, "Z");
-	}
-
-	return pass;
-}
diff --git a/src/common/node_select.h b/src/common/node_select.h
index f566da31b9d..13e7a9628bd 100644
--- a/src/common/node_select.h
+++ b/src/common/node_select.h
@@ -54,18 +54,6 @@
 #define NO_JOB_RUNNING -1
 #define NOT_FROM_CONTROLLER -2
 
-#define PASS_DENY_A    0x0001
-#define PASS_DENY_X    0x0002
-#define PASS_DENY_Y    0x0004
-#define PASS_DENY_Z    0x0008
-#define PASS_DENY_ALL  0x00ff
-
-#define PASS_FOUND_A   0x0100
-#define PASS_FOUND_X   0x0200
-#define PASS_FOUND_Y   0x0400
-#define PASS_FOUND_Z   0x0800
-#define PASS_FOUND_ANY 0xff00
-
 typedef struct {
 	bitstr_t *avail_nodes;      /* usable nodes are set on input, nodes
 				     * not required to satisfy the request
@@ -108,7 +96,7 @@ typedef struct {
 	char *ramdiskimage;            /* RamDiskImage for this block */
 	bool rotate;                   /* whether allow elongation or not */
 	int rotate_count;              /* number of times rotated */
-	char *save_name;               /* name of blocks in midplanes */
+	char *save_name;               /* name of midplanes in block */
 	int size;                      /* count of midplanes in block */
 	uint16_t small16;              /* number of blocks using 16 cnodes in
 					* block, only used for small
@@ -649,8 +637,4 @@ extern void select_g_ba_reset(bool track_down_nodes);
 extern int select_g_ba_request_apply(select_ba_request_t *ba_request);
 extern int select_g_ba_remove_block(List mps, bool is_small);
 
-/* Convert PASS_FOUND_* into equivalent string
- * Caller MUST xfree() the returned value */
-extern char *select_g_ba_passthroughs_string(uint16_t passthrough);
-
 #endif /*__SELECT_PLUGIN_API_H__*/
diff --git a/src/plugins/select/bluegene/ba_common.c b/src/plugins/select/bluegene/ba_common.c
index be93b37e408..f07c44cf798 100644
--- a/src/plugins/select/bluegene/ba_common.c
+++ b/src/plugins/select/bluegene/ba_common.c
@@ -1600,3 +1600,32 @@ extern void reset_ba_system(bool track_down_mps)
 
 	_internal_reset_ba_system(0, coords, track_down_mps);
 }
+
+extern char *ba_passthroughs_string(uint16_t passthrough)
+{
+	char *pass = NULL;
+
+	if (passthrough & PASS_FOUND_A)
+		xstrcat(pass, "A");
+	if (passthrough & PASS_FOUND_X) {
+		if (pass)
+			xstrcat(pass, ",X");
+		else
+			xstrcat(pass, "X");
+	}
+	if (passthrough & PASS_FOUND_Y) {
+		if (pass)
+			xstrcat(pass, ",Y");
+		else
+			xstrcat(pass, "Y");
+	}
+	if (passthrough & PASS_FOUND_Z) {
+		if (pass)
+			xstrcat(pass, ",Z");
+		else
+			xstrcat(pass, "Z");
+	}
+
+	return pass;
+}
+
diff --git a/src/plugins/select/bluegene/ba_common.h b/src/plugins/select/bluegene/ba_common.h
index 471e98f73a4..40546241136 100644
--- a/src/plugins/select/bluegene/ba_common.h
+++ b/src/plugins/select/bluegene/ba_common.h
@@ -58,6 +58,18 @@
 extern int DIM_SIZE[HIGHEST_DIMENSIONS]; /* how many midplanes in
 					  * each dimension */
 
+#define PASS_DENY_A    0x0001
+#define PASS_DENY_X    0x0002
+#define PASS_DENY_Y    0x0004
+#define PASS_DENY_Z    0x0008
+#define PASS_DENY_ALL  0x00ff
+
+#define PASS_FOUND_A   0x0100
+#define PASS_FOUND_X   0x0200
+#define PASS_FOUND_Y   0x0400
+#define PASS_FOUND_Z   0x0800
+#define PASS_FOUND_ANY 0xff00
+
 #define BA_MP_USED_FALSE          0x0000
 #define BA_MP_USED_TRUE           0x0001
 #define BA_MP_USED_TEMP           0x0002
@@ -537,4 +549,8 @@ extern int ba_clear_sub_block_cnodes(
  * or cnode coords */
 extern char *ba_set_ionode_str(bitstr_t *bitmap);
 
+/* Convert PASS_FOUND_* into equivalent string
+ * Caller MUST xfree() the returned value */
+extern char *ba_passthroughs_string(uint16_t passthrough);
+
 #endif
-- 
GitLab