I have a CPU consuming function do_long that I need to run on two different datasets.
do_long(data1);
do_long(data2);
do_long() {
#pragma omp for
for(...) {
// do proccessing
}
}
I have N threads available (depends on machine). How to tell OpenMP that I want that both do_long
functions are run in parallel, and N/2 threads should perform the loop in first do_long and another N/2 should process second do_long?
One approach is to do it using nested parallelism: