diff --git a/src/common/gres.c b/src/common/gres.c index 7f0668e79f3a28e0db2d38bdf39fb61ac4ba69ce..71af131f3f3b6b0c3993ba741b369590b61f01cc 100644 --- a/src/common/gres.c +++ b/src/common/gres.c @@ -4577,8 +4577,8 @@ static uint32_t _step_test(void *step_gres_data, void *job_gres_data, } if (node_offset >= job_gres_ptr->node_cnt) { - error("gres/%s: step_test %u.%u node offset invalid (%d >= %u)", - gres_name, job_id, step_id, node_offset, + error("gres/%s: %s %u.%u node offset invalid (%d >= %u)", + gres_name, __func__, job_id, step_id, node_offset, job_gres_ptr->node_cnt); return 0; } @@ -4592,8 +4592,8 @@ static uint32_t _step_test(void *step_gres_data, void *job_gres_data, if (step_gres_ptr->gres_cnt_alloc > job_gres_avail) return 0; } else { - error("gres/%s: step_test %u.%u gres_cnt_step_alloc is NULL", - gres_name, job_id, step_id); + error("gres/%s: %s %u.%u gres_cnt_step_alloc is NULL", + gres_name, __func__, job_id, step_id); return 0; } @@ -4622,8 +4622,8 @@ static uint32_t _step_test(void *step_gres_data, void *job_gres_data, gres_cnt = NO_VAL; } else { /* Note: We already validated the gres count above */ - debug("gres/%s: step_test %u.%u gres_bit_alloc is NULL", - gres_name, job_id, step_id); + debug("gres/%s: %s %u.%u gres_bit_alloc is NULL", + gres_name, __func__, job_id, step_id); gres_cnt = NO_VAL; } @@ -5311,17 +5311,17 @@ static int _step_alloc(void *step_gres_data, void *job_gres_data, xassert(step_gres_ptr); if (node_offset >= job_gres_ptr->node_cnt) { - error("gres/%s: step_alloc for %u.%u, node offset invalid " + error("gres/%s: %s for %u.%u, node offset invalid " "(%d >= %u)", - gres_name, job_id, step_id, node_offset, + gres_name, __func__, job_id, step_id, node_offset, job_gres_ptr->node_cnt); return SLURM_ERROR; } if (step_gres_ptr->gres_cnt_alloc > job_gres_ptr->gres_cnt_alloc) { - error("gres/%s: step_alloc for %u.%u, step's > job's " + error("gres/%s: %s for %u.%u, step's > job's " "for node %d (%d > %u)", - gres_name, job_id, step_id, node_offset, + gres_name, __func__, job_id, step_id, node_offset, step_gres_ptr->gres_cnt_alloc, job_gres_ptr->gres_cnt_alloc); return SLURM_ERROR; @@ -5335,9 +5335,9 @@ static int _step_alloc(void *step_gres_data, void *job_gres_data, if (step_gres_ptr->gres_cnt_alloc > (job_gres_ptr->gres_cnt_alloc - job_gres_ptr->gres_cnt_step_alloc[node_offset])) { - error("gres/%s: step_alloc for %u.%u, step's > job's " + error("gres/%s: %s for %u.%u, step's > job's " "remaining for node %d (%d > (%u - %u))", - gres_name, job_id, step_id, node_offset, + gres_name, __func__, job_id, step_id, node_offset, step_gres_ptr->gres_cnt_alloc, job_gres_ptr->gres_cnt_alloc, job_gres_ptr->gres_cnt_step_alloc[node_offset]); @@ -5354,8 +5354,8 @@ static int _step_alloc(void *step_gres_data, void *job_gres_data, if ((job_gres_ptr->gres_bit_alloc == NULL) || (job_gres_ptr->gres_bit_alloc[node_offset] == NULL)) { - debug("gres/%s: step_alloc gres_bit_alloc for %u.%u is NULL", - gres_name, job_id, step_id); + debug("gres/%s: %s gres_bit_alloc for %u.%u is NULL", + gres_name, __func__, job_id, step_id); return SLURM_SUCCESS; } @@ -5379,8 +5379,9 @@ static int _step_alloc(void *step_gres_data, void *job_gres_data, } } if (gres_needed) { - error("gres/%s: step %u.%u oversubscribed resources on node %d", - gres_name, job_id, step_id, node_offset); + error("gres/%s: %s step %u.%u oversubscribed resources on " + "node %d", + gres_name, __func__, job_id, step_id, node_offset); } if (job_gres_ptr->gres_bit_step_alloc == NULL) { @@ -5399,8 +5400,8 @@ static int _step_alloc(void *step_gres_data, void *job_gres_data, job_gres_ptr->node_cnt); } if (step_gres_ptr->gres_bit_alloc[node_offset]) { - error("gres/%s: step %u.%u bit_alloc already exists", - gres_name, job_id, step_id); + error("gres/%s: %s step %u.%u bit_alloc already exists", + gres_name, __func__, job_id, step_id); bit_or(step_gres_ptr->gres_bit_alloc[node_offset], gres_bit_alloc); FREE_NULL_BITMAP(gres_bit_alloc); @@ -5495,13 +5496,13 @@ static int _step_dealloc(void *step_gres_data, void *job_gres_data, xassert(job_gres_ptr); xassert(step_gres_ptr); if (step_gres_ptr->node_in_use == NULL) { - error("gres/%s: step %u.%u dealloc, node_in_use is NULL", - gres_name, job_id, step_id); + error("gres/%s: %s step %u.%u dealloc, node_in_use is NULL", + gres_name, __func__, job_id, step_id); return SLURM_ERROR; } node_cnt = MIN(job_gres_ptr->node_cnt, step_gres_ptr->node_cnt); - for (i=0; i<node_cnt; i++) { + for (i = 0; i < node_cnt; i++) { if (!bit_test(step_gres_ptr->node_in_use, i)) continue; @@ -5511,9 +5512,9 @@ static int _step_dealloc(void *step_gres_data, void *job_gres_data, job_gres_ptr->gres_cnt_step_alloc[i] -= step_gres_ptr->gres_cnt_alloc; } else { - error("gres/%s: step %u.%u dealloc count " + error("gres/%s: %s step %u.%u dealloc count " "underflow", - gres_name, job_id, step_id); + gres_name, __func__, job_id, step_id); job_gres_ptr->gres_cnt_step_alloc[i] = 0; } } @@ -5521,19 +5522,20 @@ static int _step_dealloc(void *step_gres_data, void *job_gres_data, (step_gres_ptr->gres_bit_alloc[i] == NULL)) continue; if (job_gres_ptr->gres_bit_alloc[i] == NULL) { - error("gres/%s: step dealloc, job %u gres_bit_alloc[%d]" - " is NULL", gres_name, job_id, i); + error("gres/%s: %s job %u gres_bit_alloc[%d]" + " is NULL", __func__, gres_name, job_id, i); continue; } len_j = bit_size(job_gres_ptr->gres_bit_alloc[i]); len_s = bit_size(step_gres_ptr->gres_bit_alloc[i]); if (len_j != len_s) { - error("gres/%s: step %u.%u dealloc, bit_alloc[%d] size " - "mis-match (%d != %d)", - gres_name, job_id, step_id, i, len_j, len_s); + error("gres/%s: %s step %u.%u dealloc, bit_alloc[%d] " + "size mis-match (%d != %d)", + gres_name, __func__, job_id, step_id, + i, len_j, len_s); len_j = MIN(len_j, len_s); } - for (j=0; j<len_j; j++) { + for (j = 0; j < len_j; j++) { if (!bit_test(step_gres_ptr->gres_bit_alloc[i], j)) continue; if (job_gres_ptr->gres_bit_step_alloc && diff --git a/src/common/gres.h b/src/common/gres.h index bae10d557aef12b91c9570d535f58a0c5af4573a..e26ed7ce755e3327521050e8bdf3fe836d503682 100644 --- a/src/common/gres.h +++ b/src/common/gres.h @@ -121,7 +121,7 @@ typedef struct gres_job_state { uint32_t gres_cnt_alloc; /* Resources currently allocated to job on each node */ - uint32_t node_cnt; + uint32_t node_cnt; /* 0 if no_consume */ bitstr_t **gres_bit_alloc; /* Resources currently allocated to job steps on each node.