Open
Description
I'm trying to have an operator that copies all the values from the i-1 cells to i in parallel. I think there shouldn't be any race conditions violated unless I'm missing something. This is basically what the code looks like.
#pragma omp parallel for schedule(dynamic)
for(uint j = 0; j < ctx.nz(); j++) {
im1[j] = viennacl::range(inds(0, j, ctx), inds(ctx.nx()-2, j, ctx)+1);
i[j] = viennacl::range(inds(1, j, ctx), inds(ctx.nx()-1, j, ctx)+1);
}
#pragma omp parallel for
for(uint j = 0; j < ctx.nz(); j++) {
viennacl::project(xn_im1, i[j], eq) = viennacl::project(xn, im1[j], eq);
}
If I remove the second omp directive it works fine and tests fine, but with it I get NaNs in my matrix. Is it not possible to get something like this done quickly. This is indirectly related to #228 .
Actual code can be found here: https://github.com/qalshidi/comfi/blob/master/operators.cpp
Metadata
Metadata
Assignees
Labels
No labels