1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 07:17:06 +01:00

Timing hooks

This commit is contained in:
paboyle
2016-10-06 09:25:12 +01:00
parent 98439847cf
commit 4089984431
4 changed files with 82 additions and 14 deletions

View File

@ -301,6 +301,39 @@
double gathermtime;
double splicetime;
double nosplicetime;
double calls;
void ZeroCounters(void) {
gathertime=0;
jointime=0;
commtime=0;
halogtime=0;
mergetime=0;
spintime=0;
gathermtime=0;
splicetime=0;
nosplicetime=0;
comms_bytes=0;
calls=0;
};
void Report(void) {
#define PRINTIT(A) \
std::cout << GridLogMessage << " Stencil " << #A << " "<< A/calls<<std::endl;
if ( calls > 0 ) {
std::cout << GridLogMessage << " Stencil calls "<<calls<<std::endl;
PRINTIT(jointime);
PRINTIT(gathertime);
PRINTIT(commtime);
PRINTIT(halogtime);
PRINTIT(mergetime);
PRINTIT(spintime);
PRINTIT(comms_bytes);
PRINTIT(gathermtime);
PRINTIT(splicetime);
PRINTIT(nosplicetime);
}
};
#endif
CartesianStencil(GridBase *grid,
@ -310,18 +343,6 @@
const std::vector<int> &distances)
: _permute_type(npoints), _comm_buf_size(npoints)
{
#ifdef TIMING_HACK
gathertime=0;
jointime=0;
commtime=0;
halogtime=0;
mergetime=0;
spintime=0;
gathermtime=0;
splicetime=0;
nosplicetime=0;
comms_bytes=0;
#endif
_npoints = npoints;
_grid = grid;
_directions = directions;
@ -623,6 +644,7 @@
template<class compressor>
void HaloExchange(const Lattice<vobj> &source,compressor &compress)
{
calls++;
Mergers.resize(0);
Packets.resize(0);
HaloGather(source,compress);