From 8b78baa587d0b6fb7d5b879d7c035af0764f3246 Mon Sep 17 00:00:00 2001 From: Kevin Sala Date: Thu, 19 Aug 2021 11:32:16 +0200 Subject: [PATCH] Fixing ovni for multiple nodes (workaround) --- emu.c | 2 ++ emu.h | 1 + emu_ovni.c | 2 +- prv.c | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/emu.c b/emu.c index 406bd87..f358214 100644 --- a/emu.c +++ b/emu.c @@ -301,6 +301,8 @@ load_metadata(struct ovni_emu *emu) for(i=0; inlooms; i++) { loom = &trace->loom[i]; + loom->offset_ncpus = emu->total_cpus; + for(j=0; jnprocs; j++) { proc = &loom->proc[j]; diff --git a/emu.h b/emu.h index a8ac1e7..a22f688 100644 --- a/emu.h +++ b/emu.h @@ -143,6 +143,7 @@ struct ovni_loom { int max_ncpus; int max_phyid; int ncpus; + int offset_ncpus; struct ovni_cpu cpu[OVNI_MAX_CPU]; int64_t clock_offset; diff --git a/emu_ovni.c b/emu_ovni.c index a552711..8af7c11 100644 --- a/emu_ovni.c +++ b/emu_ovni.c @@ -313,7 +313,7 @@ emit_thread_count(struct ovni_emu *emu) if(loom->cpu[i].last_nthreads != loom->cpu[i].nthreads) { /* Start at 1 */ - row = i + 1; + row = loom->offset_ncpus + i + 1; n = loom->cpu[i].nthreads; prv_ev_cpu(emu, row, PTC_NTHREADS, n); diff --git a/prv.c b/prv.c index 9288f9e..1e569e0 100644 --- a/prv.c +++ b/prv.c @@ -36,7 +36,7 @@ prv_ev_autocpu(struct ovni_emu *emu, int type, int val) assert(cpu->i >= 0); /* Begin at 1 */ - row = cpu->i + 1; + row = emu->cur_loom->offset_ncpus + cpu->i + 1; prv_ev_cpu(emu, row, type, val); }