From 9a1a70b8b36b4f225a2290889bbd874190211444 Mon Sep 17 00:00:00 2001 From: Stefan Kerkemeier Date: Sun, 9 Aug 2020 09:51:30 +0000 Subject: [PATCH] check number of elements in oogs callback function --- src/libP/solvers/elliptic/src/ellipticBuildMultigridLevel.c | 1 + src/libP/solvers/elliptic/src/ellipticSolveSetup.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libP/solvers/elliptic/src/ellipticBuildMultigridLevel.c b/src/libP/solvers/elliptic/src/ellipticBuildMultigridLevel.c index c6d83dbd1..83b511c38 100644 --- a/src/libP/solvers/elliptic/src/ellipticBuildMultigridLevel.c +++ b/src/libP/solvers/elliptic/src/ellipticBuildMultigridLevel.c @@ -994,6 +994,7 @@ elliptic_t* ellipticBuildMultigridLevel(elliptic_t* baseElliptic, int Nc, int Nf if(options.compareArgs("THREAD MODEL", "OPENMP")) oogsMode = OOGS_DEFAULT; auto callback = [&]() // hardwaire to FP64 const coeff { + if(mesh->NlocalGatherElements == 0) return; occa::kernel &partialAxKernel = elliptic->partialAxKernel; partialAxKernel(mesh->NlocalGatherElements, mesh->o_localGatherElementList, diff --git a/src/libP/solvers/elliptic/src/ellipticSolveSetup.c b/src/libP/solvers/elliptic/src/ellipticSolveSetup.c index d75f71c0e..83a9455a1 100644 --- a/src/libP/solvers/elliptic/src/ellipticSolveSetup.c +++ b/src/libP/solvers/elliptic/src/ellipticSolveSetup.c @@ -1009,6 +1009,7 @@ void ellipticSolveSetup(elliptic_t* elliptic, occa::properties &kernelInfo) if(options.compareArgs("THREAD MODEL", "OPENMP")) oogsMode = OOGS_DEFAULT; auto callback = [&]() // hardwired to FP64 variable coeff { + if(mesh->NlocalGatherElements == 0) return; occa::kernel &partialAxKernel = elliptic->partialAxKernel; if(elliptic->blockSolver) partialAxKernel(mesh->NlocalGatherElements,