Use the taskwait pragma to specify a wait for child tasks to be completed that are generated by the current task.
>>-#--pragma--omp taskwait-------------------------------------><