When doing a multi-parallelFor region, any ReductionVariable passed to the parallel block is reduced more than once.
Library version(s) affected
1.1.0
Steps to reproduce
Parallel.defaultConfig()
.withVariables(variables)
.parallelFor(0, m, false, (id, start, end, vars) -> {
for (int i = start; i < end; i++) {
// ...
}
})
.parallelFor(0, m, false, (id, start, end, vars) -> {
for (int i = start; i < end; i++) {
// ...
}
})
.join();
Additional context, environment
No response
Logs
Exception in thread "main" java.lang.IllegalStateException: ReductionVariable has already been merged.
at jromp.parallel.var.ReductionVariable.merge(ReductionVariable.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at jromp.parallel.Parallel.join(Parallel.java:136)
at jromp.examples.mandelbrot.MandelbrotParallel.$main(MandelbrotParallel.java:116)
at jromp.examples.mandelbrot.MandelbrotParallel.main(MandelbrotParallel.java:17)
Describe the bug
When doing a multi-parallelFor region, any ReductionVariable passed to the parallel block is reduced more than once.
Library version(s) affected
1.1.0
Steps to reproduce
Additional context, environment
No response
Logs