Fixing ovni for multiple nodes (workaround)

This commit is contained in:
Kevin Sala 2021-08-19 11:32:16 +02:00 committed by Rodrigo Arias Mallo
parent e80bcdd224
commit 8b78baa587
4 changed files with 5 additions and 2 deletions

2
emu.c
View File

@ -301,6 +301,8 @@ load_metadata(struct ovni_emu *emu)
for(i=0; i<trace->nlooms; i++)
{
loom = &trace->loom[i];
loom->offset_ncpus = emu->total_cpus;
for(j=0; j<loom->nprocs; j++)
{
proc = &loom->proc[j];

1
emu.h
View File

@ -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;

View File

@ -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);

2
prv.c
View File

@ -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);
}