Skip to content
Snippets Groups Projects
Unverified Commit be0f72e9 authored by Tobias Winchen's avatar Tobias Winchen Committed by GitHub
Browse files

Merge pull request #12 from TobiasWinchen/devel

VLBI: Fix output of skipped blocks to dada buffer
parents f4f4ac60 bff7e7f4
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,14 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) { ...@@ -136,6 +136,14 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) {
++_call_count; ++_call_count;
BOOST_LOG_TRIVIAL(debug) << "VLBI operator() called (count = " << _call_count BOOST_LOG_TRIVIAL(debug) << "VLBI operator() called (count = " << _call_count
<< ")"; << ")";
if (_samples_to_skip > _packed_voltage.size())
{
BOOST_LOG_TRIVIAL(debug) << " - Skipping full block for VDIF full-second alignemnt";
_samples_to_skip -= _packed_voltage.size();
_call_count--;
return false;
}
if (block.used_bytes() != _buffer_bytes) { /* Unexpected buffer size */ if (block.used_bytes() != _buffer_bytes) { /* Unexpected buffer size */
BOOST_LOG_TRIVIAL(error) << "Unexpected Buffer Size - Got " BOOST_LOG_TRIVIAL(error) << "Unexpected Buffer Size - Got "
<< block.used_bytes() << " byte, expected " << block.used_bytes() << " byte, expected "
...@@ -230,12 +238,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) { ...@@ -230,12 +238,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
BOOST_LOG_TRIVIAL(debug) << " - Copy Data back to host"; BOOST_LOG_TRIVIAL(debug) << " - Copy Data back to host";
CUDA_ERROR_CHECK(cudaStreamSynchronize(_d2h_stream)); CUDA_ERROR_CHECK(cudaStreamSynchronize(_d2h_stream));
if (_samples_to_skip > _packed_voltage.size())
{
BOOST_LOG_TRIVIAL(debug) << " - Skipping full block for second alignemnt";
_samples_to_skip -= _packed_voltage.size();
return false;
}
const size_t outputBlockSize = _vdifHeader.getDataFrameLength() * 8 - vlbiHeaderSize; const size_t outputBlockSize = _vdifHeader.getDataFrameLength() * 8 - vlbiHeaderSize;
const size_t totalSizeOfData = _packed_voltage.size() + _spillOver.size() - _samples_to_skip; // current array + remaining of previous - samples to skip at the beginning const size_t totalSizeOfData = _packed_voltage.size() + _spillOver.size() - _samples_to_skip; // current array + remaining of previous - samples to skip at the beginning
...@@ -282,7 +285,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) { ...@@ -282,7 +285,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) {
static_cast<void *>(_packed_voltage.a_ptr() + offset + _samples_to_skip), static_cast<void *>(_packed_voltage.a_ptr() + offset + _samples_to_skip),
_spillOver.size(), cudaMemcpyDeviceToHost, _d2h_stream)); _spillOver.size(), cudaMemcpyDeviceToHost, _d2h_stream));
// ONly skip sampels in first output block to achieve alignement // ONly skip samples in first output block to achieve alignement
_samples_to_skip = 0; _samples_to_skip = 0;
// fill in header data // fill in header data
...@@ -301,7 +304,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) { ...@@ -301,7 +304,7 @@ bool VLBI<HandlerType>::operator()(RawBytes &block) {
size_t i = ib / _vdifHeader.getDataFrameLength() / 8; size_t i = ib / _vdifHeader.getDataFrameLength() / 8;
if (i < 5) if (i < 5)
BOOST_LOG_TRIVIAL(debug) << i << " Dataframe Number: " << _vdifHeader.getDataFrameNumber(); BOOST_LOG_TRIVIAL(debug) << i << " Dataframe Number: " << _vdifHeader.getDataFrameNumber() << " " << _vdifHeader.getTimestamp();
// invalidate rest of data so it can be dropped later. // invalidate rest of data so it can be dropped later.
// Needed so that the outpuitbuffer can have always the same size // Needed so that the outpuitbuffer can have always the same size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment