From 301f01eb411af84eeece8bc97b7da4b10c545d56 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 26 Aug 2024 15:10:11 +0200 Subject: [PATCH] meshcolorizer: avoid dead stores --- opm/elasticity/meshcolorizer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opm/elasticity/meshcolorizer.cpp b/opm/elasticity/meshcolorizer.cpp index 3cc417b..5409015 100644 --- a/opm/elasticity/meshcolorizer.cpp +++ b/opm/elasticity/meshcolorizer.cpp @@ -16,7 +16,7 @@ #include -#ifdef HAVE_OPENMP +#if _OPENMP #include #endif @@ -26,12 +26,12 @@ void MeshColorizer::calcGroups() int nel1 = grid.logicalCartesianSize()[0]; int nel2 = grid.logicalCartesianSize()[1]; int nel3 = grid.logicalCartesianSize()[2]; - int threads=1; - int stripsize=0; - int remainder=0; - int dir=0, mul=1; + int threads; + int stripsize; + int remainder = 0; + int dir, mul; -#ifdef HAVE_OPENMP +#if _OPENMP threads = omp_get_max_threads(); int parts = threads > 1 ? 2*threads : 1; dir = getStripDirection(nel1,nel2,nel3,parts); @@ -53,6 +53,8 @@ void MeshColorizer::calcGroups() << "\n\tstripsize " << stripsize << "\n\t# of strips " << els/stripsize << "\n\tremainder " << remainder << std::endl; +#else + threads = 1; #endif if (threads == 1) {