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
e39f6a63
Commit
e39f6a63
authored
Jun 26, 2013
by
Pedro Gonnet
Browse files
set initial cell ownership relative to parts array.
Former-commit-id: 9afddac98ec7caa1d9087df5463f2ecd8546da35
parent
02379f18
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
e39f6a63
...
...
@@ -783,6 +783,7 @@ void engine_init ( struct engine *e , struct space *s , float dt , int nr_thread
/* Init the scheduler. */
scheduler_init
(
&
e
->
sched
,
e
->
s
,
nr_queues
,
scheduler_flag_steal
);
s
->
nr_queues
=
nr_queues
;
/* Append a kick1 task to each cell. */
scheduler_reset
(
&
e
->
sched
,
s
->
tot_cells
);
...
...
src/space.c
View file @
e39f6a63
...
...
@@ -686,10 +686,12 @@ void space_split ( struct space *s , struct cell *c ) {
if
(
c
->
progeny
[
k
]
->
maxdepth
>
maxdepth
)
maxdepth
=
c
->
progeny
[
k
]
->
maxdepth
;
}
c
->
h_max
=
h_max
;
c
->
dt_min
=
dt_min
;
c
->
dt_max
=
dt_max
;
c
->
maxdepth
=
maxdepth
;
/* Set the values for this cell. */
c
->
h_max
=
h_max
;
c
->
dt_min
=
dt_min
;
c
->
dt_max
=
dt_max
;
c
->
maxdepth
=
maxdepth
;
}
...
...
@@ -723,6 +725,9 @@ void space_split ( struct space *s , struct cell *c ) {
c
->
dt_max
=
dt_max
;
}
/* Set ownership accorind to the start of the parts array. */
c
->
owner
=
(
c
->
parts
-
s
->
parts
)
*
s
->
nr_queues
/
s
->
nr_parts
;
}
...
...
@@ -838,6 +843,7 @@ void space_init ( struct space *s , double dim[3] , struct part *parts , int N ,
s
->
nr_parts
=
N
;
s
->
parts
=
parts
;
s
->
cell_min
=
h_max
;
s
->
nr_queues
=
1
;
/* Allocate and link the xtra parts array. */
if
(
posix_memalign
(
(
void
*
)
&
s
->
xparts
,
32
,
N
*
sizeof
(
struct
xpart
)
)
!=
0
)
...
...
src/space.h
View file @
e39f6a63
...
...
@@ -93,6 +93,9 @@ struct space {
/* General-purpose lock for this space. */
lock_type
lock
;
/* Number of queues in the system. */
int
nr_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