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
9592743a
Commit
9592743a
authored
Jul 28, 2017
by
Pedro Gonnet
Committed by
Matthieu Schaller
Aug 03, 2017
Browse files
wrap engine_make_hierarchical_tasks in a threadpool mapper function.
parent
f9f3cf96
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
9592743a
...
...
@@ -253,6 +253,16 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c) {
}
}
void
engine_make_hierarchical_tasks_mapper
(
void
*
map_data
,
int
num_elements
,
void
*
extra_data
)
{
struct
engine
*
e
=
(
struct
engine
*
)
extra_data
;
for
(
int
ind
=
0
;
ind
<
num_elements
;
ind
++
)
{
struct
cell
*
c
=
&
((
struct
cell
*
)
map_data
)[
ind
];
engine_make_hierarchical_tasks
(
e
,
c
);
}
}
#ifdef WITH_MPI
/**
* Do the exchange of one type of particles with all the other nodes.
...
...
@@ -2515,8 +2525,8 @@ void engine_maketasks(struct engine *e) {
sizeof
(
struct
cell
),
0
,
NULL
);
/* Append hierarchical tasks to each cell. */
for
(
int
k
=
0
;
k
<
nr_cells
;
k
++
)
engine_make_hierarchical_tasks
(
e
,
&
cells
[
k
]
);
threadpool_map
(
&
e
->
threadpool
,
engine_make_hierarchical_tasks_mapper
,
cells
,
nr_cells
,
sizeof
(
struct
cell
),
0
,
e
);
/* Run through the tasks and make force tasks for each density task.
Each force task depends on the cell ghosts and unlocks the kick task
...
...
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