Skip to content
Snippets Groups Projects
Commit 1aeb25b8 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Add timers for the communications, still no stats

parent 4dd00bfc
No related branches found
No related tags found
1 merge request!11Draft: Fast one-sided MPI version
......@@ -32,13 +32,10 @@
// buffer is determined by the send and receive rank and the tag, which gives
// us a list of offsets into the buffer mapped by the ranktag, which we need
// to share with any rank that is expected to send us data. We'll send this
// data using normal MPI (could be done either as another extension into the
// window, which we get, but we'd need to synchronize that across all ranks,
// or we could use the global communicator to share this in a similar
// fashion).
// data using normal MPI.
//
// This variation splits the accumulate and the local flush into requestable
// parts, more like SWIFT, and uses three threads.
// asynchronous parts, more like SWIFT, and uses three threads.
#include <limits.h>
#include <mpi.h>
......@@ -217,7 +214,10 @@ static void *send_thread(void *arg) {
/* Data has the actual data and room for the header. */
BLOCKTYPE datasize = toblocks(log->size) + HEADER_SIZE;
BLOCKTYPE *dataptr = calloc(datasize, BYTESINBLOCK);
/* Update the log for the initiation of this message. */
log->data = dataptr;
log->injtic = getticks();
/* Fill data with pattern. */
if (datacheck) datacheck_fill(datasize, dataptr);
......@@ -321,6 +321,7 @@ static void *req_thread(void *arg) {
/* Done. */
log->done = 1;
log->endtic = getticks();
free(log->data);
atomic_dec(&todo_req);
}
......@@ -355,6 +356,9 @@ static void *recv_thread(void *arg) {
struct mpiuse_log_entry *log = recv_queue[k];
if (log != NULL && !log->done) {
/* On the first attempt we start listening for this receive. */
if (log->injtic == 0) log->injtic = getticks();
/* Get offset into subtype for this message. */
size_t offset = log->offset;
......@@ -376,6 +380,7 @@ static void *recv_thread(void *arg) {
/* Done, clean up. */
log->done = 1;
log->endtic = getticks();
atomic_dec(&todo_recv);
if (todo_recv == 0) break;
......@@ -452,6 +457,8 @@ static void pick_logs() {
if (log->activation) {
if (log->rank == myrank) {
log->done = 0;
log->injtic = 0;
log->endtic = 0;
log->data = NULL;
log->ranktag = toranktag(log->otherrank, log->rank, log->tag);
if (log->type == task_type_send) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment