Revision 33bb5385
Added by David Sorber about 4 years ago
| software/read_test/src/AIO_ExecDriver.cc | ||
|---|---|---|
|
Chunk* chunk = nullptr;
|
||
|
std::string prevFilename("");
|
||
|
|
||
|
// std::ofstream output("chunk.bin");
|
||
|
|
||
|
while (true)
|
||
|
{
|
||
|
chunk = inQueue->pop_front();
|
||
| ... | ... | |
|
inFileStream.close();
|
||
|
}
|
||
|
|
||
|
// std::string test(chunk->p_chunkData, 30);
|
||
|
// BlnxLog(debug) << "CHUNK " << chunk->m_chunkId << " DATA: " << test;
|
||
|
|
||
|
// output.write(chunk->p_chunkData, chunk->m_chunkSize);
|
||
|
|
||
|
outQueue->push_back(chunk);
|
||
|
}
|
||
|
|
||
|
// output.close();
|
||
|
|
||
|
// Release file descriptor
|
||
|
::close(fd);
|
||
|
|
||
| software/read_test/src/ExecDriver.cc | ||
|---|---|---|
|
* Unpublished -- all rights reserved under the copyright laws *
|
||
|
* of the United States. *
|
||
|
********************************************************************/
|
||
|
#include <iomanip>
|
||
|
|
||
|
#include <sys/stat.h>
|
||
|
#include <sys/types.h>
|
||
|
|
||
|
#include "ExecDriver.h"
|
||
|
#include "Utilities/ChunkConstants.h"
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
|
||
|
// Uncomment this to output each chunk's buffer to a file
|
||
|
#if 0
|
||
|
// Create directory to hold chunk files
|
||
|
mkdir("chunks", 0777);
|
||
|
|
||
|
// Output each chunk with a filename corresponding to its chunk ID.
|
||
|
// E.g. chunk_235.bin
|
||
|
std::ostringstream fname;
|
||
|
fname << "chunks/chunk_" << std::setw(3) << std::setfill('0')
|
||
|
<< chunk->m_chunkId << ".bin";
|
||
|
BlnxLog(error) << "FNAME: " << fname.str();
|
||
|
std::ofstream output(fname.str());
|
||
|
output.write(chunk->p_chunkData, chunk->m_chunkSize);
|
||
|
output.close();
|
||
|
#endif
|
||
|
|
||
|
bufAllocator->release(chunk->p_chunkData);
|
||
|
delete chunk;
|
||
|
}
|
||
read_test: Add optional comment block to output input data one chunk per
file. This can be used to verify that the output data matches the input
data.