diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-10-21 15:13:44 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-10-25 16:16:42 +0200 |
commit | 6a7fc6a508a64020bdd3dcd1618bc8a1c115037e (patch) | |
tree | e81a91e799480fc35eb33ef20d5faba902dd2e77 | |
parent | ae71ad5e952a892c7b4a326daa078bccf6e4393b (diff) |
CarpetInterp2: Add timers for fasterp interpolation
-rw-r--r-- | Carpet/CarpetInterp2/interface.ccl | 1 | ||||
-rw-r--r-- | Carpet/CarpetInterp2/src/fasterp.cc | 26 |
2 files changed, 26 insertions, 1 deletions
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 <cacheinfo.hh> #include <carpet.hh> #include <vect.hh> +#include <Timer.hh> #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<CCTK_REAL> recv_points (recv_descr.npoints * nvars); fill_with_poison (recv_points); vector<MPI_Request> 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<CCTK_REAL> 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<recv_descr.npoints; ++n) { size_t const nn = recv_descr.index.AT(n); @@ -1785,14 +1804,19 @@ namespace CarpetInterp2 { assert (recv_pn.AT(nn).n == n); #endif } + + gather_timer.stop(); // Wait for Isends to complete if (verbose) CCTK_INFO ("Waiting for MPI_Isends to complete"); + static Timers::Timer waitall_is_timer ("WaitAll_Isend"); + waitall_is_timer.start(); MPI_Waitall (send_reqs.size(), & send_reqs.front(), MPI_STATUSES_IGNORE); #ifdef CARPETINTERP2_CHECK MPI_Waitall (send_reqs.size(), & send_reqs_pn.front(), MPI_STATUSES_IGNORE); #endif + waitall_is_timer.stop(); if (verbose) CCTK_INFO ("Done."); } |