2023-10-23 15:12:43 +02:00
|
|
|
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
2021-12-10 18:23:47 +01:00
|
|
|
|
2023-03-22 16:01:55 +01:00
|
|
|
#include "compat.h"
|
2023-10-23 15:12:43 +02:00
|
|
|
#include "instr_nosv.h"
|
2022-06-02 15:46:22 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
task(int32_t id, uint32_t typeid, int us)
|
2021-12-10 18:23:47 +01:00
|
|
|
{
|
2023-10-23 15:12:43 +02:00
|
|
|
instr_nosv_task_create(id, typeid);
|
|
|
|
instr_nosv_task_execute(id, 0);
|
2023-03-22 16:01:55 +01:00
|
|
|
sleep_us(us);
|
2023-10-23 15:12:43 +02:00
|
|
|
instr_nosv_task_end(id, 0);
|
2021-12-10 18:23:47 +01:00
|
|
|
}
|
|
|
|
|
2022-09-29 15:34:44 +02:00
|
|
|
int
|
|
|
|
main(void)
|
2021-12-10 18:23:47 +01:00
|
|
|
{
|
|
|
|
int rank = atoi(getenv("OVNI_RANK"));
|
|
|
|
int nranks = atoi(getenv("OVNI_NRANKS"));
|
2022-06-02 15:46:22 +02:00
|
|
|
uint32_t typeid = 1;
|
2021-12-10 18:23:47 +01:00
|
|
|
|
|
|
|
instr_start(rank, nranks);
|
2023-11-10 12:34:57 +01:00
|
|
|
instr_nosv_init();
|
2021-12-10 18:23:47 +01:00
|
|
|
|
2023-10-23 15:12:43 +02:00
|
|
|
instr_nosv_type_create(typeid);
|
2022-06-02 15:46:22 +02:00
|
|
|
|
2021-12-10 18:23:47 +01:00
|
|
|
/* Create some fake nosv tasks */
|
2022-09-29 15:34:44 +02:00
|
|
|
for (int i = 0; i < 10; i++)
|
2022-06-02 15:46:22 +02:00
|
|
|
task(i + 1, typeid, 5000);
|
2021-12-10 18:23:47 +01:00
|
|
|
|
|
|
|
instr_end();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|