nrn icon indicating copy to clipboard operation
nrn copied to clipboard

nrn_setup: use std::vector for cell_groups (dat_files)

Open ferdonline opened this issue 1 year ago • 22 comments

Context

Coreneuron nrn_setup uses a plain malloc'd array for holding the input data cell groups (from files.dat). These arrays, besides being plain old and not self managed, could not grow and had a static size of nfiles/nranks + 1.

However, in the view of the upcoming load balanced input data, each rank may hold a different count of cell groups. Those changes will come as a follow-up PR.

This PR

Refactors this part of the code to replace the data structure by an std::vector, which

  • grows as required and auto deallocs
  • avoids the book-keeping of the size as a separate variable

ferdonline avatar Nov 07 '24 15:11 ferdonline

✔️ d05e252d80bbb41a8b3ca57739841f6d231607c0 -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 07 '24 19:11 azure-pipelines[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.08%. Comparing base (9015833) to head (2659180).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3185      +/-   ##
==========================================
- Coverage   67.08%   67.08%   -0.01%     
==========================================
  Files         571      571              
  Lines      111044   111045       +1     
==========================================
  Hits        74489    74489              
- Misses      36555    36556       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 07 '24 19:11 codecov[bot]

✔️ 38baa2637fb58cd40b858818d60dbb35a416083a -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 07 '24 22:11 azure-pipelines[bot]

✔️ 4e0e064c35686915c930cc84a47146560e24f634 -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 13 '24 15:11 azure-pipelines[bot]

✔️ 86be204cc41610524b73c4dace2281b752474e25 -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 15 '24 12:11 azure-pipelines[bot]

✔️ 63a32f656ca38c2ba5530b7bc8c1af78eb9a378d -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 19 '24 15:11 azure-pipelines[bot]

@1uc anything missing here?

ferdonline avatar Nov 20 '24 09:11 ferdonline

Indeed, there should be no functional changes, including preallocating the vector with the same size as the original array

ferdonline avatar Nov 21 '24 12:11 ferdonline

✔️ 0f55dd6db2dd8295cfe9e942b96dd292a28cc364 -> Azure artifacts URL

azure-pipelines[bot] avatar Nov 21 '24 14:11 azure-pipelines[bot]

✔️ 1033a0cb84d0f5a2ba73ab902b20b3e075db56d6 -> Azure artifacts URL

azure-pipelines[bot] avatar Dec 04 '24 15:12 azure-pipelines[bot]

✔️ 1853c776f5b90f5877c3ad3bcbdbd1b19a3a96ee -> Azure artifacts URL

azure-pipelines[bot] avatar Dec 11 '24 00:12 azure-pipelines[bot]