diff --git a/NEWS b/NEWS index ab3fad6fb544a532dc334c488f23029c126765c8..5da14cfd9a8e19010d9f20fe57a7fe022a213695 100644 --- a/NEWS +++ b/NEWS @@ -109,9 +109,9 @@ documents those changes that are of interest to users and administrators. -- If scancel is operating on large number of jobs and RPC responses from slurmctld daemon are slow then introduce a delay in sending the cancel job requests from scancel in order to reduce load on slurmctld. - -- If updating the number of cpus as well as tasks at the same time fix -- Remove redundant logic when updating a job's task count. -- MySQL - Fix querying jobs with reservations when the id's have rolled. + -- Perl - Fix use of uninitialized variable in slurm_job_step_get_pids. * Changes in Slurm 15.08.7 ========================== diff --git a/contribs/perlapi/libslurm/perl/Slurm.xs b/contribs/perlapi/libslurm/perl/Slurm.xs index 41b67493a9762a23bf756b242c31c16aef62da6b..0463d2a108d0f10e1d463cad1fa593f81a4ceeba 100644 --- a/contribs/perlapi/libslurm/perl/Slurm.xs +++ b/contribs/perlapi/libslurm/perl/Slurm.xs @@ -1564,7 +1564,7 @@ HV * slurm_job_step_get_pids(slurm_t self, uint32_t job_id, uint32_t step_id, char *nodelist=NULL) PREINIT: int rc; - job_step_pids_response_msg_t *resp_msg; + job_step_pids_response_msg_t *resp_msg = NULL; CODE: if (self); /* this is needed to avoid a warning about unused variables. But if we take slurm_t self diff --git a/src/api/config_info.c b/src/api/config_info.c index ae97090c703948fc4709faa2ecb2bee11e854908..5a029801a2297534040e51734a7dd6dc39b4053d 100644 --- a/src/api/config_info.c +++ b/src/api/config_info.c @@ -286,12 +286,12 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr, fprintf(fp, " Default=YES"); if (p[i].def_mem_per_cpu & MEM_PER_CPU) { - if (p[i].def_mem_per_cpu != MEM_PER_CPU) - fprintf(fp, "DefMemPerCPU=%"PRIu32"", - p[i].def_mem_per_cpu & (~MEM_PER_CPU)); - } else if (p[i].def_mem_per_cpu != 0) - fprintf(fp, "DefMemPerNode=%"PRIu32"", - p[i].def_mem_per_cpu); + if (p[i].def_mem_per_cpu != MEM_PER_CPU) + fprintf(fp, "DefMemPerCPU=%"PRIu32"", + p[i].def_mem_per_cpu & (~MEM_PER_CPU)); + } else if (p[i].def_mem_per_cpu != 0) + fprintf(fp, "DefMemPerNode=%"PRIu32"", + p[i].def_mem_per_cpu); if (!p[i].allow_accounts && p[i].deny_accounts) fprintf(fp, "DenyAccounts=%s", p[i].deny_accounts); @@ -301,8 +301,8 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr, if (p[i].default_time != (uint32_t) NO_VAL) { if (p[i].default_time == INFINITE) - fprintf(fp, "DefaultTime=UNLIMITED"); - else { + fprintf(fp, "DefaultTime=UNLIMITED"); + else { char time_line[32]; secs2time_str(p[i].default_time * 60, time_line, sizeof(time_line)); @@ -326,54 +326,54 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr, fprintf(fp, " LLN=YES"); if (p[i].max_cpus_per_node != INFINITE) - fprintf(fp, " MaxCPUsPerNode=%"PRIu32"", + fprintf(fp, " MaxCPUsPerNode=%"PRIu32"", p[i].max_cpus_per_node); if (p[i].max_mem_per_cpu & MEM_PER_CPU) { - if (p[i].max_mem_per_cpu != MEM_PER_CPU) - fprintf(fp, " MaxMemPerCPU=%"PRIu32"", - p[i].max_mem_per_cpu & (~MEM_PER_CPU)); - } else if (p[i].max_mem_per_cpu != 0) - fprintf(fp, " MaxMemPerNode=%"PRIu32"", + if (p[i].max_mem_per_cpu != MEM_PER_CPU) + fprintf(fp, " MaxMemPerCPU=%"PRIu32"", + p[i].max_mem_per_cpu & (~MEM_PER_CPU)); + } else if (p[i].max_mem_per_cpu != 0) + fprintf(fp, " MaxMemPerNode=%"PRIu32"", p[i].max_mem_per_cpu); if (p[i].max_nodes != INFINITE) { char tmp1[16]; - if (cluster_flags & CLUSTER_FLAG_BG) - convert_num_unit((float)p[i].max_nodes, tmp1, - sizeof(tmp1), UNIT_NONE, - CONVERT_NUM_UNIT_EXACT); - else - snprintf(tmp1, sizeof(tmp1), "%u", + if (cluster_flags & CLUSTER_FLAG_BG) + convert_num_unit((float)p[i].max_nodes, tmp1, + sizeof(tmp1), UNIT_NONE, + CONVERT_NUM_UNIT_EXACT); + else + snprintf(tmp1, sizeof(tmp1), "%u", p[i].max_nodes); - fprintf(fp, "MaxNodes=%s", tmp1); - } + fprintf(fp, "MaxNodes=%s", tmp1); + } if (p[i].max_time != INFINITE) { - char time_line[32]; - secs2time_str(p[i].max_time * 60, time_line, - sizeof(time_line)); - fprintf(fp, " MaxTime=%s", time_line); - } + char time_line[32]; + secs2time_str(p[i].max_time * 60, time_line, + sizeof(time_line)); + fprintf(fp, " MaxTime=%s", time_line); + } if (p[i].min_nodes != 1) { char tmp1[16]; if (cluster_flags & CLUSTER_FLAG_BG) - convert_num_unit((float)p[i].min_nodes, tmp1, + convert_num_unit((float)p[i].min_nodes, tmp1, sizeof(tmp1), UNIT_NONE, - CONVERT_NUM_UNIT_EXACT); - else - snprintf(tmp1, sizeof(tmp1), "%u", + CONVERT_NUM_UNIT_EXACT); + else + snprintf(tmp1, sizeof(tmp1), "%u", p[i].min_nodes); - fprintf(fp, " MinNodes=%s", tmp1); + fprintf(fp, " MinNodes=%s", tmp1); } if (p[i].nodes != NULL) fprintf(fp, " Nodes=%s", p[i].nodes); - if (p[i].preempt_mode != (uint16_t) NO_VAL) - fprintf(fp, " PreemptMode=%s", + if (p[i].preempt_mode != (uint16_t) NO_VAL) + fprintf(fp, " PreemptMode=%s", preempt_mode_string(p[i].preempt_mode)); if (p[i].priority != 1) @@ -389,18 +389,18 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr, fprintf(fp, " RootOnly=YES"); if (p[i].cr_type & CR_CORE) - fprintf(fp, " SelectTypeParameters=CR_CORE"); - else if (p[i].cr_type & CR_SOCKET) - fprintf(fp, " SelectTypeParameters=CR_SOCKET"); + fprintf(fp, " SelectTypeParameters=CR_CORE"); + else if (p[i].cr_type & CR_SOCKET) + fprintf(fp, " SelectTypeParameters=CR_SOCKET"); force = p[i].max_share & SHARED_FORCE; - val = p[i].max_share & (~SHARED_FORCE); - if (val == 0) - fprintf(fp, " Shared=EXCLUSIVE"); - else if (force) { - fprintf(fp, " Shared=FORCE:%u", val); - } else if (val != 1) - fprintf(fp, " Shared=YES:%u", val); + val = p[i].max_share & (~SHARED_FORCE); + if (val == 0) + fprintf(fp, " Shared=EXCLUSIVE"); + else if (force) { + fprintf(fp, " Shared=FORCE:%u", val); + } else if (val != 1) + fprintf(fp, " Shared=YES:%u", val); if (p[i].state_up == PARTITION_UP) fprintf(fp, " State=UP"); @@ -414,8 +414,8 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr, fprintf(fp, " State=UNKNOWN"); if (p[i].billing_weights_str != NULL) - fprintf(fp, " TRESBillingWeights=%s", - p[i].billing_weights_str); + fprintf(fp, " TRESBillingWeights=%s", + p[i].billing_weights_str); fprintf(fp, "\n"); } @@ -852,7 +852,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr) key_pair->value = xstrdup(slurm_ctl_conf_ptr->job_acct_gather_type); list_append(ret_list, key_pair); - key_pair = xmalloc(sizeof(config_key_pair_t)); + key_pair = xmalloc(sizeof(config_key_pair_t)); key_pair->name = xstrdup("JobAcctGatherParams"); key_pair->value = xstrdup(slurm_ctl_conf_ptr->job_acct_gather_params); list_append(ret_list, key_pair);