diff options
author | 2020-02-24 15:54:50 -0800 | |
---|---|---|
committer | 2020-02-24 15:54:50 -0800 | |
commit | bbefc3dad687f4370afd5bc85386d983201cb321 (patch) | |
tree | dbbff865cd72e16b87046685dfc25835f1d2573c /Source/WarpX.cpp | |
parent | 8c3523a1054a0d7591cac951aa723f2b01c8e68d (diff) | |
download | WarpX-bbefc3dad687f4370afd5bc85386d983201cb321.tar.gz WarpX-bbefc3dad687f4370afd5bc85386d983201cb321.tar.zst WarpX-bbefc3dad687f4370afd5bc85386d983201cb321.zip |
Profiler wrapper to allow for cudaDeviceSynchronize (#738)
* add warpx profiler wrapper
* call WX profiler wrapper instead of BL
* EOL and cleaning
* add doc on profile syncs
* do not use PROFILE macros in .H files
* replace WX_PROFILE with WARPX_PROFILE and use bool instead of int
* typo
* this file shouldn't be there
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 46f5ab731..d3f419d98 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -15,6 +15,7 @@ #include <WarpXUtil.H> #include <WarpXAlgorithmSelection.H> #include <WarpX_FDTD.H> +#include "WarpXProfilerWrapper.H" #include <AMReX_ParmParse.H> #include <AMReX_MultiFabUtil.H> @@ -144,6 +145,12 @@ int WarpX::n_current_deposition_buffer = -1; int WarpX::do_nodal = false; +#ifdef AMREX_USE_GPU +bool WarpX::do_device_synchronize_before_profile = true; +#else +bool WarpX::do_device_synchronize_before_profile = false; +#endif + WarpX* WarpX::m_instance = nullptr; WarpX& @@ -376,6 +383,8 @@ WarpX::ReadParameters () ReadBoostedFrameParameters(gamma_boost, beta_boost, boost_direction); + pp.query("do_device_synchronize_before_profile", do_device_synchronize_before_profile); + // pp.query returns 1 if argument zmax_plasma_to_compute_max_step is // specified by the user, 0 otherwise. do_compute_max_step_from_zmax = @@ -1109,7 +1118,7 @@ WarpX::RefRatio (int lev) void WarpX::Evolve (int numsteps) { - BL_PROFILE_REGION("WarpX::Evolve()"); + WARPX_PROFILE_REGION("WarpX::Evolve()"); #ifdef WARPX_DO_ELECTROSTATIC if (do_electrostatic) { |