Skip to content
Snippets Groups Projects
Commit 1caffb0b authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #10675: Add more logging to outputProc initialisation, and preallocate...

Task #10675: Add more logging to outputProc initialisation, and preallocate 30s of data instead of 4s.
parent 272b7500
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@
#include "CorrelatedData.h"
#include <Common/LofarLogger.h>
#include <Common/Timer.h>
namespace LOFAR
{
......@@ -79,7 +80,10 @@ namespace LOFAR
false),
itsNrBytesPerNrValidSamples(nrBytesPerNrValidSamples(maxNrValidSamples))
{
NSTimer timer("CorrelatedData::init()", true, true);
timer.start();
init(nrChannels, allocator);
timer.stop();
}
......
......@@ -56,9 +56,17 @@ namespace LOFAR
itsAllocator = new SparseSetAllocator(*itsArena);
NSTimer timer(str(format("preallocator %u") % itsStreamNr), true, true);
for (unsigned i = 0; i < preAllocateReceiveQueue; i++) {
timer.start();
LOG_DEBUG_STR(str(format("[stream %u] Allocating element %u") % itsStreamNr % i));
CorrelatedData *data = new CorrelatedData(itsNrStations, itsNrChannels, itsNrSamples, *itsAllocator, itsAlignment);
LOG_DEBUG_STR(str(format("[stream %u] Appending element %u") % itsStreamNr % i));
itsOutputPool.free.append(data);
timer.stop();
}
}
......@@ -73,9 +81,14 @@ namespace LOFAR
NSTimer timer(str(format("allocator %u") % itsStreamNr), true, true);
for (unsigned i = preAllocateReceiveQueue; i < maxReceiveQueueSize; i++) {
timer.start();
LOG_DEBUG_STR(str(format("[stream %u] Allocating element %u") % itsStreamNr % i));
CorrelatedData *data = new CorrelatedData(itsNrStations, itsNrChannels, itsNrSamples, *itsAllocator, itsAlignment);
LOG_DEBUG_STR(str(format("[stream %u] Appending element %u") % itsStreamNr % i));
itsOutputPool.free.append(data);
timer.stop();
}
}
......
......@@ -62,8 +62,8 @@ namespace LOFAR
unsigned streamNr() const { return itsStreamNr; }
private:
static const unsigned preAllocateReceiveQueue = 4; // number of elements to construct before starting
static const unsigned maxReceiveQueueSize = 60; // number of elements desired in the queue
static const unsigned preAllocateReceiveQueue = 30; // number of elements to construct before starting
static const unsigned maxReceiveQueueSize = 60; // number of elements desired in the queue
const unsigned itsStreamNr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment