aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gdata.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-07-31 15:26:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-07-31 15:26:00 +0000
commit2f54810c8c9450e7c4d7e00f6beb97759f20c179 (patch)
treec9855ec140091c8f239f0438b0c0a6daa6912c80 /Carpet/CarpetLib/src/gdata.cc
parent3c9fceb2947be6d35e1178bdca8c2d73d31b5862 (diff)
CarpetLib: Extend timing statistics
Add timers for the new communication infrastructure. Enhance the timers to also track the minimum and maximum time spent. Add a parameter to output timing information to files. darcs-hash:20060731152618-dae7b-1d049b2b37397610c14648078fd0ee92f252ca2a.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.cc')
-rw-r--r--Carpet/CarpetLib/src/gdata.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc
index 97896639d..428eb6871 100644
--- a/Carpet/CarpetLib/src/gdata.cc
+++ b/Carpet/CarpetLib/src/gdata.cc
@@ -316,6 +316,7 @@ void gdata::copy_into_sendbuffer (comm_state& state,
state.typebufs.at(c_datatype()).mpi_datatype,
proc(), c_datatype(), dist::comm(),
&state.srequests.at(dist::size()*c_datatype() + proc()));
+ wtime_commstate_isend.stop();
}
}
}
@@ -338,6 +339,7 @@ void gdata::copy_from_recvbuffer (comm_state& state,
ivect items = (box.upper() - box.lower()) / box.stride() + 1;
ivect offs = (box.lower() - ext.lower()) / ext.stride();
+ wtime_commstate_memcpy.start();
assert (dim == 3);
for (int k = 0; k < items[2]; k++) {
for (int j = 0; j < items[1]; j++) {
@@ -347,6 +349,7 @@ void gdata::copy_from_recvbuffer (comm_state& state,
procbuf.recvbuf += datatypesize * items[0];
}
}
+ wtime_commstate_memcpy.stop();
}
@@ -453,8 +456,10 @@ void gdata
comm_state::gcommbuf * b = make_typed_commbuf (box);
+ wtime_commstate_interpolate_irecv.start();
MPI_Irecv (b->pointer(), b->size(), b->datatype(), src->proc(),
tag, dist::comm(), &b->request);
+ wtime_commstate_interpolate_irecv.stop();
state.requests.push_back (b->request);
state.recvbufs.push (b);
} else {
@@ -468,8 +473,10 @@ void gdata
order_space, order_time);
delete tmp;
+ wtime_commstate_interpolate_from_isend.start();
MPI_Isend (b->pointer(), b->size(), b->datatype(), proc(),
tag, dist::comm(), &b->request);
+ wtime_commstate_interpolate_from_isend.stop();
state.requests.push_back (b->request);
state.sendbufs.push (b);
}
@@ -516,11 +523,13 @@ void gdata
procbuf.sendbuf += datatypesize * box.size();
// post the send if the buffer is full
- if (fillstate == procbuf.sendbufsize*datatypesize) {
+ if (fillstate == (int)procbuf.sendbufsize*datatypesize) {
+ wtime_commstate_interpolate_to_isend.start();
MPI_Isend (procbuf.sendbufbase, procbuf.sendbufsize,
state.typebufs.at(c_datatype()).mpi_datatype,
proc(), c_datatype(), dist::comm(),
&state.srequests.at(dist::size()*c_datatype() + proc()));
+ wtime_commstate_interpolate_to_isend.stop();
}
}
}