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
7019f7b4
Commit
7019f7b4
authored
Dec 12, 2012
by
Pedro Gonnet
Browse files
parallelize particle and task init.
Former-commit-id: 34fff717ccaff6ee8c5e9448cbd855857b5aec57
parent
b150ea1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
7019f7b4
...
...
@@ -197,6 +197,7 @@ void engine_run ( struct engine *e , int sort_queues ) {
struct
space
*
s
=
e
->
s
;
/* Re-set the particle data. */
#pragma omp parallel for
for
(
k
=
0
;
k
<
s
->
nr_parts
;
k
++
)
{
s
->
parts
[
k
].
wcount
=
0
.
0
f
;
s
->
parts
[
k
].
wcount_dh
=
0
.
0
f
;
...
...
@@ -205,11 +206,12 @@ void engine_run ( struct engine *e , int sort_queues ) {
}
/* Run throught the tasks and get all the waits right. */
#pragma omp parallel for private(j)
for
(
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
{
for
(
j
=
0
;
j
<
s
->
tasks
[
k
].
nr_unlock_tasks
;
j
++
)
s
->
tasks
[
k
].
unlock_tasks
[
j
]
->
wait
+=
1
;
__sync_add_and_fetch
(
&
s
->
tasks
[
k
].
unlock_tasks
[
j
]
->
wait
,
1
)
;
for
(
j
=
0
;
j
<
s
->
tasks
[
k
].
nr_unlock_cells
;
j
++
)
s
->
tasks
[
k
].
unlock_cells
[
j
]
->
wait
+=
1
;
__sync_add_and_fetch
(
&
s
->
tasks
[
k
].
unlock_cells
[
j
]
->
wait
,
1
)
;
}
/* Re-set the queues.*/
...
...
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