Skip to content

Commit

Permalink
add google checks
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Aug 4, 2023
1 parent 0055f3e commit 45e3424
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Checks: >
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
Expand All @@ -20,6 +19,9 @@ Checks: >
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-*,
google-build-explicit-make-pair,
google-build-namespaces,
google-global-names-in-headers,
misc-*,
-misc-const-correctness,
-misc-non-private-member-variables-in-classes,
Expand Down
6 changes: 4 additions & 2 deletions Src/Base/AMReX_Lazy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ namespace amrex::Lazy
#ifdef BL_USE_MPI
reduction_queue.push_back(f);
const int max_queue_size = 64;
if (reduction_queue.size() >= max_queue_size)
if (reduction_queue.size() >= max_queue_size) {
EvalReduction();
}
#else
f();
#endif
Expand All @@ -22,8 +23,9 @@ namespace amrex::Lazy
static int count = 0;
++count;
if (count == 1) {
for (auto&& f : reduction_queue)
for (auto&& f : reduction_queue) {
f();
}
reduction_queue.clear();
count = 0;
}
Expand Down
3 changes: 1 addition & 2 deletions Src/Base/AMReX_ParallelDescriptor.H
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ ParallelDescriptor::Bcast (T* t,
#ifdef BL_LAZY
int r;
MPI_Comm_compare(comm, Communicator(), &r);
if (r == MPI_IDENT)
Lazy::EvalReduction();
if (r == MPI_IDENT) { Lazy::EvalReduction(); }
#endif

BL_ASSERT(n < static_cast<size_t>(std::numeric_limits<int>::max()));
Expand Down
6 changes: 2 additions & 4 deletions Src/Base/AMReX_ParallelDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,7 @@ Barrier (const MPI_Comm &comm, const std::string &message)
#ifdef BL_LAZY
int r;
MPI_Comm_compare(comm, Communicator(), &r);
if (r == MPI_IDENT)
Lazy::EvalReduction();
if (r == MPI_IDENT) { Lazy::EvalReduction(); }
#endif

BL_PROFILE_S("ParallelDescriptor::Barrier(comm)");
Expand Down Expand Up @@ -1130,8 +1129,7 @@ Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
#ifdef BL_LAZY
int r;
MPI_Comm_compare(comm, Communicator(), &r);
if (r == MPI_IDENT)
Lazy::EvalReduction();
if (r == MPI_IDENT) { Lazy::EvalReduction(); }
#endif

BL_PROFILE_S("ParallelDescriptor::Bcast(viMiM)");
Expand Down
2 changes: 0 additions & 2 deletions Tests/Amr/Advection_AmrLevel/Exec/SingleVortex/Prob_Parm.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#include <AMReX_REAL.H>

using namespace amrex::literals;

// Define the struct to contain problem-specific variables here.
// For this case, since we don't need any, the struct is empty.
struct ProbParm {};
Expand Down
1 change: 0 additions & 1 deletion Tests/EB/CNS/Source/CNS.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <AMReX_EBCellFlag.H>
#include <AMReX_EBFluxRegister.H>

using namespace amrex;
class CNS
:
public amrex::AmrLevel
Expand Down

0 comments on commit 45e3424

Please sign in to comment.