From 21954c33563f9bf7d785eebbcef07b8e0c637b76 Mon Sep 17 00:00:00 2001 From: Angelyr Date: Thu, 11 Jul 2024 10:08:16 -0700 Subject: [PATCH] timing verbosity --- src/pmpo_c.cpp | 4 ++++ src/pmpo_c.h | 2 +- src/pmpo_fortran.f90 | 7 +++++++ test/testFortranMPAdvection.f90 | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pmpo_c.cpp b/src/pmpo_c.cpp index 89fd25a7..c5f992c0 100644 --- a/src/pmpo_c.cpp +++ b/src/pmpo_c.cpp @@ -900,4 +900,8 @@ void polympo_enableTiming_f(){ void polympo_summarizeTime_f(){ pumipic::SummarizeTime(); +} + +void polympo_setTimingVerbosity_f(int v){ + pumipic::SetTimingVerbosity(v); } \ No newline at end of file diff --git a/src/pmpo_c.h b/src/pmpo_c.h index 5430a42d..7d2d3806 100644 --- a/src/pmpo_c.h +++ b/src/pmpo_c.h @@ -88,6 +88,6 @@ void polympo_applyReconstruction_f(MPMesh_ptr p_mpmesh); // Timing void polympo_enableTiming_f(); void polympo_summarizeTime_f(); - +void polympo_setTimingVerbosity_f(int v); } #endif diff --git a/src/pmpo_fortran.f90 b/src/pmpo_fortran.f90 index e3c6d19c..318ec7e4 100644 --- a/src/pmpo_fortran.f90 +++ b/src/pmpo_fortran.f90 @@ -714,6 +714,13 @@ subroutine polympo_enableTiming() bind(C, NAME='polympo_enableTiming_f') subroutine polympo_summarizeTime() bind(C, NAME='polympo_summarizeTime_f') use :: iso_c_binding end subroutine + !--------------------------------------------------------------------------- + !> @brief set verbosity of timings collected + !--------------------------------------------------------------------------- + subroutine polympo_setTimingVerbosity(v) bind(C, NAME='polympo_setTimingVerbosity_f') + use :: iso_c_binding + integer(c_int), value :: v + end subroutine end interface contains !--------------------------------------------------------------------------- diff --git a/test/testFortranMPAdvection.f90 b/test/testFortranMPAdvection.f90 index 08426182..d663c3f8 100644 --- a/test/testFortranMPAdvection.f90 +++ b/test/testFortranMPAdvection.f90 @@ -37,6 +37,7 @@ program main call polympo_setMPICommunicator(mpi_comm_handle) call polympo_initialize() call polympo_enableTiming() + call polympo_setTimingVerbosity(1) call polympo_checkPrecisionForRealKind(MPAS_RKIND) argc = command_argument_count()