Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that replaced buffers are the correct size. #19

Merged
merged 3 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion epf/BufferCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ DataVecPtr BufferCache::fetch()
return buf;
}

constexpr size_t BufSize = 4096 * 10;
return DataVecPtr(new DataVec(BufSize));
}

Expand All @@ -41,6 +40,8 @@ void BufferCache::replace(DataVecPtr&& buf)
{
std::lock_guard<std::mutex> lock(m_mutex);

//ABELL - Fix this.
buf->resize(BufSize);
m_buffers.push_back(std::move(buf));
}

Expand Down
2 changes: 0 additions & 2 deletions epf/Cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class Writer;
class Cell
{
public:
static constexpr size_t BufSize = 4096 * 10;

Cell(const VoxelKey& key, int pointSize, Writer *writer) :
m_key(key), m_pointSize(pointSize), m_writer(writer)
{
Expand Down
4 changes: 1 addition & 3 deletions epf/Epf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ void Epf::run(const std::vector<std::string>& options)
processors.push_back(std::move(fp));
}

// Enable this when the sampler supports the output.
/**
**/
// Wait for all the processors to finish and restart.
m_pool.cycle();

Expand All @@ -197,6 +194,7 @@ void Epf::run(const std::vector<std::string>& options)
if (numPoints > MaxPointsPerNode)
{
int pointSize = layout->pointSize();

m_pool.add([key, numPoints, pointSize, this]()
{
Reprocessor r(key, numPoints, pointSize, m_outputDir, m_grid, m_writer.get());
Expand Down
1 change: 1 addition & 0 deletions epf/EpfTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using DataVec = std::vector<uint8_t>;
using DataVecPtr = std::unique_ptr<DataVec>;
using Totals = std::unordered_map<VoxelKey, size_t>;
constexpr int MaxPointsPerNode = 100000;
constexpr int BufSize = 4096 * 10;

struct Error : public std::runtime_error
{
Expand Down