Skip to content

Commit

Permalink
need unique space for each message sender
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Apr 5, 2019
1 parent 3b570ff commit fe72532
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ extern "C" {
* async is being used. */
enum PIO_MSG
{
PIO_MSG_NULL,
PIO_MSG_OPEN_FILE,
PIO_MSG_CREATE_FILE,
PIO_MSG_INQ_ATT,
Expand Down
9 changes: 5 additions & 4 deletions src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys,
MPI_Comm io_comm)
{
iosystem_desc_t *my_iosys;
int msg = 0;
int msg = PIO_MSG_NULL, messages[component_count];
MPI_Request req[component_count];
MPI_Status status;
int index;
Expand All @@ -2521,7 +2521,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys,
{
my_iosys = iosys[cmp];
LOG((1, "about to call MPI_Irecv union_comm = %d", my_iosys->union_comm));
if ((mpierr = MPI_Irecv(&msg, 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG,
if ((mpierr = MPI_Irecv(messages+cmp, 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG,
my_iosys->union_comm, &req[cmp])))
return check_mpi(NULL, mpierr, __FILE__, __LINE__);
LOG((1, "MPI_Irecv req[%d] = %d", cmp, req[cmp]));
Expand All @@ -2545,6 +2545,7 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys,
if ((mpierr = MPI_Waitany(component_count, req, &index, &status)))
return check_mpi(NULL, mpierr, __FILE__, __LINE__);
LOG((3, "Waitany returned index = %d req[%d] = %d", index, index, req[index]));
msg = messages[index];
for (int c = 0; c < component_count; c++)
LOG((3, "req[%d] = %d", c, req[c]));
}
Expand Down Expand Up @@ -2731,15 +2732,15 @@ int pio_msg_handler2(int io_rank, int component_count, iosystem_desc_t **iosys,
my_iosys = iosys[index];
LOG((3, "pio_msg_handler2 about to Irecv index = %d comproot = %d union_comm = %d",
index, my_iosys->comproot, my_iosys->union_comm));
if ((mpierr = MPI_Irecv(&msg, 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG, my_iosys->union_comm,
if ((mpierr = MPI_Irecv(messages+index, 1, MPI_INT, my_iosys->comproot, MPI_ANY_TAG, my_iosys->union_comm,
&req[index])))
return check_mpi(NULL, mpierr, __FILE__, __LINE__);
LOG((3, "pio_msg_handler2 called MPI_Irecv req[%d] = %d", index, req[index]));
}

LOG((3, "pio_msg_handler2 done msg = %d open_components = %d",
msg, open_components));

msg = PIO_MSG_NULL;
/* If there are no more open components, exit. */
if (finalize)
{
Expand Down

0 comments on commit fe72532

Please sign in to comment.