-
Notifications
You must be signed in to change notification settings - Fork 59
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
Tests for particle diffusion #2209
base: master
Are you sure you want to change the base?
Conversation
Hey @jlubo, thanks for adding this. Could you run |
And |
Okay, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
made some comments for improvements, rest looks great, thanks.
.gitignore
Outdated
@@ -105,3 +105,6 @@ _skbuild | |||
|
|||
# generated by test scripts | |||
results | |||
|
|||
# environment setting script | |||
set_arbor_env* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this file come from? If it's common (like editor/build system/... temporaries) I have no problem with adding it, but we had clashes before and so I am rather conservative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a file that I usually use to set the Arbor environment, I guess it can't be considered common :D
python/test/readme.md
Outdated
@@ -39,6 +39,6 @@ In subfolders `unit`/`unit_distributed`: | |||
|
|||
## Naming convention | |||
|
|||
- modules: `test_xxxs` (ending with `s` since module can consist of multiple classes) | |||
- class(es): `TestXxxs` (ending with `s` since class can consist of multiple test functions) | |||
- modules: `test_xxxs` (if suitable, ending with `s` since module can consist of multiple classes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- modules: `test_xxxs` (if suitable, ending with `s` since module can consist of multiple classes) | |
- modules: `test_xxxs` (if applicable use the plural as modules can comprise multiple tests) |
python/test/readme.md
Outdated
- modules: `test_xxxs` (ending with `s` since module can consist of multiple classes) | ||
- class(es): `TestXxxs` (ending with `s` since class can consist of multiple test functions) | ||
- modules: `test_xxxs` (if suitable, ending with `s` since module can consist of multiple classes) | ||
- class(es): `TestXxxs` (if suitable, ending with `s` since class can consist of multiple test functions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea here
python/test/unit/test_diffusion.py
Outdated
cat # use the provided catalogue of diffusion mechanisms | ||
) | ||
self.the_props.set_ion("s", 1, 0, 0, 0) # use diffusive particles "s" | ||
self.inc_0 = inc_0 # increase in particle amount at 0.1 s (in 1e-18 mol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a list of [(t, synapse, amount)]
instead of these three hardcoded injections seems like it could make things
more general and even clearer to understand.
…pointing to the fact that the diffusion across segments of different radius is still erroneous; see arbor-sim#2145)
74a8f99
to
2c1e802
Compare
Thanks @thorstenhater! I've revised the code according to the comments. |
ext/fmt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend git fetch --all && git merge origin/master && git submodule sync
... changing submodules in a feature PR is likely not what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I must have missed that they were in.
ext/pugixml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
25fe938
to
7f77d60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
cscs-ci run daint-gpu |
Uh-oh
@boeschf could you take a look? I suspect the recent changes to event delivery clash with the diffusion handling: if (ii_ < (end_ - begin_)) {
const auto tid_ = (begin_ + ii_)->mech_index;
if ((ii_ > 0) && ((begin_ + (ii_ - 1))->mech_index == tid_)) return;
for (auto i_ = begin_ + ii_; i_ < end_; ++i_) {
if (i_->mech_index != tid_) break;
[[maybe_unused]] auto weight = i_->weight;
unsigned lane_mask_ = arb::gpu::ballot(0xffffffff, tid_<n_); this was emitted by modcc for the NET_RECV. Note the missing |
The different-radii and different-length tests are now uncommented. They should succeed if they are run with this new fix in the diffusion solver: thorstenhater@7577092 |
Hey @jlubo, could you leave them disabled, I'll add them to the to-be-made PR for the fixes. |
…ent_radii' again (for as long as the related fix is not merged)
Done :) |
I'll fix the GPU problem in my follow-up #2226 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! See also downstream #2226. Two questions:
- It seems like lots of special casing for the different setups (num_sgs=1,2,3). Do you think it would be cleaner to split these into different tests altogether?
- Question also inline: Can't we always compute the equilibrium concentration?
I agree, I've now split the function
Yes we can! I've introduced a more general computation of CV volumes making this possible now. |
cscs-ci run daint-gpu |
Python tests are added to ensure the working of the diffusion of arbitrary particles in setups with 1-3 segments (cf. issues #2084 and #2145).
Besides showing that the diffusion seems to work if segments have the same radius, the tests that are added here also point to the fact that the diffusion across segments of different radius is still erroneous. Therefore, I left the tests for different radii commented until #2145 has been resolved.