Skip to content

Commit

Permalink
SST,MPI,DP: soft handle peer error
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Aug 29, 2023
1 parent 5986850 commit f575887
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion source/adios2/toolkit/sst/dp/mpi_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,32 @@ static void MpiDestroyWriterPerReader(CP_Services Svcs, DP_WSR_Stream WSR_Stream

const int CohortSize = StreamWPR->Link.CohortSize;

printf("WPR soft Destroy called %d (rank: %d)\n", CohortSize, StreamWR->Stream.Rank);

for (int i = 0; i < CohortSize; i++)
{
if (StreamWPR->CohortMpiComms[i] != MPI_COMM_NULL)
{
MPI_Comm_disconnect(&StreamWPR->CohortMpiComms[i]);
}
}
}

/**
* MpiDestroyWriterPerReader.
*
* This is called whenever a reader disconnect from a writer. This function
* also removes the StreamWPR from its own StreamWR.
*/
static void MpiFullyDestroyWriterPerReader(CP_Services Svcs, DP_WSR_Stream WSR_Stream_v)
{
MpiStreamWPR StreamWPR = (MpiStreamWPR)WSR_Stream_v;
MpiStreamWR StreamWR = StreamWPR->StreamWR;

const int CohortSize = StreamWPR->Link.CohortSize;

printf("WPR Destroy called %d (rank: %d)\n", CohortSize, StreamWR->Stream.Rank);

for (int i = 0; i < CohortSize; i++)
{
if (StreamWPR->CohortMpiComms[i] != MPI_COMM_NULL)
Expand Down Expand Up @@ -875,7 +901,7 @@ static void MpiDestroyWriter(CP_Services Svcs, DP_WS_Stream WS_Stream_v)
while (!TAILQ_EMPTY(&StreamWR->Readers))
{
MpiStreamWPR Stream = TAILQ_FIRST(&StreamWR->Readers);
MpiDestroyWriterPerReader(Svcs, Stream);
MpiFullyDestroyWriterPerReader(Svcs, Stream);
}
pthread_mutex_unlock(&StreamWR->MutexReaders);

Expand Down

0 comments on commit f575887

Please sign in to comment.