Skip to content

Commit

Permalink
Load balancing bug fix: remake MultiFabs for Vay deposition, current …
Browse files Browse the repository at this point in the history
…centering, time averaging (#3508)

Additional MultiFabs for Vay deposition, current centering, and time averaging need to be allocated after load-balancing, otherwise the simulation crashes.
  • Loading branch information
RevathiJambunathan authored Nov 7, 2022
1 parent 8f9da8c commit ada6fc4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Source/Parallelization/WarpXRegrid.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright 2019 Andrew Myers, Ann Almgren, Axel Huebl
* David Grote, Maxence Thevenet, Michael Rowan
* Remi Lehe, Weiqun Zhang, levinem
* Remi Lehe, Weiqun Zhang, levinem, Revathi Jambunathan
*
* This file is part of WarpX.
*
Expand Down Expand Up @@ -170,7 +170,16 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi
RemakeMultiFab(Efield_fp[lev][idim], dm, true);
RemakeMultiFab(current_fp[lev][idim], dm, false);
RemakeMultiFab(current_store[lev][idim], dm, false);

if (current_deposition_algo == CurrentDepositionAlgo::Vay) {
RemakeMultiFab(current_fp_vay[lev][idim], dm, false);
}
if (do_current_centering) {
RemakeMultiFab(current_fp_nodal[lev][idim], dm, false);
}
if (fft_do_time_averaging) {
RemakeMultiFab(Efield_avg_fp[lev][idim], dm, true);
RemakeMultiFab(Bfield_avg_fp[lev][idim], dm, true);
}
#ifdef AMREX_USE_EB
if (WarpX::maxwell_solver_id == MaxwellSolverAlgo::Yee ||
WarpX::maxwell_solver_id == MaxwellSolverAlgo::ECT ||
Expand Down Expand Up @@ -264,6 +273,10 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi
RemakeMultiFab(Bfield_cp[lev][idim], dm, true);
RemakeMultiFab(Efield_cp[lev][idim], dm, true);
RemakeMultiFab(current_cp[lev][idim], dm, false);
if (fft_do_time_averaging) {
RemakeMultiFab(Efield_avg_cp[lev][idim], dm, true);
RemakeMultiFab(Bfield_avg_cp[lev][idim], dm, true);
}
}
RemakeMultiFab(F_cp[lev], dm, true);
RemakeMultiFab(rho_cp[lev], dm, false);
Expand Down

0 comments on commit ada6fc4

Please sign in to comment.