Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
f9f3cf96
Commit
f9f3cf96
authored
Jul 28, 2017
by
Pedro Gonnet
Committed by
Matthieu Schaller
Aug 03, 2017
Browse files
add cell_set_super_mapper.
parent
d255638f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
f9f3cf96
...
...
@@ -1893,6 +1893,13 @@ void cell_set_super(struct cell *c, struct cell *super) {
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_set_super
(
c
->
progeny
[
k
],
super
);
}
void
cell_set_super_mapper
(
void
*
map_data
,
int
num_elements
,
void
*
extra_data
)
{
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
struct
cell
*
c
=
&
((
struct
cell
*
)
map_data
)[
ind
];
cell_set_super
(
c
,
NULL
);
}
}
/**
* @brief Recursively drifts the #part in a cell hierarchy.
*
...
...
src/cell.h
View file @
f9f3cf96
...
...
@@ -404,6 +404,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
void
cell_activate_drift_part
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_activate_sorts
(
struct
cell
*
c
,
int
sid
,
struct
scheduler
*
s
);
void
cell_clear_drift_flags
(
struct
cell
*
c
,
void
*
data
);
void
cell_set_super_mapper
(
void
*
map_data
,
int
num_elements
,
void
*
extra_data
);
/* Inlined functions (for speed). */
...
...
src/engine.c
View file @
f9f3cf96
...
...
@@ -2511,7 +2511,8 @@ void engine_maketasks(struct engine *e) {
/* Now that the self/pair tasks are at the right level, set the super
* pointers. */
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
cell_set_super
(
&
cells
[
k
],
NULL
);
threadpool_map
(
&
e
->
threadpool
,
cell_set_super_mapper
,
cells
,
nr_cells
,
sizeof
(
struct
cell
),
0
,
NULL
);
/* Append hierarchical tasks to each cell. */
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment