Don't set rank_min multiple times

This commit is contained in:
Rodrigo Arias 2023-04-14 12:01:47 +02:00
parent 9568d4f379
commit bfff1a815e

View File

@ -58,6 +58,7 @@ loom_init_begin(struct loom *loom, const char *name)
set_hostname(loom->hostname, loom->name); set_hostname(loom->hostname, loom->name);
loom->id = loom->name; loom->id = loom->name;
loom->rank_min = INT_MAX;
cpu_init_begin(&loom->vcpu, -1, -1, 1); cpu_init_begin(&loom->vcpu, -1, -1, 1);
cpu_set_loom(&loom->vcpu, loom); cpu_set_loom(&loom->vcpu, loom);
@ -212,12 +213,7 @@ loom_init_end(struct loom *loom)
err("process %s has no rank information", p->id); err("process %s has no rank information", p->id);
return -1; return -1;
} }
if (p->rank < loom->rank_min)
loom->rank_min = p->rank;
} }
} else {
loom->rank_min = -1;
} }
/* Populate cpus_array */ /* Populate cpus_array */
@ -294,7 +290,6 @@ loom_add_proc(struct loom *loom, struct proc *proc)
/* Check previous ranks if any */ /* Check previous ranks if any */
if (!loom->rank_enabled && proc->rank >= 0) { if (!loom->rank_enabled && proc->rank >= 0) {
loom->rank_enabled = 1; loom->rank_enabled = 1;
loom->rank_min = INT_MAX;
for (struct proc *p = loom->procs; p; p = p->hh.next) { for (struct proc *p = loom->procs; p; p = p->hh.next) {
if (p->rank < 0) { if (p->rank < 0) {