diff --git a/src/plugins/select/bluegene/ba_common.c b/src/plugins/select/bluegene/ba_common.c index dd31800f1026c5749aaf0ec3c4d2d0ca556f1a9e..71111fadd7f02ef18fbd27e3c2ee861dd7fe5916 100644 --- a/src/plugins/select/bluegene/ba_common.c +++ b/src/plugins/select/bluegene/ba_common.c @@ -1639,3 +1639,50 @@ extern char *give_geo(uint16_t *int_geo, int dims, bool with_sep) return geo; } +/* + * Convert a BG API error code to a string + * IN inx - error code from any of the BG Bridge APIs + * RET - string describing the error condition + */ +extern const char *bg_err_str(int inx) +{ + static char tmp_char[10]; + + switch (inx) { + case SLURM_SUCCESS: + return "Slurm Success"; + case SLURM_ERROR: + return "Slurm Error"; + case BG_ERROR_BLOCK_NOT_FOUND: + return "Block not found"; + case BG_ERROR_BOOT_ERROR: + return "Block boot error"; + case BG_ERROR_JOB_NOT_FOUND: + return "Job not found"; + case BG_ERROR_MP_NOT_FOUND: + return "Midplane not found"; + case BG_ERROR_SWITCH_NOT_FOUND: + return "Switch not found"; + case BG_ERROR_BLOCK_ALREADY_DEFINED: + return "Block already defined"; + case BG_ERROR_JOB_ALREADY_DEFINED: + return "Job already defined"; + case BG_ERROR_CONNECTION_ERROR: + return "Connection error"; + case BG_ERROR_INTERNAL_ERROR: + return "Internal error"; + case BG_ERROR_INVALID_INPUT: + return "Invalid input"; + case BG_ERROR_INCONSISTENT_DATA: + return "Inconsistent data"; + case BG_ERROR_NO_IOBLOCK_CONNECTED: + return "No IO Block Connected"; + } + /* I know this isn't the best way to handle this, but it only + happens very rarely and usually in debugging, so it + hopefully isn't really all that bad. + */ + snprintf(tmp_char, sizeof(tmp_char), "%u ?", inx); + return tmp_char; +} + diff --git a/src/plugins/select/bluegene/ba_common.h b/src/plugins/select/bluegene/ba_common.h index e6e7e1a1ce11bc3a142ac9f1933f09795098c1d2..c243928f3ad3f6c4e5da2f0c3873df1613f9049b 100644 --- a/src/plugins/select/bluegene/ba_common.h +++ b/src/plugins/select/bluegene/ba_common.h @@ -552,4 +552,6 @@ extern char *ba_passthroughs_string(uint16_t passthrough); extern char *give_geo(uint16_t *int_geo, int dims, bool with_sep); +extern const char *bg_err_str(int inx); + #endif diff --git a/src/plugins/select/bluegene/bg_core.c b/src/plugins/select/bluegene/bg_core.c index 74e1743a5caac36012bd9582c6b31ff738c492cb..01fb3b6e5303ea2d61681237d0fc1ee4b25b1985 100644 --- a/src/plugins/select/bluegene/bg_core.c +++ b/src/plugins/select/bluegene/bg_core.c @@ -554,51 +554,3 @@ extern int node_already_down(char *node_name) return 0; } - -/* - * Convert a BG API error code to a string - * IN inx - error code from any of the BG Bridge APIs - * RET - string describing the error condition - */ -extern const char *bg_err_str(int inx) -{ - static char tmp_char[10]; - - switch (inx) { - case SLURM_SUCCESS: - return "Slurm Success"; - case SLURM_ERROR: - return "Slurm Error"; - case BG_ERROR_BLOCK_NOT_FOUND: - return "Block not found"; - case BG_ERROR_BOOT_ERROR: - return "Block boot error"; - case BG_ERROR_JOB_NOT_FOUND: - return "Job not found"; - case BG_ERROR_MP_NOT_FOUND: - return "Midplane not found"; - case BG_ERROR_SWITCH_NOT_FOUND: - return "Switch not found"; - case BG_ERROR_BLOCK_ALREADY_DEFINED: - return "Block already defined"; - case BG_ERROR_JOB_ALREADY_DEFINED: - return "Job already defined"; - case BG_ERROR_CONNECTION_ERROR: - return "Connection error"; - case BG_ERROR_INTERNAL_ERROR: - return "Internal error"; - case BG_ERROR_INVALID_INPUT: - return "Invalid input"; - case BG_ERROR_INCONSISTENT_DATA: - return "Inconsistent data"; - case BG_ERROR_NO_IOBLOCK_CONNECTED: - return "No IO Block Connected"; - } - /* I know this isn't the best way to handle this, but it only - happens very rarely and usually in debugging, so it - hopefully isn't really all that bad. - */ - snprintf(tmp_char, sizeof(tmp_char), "%u ?", inx); - return tmp_char; -} - diff --git a/src/plugins/select/bluegene/bg_core.h b/src/plugins/select/bluegene/bg_core.h index 7277a7824d7526012ddd0b192472c2d361c5ca42..788a97f0e6d458623b0455f8b8e71ab374061c12 100644 --- a/src/plugins/select/bluegene/bg_core.h +++ b/src/plugins/select/bluegene/bg_core.h @@ -81,7 +81,6 @@ extern int free_block_list(uint32_t job_id, List track_list, bool destroy, bool wait); extern int read_bg_conf(); extern int node_already_down(char *node_name); -extern const char *bg_err_str(int inx); #endif /* _BG_CORE_H_ */