Skip to content
GitLab
Menu
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
ccfafcb2
Commit
ccfafcb2
authored
Jul 28, 2017
by
Pedro Gonnet
Browse files
add cell_set_super_mapper.
parent
0912571f
Changes
3
Show whitespace changes
Inline
Side-by-side
src/cell.c
View file @
ccfafcb2
...
@@ -1889,6 +1889,13 @@ void cell_set_super(struct cell *c, struct cell *super) {
...
@@ -1889,6 +1889,13 @@ void cell_set_super(struct cell *c, struct cell *super) {
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_set_super
(
c
->
progeny
[
k
],
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.
* @brief Recursively drifts the #part in a cell hierarchy.
*
*
...
...
src/cell.h
View file @
ccfafcb2
...
@@ -404,6 +404,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
...
@@ -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_drift_part
(
struct
cell
*
c
,
struct
scheduler
*
s
);
void
cell_activate_sorts
(
struct
cell
*
c
,
int
sid
,
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_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). */
/* Inlined functions (for speed). */
...
...
src/engine.c
View file @
ccfafcb2
...
@@ -2506,7 +2506,8 @@ void engine_maketasks(struct engine *e) {
...
@@ -2506,7 +2506,8 @@ void engine_maketasks(struct engine *e) {
/* Now that the self/pair tasks are at the right level, set the super
/* Now that the self/pair tasks are at the right level, set the super
* pointers. */
* 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. */
/* Append hierarchical tasks to each cell. */
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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