Skip to content

Commit

Permalink
Try to fix null pointer dereference possibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel committed Nov 12, 2024
1 parent 6dbac8c commit 7ef537e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/PeleLMeX_Regrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial)

// Bcast the test dmap and remake level
if (remakeLevel != 0) {
Vector<int> pmap;
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
Expand Down Expand Up @@ -239,7 +239,7 @@ 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;
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() ==
ParallelDescriptor::IOProcessorNumber()) {
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLMeX_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ PeleLM::loadBalanceChemLev(int a_lev)

// Bcast the test dmap if better
if (updateDmap != 0) {
Vector<int> pmap;
Vector<int> pmap(1);
if (
ParallelDescriptor::MyProc() == ParallelDescriptor::IOProcessorNumber()) {
pmap = test_dmap.ProcessorMap();
Expand Down

0 comments on commit 7ef537e

Please sign in to comment.