aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpXWrappers.cpp
diff options
context:
space:
mode:
authorGravatar Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com> 2021-11-18 16:59:40 -0800
committerGravatar GitHub <noreply@github.com> 2021-11-18 16:59:40 -0800
commit515edee892e3c0e4c5eda6793ea209ebd5d5e7b0 (patch)
treee0f111772532a57933b76a52be92c426c1ff4e81 /Source/Python/WarpXWrappers.cpp
parentc35d87289a4c0e91862039f386ac76263192ce92 (diff)
downloadWarpX-515edee892e3c0e4c5eda6793ea209ebd5d5e7b0.tar.gz
WarpX-515edee892e3c0e4c5eda6793ea209ebd5d5e7b0.tar.zst
WarpX-515edee892e3c0e4c5eda6793ea209ebd5d5e7b0.zip
Add WARPX_PROFILE calls to each python callback. (#2573)
When python callbacks take some time, this is useful as otherwise many callbacks are lumped together in WarpX::Evolve::step.
Diffstat (limited to 'Source/Python/WarpXWrappers.cpp')
-rw-r--r--Source/Python/WarpXWrappers.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp
index 66db34497..6e9b6e941 100644
--- a/Source/Python/WarpXWrappers.cpp
+++ b/Source/Python/WarpXWrappers.cpp
@@ -12,6 +12,7 @@
#include "Particles/ParticleBoundaryBuffer.H"
#include "Particles/WarpXParticleContainer.H"
#include "Utils/WarpXUtil.H"
+#include "Utils/WarpXProfilerWrapper.H"
#include "WarpX.H"
#include "WarpXWrappers.H"
#include "WarpX_py.H"
@@ -166,8 +167,14 @@ extern "C"
{
WarpX& warpx = WarpX::GetInstance();
warpx.InitData();
- if (warpx_py_afterinit) warpx_py_afterinit();
- if (warpx_py_particleloader) warpx_py_particleloader();
+ if (warpx_py_afterinit) {
+ WARPX_PROFILE("warpx_py_afterinit");
+ warpx_py_afterinit();
+ }
+ if (warpx_py_particleloader) {
+ WARPX_PROFILE("warpx_py_particleloader");
+ warpx_py_particleloader();
+ }
}
void warpx_finalize ()