In writing the parallel t_is_prime demonstration, I find it awkward exiting the application from within the parallel for loop. Folks have suggested the continue statement for OpenMP using C/C++ which I tried. Doing so causes Codon to disable OpenMP somehow. Is that a bug?
@par(schedule='dynamic', chunk_size=1, ordered=True)
for chunk_id in range(num_chunks):
if not_prime: continue
low = uint(chunk_size) * uint(chunk_id) + uint(6) - uint(1)
high = low + uint(chunk_size) - uint(1)
if high > q: high = q
if _DEBUG:
show_chunk_info(chunk_id, low, high)
while True:
if low > high:
break
if n % low == uint(0) or n % (low + uint(2)) == uint(0):
not_prime += 1
break
low += uint(6)
# if not_prime:
# # OpenMP lacks omp.for_break/omp.for_continue capabilities.
# terminate_early(n) # so, exit the application```
# if not_prime: omp.for_break # <-- feature request
I asked on stackoverflow where to submit a feature request for OpenMP.
In writing the parallel t_is_prime demonstration, I find it awkward exiting the application from within the parallel for loop. Folks have suggested the continue statement for OpenMP using C/C++ which I tried. Doing so causes Codon to disable OpenMP somehow. Is that a bug?
I asked on stackoverflow where to submit a feature request for OpenMP.
As always, thank you for Codon.