From 1b11d3c064b6b378dd26c2671637a25d706e0551 Mon Sep 17 00:00:00 2001 From: abhiyanpaudel Date: Thu, 29 Oct 2026 05:41:22 -0400 Subject: [PATCH 1/2] Add team barriers to compact bicubic spline setup --- src/pcms/field/evaluator/spline_interpolator.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pcms/field/evaluator/spline_interpolator.hpp b/src/pcms/field/evaluator/spline_interpolator.hpp index c59973829..69da5585f 100644 --- a/src/pcms/field/evaluator/spline_interpolator.hpp +++ b/src/pcms/field/evaluator/spline_interpolator.hpp @@ -1891,6 +1891,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, nx), [=](LO ix) { fwk_x_view(0, ix) = f(0, ix, iy); }); + team.team_barrier(); if (team.team_rank() == 0) { if (ibcxmin == 1 || ibcxmin == 2) @@ -1901,6 +1902,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, solve_cubic_spline_compact(x, nx, fwk_x_view, fwk4_x_view, ibcxmin, zbcmin, ibcxmax, zbcmax, wk_x_view); } + team.team_barrier(); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, nx), [=](LO ix) { f(1, ix, iy) = fwk_x_view(1, ix); }); @@ -1921,6 +1923,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { fwk_y_view(0, iy) = f(0, ix, iy); }); + team.team_barrier(); if (team.team_rank() == 0) { if (iflg2 == 1) { @@ -1933,6 +1936,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, solve_cubic_spline_compact(y, ny, fwk_y_view, fwk4_y_view, ibcmin, 0.0, ibcmax, 0.0, wk_y_view); } + team.team_barrier(); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { f(2, ix, iy) = fwk_y_view(1, iy); }); }); @@ -1952,6 +1956,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { fwk_y_view(0, iy) = f(1, ix, iy); }); + team.team_barrier(); if (team.team_rank() == 0) { if (iflg2 == 1) { @@ -1964,6 +1969,7 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, solve_cubic_spline_compact(y, ny, fwk_y_view, fwk4_y_view, ibcmin, 0.0, ibcmax, 0.0, wk_y_view); } + team.team_barrier(); Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { f(3, ix, iy) = fwk_y_view(1, iy); }); }); From 1ded4a96a7cec10de1fdbf572c552f9c0ddf38f3 Mon Sep 17 00:00:00 2001 From: abhiyanpaudel Date: Thu, 29 Oct 2026 06:21:40 -0400 Subject: [PATCH 2/2] Align spline barrier placement with #397 --- src/pcms/field/evaluator/spline_interpolator.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pcms/field/evaluator/spline_interpolator.hpp b/src/pcms/field/evaluator/spline_interpolator.hpp index 69da5585f..7a595b075 100644 --- a/src/pcms/field/evaluator/spline_interpolator.hpp +++ b/src/pcms/field/evaluator/spline_interpolator.hpp @@ -1891,8 +1891,8 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, nx), [=](LO ix) { fwk_x_view(0, ix) = f(0, ix, iy); }); - team.team_barrier(); + team.team_barrier(); if (team.team_rank() == 0) { if (ibcxmin == 1 || ibcxmin == 2) zbcmin = bcxmin[iy]; @@ -1923,8 +1923,8 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { fwk_y_view(0, iy) = f(0, ix, iy); }); - team.team_barrier(); + team.team_barrier(); if (team.team_rank() == 0) { if (iflg2 == 1) { if (ibcymin == 1 || ibcymin == 2) @@ -1956,8 +1956,8 @@ void solve_bicubic_spline_compact(Rank1View x, LO nx, Kokkos::parallel_for(Kokkos::TeamThreadRange(team, ny), [=](LO iy) { fwk_y_view(0, iy) = f(1, ix, iy); }); - team.team_barrier(); + team.team_barrier(); if (team.team_rank() == 0) { if (iflg2 == 1) { if (ibcymin == 1 || ibcymin == 2)