[Openmp-commits] [PATCH] D39853: [OMPT] Fix inaccuracies in worksharing tests
Joachim Protze via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Nov 10 08:45:22 PST 2017
protze.joachim added inline comments.
================
Comment at: runtime/test/ompt/worksharing/single.c:12
int x = 0;
#pragma omp parallel num_threads(2)
{
----------------
Hahnfeld wrote:
> protze.joachim wrote:
> > In other tests we use something like:
> > ```
> > int cond=0;
> > #pragma omp parallel num_threads(2)
> > {
> > if(omp_get_thread_num==1)
> > wait(cond,1);
> > #pragma omp single
> > {
> > signal(cond);
> > }
> > }
> > ```
> I only see this for test cases involving tasks where we need to enforce a certain scheduling order. This is not needed here because we only want to test that one thread enters the single and the other one does not. We don't really care which one it is, do we?
Well, by enforcing the ordering we could predict which thread should throw which callback. With the DAG you only test, that the two threads throw different callbacks.
Probably print something (frame/address) in the single region and test that this was printed by the same thread as ompt_event_single_in_block_begin.
https://reviews.llvm.org/D39853
More information about the Openmp-commits
mailing list