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
75ce2205
Commit
75ce2205
authored
8 years ago
by
w.klijn
Browse files
Options
Downloads
Patches
Plain Diff
Small textual changes and additional comments
parent
ae276099
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
miniapp/miniapp.cpp
+18
-18
18 additions, 18 deletions
miniapp/miniapp.cpp
src/communication/exporter_interface.hpp
+1
-1
1 addition, 1 deletion
src/communication/exporter_interface.hpp
src/model.hpp
+5
-0
5 additions, 0 deletions
src/model.hpp
with
24 additions
and
19 deletions
miniapp/miniapp.cpp
+
18
−
18
View file @
75ce2205
...
...
@@ -66,37 +66,37 @@ int main(int argc, char** argv) {
auto
recipe
=
make_recipe
(
options
,
pdist
);
auto
cell_range
=
distribute_cells
(
recipe
->
num_cells
());
// build model from recipe
// TODO: I would rather just forward the options object.
model_type
m
(
*
recipe
,
cell_range
.
first
,
cell_range
.
second
);
std
::
unique_ptr
<
file_export_type
>
file_exporter
;
// File output is depending on the input arguments
std
::
unique_ptr
<
file_export_type
>
file_exporter
;
if
(
!
options
.
spike_file_output
)
{
m
.
set_global_spike_callback
(
file_export_type
::
do_nothing
);
m
.
set_local_spike_callback
(
file_export_type
::
do_nothing
);
// TODO: use the no_function if PR:77
m
.
set_global_spike_callback
(
file_export_type
::
do_nothing
);
m
.
set_local_spike_callback
(
file_export_type
::
do_nothing
);
}
else
{
file_exporter
=
nest
::
mc
::
util
::
make_unique
<
file_export_type
>
(
options
.
file_name
,
options
.
output_path
,
options
.
file_extention
,
true
);
// The exporter is the same for both global and local output
// just registered as a different callback
file_exporter
=
util
::
make_unique
<
file_export_type
>
(
options
.
file_name
,
options
.
output_path
,
options
.
file_extention
,
options
.
over_write
);
if
(
options
.
single_file_per_rank
)
{
m
.
set_global_spike_callback
(
file_export_type
::
do_nothing
);
m
.
set_global_spike_callback
(
file_export_type
::
do_nothing
);
m
.
set_local_spike_callback
(
[
&
](
const
std
::
vector
<
spike_type
>&
spikes
)
{
file_exporter
->
do_export
(
spikes
);
});
[
&
](
const
std
::
vector
<
spike_type
>&
spikes
)
{
file_exporter
->
do_export
(
spikes
);
});
}
else
{
m
.
set_global_spike_callback
(
[
&
](
const
std
::
vector
<
spike_type
>&
spikes
)
{
file_exporter
->
do_export
(
spikes
);
});
m
.
set_local_spike_callback
(
file_export_type
::
do_nothing
);
[
&
](
const
std
::
vector
<
spike_type
>&
spikes
)
{
file_exporter
->
do_export
(
spikes
);
});
m
.
set_local_spike_callback
(
file_export_type
::
do_nothing
);
}
}
// inject some artificial spikes, 1 per 20 neurons.
cell_gid_type
spike_cell
=
20
*
((
cell_range
.
first
+
19
)
/
20
);
...
...
This diff is collapsed.
Click to expand it.
src/communication/exporter_interface.hpp
+
1
−
1
View file @
75ce2205
...
...
@@ -27,7 +27,7 @@ public:
// Returns the status of the exporter
virtual
bool
good
()
const
=
0
;
// Static
NULL
version of the do_export function for NOP callbacks
// Static version of the do_export function for NOP callbacks
static
void
do_nothing
(
const
std
::
vector
<
spike_type
>&
)
{}
};
...
...
This diff is collapsed.
Click to expand it.
src/model.hpp
+
5
−
0
View file @
75ce2205
...
...
@@ -178,11 +178,16 @@ public:
std
::
size_t
num_spikes
()
const
{
return
communicator_
.
num_spikes
();
}
std
::
size_t
num_groups
()
const
{
return
cell_groups_
.
size
();
}
// register a callback that will perform a export of the global
// spike vector
void
set_global_spike_callback
(
std
::
function
<
void
(
const
std
::
vector
<
spike_type
>&
)
>
global_export_callback
)
{
global_export_callback_
=
global_export_callback
;
}
// register a callback that will perform a export of the rank local
// spike vector
void
set_local_spike_callback
(
std
::
function
<
void
(
const
std
::
vector
<
spike_type
>&
)
>
local_export_callback
)
{
...
...
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