Skip to content

Commit

Permalink
Merge pull request #2919 from boutproject/fix-some-include-issues
Browse files Browse the repository at this point in the history
Fix some include issues
  • Loading branch information
ZedThree authored May 31, 2024
2 parents 43ddd13 + 533e446 commit ed69fd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions include/bout/bout.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#ifndef BOUT_H
#define BOUT_H

// IWYU pragma: begin_keep, begin_export
#include "bout/build_config.hxx"

#include "bout/boutcomm.hxx"
Expand All @@ -53,6 +54,7 @@
#include "bout/vector3d.hxx"
#include "bout/version.hxx"
#include "bout/where.hxx"
// IWYU pragma: end_keep, end_export

// BOUT++ main functions

Expand Down
2 changes: 1 addition & 1 deletion include/bout/petsclib.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Options;
// means we _must_ `#include` this header _before_ any PETSc header!
#define PETSC_HAVE_BROKEN_RECURSIVE_MACRO

#include <petsc.h>
#include <petsc.h> // IWYU pragma: export
#include <petscversion.h>

#include "bout/boutexception.hxx"
Expand Down
18 changes: 9 additions & 9 deletions include/bout/region.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,27 @@ class BoutMask;
/// }
//

#define BOUT_FOR_SERIAL(index, region) \
for (auto block = region.getBlocks().cbegin(), end = region.getBlocks().cend(); \
block < end; ++block) \
#define BOUT_FOR_SERIAL(index, region) \
for (auto block = (region).getBlocks().cbegin(), end = (region).getBlocks().cend(); \
block < end; ++block) \
for (auto index = block->first; index < block->second; ++index)

#if BOUT_USE_OPENMP
#define BOUT_FOR_OMP(index, region, omp_pragmas) \
BOUT_OMP_PERF(omp_pragmas) \
for (auto block = region.getBlocks().cbegin(); block < region.getBlocks().cend(); \
++block) \
#define BOUT_FOR_OMP(index, region, omp_pragmas) \
BOUT_OMP_PERF(omp_pragmas) \
for (auto block = (region).getBlocks().cbegin(); block < (region).getBlocks().cend(); \
++block) \
for (auto index = block->first; index < block->second; ++index)
#else
// No OpenMP, so fall back to slightly more efficient serial form
#define BOUT_FOR_OMP(index, region, omp_pragmas) BOUT_FOR_SERIAL(index, region)
#endif

#define BOUT_FOR(index, region) \
BOUT_FOR_OMP(index, region, parallel for schedule(BOUT_OPENMP_SCHEDULE))
BOUT_FOR_OMP(index, (region), parallel for schedule(BOUT_OPENMP_SCHEDULE))

#define BOUT_FOR_INNER(index, region) \
BOUT_FOR_OMP(index, region, for schedule(BOUT_OPENMP_SCHEDULE) nowait)
BOUT_FOR_OMP(index, (region), for schedule(BOUT_OPENMP_SCHEDULE) nowait)
// NOLINTEND(cppcoreguidelines-macro-usage,bugprone-macro-parentheses)

enum class IND_TYPE { IND_3D = 0, IND_2D = 1, IND_PERP = 2 };
Expand Down
3 changes: 0 additions & 3 deletions src/mesh/impls/bout/boutmesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#include <bout/sys/timer.hxx>
#include <bout/utils.hxx>

#include "boundary_region.hxx"
#include "parallel_boundary_region.hxx"

#include <algorithm>
#include <iterator>
#include <set>
Expand Down

0 comments on commit ed69fd6

Please sign in to comment.