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
aa0e4e04
Commit
aa0e4e04
authored
Jun 05, 2013
by
Pedro Gonnet
Browse files
fixed missing initialisation.
Former-commit-id: d346b8abf9c248fddca6c49fb8a6864cd5368c9e
parent
efd2eda8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
aa0e4e04
...
...
@@ -744,7 +744,7 @@ void space_map_parts ( struct space *s , void (*fun)( struct part *p , struct ce
void
space_map_cells_post
(
struct
space
*
s
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
)
,
void
*
data
)
{
int
i
,
cid
;
int
i
,
cid
=
0
;
void
rec_map
(
struct
cell
*
c
)
{
...
...
@@ -763,7 +763,7 @@ void space_map_cells_post ( struct space *s , int full , void (*fun)( struct cel
}
/* Call the recursive function on all higher-level cells. */
#pragma omp parallel shared(cid)
#pragma omp parallel shared(
s,
cid)
{
int
mycid
;
while
(
1
)
{
...
...
@@ -781,7 +781,7 @@ void space_map_cells_post ( struct space *s , int full , void (*fun)( struct cel
void
space_map_cells_pre
(
struct
space
*
s
,
int
full
,
void
(
*
fun
)(
struct
cell
*
c
,
void
*
data
)
,
void
*
data
)
{
int
i
;
int
i
,
cid
=
0
;
void
rec_map
(
struct
cell
*
c
)
{
...
...
@@ -800,9 +800,18 @@ void space_map_cells_pre ( struct space *s , int full , void (*fun)( struct cell
}
/* Call the recursive function on all higher-level cells. */
#pragma omp parallel for schedule(dynamic,1)
for
(
i
=
0
;
i
<
s
->
nr_cells
;
i
++
)
rec_map
(
&
s
->
cells
[
i
]
);
#pragma omp parallel shared(s,cid)
{
int
mycid
;
while
(
1
)
{
#pragma omp critical
mycid
=
cid
++
;
if
(
mycid
<
s
->
nr_cells
)
rec_map
(
&
s
->
cells
[
i
]
);
else
break
;
}
}
}
...
...
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