Skip to content

Commit

Permalink
Kokkos profiling 2
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne committed Nov 29, 2023
1 parent 1710296 commit e6e6d4c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/geometryXVx/poisson/chargedensitycalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ChargeDensityCalculator::ChargeDensityCalculator(Quadrature<IDimVx> const& quad)

DSpanX ChargeDensityCalculator::operator()(DSpanX const rho, DViewSpXVx const allfdistribu) const
{
Kokkos::Profiling::pushRegion("ChargeDensityCalculator");
IndexSp const last_kin_species = allfdistribu.domain<IDimSp>().back();
IndexSp const last_species = ddc::discrete_space<IDimSp>().charges().domain().back();
double chargedens_adiabspecies = 0.;
Expand All @@ -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;
}
2 changes: 2 additions & 0 deletions src/geometryXVx/poisson/fftpoissonsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDimX>(allfdistribu));
IDomainX const x_dom = electrostatic_potential.domain();

Expand Down Expand Up @@ -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();
}
2 changes: 1 addition & 1 deletion src/geometryXVx/poisson/splinechargedensitycalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDimVx>());
ddc::Chunk<double, BSDomainVx> vx_spline_coef(m_spline_vx_builder.spline_domain());

Expand Down
2 changes: 2 additions & 0 deletions src/geometryXVx/rhs/collisions_inter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ device_t<DSpanSpXVx> CollisionsInter::operator()(
device_t<DSpanSpXVx> 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<DFieldSpXVx> 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;
}
2 changes: 2 additions & 0 deletions src/geometryXVx/rhs/collisions_intra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ device_t<DSpanSpXVx> CollisionsIntra::operator()(
device_t<DSpanSpXVx> 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
Expand Down Expand Up @@ -326,5 +327,6 @@ device_t<DSpanSpXVx> CollisionsIntra::operator()(
});

ddc::deepcopy(allfdistribu_device, allfdistribu);
Kokkos::Profiling::popRegion();
return allfdistribu_device;
}
2 changes: 2 additions & 0 deletions src/geometryXVx/rhs/kinetic_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ device_t<DSpanSpXVx> KineticSource::operator()(
device_t<DSpanSpXVx> 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());
Expand All @@ -68,5 +69,6 @@ device_t<DSpanSpXVx> KineticSource::operator()(
allfdistribu(ispxvx) += df;
});

Kokkos::Profiling::popRegion();
return allfdistribu;
}
2 changes: 2 additions & 0 deletions src/geometryXVx/rhs/krook_source_adaptive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ device_t<DSpanSpXVx> KrookSourceAdaptive::operator()(
device_t<DSpanSpXVx> 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<DFieldSpXVx> timestepper(allfdistribu.domain());
timestepper.update(allfdistribu, dt, [&](DSpanSpXVx df, DViewSpXVx f) {
get_derivative(df, f, allfdistribu);
});
ddc::deepcopy(allfdistribu_device, allfdistribu);
Kokkos::Profiling::popRegion();
return allfdistribu_device;
}
2 changes: 2 additions & 0 deletions src/geometryXVx/rhs/krook_source_constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ device_t<DSpanSpXVx> KrookSourceConstant::operator()(
device_t<DSpanSpXVx> 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();
Expand All @@ -90,5 +91,6 @@ device_t<DSpanSpXVx> KrookSourceConstant::operator()(
* dt);
});

Kokkos::Profiling::popRegion();
return allfdistribu;
}

0 comments on commit e6e6d4c

Please sign in to comment.