Skip to content

Commit

Permalink
Suppress warning instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel committed Nov 14, 2024
1 parent 0ce2e2b commit 0baf384
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Source/PeleLMeX_Regrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial)

// Bcast the test dmap and remake level
if (remakeLevel != 0) {
Vector<int> pmap(1);
Vector<int> pmap;
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
pmap = test_dmap.ProcessorMap();
} else {
#pragma GCC diagnostic ignored "-Wnull-dereference"
pmap.resize(static_cast<std::size_t>(grids[0].size()));
}
ParallelDescriptor::Bcast(
Expand Down Expand Up @@ -239,12 +240,13 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial)

// Bcast the test dmap if we plan on remaking the level
if (remakeLevel != 0) {
Vector<int> pmap(1);
Vector<int> pmap;
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
pmap = test_dmap.ProcessorMap();
} else {
#pragma GCC diagnostic ignored "-Wnull-dereference"
pmap.resize(static_cast<std::size_t>(new_ba.size()));
}
ParallelDescriptor::Bcast(
Expand Down
3 changes: 2 additions & 1 deletion Source/PeleLMeX_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,12 @@ PeleLM::loadBalanceChemLev(int a_lev)

// Bcast the test dmap if better
if (updateDmap != 0) {
Vector<int> pmap(1);
Vector<int> pmap;
if (
ParallelDescriptor::MyProc() == ParallelDescriptor::IOProcessorNumber()) {
pmap = test_dmap.ProcessorMap();
} else {
#pragma GCC diagnostic ignored "-Wnull-dereference"
pmap.resize(static_cast<std::size_t>(m_baChem[a_lev]->size()));
}
ParallelDescriptor::Bcast(
Expand Down

0 comments on commit 0baf384

Please sign in to comment.