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
01548527
Unverified
Commit
01548527
authored
5 years ago
by
Nora Abi Akar
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix examples (#979)
Remove cell_stats from gap junction, dry run and ring examples. Fixes #962
parent
45885c22
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
example/dryrun/dryrun.cpp
+0
-57
0 additions, 57 deletions
example/dryrun/dryrun.cpp
example/gap_junctions/gap_junctions.cpp
+0
-40
0 additions, 40 deletions
example/gap_junctions/gap_junctions.cpp
example/ring/ring.cpp
+0
-38
0 additions, 38 deletions
example/ring/ring.cpp
with
0 additions
and
135 deletions
example/dryrun/dryrun.cpp
+
0
−
57
View file @
01548527
...
...
@@ -143,60 +143,6 @@ private:
float
event_weight_
=
0.01
;
};
struct
cell_stats
{
using
size_type
=
unsigned
;
size_type
ncells
=
0
;
int
nranks
=
1
;
size_type
nsegs
=
0
;
cell_stats
(
arb
::
recipe
&
r
,
run_params
params
)
{
#ifdef ARB_MPI_ENABLED
if
(
!
params
.
dry_run
)
{
int
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nranks
);
ncells
=
r
.
num_cells
();
size_type
cells_per_rank
=
ncells
/
nranks
;
size_type
b
=
rank
*
cells_per_rank
;
size_type
e
=
(
rank
+
1
)
*
cells_per_rank
;
size_type
nsegs_tmp
=
0
;
for
(
size_type
i
=
b
;
i
<
e
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs_tmp
+=
c
.
morphology
().
num_branches
();
}
MPI_Allreduce
(
&
nsegs_tmp
,
&
nsegs
,
1
,
MPI_UNSIGNED
,
MPI_SUM
,
MPI_COMM_WORLD
);
}
#else
if
(
!
params
.
dry_run
)
{
nranks
=
1
;
ncells
=
r
.
num_cells
();
for
(
size_type
i
=
0
;
i
<
ncells
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs
+=
c
.
morphology
().
num_branches
();
}
}
#endif
else
{
nranks
=
params
.
num_ranks
;
ncells
=
r
.
num_cells
();
//total number of cells across all ranks
for
(
size_type
i
=
0
;
i
<
params
.
num_cells_per_rank
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs
+=
c
.
morphology
().
num_branches
();
}
nsegs
*=
params
.
num_ranks
;
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
cell_stats
&
s
)
{
return
o
<<
"cell stats: "
<<
s
.
nranks
<<
" ranks; "
<<
s
.
ncells
<<
" cells; "
<<
s
.
nsegs
<<
" branches. "
;
}
};
int
main
(
int
argc
,
char
**
argv
)
{
try
{
#ifdef ARB_MPI_ENABLED
...
...
@@ -245,9 +191,6 @@ int main(int argc, char** argv) {
params
.
num_ranks
,
params
.
cell
,
params
.
min_delay
);
arb
::
symmetric_recipe
recipe
(
std
::
move
(
tile
));
cell_stats
stats
(
recipe
,
params
);
std
::
cout
<<
stats
<<
"
\n
"
;
auto
decomp
=
arb
::
partition_load_balance
(
recipe
,
ctx
);
// Construct the model.
...
...
This diff is collapsed.
Click to expand it.
example/gap_junctions/gap_junctions.cpp
+
0
−
40
View file @
01548527
...
...
@@ -142,43 +142,6 @@ private:
gap_params
params_
;
};
struct
cell_stats
{
using
size_type
=
unsigned
;
size_type
ncells
=
0
;
size_type
nsegs
=
0
;
cell_stats
(
arb
::
recipe
&
r
)
{
#ifdef ARB_MPI_ENABLED
int
nranks
,
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nranks
);
ncells
=
r
.
num_cells
();
size_type
cells_per_rank
=
ncells
/
nranks
;
size_type
b
=
rank
*
cells_per_rank
;
size_type
e
=
(
rank
==
nranks
-
1
)
?
ncells
:
(
rank
+
1
)
*
cells_per_rank
;
size_type
nsegs_tmp
=
0
;
for
(
size_type
i
=
b
;
i
<
e
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs_tmp
+=
c
.
num_branches
();
}
MPI_Allreduce
(
&
nsegs_tmp
,
&
nsegs
,
1
,
MPI_UNSIGNED
,
MPI_SUM
,
MPI_COMM_WORLD
);
#else
ncells
=
r
.
num_cells
();
for
(
size_type
i
=
0
;
i
<
ncells
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs
+=
c
.
morphology
().
num_branches
();
}
#endif
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
cell_stats
&
s
)
{
return
o
<<
"cell stats: "
<<
s
.
ncells
<<
" cells; "
<<
s
.
nsegs
<<
" branchess."
;
}
};
int
main
(
int
argc
,
char
**
argv
)
{
try
{
bool
root
=
true
;
...
...
@@ -225,9 +188,6 @@ int main(int argc, char** argv) {
// Create an instance of our recipe.
gj_recipe
recipe
(
params
);
cell_stats
stats
(
recipe
);
std
::
cout
<<
stats
<<
"
\n
"
;
auto
decomp
=
arb
::
partition_load_balance
(
recipe
,
context
);
// Construct the model.
...
...
This diff is collapsed.
Click to expand it.
example/ring/ring.cpp
+
0
−
38
View file @
01548527
...
...
@@ -136,42 +136,6 @@ private:
arb
::
cable_cell_global_properties
gprop_
;
};
struct
cell_stats
{
using
size_type
=
unsigned
;
size_type
ncells
=
0
;
size_type
nsegs
=
0
;
cell_stats
(
arb
::
recipe
&
r
)
{
#ifdef ARB_MPI_ENABLED
int
nranks
,
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nranks
);
ncells
=
r
.
num_cells
();
size_type
cells_per_rank
=
ncells
/
nranks
;
size_type
b
=
rank
*
cells_per_rank
;
size_type
e
=
(
rank
==
nranks
-
1
)
?
ncells
:
(
rank
+
1
)
*
cells_per_rank
;
size_type
nsegs_tmp
=
0
;
for
(
size_type
i
=
b
;
i
<
e
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs_tmp
+=
c
.
num_branches
();
}
MPI_Allreduce
(
&
nsegs_tmp
,
&
nsegs
,
1
,
MPI_UNSIGNED
,
MPI_SUM
,
MPI_COMM_WORLD
);
#else
ncells
=
r
.
num_cells
();
for
(
size_type
i
=
0
;
i
<
ncells
;
++
i
)
{
auto
c
=
arb
::
util
::
any_cast
<
arb
::
cable_cell
>
(
r
.
get_cell_description
(
i
));
nsegs
+=
c
.
morphology
().
num_branches
();
}
#endif
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
cell_stats
&
s
)
{
return
o
<<
"cell stats: "
<<
s
.
ncells
<<
" cells; "
<<
s
.
nsegs
<<
" branches."
;
}
};
int
main
(
int
argc
,
char
**
argv
)
{
try
{
bool
root
=
true
;
...
...
@@ -213,8 +177,6 @@ int main(int argc, char** argv) {
// Create an instance of our recipe.
ring_recipe
recipe
(
params
.
num_cells
,
params
.
cell
,
params
.
min_delay
);
cell_stats
stats
(
recipe
);
std
::
cout
<<
stats
<<
"
\n
"
;
auto
decomp
=
arb
::
partition_load_balance
(
recipe
,
context
);
...
...
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