From 396f22d09037cac538e6827461e6b98b9c10cace Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Fri, 29 Apr 2022 15:14:56 +0200
Subject: [PATCH] new time measurement for profiling

---
 src/basic_mod.F90 | 6 +++---
 src/diagnose.F90  | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/basic_mod.F90 b/src/basic_mod.F90
index b22a5f23..8bbb5253 100644
--- a/src/basic_mod.F90
+++ b/src/basic_mod.F90
@@ -47,11 +47,11 @@ MODULE basic
   ! To measure computation time
   real     :: start, finish
   real(dp) :: t0_rhs, t0_adv_field, t0_poisson, t0_Sapj, t0_diag, t0_checkfield,&
-              t0_step, t0_clos, t0_ghost, t0_coll
+              t0_step, t0_clos, t0_ghost, t0_coll, t0_process
   real(dp) :: t1_rhs, t1_adv_field, t1_poisson, t1_Sapj, t1_diag, t1_checkfield,&
-              t1_step, t1_clos, t1_ghost, t1_coll
+              t1_step, t1_clos, t1_ghost, t1_coll, t1_process
   real(dp) :: tc_rhs, tc_adv_field, tc_poisson, tc_Sapj, tc_diag, tc_checkfield,&
-              tc_step, tc_clos, tc_ghost, tc_coll
+              tc_step, tc_clos, tc_ghost, tc_coll, tc_process
   real(dp) :: maxruntime = 1e9 ! Maximum simulation CPU time
 
   INTERFACE allocate_array
diff --git a/src/diagnose.F90 b/src/diagnose.F90
index 50c0e171..c5b45f0d 100644
--- a/src/diagnose.F90
+++ b/src/diagnose.F90
@@ -59,6 +59,7 @@ SUBROUTINE diagnose(kstep)
      CALL creatd(fidres, 0, dims, "/profiler/Tc_Sapj",       "cumulative Sapj computation time")
      CALL creatd(fidres, 0, dims, "/profiler/Tc_checkfield", "cumulative checkfield computation time")
      CALL creatd(fidres, 0, dims, "/profiler/Tc_diag",       "cumulative sym computation time")
+     CALL creatd(fidres, 0, dims, "/profiler/Tc_process",    "cumulative process computation time")
      CALL creatd(fidres, 0, dims, "/profiler/Tc_step",       "cumulative total step computation time")
      CALL creatd(fidres, 0, dims, "/profiler/time",          "current simulation time")
 
@@ -345,6 +346,7 @@ SUBROUTINE diagnose_0d
   CALL append(fidres, "/profiler/Tc_Sapj",            tc_Sapj,ionode=0)
   CALL append(fidres, "/profiler/Tc_checkfield",tc_checkfield,ionode=0)
   CALL append(fidres, "/profiler/Tc_diag",            tc_diag,ionode=0)
+  CALL append(fidres, "/profiler/Tc_process",      tc_process,ionode=0)
   CALL append(fidres, "/profiler/Tc_step",            tc_step,ionode=0)
   CALL append(fidres, "/profiler/time",                  time,ionode=0)
   ! Processing data
-- 
GitLab