diff --git a/src/common/slurmdb_pack.c b/src/common/slurmdb_pack.c index 059751a8442fc7b2fd609976d7a956642582c1f8..d8d776316c958807a5a9a6bfb1b23ca6f3462b89 100644 --- a/src/common/slurmdb_pack.c +++ b/src/common/slurmdb_pack.c @@ -3769,7 +3769,6 @@ extern void slurmdb_pack_assoc_cond(void *in, uint16_t rpc_version, } list_iterator_destroy(itr); } - count = NO_VAL; pack32(NO_VAL, buffer); diff --git a/src/plugins/burst_buffer/cray/burst_buffer_cray.c b/src/plugins/burst_buffer/cray/burst_buffer_cray.c index a1b0590e7b127ae1f79a13f8b3e93e65b17de27b..0fd5a0b2a2987cb038f4ff1a4c431dbbb216c7f2 100644 --- a/src/plugins/burst_buffer/cray/burst_buffer_cray.c +++ b/src/plugins/burst_buffer/cray/burst_buffer_cray.c @@ -429,7 +429,6 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr) bb_specs = xstrdup(job_ptr->burst_buffer); tok = strtok_r(bb_specs, " ", &save_ptr); while (tok) { - tmp_cnt = 0; if (!strncmp(tok, "SLURM_JOB=", 10)) { /* Format: "SLURM_JOB=SIZE=%"PRIu64",ACCESS=%s,TYPE=%s" */ have_bb = true; @@ -438,12 +437,12 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr) job_type = strstr(tok, ",TYPE="); if (job_type) { job_type[0] = '\0'; - job_type += 6; + /* FIXME: Contents current unused */ } job_access = strstr(tok, ",ACCESS="); if (job_access) { job_access[0] = '\0'; - job_access += 8; + /* FIXME: Contents current unused */ } bb_size = strstr(tok, "SIZE="); if (bb_size) { @@ -452,8 +451,7 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr) bb_size + 5, bb_state.bb_config.granularity); bb_job->total_size += tmp_cnt; - } else - tmp_cnt = 0; + } } else if (!strncmp(tok, "SLURM_SWAP=", 11)) { /* Format: "SLURM_SWAP=%uGB(%uNodes)" */ tok += 11; @@ -497,12 +495,12 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr) bb_type = strstr(tok, ",TYPE="); if (bb_type) { bb_type[0] = '\0'; - bb_type += 6; + /* FIXME: Contents current unused */ } bb_access = strstr(tok, ",ACCESS="); if (bb_access) { bb_access[0] = '\0'; - bb_access += 8; + /* FIXME: Contents current unused */ } bb_size = strstr(tok, ",SIZE="); if (bb_size) { @@ -983,6 +981,7 @@ static void _load_state(bool init_config) instances = _bb_get_instances(&num_instances, &bb_state); if (instances == NULL) { info("%s: failed to find DataWarp instances", __func__); + num_instances = 0; /* Redundant, but fixes CLANG bug */ } sessions = _bb_get_sessions(&num_sessions, &bb_state); pthread_mutex_lock(&bb_state.bb_mutex); @@ -2097,7 +2096,6 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size, rc = ESLURM_INVALID_BURST_BUFFER_REQUEST; break; } - if ((sub_tok = strstr(tok, "hurry"))) { hurry = true; sub_tok[0] = '\0'; @@ -3735,14 +3733,16 @@ static void *_destroy_persistent(void *x) BB_STATE_DELETED); /* Modify internal buffer record for purging */ - bb_alloc->state = BB_STATE_COMPLETE; - bb_alloc->job_id = destroy_args->job_id; - bb_alloc->state_time = time(NULL); - bb_limit_rem(bb_alloc->user_id, bb_alloc->account, - bb_alloc->partition, bb_alloc->qos, - bb_alloc->size, &bb_state); - (void) bb_post_persist_delete(bb_alloc, &bb_state); - (void) bb_free_alloc_rec(&bb_state, bb_alloc); + if (bb_alloc) { + bb_alloc->state = BB_STATE_COMPLETE; + bb_alloc->job_id = destroy_args->job_id; + bb_alloc->state_time = time(NULL); + bb_limit_rem(bb_alloc->user_id, bb_alloc->account, + bb_alloc->partition, bb_alloc->qos, + bb_alloc->size, &bb_state); + (void) bb_post_persist_delete(bb_alloc, &bb_state); + (void) bb_free_alloc_rec(&bb_state, bb_alloc); + } bb_state.last_update_time = time(NULL); pthread_mutex_unlock(&bb_state.bb_mutex); } @@ -3751,7 +3751,7 @@ static void *_destroy_persistent(void *x) return NULL; } -/* _bb_get_instances() +/* _bb_get_configs() * * Handle the JSON stream with configuration info (instance use details). */ diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index 125a59390c01f87c9b39f339188c887bf00d93ff..fa61a0f414c9d3abe553cc9daddc58735f2839b3 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -1362,8 +1362,8 @@ static int _init_tres(void) slurm_addto_char_list(char_list, temp_char); xfree(temp_char); + memset(&update_object, 0, sizeof(slurmdb_update_object_t)); if (!association_based_accounting) { - memset(&update_object, 0, sizeof(slurmdb_update_object_t)); update_object.type = SLURMDB_ADD_TRES; update_object.objects = list_create(slurmdb_destroy_tres_rec); } diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 24114a3a65ff851d66ec9d2d7f744a36491dc787..7e224fd31d53922fd81a53857515daaf7baa0ab8 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -9590,7 +9590,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs, job_ptr->tres_req_cnt[TRES_ARRAY_CPU], job_specs->min_nodes != NO_VAL ? job_specs->min_nodes : - detail_ptr->min_nodes); + detail_ptr ? detail_ptr->min_nodes : 1); if (job_specs->gres) { if ((!IS_JOB_PENDING(job_ptr)) || (detail_ptr == NULL) || @@ -10281,6 +10281,19 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs, save_min_nodes, detail_ptr->min_nodes, job_ptr->job_id); job_ptr->limit_set.tres[TRES_ARRAY_NODE] = acct_policy_limit_set.tres[TRES_ARRAY_NODE]; + job_ptr->tres_req_cnt[TRES_ARRAY_NODE] = + (uint64_t)detail_ptr->min_nodes; + xfree(job_ptr->tres_req_str); + job_ptr->tres_req_str = + assoc_mgr_make_tres_str_from_array( + job_ptr->tres_req_cnt, + TRES_STR_FLAG_SIMPLE, false); + + xfree(job_ptr->tres_fmt_req_str); + job_ptr->tres_fmt_req_str = + assoc_mgr_make_tres_str_from_array( + job_ptr->tres_req_cnt, + 0, false); update_accounting = true; } if (save_max_nodes && (save_max_nodes != detail_ptr->max_nodes)) { diff --git a/src/slurmctld/srun_comm.c b/src/slurmctld/srun_comm.c index e08ffe934559f36ff9de753f908283b0d506e547..d039310fbdad0e7b2f693b6f36427aa1278a001e 100644 --- a/src/slurmctld/srun_comm.c +++ b/src/slurmctld/srun_comm.c @@ -108,6 +108,16 @@ extern void srun_allocate (uint32_t job_id) msg_arg->cpu_freq_min = job_ptr->details->cpu_freq_min; msg_arg->cpu_freq_max = job_ptr->details->cpu_freq_max; msg_arg->cpu_freq_gov = job_ptr->details->cpu_freq_gov; + if (job_ptr->details->env_cnt) { + msg_arg->env_size = job_ptr->details->env_cnt; + msg_arg->environment = xmalloc( + sizeof(char *) * msg_arg->env_size); + for (i = 0; i < msg_arg->env_size; i++) { + msg_arg->environment[i] = + xstrdup(job_ptr->details-> + env_sup[i]); + } + } } memcpy(msg_arg->cpus_per_node, job_resrcs_ptr->cpu_array_value, @@ -121,15 +131,6 @@ extern void srun_allocate (uint32_t job_id) msg_arg->select_jobinfo = select_g_select_jobinfo_copy( job_ptr->select_jobinfo); msg_arg->error_code = SLURM_SUCCESS; - if (job_ptr->details->env_cnt) { - msg_arg->env_size = job_ptr->details->env_cnt; - msg_arg->environment = xmalloc(sizeof(char *) * - msg_arg->env_size); - for (i = 0; i < msg_arg->env_size; i++) { - msg_arg->environment[i] = - xstrdup(job_ptr->details->env_sup[i]); - } - } _srun_agent_launch(addr, job_ptr->alloc_node, RESPONSE_RESOURCE_ALLOCATION, msg_arg,