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

Merge branch 'master' into mpiwaitall

parents b5ad09de 41f45fa1
No related branches found
No related tags found
1 merge request!4Use MPI_Waitall instead of MPI_Test polling.
...@@ -127,6 +127,7 @@ static void *inject_thread(void *arg) { ...@@ -127,6 +127,7 @@ static void *inject_thread(void *arg) {
/* Differences to SWIFT: MPI_BYTE not the MPI_Type. */ /* Differences to SWIFT: MPI_BYTE not the MPI_Type. */
int err = 0; int err = 0;
if (log->type == task_type_send) { if (log->type == task_type_send) {
log->data = calloc(log->size, 1);
err = MPI_Isend(log->data, log->size, MPI_BYTE, log->otherrank, log->tag, err = MPI_Isend(log->data, log->size, MPI_BYTE, log->otherrank, log->tag,
subtypeMPI_comms[log->subtype], &log->req); subtypeMPI_comms[log->subtype], &log->req);
...@@ -136,6 +137,7 @@ static void *inject_thread(void *arg) { ...@@ -136,6 +137,7 @@ static void *inject_thread(void *arg) {
atomic_inc(&todo_send); atomic_inc(&todo_send);
} else { } else {
log->data = calloc(log->size, 1);
err = MPI_Irecv(log->data, log->size, MPI_BYTE, log->otherrank, log->tag, err = MPI_Irecv(log->data, log->size, MPI_BYTE, log->otherrank, log->tag,
subtypeMPI_comms[log->subtype], &log->req); subtypeMPI_comms[log->subtype], &log->req);
...@@ -327,7 +329,7 @@ static void pick_logs(void) { ...@@ -327,7 +329,7 @@ static void pick_logs(void) {
nlogs, sizeof(struct mpiuse_log_entry *)); nlogs, sizeof(struct mpiuse_log_entry *));
nr_reqs = 0; nr_reqs = 0;
sends_queue = (struct mpiuse_log_entry **)calloc( sends_queue = (struct mpiuse_log_entry **)calloc(
nlogs, sizeof(struct mpiuse_log_entry *) * nlogs); nlogs, sizeof(struct mpiuse_log_entry *));
nr_sends = 0; nr_sends = 0;
recvs_queue = (struct mpiuse_log_entry **)calloc( recvs_queue = (struct mpiuse_log_entry **)calloc(
nlogs, sizeof(struct mpiuse_log_entry *)); nlogs, sizeof(struct mpiuse_log_entry *));
...@@ -338,10 +340,8 @@ static void pick_logs(void) { ...@@ -338,10 +340,8 @@ static void pick_logs(void) {
if (log->rank == myrank && log->activation) { if (log->rank == myrank && log->activation) {
if (log->type == task_type_send || log->type == task_type_recv) { if (log->type == task_type_send || log->type == task_type_recv) {
/* Allocate space for data. */
log->data = calloc(log->size, 1);
/* And keep this log. */ /* And keep this log. */
log->data = NULL;
reqs_queue[nr_reqs] = log; reqs_queue[nr_reqs] = log;
nr_reqs++; nr_reqs++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment