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

Issue: size estimation for buffers (estimateMemoryForCompaction) seems to return too small values when called for small maps/vectors #45

Open
markusbattarbee opened this issue Feb 19, 2024 · 3 comments

Comments

@markusbattarbee
Copy link
Collaborator

No description provided.

@kstppd
Copy link
Owner

kstppd commented Mar 1, 2024

Trying to reproduce this and I cannot seem to get it to complain. Do you have any specific example either in Vlasiator or in the units tests?

@kstppd
Copy link
Owner

kstppd commented Apr 3, 2024

Any news on this?

@markusbattarbee
Copy link
Collaborator Author

After switching to the loop-interfaces for compactions, I no longer use this function. So I think the issue is still probably there.

It cropped up with small block counts, so that's where testing should go - also, I always initialize hashmaps with at least sizepower 7, so perhaps it's right down at that value.

In an older Vlasiator source file, I had these lines:

size_t bytesNeeded = split::tools::estimateMemoryForCompaction((size_t)std::pow(2,BlocksRequiredMap_sizepower+4));
const vmesh::LocalID nBlocksRequired = BlocksRequiredMap->extractAllKeys(*BlocksRequired,compaction_buffer[thread_id],bytesNeeded,stream,false);

where the +4 is exactly to get rid of this issue. This map was grown on-device, so it may have had a fill rate greater than 0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants