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 MutexPool an allocator #2766

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Make MutexPool an allocator #2766

wants to merge 21 commits into from

Conversation

alkino
Copy link
Member

@alkino alkino commented Mar 1, 2024

Move structpool.h to utils/pool.hpp
Move nrncvode/pool.h in utils/mutexed_pool.hpp.

The new pools is neuron-agnostic (hoc, ...).

To create a normal pool: Pool<int>
To create a pool protected with mutex: MutexedPool<int>, the type of the mutex can be given as a second optional argument (by default std::mutex) MutexedPool<int, std::recursive_mutex>

To follow https://en.cppreference.com/w/cpp/named_req/Allocator:

  • Rename alloc to allocate
  • Rename hpfree to deallocate

The function to clean the data has to be set with set_function it lets us, use a different name, a lambda, a free function, ... compare to before where the function should be part of the type and named clear().

@pramodk pramodk requested review from nrnhines and removed request for nrnhines March 1, 2024 13:45
@bbpbuildbot

This comment has been minimized.

@bbpbuildbot

This comment has been minimized.

@alkino alkino closed this Mar 18, 2024
@alkino alkino reopened this Mar 18, 2024
Copy link

✔️ d72251f -> Azure artifacts URL

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 89.18919% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 67.14%. Comparing base (2b928ad) to head (cc18266).
Report is 1 commits behind head on master.

Files Patch % Lines
src/utils/pool.hpp 80.95% 8 Missing ⚠️
src/nrncvode/tqueue.cpp 87.50% 1 Missing ⚠️
src/nrniv/cxprop.cpp 75.00% 1 Missing ⚠️
src/nrniv/multisend.cpp 80.00% 1 Missing ⚠️
src/utils/mutexed_pool.hpp 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2766      +/-   ##
==========================================
- Coverage   67.15%   67.14%   -0.01%     
==========================================
  Files         562      561       -1     
  Lines      104118   104073      -45     
==========================================
- Hits        69923    69885      -38     
+ Misses      34195    34188       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 4a12b57 -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@pramodk pramodk requested a review from JCGoran March 21, 2024 13:29
@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 2b1719a -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

Copy link

✔️ 0936bef -> Azure artifacts URL

@alkino alkino marked this pull request as draft March 26, 2024 15:24
@bbpbuildbot

This comment has been minimized.

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed

Issues
14 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
21.2% Duplication on New Code

See analysis details on SonarCloud

Copy link

✔️ cc18266 -> Azure artifacts URL

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

Successfully merging this pull request may close these issues.

None yet

3 participants