Skip to content

Commit

Permalink
Fix bug introduced by overlapping gather-scatter and fusedFDMKernel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MalachiTimothyPhillips authored Feb 13, 2021
1 parent dc90a49 commit 932549f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/elliptic/ellipticMultiGridSchwarz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,25 +923,33 @@ void MGLevel::smoothSchwarz(occa::memory& o_u, occa::memory& o_Su, bool xIsZero)
oogs::startFinish(o_work1, 1, 0, ogsDataTypeString, ogsAdd, (oogs_t*) extendedOgs);

if(options.compareArgs("MULTIGRID SMOOTHER","RAS")) {
if(mesh->NglobalGatherElements || !overlap)
if(!overlap){
fusedFDMKernel(Nelements,mesh->NglobalGatherElements,mesh->o_globalGatherElementList,
o_Su,o_Sx,o_Sy,o_Sz,o_invL,o_work1, elliptic->ogs->o_invDegree);
} else if(overlap && mesh->NglobalGatherElements){
fusedFDMKernel(Nelements,mesh->NglobalGatherElements,mesh->o_globalGatherElementList,
o_Su,o_Sx,o_Sy,o_Sz,o_invL,o_work1, elliptic->ogs->o_invDegree);
}

oogs::start(o_Su, 1, 0, ogsDataTypeString, ogsAdd, (oogs_t*) ogs);

if(overlap)
if(overlap && mesh->NlocalGatherElements)
fusedFDMKernel(Nelements,mesh->NlocalGatherElements,mesh->o_localGatherElementList,
o_Su,o_Sx,o_Sy,o_Sz,o_invL,o_work1, elliptic->ogs->o_invDegree);

oogs::finish(o_Su, 1, 0, ogsDataTypeString, ogsAdd, (oogs_t*) ogs);
} else {
if(mesh->NglobalGatherElements || !overlap)
if(!overlap){
fusedFDMKernel(Nelements,mesh->NglobalGatherElements,mesh->o_globalGatherElementList,
o_work2,o_Sx,o_Sy,o_Sz,o_invL,o_work1);
} else if(overlap && mesh->NglobalGatherElements){
fusedFDMKernel(Nelements,mesh->NglobalGatherElements,mesh->o_globalGatherElementList,
o_work2,o_Sx,o_Sy,o_Sz,o_invL,o_work1);
}

oogs::start(o_work2, 1, 0, ogsDataTypeString, ogsAdd, (oogs_t*) extendedOgs);

if(overlap)
if(overlap && mesh->NlocalGatherElements)
fusedFDMKernel(Nelements,mesh->NlocalGatherElements,mesh->o_localGatherElementList,
o_work2,o_Sx,o_Sy,o_Sz,o_invL,o_work1);

Expand Down

0 comments on commit 932549f

Please sign in to comment.