Skip to content
Snippets Groups Projects
Commit c3fe5db3 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Have slaunch shrink the number of nodes in a nodelist to the number of tasks

requested.  For instance "slaunch -w foo[4,2,2,2,2,4,4] -n3" will only
launch 3 tasks on foo[4,2,2], and only asks the controller for foo[4,2,2].
If it asked for the whole string, scontroller would balk.
parent f6d502f4
No related branches found
No related tags found
No related merge requests found
......@@ -1447,9 +1447,15 @@ static bool _opt_verify(void)
if (opt.num_tasks_set && opt.num_tasks < hostlist_count(hl)) {
/* shrink the hostlist */
int i, shrinkage;
char buf[8192];
info("need to shrink node list of len %d to %d",
hostlist_count(hl), opt.num_tasks);
shrinkage = hostlist_count(hl) - opt.num_tasks;
for (i = 0; i < shrinkage; i++)
free(hostlist_pop(hl));
xfree(opt.nodelist);
hostlist_ranged_string(hl, 8192, buf);
opt.nodelist = xstrdup(buf);
}
hl_unique = hostlist_copy(hl);
hostlist_uniq(hl_unique);
......
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