#pragma omp parallel num_threads(min_thread) shared(count){
#pragma omp for
for (int i = 0; i < v_edgeWeight.size(); i++) { // light cpu work for (long j=0; j<currentNedges; j++) { // light cpu work if ( valid ) { //wait all threads // execute a line once and release all threads } } } }
i made a function with #pragma omp barrierand #pragma omp single
but the problem is that some threads get stuck at the barrier when some threads exits the loop without reintering the inner loop(which has to be sequential)