ovni/test/emu/nosv/mp-rank.c
Rodrigo Arias Mallo 24324ae734 Add parallel task and update old emu tests
All task-related events now require the body id as argument.
Additionally, in nOS-V, nested tasks require the parents to be paused.
2024-03-13 17:07:32 +01:00

36 lines
660 B
C

/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "compat.h"
#include "instr_nosv.h"
static void
task(int32_t id, uint32_t typeid, int us)
{
instr_nosv_task_create(id, typeid);
instr_nosv_task_execute(id, 0);
sleep_us(us);
instr_nosv_task_end(id, 0);
}
int
main(void)
{
int rank = atoi(getenv("OVNI_RANK"));
int nranks = atoi(getenv("OVNI_NRANKS"));
uint32_t typeid = 1;
instr_start(rank, nranks);
instr_nosv_init();
instr_nosv_type_create(typeid);
/* Create some fake nosv tasks */
for (int i = 0; i < 10; i++)
task(i + 1, typeid, 5000);
instr_end();
return 0;
}