ovni/test/rt/openmp/worksharing-active-th.c
Raúl Peñacoba Veigas 9826879bcd
Some checks failed
CI / build:rt (push) Failing after 15s
CI / build:debug (push) Successful in 13s
CI / build:asan (push) Failing after 13s
CI / build:nompi (push) Successful in 13s
CI / build:compilers (push) Successful in 13s
CI / build:local (push) Successful in 23s
Add OpenMP support for labels and taskID views
Co-authored-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-12-09 16:41:16 +01:00

23 lines
603 B
C

/* Copyright (c) 2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include <nosv.h>
#include "ovni.h"
/* Ensure that the thread is paused on nosv_waitfor(), so there is a hole in the
* OpenMP views, as they track the active thread (in the thread views) and the
* running thread (in the CPU views). */
int
main(void)
{
ovni_mark_type(0, OVNI_MARK_STACK, "tracker");
#pragma omp parallel for num_threads(1)
for (int i = 0; i < 100; ++i) {
ovni_mark_push(0, 123);
/* We should see a hole here */
nosv_waitfor(10, NULL);
ovni_mark_pop(0, 123);
}
}