From cc5b1bb529dd7723d9b13b9ce4efdfedee3f7dbf Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Fri, 30 Nov 2007 23:35:18 +0000 Subject: [PATCH] Fix some BGL build problems and add will run call to sched/wiki2 --- src/common/node_select.c | 37 +++++++++++++---------------- src/plugins/sched/wiki2/Makefile.am | 1 + src/plugins/sched/wiki2/Makefile.in | 7 ++++-- src/plugins/sched/wiki2/msg.c | 3 +++ src/slurmctld/node_scheduler.c | 8 ++++--- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/common/node_select.c b/src/common/node_select.c index 97a717bcc05..34dd3684e15 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -632,13 +632,10 @@ static int _unpack_node_info(bg_info_record_t *bg_info_record, Buf buffer) uint32_t uint32_tmp; char *bp_inx_str; - safe_unpackstr_xmalloc(&(bg_info_record->nodes), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(bg_info_record->ionodes), &uint16_tmp, - buffer); - safe_unpackstr_xmalloc(&bg_info_record->owner_name, &uint16_tmp, - buffer); - safe_unpackstr_xmalloc(&bg_info_record->bg_block_id, &uint16_tmp, - buffer); + safe_unpackstr_xmalloc(&(bg_info_record->nodes), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(bg_info_record->ionodes), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&bg_info_record->owner_name, &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&bg_info_record->bg_block_id, &uint32_tmp, buffer); safe_unpack16(&uint16_tmp, buffer); bg_info_record->state = (int) uint16_tmp; @@ -652,27 +649,27 @@ static int _unpack_node_info(bg_info_record_t *bg_info_record, Buf buffer) bg_info_record->nodecard = (int) uint16_tmp; safe_unpack32(&uint32_tmp, buffer); bg_info_record->node_cnt = (int) uint32_tmp; - safe_unpackstr_xmalloc(&bp_inx_str, &uint16_tmp, buffer); + safe_unpackstr_xmalloc(&bp_inx_str, &uint32_tmp, buffer); if (bp_inx_str == NULL) { bg_info_record->bp_inx = bitfmt2int(""); } else { bg_info_record->bp_inx = bitfmt2int(bp_inx_str); xfree(bp_inx_str); } - safe_unpackstr_xmalloc(&bp_inx_str, &uint16_tmp, buffer); + safe_unpackstr_xmalloc(&bp_inx_str, &uint32_tmp, buffer); if (bp_inx_str == NULL) { bg_info_record->ionode_inx = bitfmt2int(""); } else { bg_info_record->ionode_inx = bitfmt2int(bp_inx_str); xfree(bp_inx_str); } - safe_unpackstr_xmalloc(&bg_info_record->blrtsimage, &uint16_tmp, + safe_unpackstr_xmalloc(&bg_info_record->blrtsimage, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&bg_info_record->linuximage, &uint16_tmp, + safe_unpackstr_xmalloc(&bg_info_record->linuximage, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&bg_info_record->mloaderimage, &uint16_tmp, + safe_unpackstr_xmalloc(&bg_info_record->mloaderimage, &uint32_tmp, buffer); - safe_unpackstr_xmalloc(&bg_info_record->ramdiskimage, &uint16_tmp, + safe_unpackstr_xmalloc(&bg_info_record->ramdiskimage, &uint32_tmp, buffer); return SLURM_SUCCESS; @@ -1046,7 +1043,7 @@ extern int select_g_pack_jobinfo (select_jobinfo_t jobinfo, Buf buffer) extern int select_g_unpack_jobinfo(select_jobinfo_t jobinfo, Buf buffer) { int i; - uint16_t uint16_tmp; + uint32_t uint32_tmp; for (i=0; i<SYSTEM_DIMENSIONS; i++) { safe_unpack16(&(jobinfo->start[i]), buffer); @@ -1059,12 +1056,12 @@ extern int select_g_unpack_jobinfo(select_jobinfo_t jobinfo, Buf buffer) safe_unpack32(&(jobinfo->node_cnt), buffer); safe_unpack32(&(jobinfo->max_procs), buffer); - safe_unpackstr_xmalloc(&(jobinfo->bg_block_id), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(jobinfo->ionodes), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(jobinfo->blrtsimage), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(jobinfo->linuximage), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(jobinfo->mloaderimage), &uint16_tmp, buffer); - safe_unpackstr_xmalloc(&(jobinfo->ramdiskimage), &uint16_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->bg_block_id), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->ionodes), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->blrtsimage), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->linuximage), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->mloaderimage), &uint32_tmp, buffer); + safe_unpackstr_xmalloc(&(jobinfo->ramdiskimage), &uint32_tmp, buffer); return SLURM_SUCCESS; diff --git a/src/plugins/sched/wiki2/Makefile.am b/src/plugins/sched/wiki2/Makefile.am index 4f7570b4890..24a352673dd 100644 --- a/src/plugins/sched/wiki2/Makefile.am +++ b/src/plugins/sched/wiki2/Makefile.am @@ -25,6 +25,7 @@ sched_wiki2_la_SOURCES = \ job_release_task.c \ job_requeue.c \ job_signal.c \ + job_will_run.c \ msg.c \ msg.h \ resume_job.c \ diff --git a/src/plugins/sched/wiki2/Makefile.in b/src/plugins/sched/wiki2/Makefile.in index 8c5ad353c76..484fd090fd2 100644 --- a/src/plugins/sched/wiki2/Makefile.in +++ b/src/plugins/sched/wiki2/Makefile.in @@ -78,8 +78,9 @@ sched_wiki2_la_LIBADD = am_sched_wiki2_la_OBJECTS = cancel_job.lo crypto.lo event.lo \ get_jobs.lo get_nodes.lo hostlist.lo initialize.lo \ job_add_task.lo job_modify.lo job_notify.lo \ - job_release_task.lo job_requeue.lo job_signal.lo msg.lo \ - resume_job.lo sched_wiki.lo start_job.lo suspend_job.lo + job_release_task.lo job_requeue.lo job_signal.lo \ + job_will_run.lo msg.lo resume_job.lo sched_wiki.lo \ + start_job.lo suspend_job.lo sched_wiki2_la_OBJECTS = $(am_sched_wiki2_la_OBJECTS) sched_wiki2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -282,6 +283,7 @@ sched_wiki2_la_SOURCES = \ job_release_task.c \ job_requeue.c \ job_signal.c \ + job_will_run.c \ msg.c \ msg.h \ resume_job.c \ @@ -372,6 +374,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_release_task.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_requeue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_signal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_will_run.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resume_job.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_wiki.Plo@am__quote@ diff --git a/src/plugins/sched/wiki2/msg.c b/src/plugins/sched/wiki2/msg.c index 2834efc02ce..d7a99be6f43 100644 --- a/src/plugins/sched/wiki2/msg.c +++ b/src/plugins/sched/wiki2/msg.c @@ -619,6 +619,9 @@ static void _proc_msg(slurm_fd new_fd, char *msg) } else if (strncmp(cmd_ptr, "JOBRELEASETASK", 14) == 0) { msg_type = "wiki:JOBRELEASETASK"; job_release_task(cmd_ptr, &err_code, &err_msg); + } else if (strncmp(cmd_ptr, "JOBWILLRUN", 10) == 0) { + msg_type = "wiki:JOBWILLRUN"; + job_will_run(cmd_ptr, &err_code, &err_msg); } else if (strncmp(cmd_ptr, "MODIFYJOB", 9) == 0) { msg_type = "wiki:MODIFYJOB"; job_modify_wiki(cmd_ptr, &err_code, &err_msg); diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c index 9495926ada6..2ac2d6b8a1b 100644 --- a/src/slurmctld/node_scheduler.c +++ b/src/slurmctld/node_scheduler.c @@ -93,15 +93,16 @@ static int _build_node_list(struct job_record *job_ptr, static void _feature_list_delete(void *x); static void _filter_nodes_in_set(struct node_set *node_set_ptr, struct job_details *detail_ptr); -static int _job_count_bitmap(bitstr_t * bitmap, bitstr_t * jobmap, - int job_cnt); static int _match_feature(char *seek, char *available); static int _nodes_in_sets(bitstr_t *req_bitmap, struct node_set * node_set_ptr, int node_set_size); +#ifndef HAVE_BG static int _pick_best_load(struct job_record *job_ptr, bitstr_t * bitmap, uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes, bool test_only); + +#endif static int _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, bitstr_t ** select_bitmap, struct job_record *job_ptr, @@ -270,7 +271,7 @@ static int _match_feature(char *seek, char *available) return found; } - +#ifndef HAVE_BG /* * _pick_best_load - Given a specification of scheduling requirements, * identify the nodes which "best" satisfy the request. @@ -344,6 +345,7 @@ _job_count_bitmap(bitstr_t * bitmap, bitstr_t * jobmap, int job_cnt) } return count; } +#endif /* * Decide if a job can share nodes with other jobs based on the -- GitLab