From e6e6d4c25131ee6dbd4a5636ce63a21517c4ad3d Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Wed, 29 Nov 2023 16:57:34 +0000 Subject: [PATCH] Kokkos profiling 2 --- src/geometryXVx/poisson/chargedensitycalculator.cpp | 2 ++ src/geometryXVx/poisson/fftpoissonsolver.cpp | 2 ++ src/geometryXVx/poisson/splinechargedensitycalculator.cpp | 2 +- src/geometryXVx/rhs/collisions_inter.cpp | 2 ++ src/geometryXVx/rhs/collisions_intra.cpp | 2 ++ src/geometryXVx/rhs/kinetic_source.cpp | 2 ++ src/geometryXVx/rhs/krook_source_adaptive.cpp | 2 ++ src/geometryXVx/rhs/krook_source_constant.cpp | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/geometryXVx/poisson/chargedensitycalculator.cpp b/src/geometryXVx/poisson/chargedensitycalculator.cpp index 4af2004a5..a09d2733f 100644 --- a/src/geometryXVx/poisson/chargedensitycalculator.cpp +++ b/src/geometryXVx/poisson/chargedensitycalculator.cpp @@ -12,6 +12,7 @@ ChargeDensityCalculator::ChargeDensityCalculator(Quadrature const& quad) DSpanX ChargeDensityCalculator::operator()(DSpanX const rho, DViewSpXVx const allfdistribu) const { + Kokkos::Profiling::pushRegion("ChargeDensityCalculator"); IndexSp const last_kin_species = allfdistribu.domain().back(); IndexSp const last_species = ddc::discrete_space().charges().domain().back(); double chargedens_adiabspecies = 0.; @@ -25,6 +26,7 @@ DSpanX ChargeDensityCalculator::operator()(DSpanX const rho, DViewSpXVx const al rho(ix) += charge(isp) * m_quad(allfdistribu[isp][ix]); }); }); + Kokkos::Profiling::popRegion(); return rho; } diff --git a/src/geometryXVx/poisson/fftpoissonsolver.cpp b/src/geometryXVx/poisson/fftpoissonsolver.cpp index 32629a45e..105298dec 100644 --- a/src/geometryXVx/poisson/fftpoissonsolver.cpp +++ b/src/geometryXVx/poisson/fftpoissonsolver.cpp @@ -33,6 +33,7 @@ void FftPoissonSolver::operator()( DSpanX const electric_field, DViewSpXVx const allfdistribu) const { + Kokkos::Profiling::pushRegion("PoissonSolver"); assert(electrostatic_potential.domain() == ddc::get_domain(allfdistribu)); IDomainX const x_dom = electrostatic_potential.domain(); @@ -71,4 +72,5 @@ void FftPoissonSolver::operator()( // Compute efield = -dPhi/dx where Phi is the electrostatic potential m_electric_field(electric_field, electrostatic_potential); + Kokkos::Profiling::popRegion(); } diff --git a/src/geometryXVx/poisson/splinechargedensitycalculator.cpp b/src/geometryXVx/poisson/splinechargedensitycalculator.cpp index 64f464845..f44753581 100644 --- a/src/geometryXVx/poisson/splinechargedensitycalculator.cpp +++ b/src/geometryXVx/poisson/splinechargedensitycalculator.cpp @@ -19,7 +19,7 @@ SplineChargeDensityCalculator::SplineChargeDensityCalculator( DSpanX SplineChargeDensityCalculator::operator()(DSpanX const rho, DViewSpXVx const allfdistribu) const { - Kokkos::Profiling::pushRegion("SplineChargeDensityCalculator"); + Kokkos::Profiling::pushRegion("ChargeDensityCalculator"); DFieldVx f_vx_slice(allfdistribu.domain()); ddc::Chunk vx_spline_coef(m_spline_vx_builder.spline_domain()); diff --git a/src/geometryXVx/rhs/collisions_inter.cpp b/src/geometryXVx/rhs/collisions_inter.cpp index 2d58b8f61..e5fc6f83a 100644 --- a/src/geometryXVx/rhs/collisions_inter.cpp +++ b/src/geometryXVx/rhs/collisions_inter.cpp @@ -94,10 +94,12 @@ device_t CollisionsInter::operator()( device_t allfdistribu_device, double dt) const { + Kokkos::Profiling::pushRegion("CollisionsInter"); auto allfdistribu_alloc = ddc::create_mirror_view_and_copy(allfdistribu_device); ddc::ChunkSpan allfdistribu = allfdistribu_alloc.span_view(); RK2 timestepper(allfdistribu.domain()); timestepper.update(allfdistribu, dt, [&](DSpanSpXVx dy, DViewSpXVx y) { compute_rhs(dy, y); }); ddc::deepcopy(allfdistribu_device, allfdistribu); + Kokkos::Profiling::popRegion(); return allfdistribu_device; } diff --git a/src/geometryXVx/rhs/collisions_intra.cpp b/src/geometryXVx/rhs/collisions_intra.cpp index 713743817..f4a02530c 100644 --- a/src/geometryXVx/rhs/collisions_intra.cpp +++ b/src/geometryXVx/rhs/collisions_intra.cpp @@ -214,6 +214,7 @@ device_t CollisionsIntra::operator()( device_t allfdistribu_device, double dt) const { + Kokkos::Profiling::pushRegion("CollisionsIntra"); auto allfdistribu_alloc = ddc::create_mirror_view_and_copy(allfdistribu_device); ddc::ChunkSpan allfdistribu = allfdistribu_alloc.span_view(); // density and temperature @@ -326,5 +327,6 @@ device_t CollisionsIntra::operator()( }); ddc::deepcopy(allfdistribu_device, allfdistribu); + Kokkos::Profiling::popRegion(); return allfdistribu_device; } diff --git a/src/geometryXVx/rhs/kinetic_source.cpp b/src/geometryXVx/rhs/kinetic_source.cpp index 4de64bd8a..86649e776 100644 --- a/src/geometryXVx/rhs/kinetic_source.cpp +++ b/src/geometryXVx/rhs/kinetic_source.cpp @@ -46,6 +46,7 @@ device_t KineticSource::operator()( device_t const allfdistribu, double const dt) const { + Kokkos::Profiling::pushRegion("KineticSource"); auto velocity_shape_device_alloc = ddc::create_mirror_view_and_copy( Kokkos::DefaultExecutionSpace(), m_velocity_shape.span_view()); @@ -68,5 +69,6 @@ device_t KineticSource::operator()( allfdistribu(ispxvx) += df; }); + Kokkos::Profiling::popRegion(); return allfdistribu; } diff --git a/src/geometryXVx/rhs/krook_source_adaptive.cpp b/src/geometryXVx/rhs/krook_source_adaptive.cpp index 536509425..d7940a9c5 100644 --- a/src/geometryXVx/rhs/krook_source_adaptive.cpp +++ b/src/geometryXVx/rhs/krook_source_adaptive.cpp @@ -160,6 +160,7 @@ device_t KrookSourceAdaptive::operator()( device_t const allfdistribu_device, double const dt) const { + Kokkos::Profiling::pushRegion("KrookSource"); auto allfdistribu_alloc = ddc::create_mirror_view_and_copy(allfdistribu_device); ddc::ChunkSpan allfdistribu = allfdistribu_alloc.span_view(); RK2 timestepper(allfdistribu.domain()); @@ -167,5 +168,6 @@ device_t KrookSourceAdaptive::operator()( get_derivative(df, f, allfdistribu); }); ddc::deepcopy(allfdistribu_device, allfdistribu); + Kokkos::Profiling::popRegion(); return allfdistribu_device; } diff --git a/src/geometryXVx/rhs/krook_source_constant.cpp b/src/geometryXVx/rhs/krook_source_constant.cpp index e8e0fbd14..5e8def601 100644 --- a/src/geometryXVx/rhs/krook_source_constant.cpp +++ b/src/geometryXVx/rhs/krook_source_constant.cpp @@ -68,6 +68,7 @@ device_t KrookSourceConstant::operator()( device_t const allfdistribu, double const dt) const { + Kokkos::Profiling::pushRegion("KrookSource"); auto ftarget_device_alloc = ddc:: create_mirror_view_and_copy(Kokkos::DefaultExecutionSpace(), m_ftarget.span_view()); auto ftarget_device = ftarget_device_alloc.span_view(); @@ -90,5 +91,6 @@ device_t KrookSourceConstant::operator()( * dt); }); + Kokkos::Profiling::popRegion(); return allfdistribu; }