From adbd34092ec972b8609c90b99b19067f25973b4a Mon Sep 17 00:00:00 2001 From: Neil Lindquist Date: Thu, 9 Nov 2023 20:12:13 -0500 Subject: [PATCH] Improve some style issues --- src/ge2tb.cc | 27 +++++++++------------------ src/he2hb.cc | 15 +++++---------- src/internal/internal_util.hh | 10 ++++------ 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/src/ge2tb.cc b/src/ge2tb.cc index f0d487f1e..d6973d27a 100644 --- a/src/ge2tb.cc +++ b/src/ge2tb.cc @@ -224,6 +224,7 @@ void ge2tb( if (k < A_mt) { BcastList bcast_list_V; for (int64_t i = k; i < A_mt; ++i) { + // send A(i, k) across row A(i, k+1:nt-1) bcast_list_V.push_back( {i, k, {A.sub(i, i, k+1, A_nt-1)}}); } @@ -279,15 +280,10 @@ void ge2tb( // Can release tiles parallel to the main execution #pragma omp task { - for (int64_t i = k; i < A_mt; ++i) { - if (A.tileIsLocal(i, k)) { - A.tileUpdateOrigin(i, k); - A.releaseLocalWorkspaceTile(i, k); - } - else { - A.releaseRemoteWorkspaceTile(i, k); - } - } + // Ensure the origin is up to date, then remove the panel's workspace + U_panel.tileUpdateAllOrigin(); + U_panel.releaseLocalWorkspace(); + U_panel.releaseRemoteWorkspace(); for (int64_t i : first_indices) { if (TUlocal.tileIsLocal( i, k )) { @@ -435,15 +431,10 @@ void ge2tb( // Can release tiles parallel to the main execution #pragma omp task { - for (int64_t j = k+1; j < A_nt; ++j) { - if (A.tileIsLocal(k, j)) { - A.tileUpdateOrigin(k, j); - A.releaseLocalWorkspaceTile(k, j); - } - else { - A.releaseRemoteWorkspaceTile(k, j); - } - } + // Ensure the origin is up to date, then remove the panel's workspace + V_panel.tileUpdateAllOrigin(); + V_panel.releaseLocalWorkspace(); + V_panel.releaseRemoteWorkspace(); for (int64_t j : first_indices) { if (TVlocal.tileIsLocal( k, j )) { diff --git a/src/he2hb.cc b/src/he2hb.cc index a7c5ba2e0..040769337 100644 --- a/src/he2hb.cc +++ b/src/he2hb.cc @@ -598,18 +598,13 @@ void he2hb( // Release workspace tiles #pragma omp task slate_omp_default_none \ depend( inout:block[ k ] ) \ - shared( A, Tlocal, Treduce ) \ + shared( A_panel, Tlocal, Treduce ) \ firstprivate( k, nt, first_indices ) { - for (int64_t i = k+1; i < nt; ++i) { - if (A.tileIsLocal( i, k )) { - A.tileUpdateOrigin( i, k ); - A.releaseLocalWorkspaceTile( i, k ); - } - else { - A.releaseRemoteWorkspaceTile( i, k ); - } - } + // Ensure the origin is up to date, then remove the panel's workspace + A_panel.tileUpdateAllOrigin(); + A_panel.releaseLocalWorkspace(); + A_panel.releaseRemoteWorkspace(); for (int64_t i : first_indices) { if (Tlocal.tileIsLocal( i, k )) { diff --git a/src/internal/internal_util.hh b/src/internal/internal_util.hh index 89e4ebd45..5a2454dd6 100644 --- a/src/internal/internal_util.hh +++ b/src/internal/internal_util.hh @@ -71,7 +71,7 @@ inline bool compareSecond( } //------------------------------------------------------------------------------ -/// An helper function to find each rank's first (top-most) row in panel k for +/// A helper function to find each rank's first (top-most) row in panel k for /// the QR-family of routines. /// /// @param[in] A_panel @@ -80,8 +80,7 @@ inline bool compareSecond( /// @param[in] k /// Index of the current panel in the input matrix $A$. /// -/// @param[out] first_indices -/// The array of computed indices. +/// @return The array of computed indices. /// /// @ingroup geqrf_impl /// @@ -111,7 +110,7 @@ std::vector< int64_t > geqrf_compute_first_indices( } //------------------------------------------------------------------------------ -/// An helper function to find each rank's first (left-most) row in panel k for +/// A helper function to find each rank's first (left-most) row in panel k for /// the LQ-family of routines. /// /// @param[in] A_panel @@ -120,8 +119,7 @@ std::vector< int64_t > geqrf_compute_first_indices( /// @param[in] k /// Index of the current panel in the input matrix $A$. /// -/// @param[out] first_indices -/// The array of computed indices. +/// @return The array of computed indices. /// /// @ingroup gelqf_impl ///