@@ -200,13 +200,17 @@ class SplineBuilder
200200 // interpolator specific
201201 std::unique_ptr<ddc::detail::SplinesLinearProblem<exec_space>> m_matrix;
202202
203+ std::string m_label;
204+
203205 // / Calculate offset so that the matrix is diagonally dominant
204206 void compute_offset (interpolation_domain_type const & interpolation_domain, int & offset);
205207
206208public:
207209 /* *
208210 * @brief Build a SplineBuilder acting on interpolation_domain.
209211 *
212+ * @param label A label used to tag parallel regions and memory allocations for profiling.
213+ *
210214 * @param interpolation_domain The domain on which the interpolation points are defined.
211215 *
212216 * @param cols_per_chunk A parameter used by the slicer (internal to the solver) to define the size
@@ -221,12 +225,14 @@ class SplineBuilder
221225 * @see MatrixSparse
222226 */
223227 explicit SplineBuilder (
228+ std::string label,
224229 interpolation_domain_type const & interpolation_domain,
225230 std::optional<std::size_t > cols_per_chunk = std::nullopt ,
226231 std::optional<unsigned int > preconditioner_max_block_size = std::nullopt )
227232 : m_interpolation_domain(interpolation_domain)
228233 , m_dx((ddc::discrete_space<BSplines>().rmax() - ddc::discrete_space<BSplines>().rmin())
229234 / ddc::discrete_space<BSplines>().ncells())
235+ , m_label(std::move(label))
230236 {
231237 static_assert (
232238 ((BcLower == BoundCond::PERIODIC) == (BcUpper == BoundCond::PERIODIC)),
@@ -252,6 +258,66 @@ class SplineBuilder
252258 preconditioner_max_block_size);
253259 }
254260
261+ /* *
262+ * @brief Build a SplineBuilder acting on interpolation_domain.
263+ *
264+ * @param interpolation_domain The domain on which the interpolation points are defined.
265+ *
266+ * @param cols_per_chunk A parameter used by the slicer (internal to the solver) to define the size
267+ * of a chunk of right-hand sides of the linear problem to be computed in parallel (chunks are treated
268+ * by the linear solver one-after-the-other).
269+ * This value is optional. If no value is provided then the default value is chosen by the requested solver.
270+ *
271+ * @param preconditioner_max_block_size A parameter used by the slicer (internal to the solver) to
272+ * define the size of a block used by the Block-Jacobi preconditioner.
273+ * This value is optional. If no value is provided then the default value is chosen by the requested solver.
274+ *
275+ * @see MatrixSparse
276+ */
277+ explicit SplineBuilder (
278+ interpolation_domain_type const & interpolation_domain,
279+ std::optional<std::size_t > cols_per_chunk = std::nullopt ,
280+ std::optional<unsigned int > preconditioner_max_block_size = std::nullopt )
281+ : SplineBuilder(
282+ " no-label" ,
283+ interpolation_domain,
284+ cols_per_chunk,
285+ preconditioner_max_block_size)
286+ {
287+ }
288+
289+ /* *
290+ * @brief Build a SplineBuilder acting on the interpolation domain contained by batched_interpolation_domain.
291+ *
292+ * @param label A label used to tag parallel regions and memory allocations for profiling.
293+ *
294+ * @param batched_interpolation_domain The whole domain on which the interpolation points are defined.
295+ *
296+ * @param cols_per_chunk A parameter used by the slicer (internal to the solver) to define the size
297+ * of a chunk of right-hand sides of the linear problem to be computed in parallel (chunks are treated
298+ * by the linear solver one-after-the-other).
299+ * This value is optional. If no value is provided then the default value is chosen by the requested solver.
300+ *
301+ * @param preconditioner_max_block_size A parameter used by the slicer (internal to the solver) to
302+ * define the size of a block used by the Block-Jacobi preconditioner.
303+ * This value is optional. If no value is provided then the default value is chosen by the requested solver.
304+ *
305+ * @see MatrixSparse
306+ */
307+ template <concepts::discrete_domain BatchedInterpolationDDom>
308+ explicit SplineBuilder (
309+ std::string label,
310+ BatchedInterpolationDDom const & batched_interpolation_domain,
311+ std::optional<std::size_t > cols_per_chunk = std::nullopt ,
312+ std::optional<unsigned int > preconditioner_max_block_size = std::nullopt )
313+ : SplineBuilder(
314+ std::move (label),
315+ interpolation_domain_type(batched_interpolation_domain),
316+ cols_per_chunk,
317+ preconditioner_max_block_size)
318+ {
319+ }
320+
255321 /* *
256322 * @brief Build a SplineBuilder acting on the interpolation domain contained by batched_interpolation_domain.
257323 *
@@ -274,6 +340,7 @@ class SplineBuilder
274340 std::optional<std::size_t > cols_per_chunk = std::nullopt ,
275341 std::optional<unsigned int > preconditioner_max_block_size = std::nullopt )
276342 : SplineBuilder(
343+ " no-label" ,
277344 interpolation_domain_type (batched_interpolation_domain),
278345 cols_per_chunk,
279346 preconditioner_max_block_size)
@@ -938,11 +1005,12 @@ operator()(
9381005 // Allocate and fill a transposed version of spline in order to get dimension of interest as last dimension (optimal for GPU, necessary for Ginkgo). Also select only relevant rows in case of periodic boundaries
9391006 auto const & offset_proxy = m_offset;
9401007 ddc::Chunk spline_tr_alloc (
1008+ m_label + " > spline_tr (ddc::SplineBuilder::operator())" ,
9411009 batched_spline_tr_domain (batched_interpolation_domain),
9421010 ddc::KokkosAllocator<double , memory_space>());
9431011 ddc::ChunkSpan const spline_tr = spline_tr_alloc.span_view ();
9441012 ddc::parallel_for_each (
945- " ddc_splines_transpose_rhs" ,
1013+ m_label + " > ddc_splines_transpose_rhs" ,
9461014 exec_space (),
9471015 batch_domain (batched_interpolation_domain),
9481016 KOKKOS_LAMBDA (
@@ -961,7 +1029,7 @@ operator()(
9611029 m_matrix->solve (bcoef_section, false );
9621030 // Transpose back spline_tr into spline.
9631031 ddc::parallel_for_each (
964- " ddc_splines_transpose_back_rhs" ,
1032+ m_label + " > ddc_splines_transpose_back_rhs" ,
9651033 exec_space (),
9661034 batch_domain (batched_interpolation_domain),
9671035 KOKKOS_LAMBDA (
@@ -975,7 +1043,7 @@ operator()(
9751043 // Duplicate the lower spline coefficients to the upper side in case of periodic boundaries
9761044 if (bsplines_type::is_periodic ()) {
9771045 ddc::parallel_for_each (
978- " ddc_splines_periodic_rows_duplicate_rhs" ,
1046+ m_label + " > ddc_splines_periodic_rows_duplicate_rhs" ,
9791047 exec_space (),
9801048 batch_domain (batched_interpolation_domain),
9811049 KOKKOS_LAMBDA (
@@ -1041,7 +1109,7 @@ SplineBuilder<ExecSpace, MemorySpace, BSplines, InterpolationDDim, BcLower, BcUp
10411109 // Allocate mirror with additional rows (cf. SplinesLinearProblem3x3Blocks documentation)
10421110 Kokkos::View<double **, Kokkos::LayoutRight, MemorySpace> const
10431111 integral_bsplines_mirror_with_additional_allocation (
1044- " integral_bsplines_mirror_with_additional_allocation" ,
1112+ m_label + " > integral_bsplines_mirror_with_additional_allocation" ,
10451113 m_matrix->required_number_of_rhs_rows (),
10461114 1 );
10471115
0 commit comments