Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Destroyed state to streams #1995

Merged
merged 2 commits into from
Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions source/adios2/toolkit/sst/cp/cp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ extern void SstStreamDestroy(SstStream Stream)
CP_verbose(Stream, "Destroying stream %p, name %s\n", Stream,
Stream->Filename);
pthread_mutex_lock(&Stream->DataLock);
Stream->Status = Closed;
Stream->Status = Destroyed;
struct _TimestepMetadataList *Next = Stream->Timesteps;
while (Next)
{
Expand Down Expand Up @@ -1139,7 +1139,6 @@ extern void SstStreamDestroy(SstStream Stream)
CP_verbose(
Stream,
"Reference count now zero, Destroying process SST info cache\n");
// wait .1 sec for last messages
CManager_close(CPInfo->cm);
if (CPInfo->ffs_c)
free_FFSContext(CPInfo->ffs_c);
Expand Down
3 changes: 2 additions & 1 deletion source/adios2/toolkit/sst/cp/cp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ enum StreamStatus
Established,
PeerClosed,
PeerFailed,
Closed
Closed,
Destroyed
};

static char *SSTStreamStatusStr[] = {"NotOpen", "Opening", "Established",
Expand Down
2 changes: 2 additions & 0 deletions source/adios2/toolkit/sst/cp/cp_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ extern void ReaderConnCloseHandler(CManager cm, CMConnection ClosedConn,
SstStream Stream = (SstStream)client_data;
int FailedPeerRank = -1;
CP_verbose(Stream, "Reader-side close handler invoked\n");
if (Stream->Status == Destroyed)
return;
if (!Stream->ConnectionsToWriter)
return;
for (int i = 0; i < Stream->WriterCohortSize; i++)
Expand Down
16 changes: 9 additions & 7 deletions testing/adios2/engine/staging-common/TestCommonReadAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,18 @@ TEST_F(CommonReadTest, ADIOS2CommonRead1D8)
TimeGapDetected++;
}

if (TimeGapExpected)
if (!IgnoreTimeGap)
{
EXPECT_TRUE(TimeGapDetected);
if (TimeGapExpected)
{
EXPECT_TRUE(TimeGapDetected);
}
else
{
EXPECT_FALSE(TimeGapDetected);
}
}
else
{
EXPECT_EQ(t, NSteps);

EXPECT_FALSE(TimeGapDetected);
}
// Close the file
engine.Close();
}
Expand Down