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
be6e65aa
Commit
be6e65aa
authored
May 26, 2017
by
Pedro Gonnet
Browse files
minor fixes here and there, compiles now.
parent
b4ff16e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
be6e65aa
...
...
@@ -1325,10 +1325,10 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
const
integertime_t
ti_current
=
e
->
ti_current
;
/* Store the current dx_max and h_max values. */
ci
->
dx_max_old
=
ci
->
dx_max
;
ci
->
dx_max_old
=
ci
->
dx_max
_part
;
ci
->
h_max_old
=
ci
->
h_max
;
if
(
cj
!=
NULL
)
{
cj
->
dx_max_old
=
cj
->
dx_max
;
cj
->
dx_max_old
=
cj
->
dx_max
_part
;
cj
->
h_max_old
=
cj
->
h_max
;
}
...
...
@@ -1348,7 +1348,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
}
/* Activate drift task, if it is present. */
if
(
ci
->
drift
!=
NULL
)
scheduler_activate
(
s
,
ci
->
drift
);
if
(
ci
->
drift
_part
!=
NULL
)
scheduler_activate
(
s
,
ci
->
drift
_part
);
}
}
...
...
@@ -1579,8 +1579,8 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
atomic_or
(
&
cj
->
sorts
->
flags
,
(
1
<<
sid
));
/* Activate the drifts if the cells are local. */
if
(
ci
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
ci
->
drift
);
if
(
cj
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
cj
->
drift
);
if
(
ci
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
ci
->
drift
_part
);
if
(
cj
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
cj
->
drift
_part
);
if
(
ci
->
dx_max_sort
>
space_maxreldx
*
ci
->
dmin
)
{
for
(
struct
cell
*
finger
=
ci
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
{
...
...
src/engine.c
View file @
be6e65aa
...
...
@@ -1892,12 +1892,13 @@ void engine_count_and_link_tasks(struct engine *e) {
else
if
(
t
->
type
==
task_type_drift_part
)
{
for
(
struct
cell
*
finger
=
t
->
ci
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
if
(
finger
->
drift_part
!=
NULL
)
scheduler_addunlock
(
sched
,
t
,
finger
->
drift_part
);
}
else
if
(
t
->
type
==
task_type_drift_gpart
)
{
if
(
finger
->
drift_part
!=
NULL
)
scheduler_addunlock
(
sched
,
t
,
finger
->
drift_part
);
}
else
if
(
t
->
type
==
task_type_drift_gpart
)
{
for
(
struct
cell
*
finger
=
t
->
ci
->
parent
;
finger
!=
NULL
;
finger
=
finger
->
parent
)
if
(
finger
->
drift_gpart
!=
NULL
)
scheduler_addunlock
(
sched
,
t
,
finger
->
drift_gpart
);
if
(
finger
->
drift_gpart
!=
NULL
)
scheduler_addunlock
(
sched
,
t
,
finger
->
drift_gpart
);
}
/* Link self tasks to cells. */
...
...
@@ -2568,7 +2569,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
if
(
t
->
subtype
!=
task_subtype_density
)
continue
;
/* Too much particle movement? */
if
(
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max
+
cj
->
dx_max
>
cj
->
dmin
)
if
(
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max_part
+
cj
->
dx_max_part
>
cj
->
dmin
)
*
rebuild_space
=
1
;
/* Set the correct sorting flags */
...
...
@@ -2594,7 +2596,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
error
(
"bad flags in sort task."
);
#endif
scheduler_activate
(
s
,
ci
->
sorts
);
if
(
ci
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
ci
->
drift
);
if
(
ci
->
nodeID
==
engine_rank
)
scheduler_activate
(
s
,
ci
->
drift
_part
);
}
if
(
cj
->
dx_max_sort
>
space_maxreldx
*
cj
->
dmin
)
{
for
(
struct
cell
*
finger
=
cj
;
finger
!=
NULL
;
...
...
@@ -3203,7 +3205,7 @@ void engine_skip_drift(struct engine *e) {
struct
task
*
t
=
&
tasks
[
i
];
/* Skip everything that updates the particles */
if
(
t
->
type
==
task_type_drift
)
t
->
skip
=
1
;
if
(
t
->
type
==
task_type_drift
_part
)
t
->
skip
=
1
;
}
}
...
...
src/scheduler.c
View file @
be6e65aa
...
...
@@ -132,9 +132,9 @@ void scheduler_add_subcell_tasks(struct scheduler *s, struct cell *c,
lock_lock
(
&
c
->
lock
);
/* Add a drift task if not present. */
if
(
c
->
drift
==
NULL
)
c
->
drift
=
scheduler_addtask
(
s
,
task_type_drift
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
if
(
c
->
drift
_part
==
NULL
)
c
->
drift
_part
=
scheduler_addtask
(
s
,
task_type_drift_part
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
/* Add a sort task if not present. Note that the sort flags will be
populated in cell_activate_subcell_tasks. */
...
...
@@ -147,7 +147,7 @@ void scheduler_add_subcell_tasks(struct scheduler *s, struct cell *c,
lock_unlock_blind
(
&
c
->
lock
);
/* The provided task should depend on both the drift and the sort. */
scheduler_addunlock
(
s
,
c
->
drift
,
t
);
scheduler_addunlock
(
s
,
c
->
drift
_part
,
t
);
scheduler_addunlock
(
s
,
c
->
sorts
,
t
);
}
...
...
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