How not to wait for other threads in OpenMP?

I am considering using OpenMP for multithreading in C ++. But I wonder if there is a way to tell the thread not to wait for another parallel thread and continue working with my program? (Maybe I can undo / kill other threads?)

I am aware of the existence of the “nowait” sentence, but I want the decision to “wait” or “not wait” to be executed dynamically (the program will decide depending on the results of the process that I am doing).

Hope I can get some advice on this.

Thanks in advance.

+3
source share
1 answer

I would do it something like

if(conditon)
{
     taskA_with_Barriers();
}  
else
{
     taskA_without_Barrier();
}

condtion .

Threads, . pthreads MPI.

+1

Source: https://habr.com/ru/post/1757769/


All Articles