From f93fe603023b5fe52d75074de0eb73686b068d1b Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Mon, 24 Jul 2006 16:40:05 +0000 Subject: [PATCH] mods to make the step node list unique and more readable --- src/common/dist_tasks.c | 6 +++--- src/slurmctld/step_mgr.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/common/dist_tasks.c b/src/common/dist_tasks.c index cafa39da822..b272c4b41ea 100644 --- a/src/common/dist_tasks.c +++ b/src/common/dist_tasks.c @@ -401,7 +401,7 @@ extern int task_layout(slurm_step_layout_t *step_layout) slurm_conf_get_addr(step_layout->host[i], &step_layout->node_addr[i]); - debug("host %d = %s", i, step_layout->host[i]); + debug2("host %d = %s", i, step_layout->host[i]); step_layout->cpus[i] = step_layout->cpus_per_node[cpu_inx]; if ((++cpu_cnt) >= step_layout->cpu_count_reps[cpu_inx]) { /* move to next record */ @@ -454,10 +454,10 @@ static int _task_layout_hostfile(slurm_step_layout_t *step_layout) hostlist_t job_alloc_hosts = NULL; hostlist_t step_alloc_hosts = NULL; - debug("job list is %s", step_layout->nodes); + debug2("job list is %s", step_layout->nodes); job_alloc_hosts = hostlist_create(step_layout->nodes); itr = hostlist_iterator_create(job_alloc_hosts); - debug("list is %s", step_layout->arbitrary_nodes); + debug2("list is %s", step_layout->arbitrary_nodes); step_alloc_hosts = hostlist_create(step_layout->arbitrary_nodes); if(hostlist_count(step_alloc_hosts) != step_layout->num_tasks) { error("Asked for %d tasks have %d in the nodelist. " diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index ca2d0e3cee4..d3770763a1c 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -688,14 +688,14 @@ step_create(job_step_create_request_msg_t *step_specs, /* set the step_record values */ /* Here is where the node list is set for the job */ if(step_specs->node_list - && step_specs->task_dist == SLURM_DIST_ARBITRARY) + && step_specs->task_dist == SLURM_DIST_ARBITRARY) { step_ptr->step_node_list = xstrdup(step_specs->node_list); - else { + xfree(step_specs->node_list); + } else { step_ptr->step_node_list = bitmap2node_name(nodeset); step_specs->node_list = xstrdup(step_ptr->step_node_list); } - //xfree(step_specs->node_list); - //step_specs->node_list = bitmap2node_name(nodeset); + step_specs->node_list = bitmap2node_name(nodeset); step_ptr->step_node_bitmap = nodeset; step_ptr->cyclic_alloc = (uint16_t) (step_specs->task_dist == SLURM_DIST_CYCLIC); @@ -742,6 +742,12 @@ step_create(job_step_create_request_msg_t *step_specs, delete_step_record (job_ptr, step_ptr->step_id); return ESLURM_INTERCONNECT_FAILURE; } + /* FIXME: this var should be removed all together once the + switch_build_jobinfo is rewritten to take the step_layout + structure */ + xfree(step_ptr->step_node_list); + step_ptr->step_node_list = + xstrdup(step_ptr->step_layout->nodes); } if (checkpoint_alloc_jobinfo (&step_ptr->check_job) < 0) fatal ("step_create: checkpoint_alloc_jobinfo error"); -- GitLab