Commit c4140fde authored by Eisenhauer, Greg's avatar Eisenhauer, Greg
Browse files

Handle stream shutdown in BeginStep with timeout

parent 54c4c753
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -637,6 +637,13 @@ static void waitForMetadataWithTimeout(SstStream Stream, float timeout_secs)
                       "Returning from wait with timeout, NO TIMEOUT\n");
            return;
        }
        if (Stream->Status != Established)
        {
            pthread_mutex_unlock(&Stream->DataLock);
            CP_verbose(Stream, "Returning from wait with timeout, STREAM NO "
                               "LONGER ESTABLISHED\n");
            return;
        }
        gettimeofday(&now, NULL);
        CP_verbose(Stream, "timercmp, now is %ld.%06ld    end is %ld.%06ld \n",
                   now.tv_sec, now.tv_usec, end.tv_sec, end.tv_usec);
@@ -990,6 +997,13 @@ extern SstStatusValue SstAdvanceStep(SstStream Stream, int mode,
        {
            MPI_Bcast(&NextTimestep, 1, MPI_LONG, 0, Stream->mpiComm);
        }
        if (Stream->Status == PeerClosed)
        {
            CP_verbose(Stream,
                       "SstAdvanceStep returning EndOfStream at timestep %d\n",
                       Stream->ReaderTimestep);
            return SstEndOfStream;
        }
        if (NextTimestep == -1)
        {
            CP_verbose(Stream, "Advancestep timing out on no data\n");