Skip to content

Use modern SoA helpers for fast_imem data.#2381

Merged
olupton merged 6 commits into
masterfrom
olupton/soa-fast-imem
Jun 16, 2023
Merged

Use modern SoA helpers for fast_imem data.#2381
olupton merged 6 commits into
masterfrom
olupton/soa-fast-imem

Conversation

@olupton

@olupton olupton commented Jun 12, 2023

Copy link
Copy Markdown
Collaborator

These data were already in SoA format, but bringing them into the ecosystem introduced in #2027 removes the final usage of some old pointer-updating logic, which in any case required contortions in Python scripts to get things to work. This can be removed because the new data_handle<T> component can now handle referring to i_membrane_ values.

To enable this, add support to neuron::container::soa<...> for fields that can be toggled active/inactive at runtime, and add new tests covering this. Note that the possibility of doing:

enable_optional_field();
data_handle<double> h = foo.handle_to_optional_field();
assert(h); // optional field is enabled
disable_optional_field();
assert(!h); // optional field is disabled, so this is no longer valid
foo.some_regular_field(); // still OK

and ending up with an invalid "h" is qualitatively new, as this PR introduces the possibility of handles (which are basically (row, column) coordinates) being invalidated by the column (i.e. the optional field) becoming invalid, while the row (i.e. foo) remains valid).

Also drop set_area and set_v for uniformity.

Comment thread src/neuron/container/node.hpp Outdated
Comment thread src/neuron/container/node.hpp Outdated
Comment thread src/nmodl/noccout.cpp
@olupton olupton added the nrn-modeldb-ci-nightly Launch external ModelDB CI label Jun 12, 2023
@github-actions github-actions Bot removed the nrn-modeldb-ci-nightly Launch external ModelDB CI label Jun 12, 2023
@github-actions

Copy link
Copy Markdown
Contributor

Unable to retrieve AZURE drop url from comments!

@olupton olupton requested review from iomaganaris and nrnhines June 12, 2023 12:08
@azure-pipelines

Copy link
Copy Markdown

✔️ 1d295c3 -> Azure artifacts URL

@olupton olupton added the nrn-modeldb-ci-nightly Launch external ModelDB CI label Jun 12, 2023
@github-actions github-actions Bot removed the nrn-modeldb-ci-nightly Launch external ModelDB CI label Jun 12, 2023
@github-actions

Copy link
Copy Markdown
Contributor

NEURON ModelDB CI: launching for 1d295c3 via its drop url

@codecov

codecov Bot commented Jun 12, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2381 (25c731d) into master (4a5f886) will increase coverage by 0.01%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##           master    #2381      +/-   ##
==========================================
+ Coverage   60.16%   60.18%   +0.01%     
==========================================
  Files         642      641       -1     
  Lines      121137   121169      +32     
==========================================
+ Hits        72877    72920      +43     
+ Misses      48260    48249      -11     
Impacted Files Coverage Δ
share/lib/python/neuron/rxd/rangevar.py 28.12% <ø> (-0.45%) ⬇️
share/lib/python/neuron/rxd/rxd.py 83.97% <ø> (+0.04%) ⬆️
share/lib/python/neuron/rxd/section1d.py 88.67% <ø> (-0.13%) ⬇️
src/ivoc/ivoc.cpp 84.33% <ø> (+1.00%) ⬆️
src/ivoc/ivoc.h 28.57% <ø> (ø)
src/ivoc/ocptrvector.cpp 30.89% <ø> (-5.92%) ⬇️
src/ivoc/ocptrvector.h 100.00% <ø> (ø)
src/neuron/container/mechanism.hpp 100.00% <ø> (ø)
src/neuron/container/node_data.hpp 100.00% <ø> (ø)
src/nrncvode/netcvode.cpp 88.41% <ø> (-0.04%) ⬇️
... and 27 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bbpbuildbot

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

NEURON ModelDB CI: 1d295c3 -> download reports from here

olupton added 2 commits June 13, 2023 21:28
Also:
* Drop set_area and set_v for uniformity.
* Drop pointer-updating logic.
@olupton olupton force-pushed the olupton/soa-fast-imem branch from 1d295c3 to 88a4ceb Compare June 13, 2023 19:28
@azure-pipelines

Copy link
Copy Markdown

✔️ 88a4ceb -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@olupton olupton marked this pull request as ready for review June 13, 2023 21:06
Expand tests for optional fields in soa<...> containers, in particular
using fast_imem fields in the Node data container. Because these can be
toggled on and off, there are additional states that can be attained.

As part of this, change the pretty-printing code to use the "T**"
pointers to where the "T*" pointers are stored, instead of the "T*"
values (== vec.data()), when searching for information about the
container a data handle points into. This means that data handles to
disabled columns can pretty-print as such, instead of having to
pretty-print as being handles to unknown containers.
Comment thread test/unit_tests/container/node.cpp Outdated
@azure-pipelines

Copy link
Copy Markdown

✔️ 948673c -> Azure artifacts URL

@bbpbuildbot

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown

✔️ 25c731d -> Azure artifacts URL

@nrnhines nrnhines left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very useful addition

Comment thread cmake/NeuronFileLists.cmake
@olupton olupton merged commit 7c36a8f into master Jun 16, 2023
@olupton olupton deleted the olupton/soa-fast-imem branch June 16, 2023 12:56
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.

3 participants