Trace hooks

This commit is contained in:
Peter Boyle
2026-08-20 07:38:28 -04:00
parent b31547c903
commit 2fde4f3e50
+10
View File
@@ -436,6 +436,11 @@ public:
RealD t_comms=0.0; RealD t_comms=0.0;
RealD t_copy=0.0; RealD t_copy=0.0;
// Packet lifetime: posted to waited. The two directions overlap rather
// than nest -- bwd is still in flight across the fwd scatter -- so these
// use the id API and not a scoped range.
int fwd_trace, bwd_trace;
// std::cout << GridLogMessage << "dimension " <<dimension<<std::endl; // std::cout << GridLogMessage << "dimension " <<dimension<<std::endl;
// DumpSliceNorm(std::string("Face_exchange from"),from,dimension); // DumpSliceNorm(std::string("Face_exchange from"),from,dimension);
GridBase *grid=from.Grid(); GridBase *grid=from.Grid();
@@ -501,6 +506,8 @@ public:
t_gather+=usecond()-t; t_gather+=usecond()-t;
t=usecond(); t=usecond();
if(d==0) fwd_trace = traceStart("PaddedCellFwdMPI");
#ifdef ACCELERATOR_AWARE_MPI #ifdef ACCELERATOR_AWARE_MPI
grid->SendToRecvFromBegin(fwd_req, grid->SendToRecvFromBegin(fwd_req,
(void *)&send_buf[d*buffer_size], xmit_to_rank, (void *)&send_buf[d*buffer_size], xmit_to_rank,
@@ -521,6 +528,7 @@ public:
t_gather+= usecond() - t; t_gather+= usecond() - t;
t=usecond(); t=usecond();
if (d==0) bwd_trace = traceStart("PaddedCellBwdMPI");
#ifdef ACCELERATOR_AWARE_MPI #ifdef ACCELERATOR_AWARE_MPI
grid->SendToRecvFromBegin(bwd_req, grid->SendToRecvFromBegin(bwd_req,
(void *)&send_buf[(d+depth)*buffer_size], recv_from_rank, (void *)&send_buf[(d+depth)*buffer_size], recv_from_rank,
@@ -553,6 +561,7 @@ public:
t=usecond(); t=usecond();
grid->CommsComplete(fwd_req); grid->CommsComplete(fwd_req);
traceStop(fwd_trace);
#ifndef ACCELERATOR_AWARE_MPI #ifndef ACCELERATOR_AWARE_MPI
for ( int d=0;d < depth ; d ++ ) { for ( int d=0;d < depth ; d ++ ) {
acceleratorCopyToDevice(&hrecv_buf[d*buffer_size],&recv_buf[d*buffer_size],bytes); acceleratorCopyToDevice(&hrecv_buf[d*buffer_size],&recv_buf[d*buffer_size],bytes);
@@ -568,6 +577,7 @@ public:
t=usecond(); t=usecond();
grid->CommsComplete(bwd_req); grid->CommsComplete(bwd_req);
traceStop(bwd_trace);
#ifndef ACCELERATOR_AWARE_MPI #ifndef ACCELERATOR_AWARE_MPI
for ( int d=0;d < depth ; d ++ ) { for ( int d=0;d < depth ; d ++ ) {
acceleratorCopyToDevice(&hrecv_buf[(d+depth)*buffer_size],&recv_buf[(d+depth)*buffer_size],bytes); acceleratorCopyToDevice(&hrecv_buf[(d+depth)*buffer_size],&recv_buf[(d+depth)*buffer_size],bytes);