From ddb5de2285a67573b620d2d740c6b1c29d05e31d Mon Sep 17 00:00:00 2001 From: Greg Eisenhauer Date: Fri, 28 Feb 2020 14:01:02 -0500 Subject: [PATCH 1/2] Add a Destroyed state to streams --- source/adios2/toolkit/sst/cp/cp_common.c | 3 +-- source/adios2/toolkit/sst/cp/cp_internal.h | 3 ++- source/adios2/toolkit/sst/cp/cp_reader.c | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/adios2/toolkit/sst/cp/cp_common.c b/source/adios2/toolkit/sst/cp/cp_common.c index 5c7be054db..56966f4b49 100644 --- a/source/adios2/toolkit/sst/cp/cp_common.c +++ b/source/adios2/toolkit/sst/cp/cp_common.c @@ -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) { @@ -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); diff --git a/source/adios2/toolkit/sst/cp/cp_internal.h b/source/adios2/toolkit/sst/cp/cp_internal.h index 40a62ffd45..b9456d6a95 100644 --- a/source/adios2/toolkit/sst/cp/cp_internal.h +++ b/source/adios2/toolkit/sst/cp/cp_internal.h @@ -55,7 +55,8 @@ enum StreamStatus Established, PeerClosed, PeerFailed, - Closed + Closed, + Destroyed }; static char *SSTStreamStatusStr[] = {"NotOpen", "Opening", "Established", diff --git a/source/adios2/toolkit/sst/cp/cp_reader.c b/source/adios2/toolkit/sst/cp/cp_reader.c index 178d004500..a190aeaebd 100644 --- a/source/adios2/toolkit/sst/cp/cp_reader.c +++ b/source/adios2/toolkit/sst/cp/cp_reader.c @@ -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++) From c4b9b09f47cbf2835852d35c6924b44d84d55957 Mon Sep 17 00:00:00 2001 From: Greg Eisenhauer Date: Sat, 29 Feb 2020 06:50:35 -0500 Subject: [PATCH 2/2] Mod to TestCommonReadAttr to ignore time cap if not required --- .../staging-common/TestCommonReadAttrs.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testing/adios2/engine/staging-common/TestCommonReadAttrs.cpp b/testing/adios2/engine/staging-common/TestCommonReadAttrs.cpp index c3b392ddd6..e372d52a23 100644 --- a/testing/adios2/engine/staging-common/TestCommonReadAttrs.cpp +++ b/testing/adios2/engine/staging-common/TestCommonReadAttrs.cpp @@ -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(); }