Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
b5cbd968
Commit
b5cbd968
authored
8 years ago
by
Sam Yates
Browse files
Options
Downloads
Patches
Plain Diff
Tell communicator about connections.
Turns out this helps when trying to deliver spikes.
parent
f517ba56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
miniapp/miniapp_recipes.cpp
+1
-1
1 addition, 1 deletion
miniapp/miniapp_recipes.cpp
src/cell_group.hpp
+4
-4
4 additions, 4 deletions
src/cell_group.hpp
src/communication/communicator.hpp
+2
-2
2 additions, 2 deletions
src/communication/communicator.hpp
src/model.hpp
+11
-1
11 additions, 1 deletion
src/model.hpp
with
18 additions
and
8 deletions
miniapp/miniapp_recipes.cpp
+
1
−
1
View file @
b5cbd968
...
...
@@ -112,7 +112,7 @@ protected:
cell_gid_type
ncell_
;
basic_recipe_param
param_
;
probe_distribution
pdist_
;
static
constexpr
int
basic_cell_segments
=
3
;
static
constexpr
int
basic_cell_segments
=
4
;
using
exp_param
=
std
::
exponential_distribution
<
float
>::
param_type
;
exp_param
delay_distribution_param
;
...
...
This diff is collapsed.
Click to expand it.
src/cell_group.hpp
+
4
−
4
View file @
b5cbd968
...
...
@@ -64,11 +64,11 @@ public:
PE
(
"sampling"
);
while
(
auto
m
=
sample_events_
.
pop_if_before
(
cell_time
))
{
auto
&
sampler
=
samplers_
[
m
->
sampler_index
];
EXPECTS
((
bool
)
sampler
.
sample
);
auto
&
sampler
_spec
=
samplers_
[
m
->
sampler_index
];
EXPECTS
((
bool
)
sampler
_spec
.
sample
r
);
index_type
probe_index
=
sampler
.
probe_id
.
index
;
auto
next
=
sampler
.
sampler
(
cell_
.
time
(),
cell_
.
probe
(
probe_index
));
index_type
probe_index
=
sampler
_spec
.
probe_id
.
index
;
auto
next
=
sampler
_spec
.
sampler
(
cell_
.
time
(),
cell_
.
probe
(
probe_index
));
if
(
next
)
{
m
->
time
=
std
::
max
(
*
next
,
cell_time
);
sample_events_
.
push
(
*
m
);
...
...
This diff is collapsed.
Click to expand it.
src/communication/communicator.hpp
+
2
−
2
View file @
b5cbd968
...
...
@@ -50,7 +50,7 @@ public:
void
add_connection
(
connection
con
)
{
EXPECTS
(
is_local_
target
(
con
.
destination
()));
EXPECTS
(
is_local_
cell
(
con
.
destination
()
.
gid
));
connections_
.
push_back
(
con
);
}
...
...
@@ -114,11 +114,11 @@ public:
// generate an event for each target
for
(
auto
it
=
targets
.
first
;
it
!=
targets
.
second
;
++
it
)
{
auto
gidx
=
it
->
destination
().
gid
-
cell_gid_from_
;
events_
[
gidx
].
push_back
(
it
->
make_event
(
spike
));
}
}
//profiler_.leave(); // make events
//profiler_.leave(); // event generation
...
...
This diff is collapsed.
Click to expand it.
src/model.hpp
+
11
−
1
View file @
b5cbd968
...
...
@@ -34,7 +34,7 @@ struct model {
cell_groups_
=
std
::
vector
<
cell_group_type
>
{
cell_to_
-
cell_from_
};
threading
::
parallel_vector
<
probe_record
>
probes
;
threading
::
parallel_for
::
apply
(
cell_from_
,
cell_to_
,
threading
::
parallel_for
::
apply
(
cell_from_
,
cell_to_
,
[
&
](
cell_gid_type
i
)
{
PE
(
"setup"
,
"cells"
);
auto
cell
=
rec
.
get_cell
(
i
);
...
...
@@ -50,9 +50,19 @@ struct model {
});
probes_
.
assign
(
probes
.
begin
(),
probes
.
end
());
communicator_
=
communicator_type
(
cell_from_
,
cell_to_
);
for
(
cell_gid_type
i
=
cell_from_
;
i
<
cell_to_
;
++
i
)
{
for
(
const
auto
&
cc
:
rec
.
connections_on
(
i
))
{
// currently cell_connection and connection are basically the same data;
// merge?
communicator_
.
add_connection
(
connection
{
cc
.
source
,
cc
.
dest
,
cc
.
weight
,
cc
.
delay
});
}
}
communicator_
.
construct
();
}
void
reset
()
{
t_
=
0.
;
for
(
auto
&
group
:
cell_groups_
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment