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
bcfb79fb
Commit
bcfb79fb
authored
8 years ago
by
Benjamin Cumming
Browse files
Options
Downloads
Patches
Plain Diff
add timing to the ball_and_3stick validation test
parent
a772ff2e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nrn/ball_and_3stick.py
+1
-1
1 addition, 1 deletion
nrn/ball_and_3stick.py
tests/util.hpp
+17
-0
17 additions, 0 deletions
tests/util.hpp
tests/validate_ball_and_stick.cpp
+3
-0
3 additions, 0 deletions
tests/validate_ball_and_stick.cpp
with
21 additions
and
1 deletion
nrn/ball_and_3stick.py
+
1
−
1
View file @
bcfb79fb
...
@@ -89,7 +89,7 @@ for nseg in [5, 11, 51, 101] :
...
@@ -89,7 +89,7 @@ for nseg in [5, 11, 51, 101] :
# record spikes
# record spikes
# this is a bit verbose, no?
# this is a bit verbose, no?
spike_counter_soma
=
h
.
APCount
(
soma
(
0.5
))
spike_counter_soma
=
h
.
APCount
(
soma
(
0.5
))
spike_counter_soma
.
thresh
=
-
0
spike_counter_soma
.
thresh
=
0
spike_counter_dend
=
h
.
APCount
(
dend
[
0
](
1
))
spike_counter_dend
=
h
.
APCount
(
dend
[
0
](
1
))
spike_counter_dend
.
thresh
=
-
20
spike_counter_dend
.
thresh
=
-
20
spike_counter_clamp
=
h
.
APCount
(
dend
[
1
](
1.0
))
spike_counter_clamp
=
h
.
APCount
(
dend
[
1
](
1.0
))
...
...
This diff is collapsed.
Click to expand it.
tests/util.hpp
+
17
−
0
View file @
bcfb79fb
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include
<string>
#include
<string>
#include
<vector>
#include
<vector>
#include
<iomanip>
#include
<iomanip>
#include
<chrono>
#include
<cmath>
#include
<cmath>
...
@@ -14,6 +15,22 @@
...
@@ -14,6 +15,22 @@
namespace
testing
{
namespace
testing
{
using
time_point
=
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
;
using
duration_type
=
std
::
chrono
::
duration
<
double
>
;
static
inline
time_point
tic
()
{
return
std
::
chrono
::
system_clock
::
now
();
}
static
inline
double
toc
(
time_point
start
)
{
return
duration_type
(
tic
()
-
start
).
count
();
}
[[
gnu
::
unused
]]
static
[[
gnu
::
unused
]]
static
void
write_vis_file
(
const
std
::
string
&
fname
,
std
::
vector
<
std
::
vector
<
double
>>
values
)
void
write_vis_file
(
const
std
::
string
&
fname
,
std
::
vector
<
std
::
vector
<
double
>>
values
)
{
{
...
...
This diff is collapsed.
Click to expand it.
tests/validate_ball_and_stick.cpp
+
3
−
0
View file @
bcfb79fb
...
@@ -240,6 +240,7 @@ TEST(ball_and_3stick, neuron_baseline)
...
@@ -240,6 +240,7 @@ TEST(ball_and_3stick, neuron_baseline)
};
};
std
::
vector
<
result
>
results
;
std
::
vector
<
result
>
results
;
auto
start
=
testing
::
tic
();
for
(
auto
run_index
=
0u
;
run_index
<
cell_data
.
size
();
++
run_index
)
{
for
(
auto
run_index
=
0u
;
run_index
<
cell_data
.
size
();
++
run_index
)
{
auto
&
run
=
cell_data
[
run_index
];
auto
&
run
=
cell_data
[
run_index
];
int
num_compartments
=
run
[
"nseg"
];
int
num_compartments
=
run
[
"nseg"
];
...
@@ -274,6 +275,8 @@ TEST(ball_and_3stick, neuron_baseline)
...
@@ -274,6 +275,8 @@ TEST(ball_and_3stick, neuron_baseline)
results
.
push_back
(
{
num_compartments
,
dt
,
v
,
measurements
}
);
results
.
push_back
(
{
num_compartments
,
dt
,
v
,
measurements
}
);
}
}
auto
time_taken
=
testing
::
toc
(
start
);
std
::
cout
<<
"took "
<<
time_taken
<<
" seconds
\n
"
;
// print results
// print results
auto
colors
=
{
memory
::
util
::
kWhite
,
memory
::
util
::
kGreen
,
memory
::
util
::
kYellow
};
auto
colors
=
{
memory
::
util
::
kWhite
,
memory
::
util
::
kGreen
,
memory
::
util
::
kYellow
};
...
...
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