Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix override default particle tiling #2762

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Regression/WarpX-GPU-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ emailBody = Check https://ccse.lbl.gov/pub/GpuRegressionTesting/WarpX/ for more

[AMReX]
dir = /home/regtester/git/amrex/
branch = 7314e78fecda4080f6bd3a1857d033545f7d8a56
branch = 812836f08a758ef6f65caf7eea477bfc6423e72b

[source]
dir = /home/regtester/git/WarpX
Expand Down
2 changes: 1 addition & 1 deletion Regression/WarpX-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ emailBody = Check https://ccse.lbl.gov/pub/RegressionTesting/WarpX/ for more det

[AMReX]
dir = /home/regtester/AMReX_RegTesting/amrex/
branch = 7314e78fecda4080f6bd3a1857d033545f7d8a56
branch = 812836f08a758ef6f65caf7eea477bfc6423e72b

[source]
dir = /home/regtester/AMReX_RegTesting/warpx
Expand Down
22 changes: 17 additions & 5 deletions Source/Initialization/WarpXAMReXInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
namespace {
/** Overwrite defaults in AMReX Inputs
*
* This overwrites defaults in amrex::ParamParse for inputs.
* This overwrites defaults in amrex::ParmParse for inputs.
*/
void
overwrite_amrex_parser_defaults()
overwrite_amrex_parser_defaults ()
{
amrex::ParmParse pp_amrex("amrex");

// https://amrex-codes.github.io/amrex/docs_html/GPU.html#inputs-parameters
bool abort_on_out_of_gpu_memory = true; // AMReX' default: false
pp_amrex.query("abort_on_out_of_gpu_memory", abort_on_out_of_gpu_memory);
pp_amrex.add("abort_on_out_of_gpu_memory", abort_on_out_of_gpu_memory);
pp_amrex.queryAdd("abort_on_out_of_gpu_memory", abort_on_out_of_gpu_memory);

// Work-around:
// If warpx.numprocs is used for the domain decomposition, we will not use blocking factor
Expand All @@ -36,11 +35,24 @@ namespace {
amrex::ParmParse pp_amr("amr");
pp_amr.add("blocking_factor", 1);
}

// Here we override the default tiling option for particles, which is always
// "false" in AMReX, to "false" if compiling for GPU execution and "true"
// if compiling for CPU.
{
amrex::ParmParse pp_particles("particles");
#ifdef AMREX_USE_GPU
bool do_tiling = false; // By default, tiling is off on GPU
#else
bool do_tiling = true;
#endif
pp_particles.queryAdd("do_tiling", do_tiling);
}
}
}

amrex::AMReX*
warpx_amrex_init(int& argc, char**& argv, bool const build_parm_parse, MPI_Comm const mpi_comm)
warpx_amrex_init (int& argc, char**& argv, bool const build_parm_parse, MPI_Comm const mpi_comm)
{
return amrex::Initialize(
argc,
Expand Down
7 changes: 0 additions & 7 deletions Source/Particles/WarpXParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,7 @@ WarpXParticleContainer::ReadParameters ()
if (!initialized)
{
ParmParse pp_particles("particles");

#ifdef AMREX_USE_GPU
do_tiling = false; // By default, tiling is off on GPU
#else
do_tiling = true;
#endif
pp_particles.query("do_tiling", do_tiling);

initialized = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies/AMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ set(WarpX_amrex_src ""
set(WarpX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
CACHE STRING
"Repository URI to pull and build AMReX from if(WarpX_amrex_internal)")
set(WarpX_amrex_branch "7314e78fecda4080f6bd3a1857d033545f7d8a56"
set(WarpX_amrex_branch "812836f08a758ef6f65caf7eea477bfc6423e72b"
CACHE STRING
"Repository branch for WarpX_amrex_repo if(WarpX_amrex_internal)")

Expand Down
2 changes: 1 addition & 1 deletion run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ python3 -m pip install --upgrade -r warpx/Regression/requirements.txt

# Clone AMReX and warpx-data
git clone https://github.com/AMReX-Codes/amrex.git
cd amrex && git checkout --detach 7314e78fecda4080f6bd3a1857d033545f7d8a56 && cd -
cd amrex && git checkout --detach 812836f08a758ef6f65caf7eea477bfc6423e72b && cd -
# warpx-data contains various required data sets
git clone --depth 1 https://github.com/ECP-WarpX/warpx-data.git

Expand Down