Skip to content
Snippets Groups Projects
Commit 302bf02e authored by Chris Broekema's avatar Chris Broekema
Browse files

Bug #1011: Added RSP TimeStamp to logging

parent bac2d1d9
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <Interface/Exceptions.h> #include <Interface/Exceptions.h>
#include <Interface/PipelineOutput.h> #include <Interface/PipelineOutput.h>
#include <Interface/MultiDimArray.h> #include <Interface/MultiDimArray.h>
#include <Interface/RSPTimeStamp.h>
#include <Storage/Format.h> #include <Storage/Format.h>
#include <Storage/InputThread.h> #include <Storage/InputThread.h>
...@@ -50,6 +51,7 @@ namespace LOFAR { ...@@ -50,6 +51,7 @@ namespace LOFAR {
// writes, for O_DIRECT // writes, for O_DIRECT
Matrix<int> itsPreviousSequenceNumbers; Matrix<int> itsPreviousSequenceNumbers;
TimeStamp itsSyncedStamp;
NSTimer itsWriteTimer; NSTimer itsWriteTimer;
double bytesWritten; double bytesWritten;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <Interface/PipelineOutput.h> #include <Interface/PipelineOutput.h>
#include <Interface/StreamableData.h> #include <Interface/StreamableData.h>
#include <Interface/Queue.h> #include <Interface/Queue.h>
#include <Interface/RSPTimeStamp.h>
#include <Storage/InputThread.h> #include <Storage/InputThread.h>
#include <Stream/Stream.h> #include <Stream/Stream.h>
...@@ -96,6 +97,8 @@ class SubbandWriter ...@@ -96,6 +97,8 @@ class SubbandWriter
NSTimer itsWriteTimer; NSTimer itsWriteTimer;
TimeStamp itsSyncedStamp;
#ifdef USE_MAC_PI #ifdef USE_MAC_PI
bool itsWriteToMAC; bool itsWriteToMAC;
GCF::CEPPMLlight::CEPPropertySet* itsPropertySet; GCF::CEPPMLlight::CEPPropertySet* itsPropertySet;
......
...@@ -58,6 +58,14 @@ RTStorage::~RTStorage() ...@@ -58,6 +58,14 @@ RTStorage::~RTStorage()
void RTStorage::preprocess() void RTStorage::preprocess()
{ {
const double startTime = itsPS->startTime();
const double sampleFreq = itsPS->sampleRate();
const unsigned seconds = static_cast<unsigned>(floor(startTime));
const unsigned samples = static_cast<unsigned>((startTime - floor(startTime)) * sampleFreq);
itsSyncedStamp.setStationClockSpeed(static_cast<unsigned>(sampleFreq * 1024));
itsSyncedStamp = TimeStamp(seconds, samples);
/// Get various observation parameters /// Get various observation parameters
itsNrSubbands = itsPS->nrSubbands(); itsNrSubbands = itsPS->nrSubbands();
if (itsNrSubbands % itsSize == 0) { if (itsNrSubbands % itsSize == 0) {
...@@ -115,7 +123,7 @@ void RTStorage::preprocess() ...@@ -115,7 +123,7 @@ void RTStorage::preprocess()
itsPreviousSequenceNumbers[i][j] = -1; itsPreviousSequenceNumbers[i][j] = -1;
} }
} }
} }
...@@ -175,7 +183,10 @@ void RTStorage::writeLogMessage() ...@@ -175,7 +183,10 @@ void RTStorage::writeLogMessage()
#if defined HAVE_MPI #if defined HAVE_MPI
", rank = " << itsRank << ", rank = " << itsRank <<
#endif #endif
", count = " << counter ++); ", count = " << counter ++ <<
", timestamp = " << itsSyncedStamp);
itsSyncedStamp += itsPS->nrSubbandSamples() * itsPS->IONintegrationSteps();
} }
...@@ -213,7 +224,7 @@ bool RTStorage::processSubband(unsigned sb) ...@@ -213,7 +224,7 @@ bool RTStorage::processSubband(unsigned sb)
itsWriteTimer.start(); itsWriteTimer.start();
/// write data to correct fd /// write data to correct fd
for (unsigned i = 0; i < itsNrOutputs; i++) { for (unsigned i = 0; i < itsNrOutputs; i++) {
data->write( myFDs[sb][i], true, itsAlignment); data->write( myFDs[sb][i], true, itsAlignment );
} }
itsWriteTimer.stop(); itsWriteTimer.stop();
......
...@@ -164,6 +164,14 @@ void SubbandWriter::preprocess() ...@@ -164,6 +164,14 @@ void SubbandWriter::preprocess()
itsNrSubbandsPerStorage = (itsNrSubbands / itsSize) + 1; itsNrSubbandsPerStorage = (itsNrSubbands / itsSize) + 1;
} }
const double sampleFreq = itsPS->sampleRate();
const unsigned seconds = static_cast<unsigned>(floor(startTime));
const unsigned samples = static_cast<unsigned>((startTime - floor(startTime)) * sampleFreq);
itsSyncedStamp.setStationClockSpeed(static_cast<unsigned>(sampleFreq * 1024));
itsSyncedStamp = TimeStamp(seconds, samples);
LOG_TRACE_VAR_STR("SubbandsPerStorage = " << itsNrSubbandsPerStorage); LOG_TRACE_VAR_STR("SubbandsPerStorage = " << itsNrSubbandsPerStorage);
itsMyNrSubbands = 0; itsMyNrSubbands = 0;
...@@ -281,9 +289,12 @@ void SubbandWriter::writeLogMessage() ...@@ -281,9 +289,12 @@ void SubbandWriter::writeLogMessage()
LOG_INFO_STR("time = " << buf << LOG_INFO_STR("time = " << buf <<
#if defined HAVE_MPI #if defined HAVE_MPI
", rank = " << itsRank << ", rank = " << itsRank <<
#endif #endif
", count = " << counter ++); ", count = " << counter ++ <<
", timestamp = " << itsSyncedStamp) ;
itsSyncedStamp += itsPS->nrSubbandSamples() * itsPS->IONintegrationSteps();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment