From 0dfe0fee56722baf77166626a98ad7101f88ee0f Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" <50467563+victorapm@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:58:08 -0500 Subject: [PATCH] Fix GPU profiling regions (#1032) Fix GPU profiling regions at `par_gauss_elim.c` --- src/parcsr_ls/par_gauss_elim.c | 44 ++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/parcsr_ls/par_gauss_elim.c b/src/parcsr_ls/par_gauss_elim.c index 3016fcd54..3eb87f3f6 100644 --- a/src/parcsr_ls/par_gauss_elim.c +++ b/src/parcsr_ls/par_gauss_elim.c @@ -272,6 +272,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, { /* Skip setup if this rank has no rows. */ hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } } @@ -320,6 +325,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, /* Skip setup if this rank has no rows. */ hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -331,6 +341,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, if (!num_rows) { hypre_ParAMGDataGSSetup(amg_data) = 1; + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -357,6 +372,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, if (ierr != 0) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetrf!"); + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -373,6 +393,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, if (ierr != 0) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetri (query)!"); + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -386,6 +411,11 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, if (ierr != 0) { hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Problem with dgetri!"); + + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } hypre_TFree(work, HYPRE_MEMORY_HOST); @@ -399,11 +429,12 @@ hypre_GaussElimSetup(hypre_ParAMGData *amg_data, hypre_ParAMGDataGSSetup(amg_data) = 1; + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; #ifdef HYPRE_PROFILE hypre_profile_times[HYPRE_TIMER_ID_GS_ELIM_SETUP] += hypre_MPI_Wtime(); #endif - hypre_GpuProfilingPopRange(); - HYPRE_ANNOTATE_FUNC_END; return hypre_error_flag; } @@ -512,6 +543,10 @@ hypre_GaussElimSolve(hypre_ParAMGData *amg_data, hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); } + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -572,6 +607,10 @@ hypre_GaussElimSolve(hypre_ParAMGData *amg_data, hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); } + /* Finalize profiling */ + hypre_GpuProfilingPopRange(); + HYPRE_ANNOTATE_FUNC_END; + return hypre_error_flag; } @@ -641,6 +680,7 @@ hypre_GaussElimSolve(hypre_ParAMGData *amg_data, hypre_TFree(b_data_h, HYPRE_MEMORY_HOST); } + /* Finalize profiling */ hypre_GpuProfilingPopRange(); HYPRE_ANNOTATE_FUNC_END; #ifdef HYPRE_PROFILE