Skip to content
Snippets Groups Projects
Commit 46fa98d0 authored by Danny Auble's avatar Danny Auble
Browse files

fix for hostfile support

parent 1059a7c7
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ extern slurm_step_layout_t *step_layout_create(
* one of the allocated nodes. */
step_layout->num_hosts = 1;
#else
step_layout->num_hosts = step_req->node_count;
step_layout->num_hosts = hostlist_count(step_layout->hl);
#endif
step_layout->task_dist = step_req->task_dist;
step_layout->num_tasks = step_req->num_tasks;
......@@ -285,7 +285,7 @@ extern int task_layout(slurm_step_layout_t *step_layout)
cpu_cnt = 0;
}
}
step_layout->tasks = xmalloc(sizeof(uint32_t)
step_layout->tasks = xmalloc(sizeof(uint32_t)
* step_layout->num_hosts);
step_layout->tids = xmalloc(sizeof(uint32_t *)
* step_layout->num_hosts);
......
......@@ -182,6 +182,8 @@ launch(void *arg)
itr = hostlist_iterator_create(hostlist);
job->thr_count = 0;
for (i = 0; i < job->step_layout->num_hosts; i++) {
if(!job->step_layout->host[i])
break;
slurm_msg_t *m = &msg_array_ptr[job->thr_count];
m->srun_node_id = (uint32_t)i;
......@@ -190,7 +192,7 @@ launch(void *arg)
m->ret_list = NULL;
m->orig_addr.sin_addr.s_addr = 0;
m->buffer = buffer;
j=0;
while((host = hostlist_next(itr)) != NULL) {
if(!strcmp(host,job->step_layout->host[i])) {
......@@ -201,7 +203,7 @@ launch(void *arg)
free(host);
}
hostlist_iterator_reset(itr);
/* debug2("using %d %s with %d tasks\n", j, */
/* debug2("using %d %s with %d tasks\n", j, */
/* job->step_layout->host[i], */
/* r.nprocs); */
memcpy(&m->address,
......@@ -215,13 +217,11 @@ launch(void *arg)
job->slurmd_addr,
itr,
opt.msg_timeout);
job->thr_count++;
}
xfree(span);
hostlist_iterator_destroy(itr);
hostlist_destroy(hostlist);
_p_launch(msg_array_ptr, job);
if (fail_launch_cnt) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment