From a62ba4eef529dea44bff358c1ef36266879be124 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 2 Jun 2022 15:46:22 +0200 Subject: [PATCH] Always create task types in the tests --- test/mp-rank.c | 29 ++++++++++++++++++++++++++--- test/nosv-nested-tasks.c | 29 ++++++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/test/mp-rank.c b/test/mp-rank.c index f9753f5..e065a24 100644 --- a/test/mp-rank.c +++ b/test/mp-rank.c @@ -107,9 +107,29 @@ static inline void instr_end(void) } static void -task(int32_t id, int us) +type_create(int32_t typeid) +{ + struct ovni_ev ev = {0}; + + ovni_ev_set_mcv(&ev, "VYc"); + ovni_ev_set_clock(&ev, ovni_clock_now()); + + char buf[256]; + char *p = buf; + + size_t nbytes = 0; + memcpy(buf, &typeid, sizeof(typeid)); + p += sizeof(typeid); + nbytes += sizeof(typeid); + sprintf(p, "testtype%d", typeid); + nbytes += strlen(p) + 1; + + ovni_ev_jumbo_emit(&ev, (uint8_t *) buf, nbytes); +} + +static void +task(int32_t id, uint32_t typeid, int us) { - int32_t typeid = 1; struct ovni_ev ev = {0}; ovni_ev_set_mcv(&ev, "VTc"); @@ -139,12 +159,15 @@ int main(void) { int rank = atoi(getenv("OVNI_RANK")); int nranks = atoi(getenv("OVNI_NRANKS")); + uint32_t typeid = 1; instr_start(rank, nranks); + type_create(typeid); + /* Create some fake nosv tasks */ for(int i=0; i<10; i++) - task(i + 1, 50 * 1000); + task(i + 1, typeid, 5000); instr_end(); diff --git a/test/nosv-nested-tasks.c b/test/nosv-nested-tasks.c index 83fb3da..7a24315 100644 --- a/test/nosv-nested-tasks.c +++ b/test/nosv-nested-tasks.c @@ -112,9 +112,29 @@ instr_end(void) } static void -task_begin(int32_t id, int us) +type_create(int32_t typeid) +{ + struct ovni_ev ev = {0}; + + ovni_ev_set_mcv(&ev, "VYc"); + ovni_ev_set_clock(&ev, ovni_clock_now()); + + char buf[256]; + char *p = buf; + + size_t nbytes = 0; + memcpy(buf, &typeid, sizeof(typeid)); + p += sizeof(typeid); + nbytes += sizeof(typeid); + sprintf(p, "testtype%d", typeid); + nbytes += strlen(p) + 1; + + ovni_ev_jumbo_emit(&ev, (uint8_t *) buf, nbytes); +} + +static void +task_begin(int32_t id, uint32_t typeid, int us) { - int32_t typeid = 1; struct ovni_ev ev = {0}; ovni_ev_set_mcv(&ev, "VTc"); @@ -150,10 +170,13 @@ main(void) instr_start(0, 1); int ntasks = 100; + uint32_t typeid = 1; + + type_create(typeid); /* Create and run the tasks, one nested into another */ for(int i=0; i=0; i--)