Skip to content
Snippets Groups Projects
Commit 3097cd86 authored by Moe Jette's avatar Moe Jette
Browse files

01_Enable-compilation-of-HAVE_CRAY-without-errors.diff from Gerrit

Allow compilation with --enable-cray.

This patch allows compilation of slurm with --enable-cray without build errors,
on such (multi-cluster) systems that need to be able to load select/cray, but
without actually using the internal functionality (e.g. slurmdbd host).

The code stubs have been translated into corresponding comments with FIXMEs
added, these are then addressed later in the (post-2.2) patch set.

Added the missing part (variables) to fix build errors and tested tested that 
the compilation of --enable-cray works without errors.
parent 4becc234
No related branches found
No related tags found
No related merge requests found
...@@ -68,16 +68,7 @@ extern int basil_resv_conf(uint32_t reservation_id, uint32_t job_id) ...@@ -68,16 +68,7 @@ extern int basil_resv_conf(uint32_t reservation_id, uint32_t job_id)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
#ifdef HAVE_CRAY #ifdef HAVE_CRAY
/* Issue the BASIL CONFIRM request */ /* Issue the BASIL CONFIRM request - To Be Done */
if (request_failure) { #endif
error("basil confirm of %u error: %s", reservation_id, "TBD");
return SLURM_ERROR;
}
debug("basil confirm of reservation %u by job %u complete",
reservation_id, job_id);
#else
debug("basil confirm of reservation %u by job %u complete",
reservation_id, job_id);
#endif /* HAVE_CRAY */
return error_code; return error_code;
} }
...@@ -67,7 +67,7 @@ static void _validate_basil_node_id(void) ...@@ -67,7 +67,7 @@ static void _validate_basil_node_id(void)
int i; int i;
struct node_record *node_ptr = node_record_table_ptr; struct node_record *node_ptr = node_record_table_ptr;
for (i=0; i<node_record_cnt; i++, node_ptr++) for (i = 0; i < node_record_count; i++, node_ptr++) {
if (node_ptr->basil_node_id != NO_VAL) if (node_ptr->basil_node_id != NO_VAL)
continue; continue;
if (IS_NODE_DOWN(node_ptr)) if (IS_NODE_DOWN(node_ptr))
...@@ -89,118 +89,35 @@ extern int basil_query(void) ...@@ -89,118 +89,35 @@ extern int basil_query(void)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
#ifdef HAVE_CRAY #ifdef HAVE_CRAY
struct config_record *config_ptr;
struct node_record *node_ptr; struct node_record *node_ptr;
struct job_record *job_ptr;
ListIterator job_iterator;
int i; int i;
char *reason;
uint32_t res_id = 0;
static bool first_run = true; static bool first_run = true;
/* Issue the BASIL QUERY request */ /*
if (request_failure) { * Issue the BASIL INVENTORY QUERY
fatal("basil query error: %s", "TBD"); * FIXME: Still to be done,
return SLURM_ERROR; * return SLURM_ERROR on failure
} */
debug("basil query initiated"); debug("basil query initiated");
if (first_run) { if (first_run) {
/* Set basil_node_id to NO_VAL since the default value /* Set basil_node_id to NO_VAL since the default value
* of zero is a valid BASIL node ID */ * of zero is a valid BASIL node ID */
node_ptr = node_record_table_ptr; node_ptr = node_record_table_ptr;
for (i=0; i<node_record_cnt; i++, node_ptr++) for (i = 0; i < node_record_count; i++, node_ptr++)
node_ptr->basil_node_id = NO_VAL; node_ptr->basil_node_id = NO_VAL;
first_run = false; first_run = false;
} }
/* Validate configuration for each node that BASIL reports */ /* Validate configuration for each node that BASIL reports: TBD */
for (each_basil_node) {
#if BASIL_DEBUG
/* Log node state according to BASIL */
info("basil query: name=%s arch=%s",
basil_node_name, basil_node_arch, etc.);
#endif /* BASIL_DEBUG */
/* NOTE: Cray should provide X-, Y- and Z-coordinates
* in the future. When that happens, we'll want to use
* those numbers to generate the hostname:
* slurm_host_name = xmalloc(sizeof(conf->node_prefix) + 4);
* sprintf(slurm_host_name: %s%d%d%d", basil_node_name, X,Y,Z);
* Until then the node name must contain a 3-digit numberic
* suffix specifying the X-, Y- and Z-coordinates.
*/
node_ptr = find_node_record(basil_node_name);
if (node_ptr == NULL) {
error("basil node %s not found in slurm",
basil_node_name);
continue;
}
/* Record BASIL's node_id for use in reservations */
node_ptr->basil_node_id = basil_node_id;
/* Update architecture in slurmctld's node record */
if (node_ptr->arch == NULL) {
xfree(node_ptr->arch);
node_ptr->arch = xstrdup(basil_node_arch);
}
/* Update slurmctld's node state if necessary */
reason = NULL;
if (!IS_NODE_DOWN(node_ptr)) {
if (strcmp(basil_state, "UP"))
reason = "basil state not UP";
else if (strcmp(basil_role, "BATCH"))
reason = "basil role not BATCH";
}
/* Calculate the total count of processors and
* MB of memory on the node */
config_ptr = node_ptr->config_ptr;
if ((slurmctld_conf.fast_schedule != 2) &&
(basil_cpus < config_ptr->cpus)) {
error("Node %s has low cpu count %d",
node_ptr->name, basil_cpus);
reason = "Low CPUs";
}
node_ptr->cpus = basil_cpus;
if ((slurmctld_conf.fast_schedule != 2) &&
(basil_memory < config_ptr->real_memory)) {
error("Node %s has low real_memory size %d",
node_ptr->name, basil_memory);
reason = "Low RealMemory";
}
node_ptr->real_memory = basil_memory;
if (reason) {
last_node_update = time(NULL);
set_node_down(node_ptr->name, reason);
}
}
_validate_basil_node_id(); _validate_basil_node_id();
/* Confirm that each BASIL reservation is still valid, /*
* purge vestigial reservations */ * Confirm that each BASIL reservation is still valid,
for (each_basil_reservation) { * iterate through each current ALPS reservation,
bool found = false; * purge vestigial reservations.
job_iterator = list_iterator_create(job_list); * FIXME: still to be done
while ((job_ptr = (struct job_record *) */
list_next(job_iterator))) {
select_g_select_jobinfo_get(job_ptr->select_jobinfo,
SELECT_JOBDATA_RESV_ID,
&res_id);
found = res_id == basil_reservation_id;
if (found)
break;
}
list_iterator_destroy(job_iterator);
if (found) {
error("vestigial basil reservation %s being removed",
basil_reservation_id);
basil_dealloc(basil_reservation_id);
}
}
#endif /* HAVE_CRAY */ #endif /* HAVE_CRAY */
return error_code; return error_code;
...@@ -215,11 +132,12 @@ extern int basil_reserve(struct job_record *job_ptr) ...@@ -215,11 +132,12 @@ extern int basil_reserve(struct job_record *job_ptr)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
#ifdef HAVE_CRAY #ifdef HAVE_CRAY
/* Issue the BASIL RESERVE request */ uint32_t reservation_id;
if (request_failure) {
error("basil reserve error: %s", "TBD"); /*
return SLURM_ERROR; * Issue the BASIL RESERVE request
} * FIXME: still to be done, return SLURM_ERROR on error.
*/
select_g_select_jobinfo_set(job_ptr->select_jobinfo, select_g_select_jobinfo_set(job_ptr->select_jobinfo,
SELECT_JOBDATA_RESV_ID, &reservation_id); SELECT_JOBDATA_RESV_ID, &reservation_id);
debug("basil reservation made job_id=%u resv_id=%u", debug("basil reservation made job_id=%u resv_id=%u",
...@@ -256,11 +174,10 @@ extern int basil_release_id(uint32_t reservation_id) ...@@ -256,11 +174,10 @@ extern int basil_release_id(uint32_t reservation_id)
{ {
int error_code = SLURM_SUCCESS; int error_code = SLURM_SUCCESS;
#ifdef HAVE_CRAY #ifdef HAVE_CRAY
/* Issue the BASIL RELEASE request */ /*
if (request_failure) { * Issue the BASIL RELEASE request
error("basil release of %d error: %s", reservation_id, "TBD"); * FIXME: still to be done, return SLURM_ERROR on error.
return SLURM_ERROR; */
}
debug("basil release of reservation %d complete", reservation_id); debug("basil release of reservation %d complete", reservation_id);
#endif /* HAVE_CRAY */ #endif /* HAVE_CRAY */
return error_code; return error_code;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment