diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 3d0ad15814f4a277c7b20e24e142a09af0f4293f..dd899417ce2c34f5856797f32ad8d226c9aaa0f3 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -302,7 +302,6 @@ enum select_jobdata_type { SELECT_JOBDATA_IONODES, /* data-> char *ionodes */ SELECT_JOBDATA_NODE_CNT, /* data-> uint32_t node_cnt */ SELECT_JOBDATA_ALTERED, /* data-> uint16_t altered */ - SELECT_JOBDATA_MAX_CPUS, /* data-> uint32_t max_cpus */ SELECT_JOBDATA_BLRTS_IMAGE,/* data-> char *blrtsimage */ SELECT_JOBDATA_LINUX_IMAGE,/* data-> char *linuximage */ SELECT_JOBDATA_MLOADER_IMAGE,/* data-> char *mloaderimage */ @@ -332,7 +331,6 @@ enum select_print_mode { SELECT_PRINT_ROTATE, /* Print just the ROTATE */ SELECT_PRINT_GEOMETRY, /* Print just the GEO */ SELECT_PRINT_START, /* Print just the START location */ - SELECT_PRINT_MAX_CPUS, /* Print just the MAX CPUS */ SELECT_PRINT_BLRTS_IMAGE,/* Print just the BLRTS IMAGE */ SELECT_PRINT_LINUX_IMAGE,/* Print just the LINUX IMAGE */ SELECT_PRINT_MLOADER_IMAGE,/* Print just the MLOADER IMAGE */ diff --git a/src/api/job_info.c b/src/api/job_info.c index 5e74bd71171055dbbbe247571b30633b26737e66..21a3be2ff63a23f307ff6f2925462ccb56839894 100644 --- a/src/api/job_info.c +++ b/src/api/job_info.c @@ -90,7 +90,7 @@ static void _sprint_range(char *str, uint32_t str_size, uint32_t lower, uint32_t upper) { char tmp[128]; - /* Note: We don't have the size of str here */ + #ifdef HAVE_BG convert_num_unit((float)lower, tmp, sizeof(tmp), UNIT_NONE); #else @@ -120,7 +120,7 @@ extern void slurm_print_job_info ( FILE* out, job_info_t * job_ptr, int one_liner ) { char *print_this = slurm_sprint_job_info(job_ptr, one_liner); - fprintf ( out, "%s", print_this); + fprintf(out, "%s", print_this); xfree(print_this); } @@ -144,7 +144,7 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) job_resources_t *job_resrcs = job_ptr->job_resrcs; char *out = NULL; time_t run_time; - uint32_t min_nodes, max_nodes; + uint32_t min_nodes, max_nodes = 0; #ifdef HAVE_BG char select_buf[122]; @@ -371,7 +371,7 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner ) if ((min_nodes == 0) || (min_nodes == NO_VAL)) { min_nodes = job_ptr->num_nodes; max_nodes = job_ptr->max_nodes; - } else + } else if(job_ptr->max_nodes) max_nodes = min_nodes; #else min_nodes = job_ptr->num_nodes; diff --git a/src/plugins/jobcomp/mysql/jobcomp_mysql.c b/src/plugins/jobcomp/mysql/jobcomp_mysql.c index 40801884d73e3327bea0b73bbed3868dbdc9c912..d4fbcae1483fd01a2c46807c3fef0cbe6b85a912 100644 --- a/src/plugins/jobcomp/mysql/jobcomp_mysql.c +++ b/src/plugins/jobcomp/mysql/jobcomp_mysql.c @@ -286,7 +286,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) int rc = SLURM_SUCCESS; char *usr_str = NULL, *grp_str = NULL, lim_str[32]; char *connect_type = NULL, *reboot = NULL, *rotate = NULL, - *maxprocs = NULL, *geometry = NULL, *start = NULL, + *geometry = NULL, *start = NULL, *blockid = NULL; enum job_states job_state; char *query = NULL; @@ -319,8 +319,6 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) SELECT_PRINT_REBOOT); rotate = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, SELECT_PRINT_ROTATE); - maxprocs = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, - SELECT_PRINT_MAX_CPUS); geometry = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, SELECT_PRINT_GEOMETRY); start = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, @@ -346,7 +344,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) xstrcat(query, ", reboot"); if(rotate) xstrcat(query, ", rotate"); - if(maxprocs) + if(job_ptr->details && (job_ptr->details->max_cpus != NO_VAL)) xstrcat(query, ", maxprocs"); if(geometry) xstrcat(query, ", geometry"); @@ -377,10 +375,9 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) xstrfmtcat(query, ", '%s'", rotate); xfree(rotate); } - if(maxprocs) { - xstrfmtcat(query, ", '%s'", maxprocs); - xfree(maxprocs); - } + if(job_ptr->details && (job_ptr->details->max_cpus != NO_VAL)) + xstrfmtcat(query, ", '%u'", job_ptr->details->max_cpus); + if(geometry) { xstrfmtcat(query, ", '%s'", geometry); xfree(geometry); diff --git a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c index 7b0edf915cf24700d0c1ef429a7acd4708d0ae3e..94d16abf9df18be5d8835ef3387b13f80f4c7e21 100644 --- a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c +++ b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c @@ -308,7 +308,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) int rc = SLURM_SUCCESS; char *usr_str = NULL, *grp_str = NULL, lim_str[32]; char *connect_type = NULL, *reboot = NULL, *rotate = NULL, - *maxprocs = NULL, *geometry = NULL, *start = NULL, + *geometry = NULL, *start = NULL, *blockid = NULL; enum job_states job_state; char *query = NULL; @@ -341,8 +341,6 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) SELECT_PRINT_REBOOT); rotate = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, SELECT_PRINT_ROTATE); - maxprocs = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, - SELECT_PRINT_MAX_CPUS); geometry = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, SELECT_PRINT_GEOMETRY); start = select_g_select_jobinfo_xstrdup(job_ptr->select_jobinfo, @@ -368,7 +366,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) xstrcat(query, ", reboot"); if(rotate) xstrcat(query, ", rotate"); - if(maxprocs) + if(job_ptr->details && (job_ptr->details->max_cpus != NO_VAL)) xstrcat(query, ", maxprocs"); if(geometry) xstrcat(query, ", geometry"); @@ -400,10 +398,8 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr) xstrfmtcat(query, ", '%s'", rotate); xfree(rotate); } - if(maxprocs) { - xstrfmtcat(query, ", '%s'", maxprocs); - xfree(maxprocs); - } + if(job_ptr->details && (job_ptr->details->max_cpus != NO_VAL)) + xstrfmtcat(query, ", '%u'", job_ptr->details->max_cpus); if(geometry) { xstrfmtcat(query, ", '%s'", geometry); xfree(geometry); diff --git a/src/plugins/select/bluegene/plugin/bg_job_place.c b/src/plugins/select/bluegene/plugin/bg_job_place.c index 963504712968edd33cac29d989f0adc2e7149336..e8466610f7f64da919f4849c56dd2f9eb6c85ca4 100644 --- a/src/plugins/select/bluegene/plugin/bg_job_place.c +++ b/src/plugins/select/bluegene/plugin/bg_job_place.c @@ -839,7 +839,7 @@ static int _find_best_block_match(List block_list, int overlap_check = 0; int allow = 0; int check_image = 1; - uint32_t max_cpus = (uint32_t)NO_VAL; + uint32_t max_cpus = job_ptr->details->max_cpus; char tmp_char[256]; static int total_cpus = 0; #ifdef HAVE_BGL @@ -880,9 +880,6 @@ static int _find_best_block_match(List block_list, SELECT_JOBDATA_GEOMETRY, &req_geometry); select_g_select_jobinfo_get(job_ptr->select_jobinfo, SELECT_JOBDATA_ROTATE, &rotate); - select_g_select_jobinfo_get(job_ptr->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, &max_cpus); - #ifdef HAVE_BGL if((rc = _check_images(job_ptr, &blrtsimage, &linuximage, @@ -942,8 +939,6 @@ static int _find_best_block_match(List block_list, else request.avail_node_bitmap = slurm_block_bitmap; - select_g_select_jobinfo_get(job_ptr->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, &max_cpus); /* since we only look at procs after this and not nodes we * need to set a max_cpus if given */ diff --git a/src/plugins/select/bluegene/plugin/jobinfo.c b/src/plugins/select/bluegene/plugin/jobinfo.c index 708629e7cde79b8a7419b974cc19fd4edd238032..194bf50d0adbc9ce7d2c901e3cd267c3af62cb2b 100644 --- a/src/plugins/select/bluegene/plugin/jobinfo.c +++ b/src/plugins/select/bluegene/plugin/jobinfo.c @@ -68,7 +68,6 @@ extern select_jobinfo_t *alloc_select_jobinfo() jobinfo->rotate = (uint16_t) NO_VAL; jobinfo->magic = JOBINFO_MAGIC; jobinfo->node_cnt = NO_VAL; - jobinfo->max_cpus = NO_VAL; /* Remainder of structure is already NULL fulled */ return jobinfo; @@ -156,9 +155,6 @@ extern int set_select_jobinfo(select_jobinfo_t *jobinfo, case SELECT_JOBDATA_ALTERED: jobinfo->altered = *uint16; break; - case SELECT_JOBDATA_MAX_CPUS: - jobinfo->max_cpus = *uint32; - break; case SELECT_JOBDATA_BLRTS_IMAGE: /* we xfree() any preset value to avoid a memory leak */ #ifdef HAVE_BGL @@ -254,9 +250,6 @@ extern int get_select_jobinfo(select_jobinfo_t *jobinfo, case SELECT_JOBDATA_ALTERED: *uint16 = jobinfo->altered; break; - case SELECT_JOBDATA_MAX_CPUS: - *uint32 = jobinfo->max_cpus; - break; case SELECT_JOBDATA_BLRTS_IMAGE: #ifdef HAVE_BGL if ((jobinfo->blrtsimage == NULL) @@ -323,7 +316,6 @@ extern select_jobinfo_t *copy_select_jobinfo(select_jobinfo_t *jobinfo) rc->ionodes = xstrdup(jobinfo->ionodes); rc->node_cnt = jobinfo->node_cnt; rc->altered = jobinfo->altered; - rc->max_cpus = jobinfo->max_cpus; #ifdef HAVE_BGL rc->blrtsimage = xstrdup(jobinfo->blrtsimage); #endif @@ -346,7 +338,49 @@ extern int pack_select_jobinfo(select_jobinfo_t *jobinfo, Buf buffer, { int i; - if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + if (jobinfo) { + /* NOTE: If new elements are added here, make sure to + * add equivalant pack of zeros below for NULL + * pointer */ + for (i=0; i<SYSTEM_DIMENSIONS; i++) { + pack16(jobinfo->geometry[i], buffer); + } + pack16(jobinfo->conn_type, buffer); + pack16(jobinfo->reboot, buffer); + pack16(jobinfo->rotate, buffer); + + pack32(jobinfo->node_cnt, buffer); + + packstr(jobinfo->bg_block_id, buffer); + packstr(jobinfo->nodes, buffer); + packstr(jobinfo->ionodes, buffer); +#ifdef HAVE_BGL + packstr(jobinfo->blrtsimage, buffer); +#endif + packstr(jobinfo->linuximage, buffer); + packstr(jobinfo->mloaderimage, buffer); + packstr(jobinfo->ramdiskimage, buffer); + } else { + /* pack space for 3 positions for geo + * then 1 for conn_type, reboot, and rotate + */ + for (i=0; i<(SYSTEM_DIMENSIONS+3); i++) + pack16((uint16_t) 0, buffer); + + pack32((uint32_t) 0, buffer); //node_cnt + + packnull(buffer); //bg_block_id + packnull(buffer); //nodes + packnull(buffer); //ionodes +#ifdef HAVE_BGL + packnull(buffer); //blrts +#endif + packnull(buffer); //linux + packnull(buffer); //mloader + packnull(buffer); //ramdisk + } + } else { if (jobinfo) { /* NOTE: If new elements are added here, make sure to * add equivalant pack of zeros below for NULL @@ -359,7 +393,7 @@ extern int pack_select_jobinfo(select_jobinfo_t *jobinfo, Buf buffer, pack16(jobinfo->rotate, buffer); pack32(jobinfo->node_cnt, buffer); - pack32(jobinfo->max_cpus, buffer); + pack32(0, buffer); packstr(jobinfo->bg_block_id, buffer); packstr(jobinfo->nodes, buffer); @@ -410,7 +444,32 @@ extern int unpack_select_jobinfo(select_jobinfo_t **jobinfo_pptr, Buf buffer, *jobinfo_pptr = jobinfo; jobinfo->magic = JOBINFO_MAGIC; - if(protocol_version >= SLURM_2_1_PROTOCOL_VERSION) { + if(protocol_version >= SLURM_2_2_PROTOCOL_VERSION) { + for (i=0; i<SYSTEM_DIMENSIONS; i++) { + safe_unpack16(&(jobinfo->geometry[i]), buffer); + } + safe_unpack16(&(jobinfo->conn_type), buffer); + safe_unpack16(&(jobinfo->reboot), buffer); + safe_unpack16(&(jobinfo->rotate), buffer); + + safe_unpack32(&(jobinfo->node_cnt), buffer); + + safe_unpackstr_xmalloc(&(jobinfo->bg_block_id), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(jobinfo->nodes), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->ionodes), &uint32_tmp, + buffer); +#ifdef HAVE_BGL + safe_unpackstr_xmalloc(&(jobinfo->blrtsimage), &uint32_tmp, + buffer); +#endif + safe_unpackstr_xmalloc(&(jobinfo->linuximage), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(jobinfo->mloaderimage), &uint32_tmp, + buffer); + safe_unpackstr_xmalloc(&(jobinfo->ramdiskimage), &uint32_tmp, + buffer); + } else { for (i=0; i<SYSTEM_DIMENSIONS; i++) { safe_unpack16(&(jobinfo->geometry[i]), buffer); } @@ -419,7 +478,7 @@ extern int unpack_select_jobinfo(select_jobinfo_t **jobinfo_pptr, Buf buffer, safe_unpack16(&(jobinfo->rotate), buffer); safe_unpack32(&(jobinfo->node_cnt), buffer); - safe_unpack32(&(jobinfo->max_cpus), buffer); + safe_unpack32(&uint32_tmp, buffer); safe_unpackstr_xmalloc(&(jobinfo->bg_block_id), &uint32_tmp, buffer); @@ -457,7 +516,6 @@ extern char *sprint_select_jobinfo(select_jobinfo_t *jobinfo, { uint16_t geometry[SYSTEM_DIMENSIONS]; int i; - char max_cpus_char[8]; char *tmp_image = "default"; if (buf == NULL) { @@ -487,21 +545,14 @@ extern char *sprint_select_jobinfo(select_jobinfo_t *jobinfo, switch (mode) { case SELECT_PRINT_HEAD: snprintf(buf, size, - "CONNECT REBOOT ROTATE MAX_CPUS GEOMETRY BLOCK_ID"); + "CONNECT REBOOT ROTATE GEOMETRY BLOCK_ID"); break; case SELECT_PRINT_DATA: - if (jobinfo->max_cpus == NO_VAL) - sprintf(max_cpus_char, "None"); - else - convert_num_unit((float)jobinfo->max_cpus, - max_cpus_char, sizeof(max_cpus_char), - UNIT_NONE); snprintf(buf, size, - "%7.7s %6.6s %6.6s %8s %cx%cx%c %-16s", + "%7.7s %6.6s %6.6s %cx%cx%c %-16s", conn_type_string(jobinfo->conn_type), _yes_no_string(jobinfo->reboot), _yes_no_string(jobinfo->rotate), - max_cpus_char, alpha_num[geometry[0]], alpha_num[geometry[1]], alpha_num[geometry[2]], @@ -558,16 +609,6 @@ extern char *sprint_select_jobinfo(select_jobinfo_t *jobinfo, alpha_num[geometry[1]], alpha_num[geometry[2]]); break; - case SELECT_PRINT_MAX_CPUS: - if (jobinfo->max_cpus == NO_VAL) - sprintf(max_cpus_char, "None"); - else - convert_num_unit((float)jobinfo->max_cpus, - max_cpus_char, sizeof(max_cpus_char), - UNIT_NONE); - - snprintf(buf, size, "%s", max_cpus_char); - break; case SELECT_PRINT_BLRTS_IMAGE: #ifdef HAVE_BGL if(jobinfo->blrtsimage) @@ -608,7 +649,6 @@ extern char *xstrdup_select_jobinfo(select_jobinfo_t *jobinfo, int mode) { uint16_t geometry[SYSTEM_DIMENSIONS]; int i; - char max_cpus_char[8]; char *tmp_image = "default"; char *buf = NULL; @@ -634,21 +674,14 @@ extern char *xstrdup_select_jobinfo(select_jobinfo_t *jobinfo, int mode) switch (mode) { case SELECT_PRINT_HEAD: xstrcat(buf, - "CONNECT REBOOT ROTATE MAX_CPUS GEOMETRY BLOCK_ID"); + "CONNECT REBOOT ROTATE GEOMETRY BLOCK_ID"); break; case SELECT_PRINT_DATA: - if (jobinfo->max_cpus == NO_VAL) - sprintf(max_cpus_char, "None"); - else - convert_num_unit((float)jobinfo->max_cpus, - max_cpus_char, sizeof(max_cpus_char), - UNIT_NONE); xstrfmtcat(buf, - "%7.7s %6.6s %6.6s %8s %cx%cx%c %-16s", + "%7.7s %6.6s %6.6s %cx%cx%c %-16s", conn_type_string(jobinfo->conn_type), _yes_no_string(jobinfo->reboot), _yes_no_string(jobinfo->rotate), - max_cpus_char, alpha_num[geometry[0]], alpha_num[geometry[1]], alpha_num[geometry[2]], @@ -694,16 +727,6 @@ extern char *xstrdup_select_jobinfo(select_jobinfo_t *jobinfo, int mode) alpha_num[geometry[1]], alpha_num[geometry[2]]); break; - case SELECT_PRINT_MAX_CPUS: - if (jobinfo->max_cpus == NO_VAL) - sprintf(max_cpus_char, "None"); - else - convert_num_unit((float)jobinfo->max_cpus, - max_cpus_char, sizeof(max_cpus_char), - UNIT_NONE); - - xstrfmtcat(buf, "%s", max_cpus_char); - break; case SELECT_PRINT_BLRTS_IMAGE: #ifdef HAVE_BGL if(jobinfo->blrtsimage) diff --git a/src/plugins/select/bluegene/plugin/jobinfo.h b/src/plugins/select/bluegene/plugin/jobinfo.h index c66185362ccec2f0479e8cc297ebb77f69447a4b..cae0df910e41ad1758baec63ba4d4edabc0ce163 100644 --- a/src/plugins/select/bluegene/plugin/jobinfo.h +++ b/src/plugins/select/bluegene/plugin/jobinfo.h @@ -58,7 +58,6 @@ struct select_jobinfo { uint32_t node_cnt; /* how many cnodes in block running job */ uint16_t altered; /* see if we have altered this job * or not yet */ - uint32_t max_cpus; /* maximum processors to use */ #ifdef HAVE_BGL char *blrtsimage; /* BlrtsImage for this block */ #endif diff --git a/src/plugins/select/bluegene/plugin/select_bluegene.c b/src/plugins/select/bluegene/plugin/select_bluegene.c index 019dea70464432cdff8de3058df3beb58ae0daf3..eef51f602a20c17f657463e4baed69491adf5211 100644 --- a/src/plugins/select/bluegene/plugin/select_bluegene.c +++ b/src/plugins/select/bluegene/plugin/select_bluegene.c @@ -1142,10 +1142,6 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) tmp = 1; set_select_jobinfo(job_desc->select_jobinfo, SELECT_JOBDATA_ALTERED, &tmp); - tmp = NO_VAL; - set_select_jobinfo(job_desc->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, - &tmp); if(job_desc->min_nodes == (uint32_t) NO_VAL) return SLURM_SUCCESS; @@ -1240,7 +1236,6 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) job_desc->min_nodes = 1; #endif } - //job_desc->job_min_cpus = job_desc->min_cpus; if(job_desc->max_nodes > bg_conf->bp_node_cnt) { tmp = job_desc->max_nodes % bg_conf->bp_node_cnt; @@ -1252,10 +1247,8 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) if(tmp > 0) { job_desc->max_nodes = tmp; - tmp *= bg_conf->cpus_per_bp; - set_select_jobinfo(job_desc->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, - &tmp); + job_desc->max_cpus = + job_desc->max_nodes * bg_conf->cpus_per_bp; tmp = NO_VAL; } else { #ifdef HAVE_BGL @@ -1272,11 +1265,7 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) bg_conf->bp_node_cnt; tmp = bg_conf->bp_node_cnt/job_desc->max_nodes; - tmp = bg_conf->cpus_per_bp/tmp; - - set_select_jobinfo(job_desc->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, - &tmp); + job_desc->max_cpus = bg_conf->cpus_per_bp/tmp; job_desc->max_nodes = 1; #else i = bg_conf->smallest_block; @@ -1287,10 +1276,8 @@ extern int select_p_alter_node_cnt(enum select_node_cnt type, void *data) } i *= 2; } - tmp = job_desc->max_nodes * bg_conf->cpu_ratio; - set_select_jobinfo(job_desc->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, - &tmp); + job_desc->max_cpus = + job_desc->max_nodes * bg_conf->cpu_ratio; job_desc->max_nodes = 1; #endif diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 602f274c3c428f96a41ebc69684c65f9fca5a7fe..073fe086a80fa5e2bbe2b8e6347e2980b8fa23fa 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -1879,7 +1879,7 @@ void dump_job_desc(job_desc_msg_t * job_specs) (long) job_specs->min_cpus : -1L; job_min_cpus = (job_specs->job_min_cpus != (uint16_t) NO_VAL) ? (long) job_specs->job_min_cpus : -1L; - debug3(" min_cpus=%ld job_min_procs=%ld", min_cpus, job_min_cpus); + debug3(" min_cpus=%ld job_min_cpus=%ld", min_cpus, job_min_cpus); debug3(" -N min-[max]: %u-[%u]:%u:%u:%u", job_specs->min_nodes, job_specs->max_nodes, @@ -2596,7 +2596,6 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, uint16_t reboot; uint16_t rotate; uint16_t conn_type; - uint32_t max_cpus=0; static uint32_t cpus_per_bp = 0; if(!cpus_per_bp) @@ -2760,15 +2759,13 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, /* This needs to be done after the association acct policy check since * it looks at unaltered nodes for bluegene systems */ - debug3("before alteration asking for nodes %u-%u cpus %u", + debug3("before alteration asking for nodes %u-%u cpus %u-%u", job_desc->min_nodes, job_desc->max_nodes, - job_desc->min_cpus); + job_desc->min_cpus, job_desc->max_cpus); select_g_alter_node_cnt(SELECT_SET_NODE_CNT, job_desc); - select_g_select_jobinfo_get(job_desc->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, &max_cpus); debug3("after alteration asking for nodes %u-%u cpus %u-%u", job_desc->min_nodes, job_desc->max_nodes, - job_desc->min_cpus, max_cpus); + job_desc->min_cpus, job_desc->max_cpus); #endif /* check if select partition has sufficient resources to satisfy * the request */ @@ -2799,6 +2796,9 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, if(job_desc->max_nodes && job_desc->min_nodes > job_desc->max_nodes) job_desc->max_nodes = job_desc->min_nodes; + if(job_desc->max_cpus + && job_desc->min_cpus > job_desc->max_cpus) + job_desc->max_cpus = job_desc->min_cpus; } if (job_desc->exc_nodes) { error_code = node_name2bitmap(job_desc->exc_nodes, false, @@ -4711,7 +4711,6 @@ static void _pack_default_job_details(struct job_record *job_ptr, pack32(detail_ptr->min_cpus, buffer); pack32(detail_ptr->max_cpus, buffer); } - if (job_ptr->node_cnt) { pack32(job_ptr->node_cnt, buffer); pack32((uint32_t) 0, buffer); @@ -5228,7 +5227,7 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) { int error_code = SLURM_SUCCESS; int super_user = 0; - uint32_t save_min_nodes = NO_VAL, save_max_nodes = NO_VAL, max_cpus; + uint32_t save_min_nodes = NO_VAL, save_max_nodes = NO_VAL; uint32_t save_min_cpus = NO_VAL, save_max_cpus = NO_VAL; struct job_record *job_ptr; struct job_details *detail_ptr; @@ -5389,15 +5388,13 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) /* This needs to be done after the association acct policy check since * it looks at unaltered nodes for bluegene systems */ - debug3("update before alteration asking for nodes %u-%u cpus %u", + debug3("update before alteration asking for nodes %u-%u cpus %u-%u", job_specs->min_nodes, job_specs->max_nodes, - job_specs->min_cpus); + job_specs->min_cpus, job_specs->max_cpus); select_g_alter_node_cnt(SELECT_SET_NODE_CNT, job_specs); - select_g_select_jobinfo_get(job_specs->select_jobinfo, - SELECT_JOBDATA_MAX_CPUS, &max_cpus); debug3("update after alteration asking for nodes %u-%u cpus %u-%u", job_specs->min_nodes, job_specs->max_nodes, - job_specs->min_cpus, max_cpus); + job_specs->min_cpus, job_specs->max_cpus); /* Reset min and max cpu counts as needed, insure consistency */ if (job_specs->min_cpus != NO_VAL) { diff --git a/src/sview/job_info.c b/src/sview/job_info.c index 0df33a57ecb23aa9546318a3ba82c0dcd8d4db7d..36e5d549d2cafda9631ee2a0bc2955b421e47c8e 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -1225,10 +1225,8 @@ static void _layout_job_record(GtkTreeView *treeview, tmp_char); #ifdef HAVE_BG - select_g_select_jobinfo_sprint(job_ptr->select_jobinfo, - tmp_char, - sizeof(tmp_char), - SELECT_PRINT_MAX_CPUS); + convert_num_unit((float)job_ptr->max_cpus, tmp_char, sizeof(tmp_char), + UNIT_NONE); #else snprintf(tmp_char, sizeof(tmp_char), "%u", job_ptr->max_cpus); #endif @@ -1787,10 +1785,8 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr, SORTID_CPU_MIN, tmp_char, -1); #ifdef HAVE_BG - select_g_select_jobinfo_sprint(job_ptr->select_jobinfo, - tmp_char, - sizeof(tmp_char), - SELECT_PRINT_MAX_CPUS); + convert_num_unit((float)job_ptr->max_cpus, tmp_char, sizeof(tmp_char), + UNIT_NONE); #else snprintf(tmp_char, sizeof(tmp_char), "%u", job_ptr->max_cpus); #endif