From 6a7fc6a508a64020bdd3dcd1618bc8a1c115037e Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Mon, 21 Oct 2013 15:13:44 +0200 Subject: CarpetInterp2: Add timers for fasterp interpolation --- Carpet/CarpetInterp2/interface.ccl | 1 + Carpet/CarpetInterp2/src/fasterp.cc | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Carpet/CarpetInterp2/interface.ccl b/Carpet/CarpetInterp2/interface.ccl index 529876225..b790f9c02 100644 --- a/Carpet/CarpetInterp2/interface.ccl +++ b/Carpet/CarpetInterp2/interface.ccl @@ -14,6 +14,7 @@ USES INCLUDE HEADER: typeprops.hh USES INCLUDE HEADER: vect.hh USES INCLUDE HEADER: carpet.hh +uses include header: Timer.hh diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc index 00cf94f7c..c32721fc9 100644 --- a/Carpet/CarpetInterp2/src/fasterp.cc +++ b/Carpet/CarpetInterp2/src/fasterp.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "fasterp.hh" @@ -1646,6 +1647,11 @@ namespace CarpetInterp2 { // Post Irecvs if (verbose) CCTK_INFO ("Posting MPI_Irecvs"); + + static Timers::Timer irecvs_timer ("PostIrecvs"); + irecvs_timer.start(); + + vector recv_points (recv_descr.npoints * nvars); fill_with_poison (recv_points); vector recv_reqs (recv_descr.procs.size()); @@ -1667,9 +1673,13 @@ namespace CarpetInterp2 { comm_world, & recv_reqs_pn.AT(pp)); #endif } + irecvs_timer.stop(); // Interpolate data and post Isends if (verbose) CCTK_INFO ("Interpolating and posting MPI_Isends"); + static Timers::Timer interpolate_timer ("Interpolate"); + interpolate_timer.start(); + // TODO: Use one array per processor? vector send_points (send_descr.npoints * nvars); fill_with_poison (send_points); @@ -1761,16 +1771,25 @@ namespace CarpetInterp2 { comm_world, & send_reqs_pn.AT(pp)); #endif } // for pp - + + interpolate_timer.stop(); + // Wait for Irecvs to complete if (verbose) CCTK_INFO ("Waiting for MPI_Irevcs to complete"); + + static Timers::Timer waitall_ir_timer ("WaitAll_Irecvs"); + waitall_ir_timer.start(); MPI_Waitall (recv_reqs.size(), & recv_reqs.front(), MPI_STATUSES_IGNORE); #ifdef CARPETINTERP2_CHECK MPI_Waitall (recv_reqs.size(), & recv_reqs_pn.front(), MPI_STATUSES_IGNORE); #endif + waitall_ir_timer.stop(); // Gather data if (verbose) CCTK_INFO ("Gathering data"); + static Timers::Timer gather_timer ("Gather"); + gather_timer.start(); + #pragma omp parallel for for (int n=0; n