<div dir="ltr">I am trying to implement following code:<br>---------------------------------------------------------------------------------------------------------<br><font face="trebuchet ms, sans-serif">#pragma omp parallel private(i, piold, err) shared(pi, threshold_err)<br>{<br>#pragma omp for reduction(+:pi) schedule (static)<br>  for (i = 0; i < 10000000 ; i++){<br>        piold = pi;<br>        pi += (((i&1) == false) ? 1.0 : -1.0)/(2*i+1);<br>        err = fabs(pi-piold);<br>        if ( err < threshold_err){<br>#pragma omp cancel for<br>        }<br><br>  }<br>}</font><br>-------------------------------------------------------------------------------------------------------------<br>Although with if statement removed, code takes 11 seconds, while with it in it takes forever and I ave to abort the code.<br><div><br></div><div>I am using LLVM3.9/CLANG4.0.</div><div><br></div><div>Is cancel for implemented in LLVM? I use a small code to see that and omp_get_cancellation() returns true for export OMP_CANCELLATION=true directive.</div><div><br></div><div>Thank you.</div><div><br></div><div>-Gurunath</div></div>