Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
ec6a47c9
Commit
ec6a47c9
authored
Feb 12, 2017
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Reduce the rebuild flag accross all nodes.
parent
4a6150af
No related branches found
No related tags found
1 merge request
!314
Timestep order
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cell.c
+3
-8
3 additions, 8 deletions
src/cell.c
src/engine.c
+11
-5
11 additions, 5 deletions
src/engine.c
with
14 additions
and
13 deletions
src/cell.c
+
3
−
8
View file @
ec6a47c9
...
@@ -912,10 +912,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -912,10 +912,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
struct
engine
*
e
=
s
->
space
->
e
;
struct
engine
*
e
=
s
->
space
->
e
;
#endif
#endif
//message("unskip! c=%p c->kick1=%p c->drift=%p", c, c->kick1, c->drift);
int
rebuild
=
0
;
//task_print(c->drift);
int
ret
=
0
;
/* Un-skip the density tasks involved with this cell. */
/* Un-skip the density tasks involved with this cell. */
for
(
struct
link
*
l
=
c
->
density
;
l
!=
NULL
;
l
=
l
->
next
)
{
for
(
struct
link
*
l
=
c
->
density
;
l
!=
NULL
;
l
=
l
->
next
)
{
...
@@ -942,7 +939,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -942,7 +939,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
(
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max
+
cj
->
dx_max
>
cj
->
dmin
||
(
max
(
ci
->
h_max
,
cj
->
h_max
)
+
ci
->
dx_max
+
cj
->
dx_max
>
cj
->
dmin
||
ci
->
dx_max
>
space_maxreldx
*
ci
->
h_max
||
ci
->
dx_max
>
space_maxreldx
*
ci
->
h_max
||
cj
->
dx_max
>
space_maxreldx
*
cj
->
h_max
))
cj
->
dx_max
>
space_maxreldx
*
cj
->
h_max
))
re
t
=
1
;
re
build
=
1
;
#ifdef WITH_MPI
#ifdef WITH_MPI
/* Activate the send/recv flags. */
/* Activate the send/recv flags. */
...
@@ -1039,9 +1036,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -1039,9 +1036,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
if
(
c
->
cooling
!=
NULL
)
scheduler_activate
(
s
,
c
->
cooling
);
if
(
c
->
cooling
!=
NULL
)
scheduler_activate
(
s
,
c
->
cooling
);
if
(
c
->
sourceterms
!=
NULL
)
scheduler_activate
(
s
,
c
->
sourceterms
);
if
(
c
->
sourceterms
!=
NULL
)
scheduler_activate
(
s
,
c
->
sourceterms
);
//task_print(c->drift);
return
rebuild
;
return
ret
;
}
}
/**
/**
...
...
...
...
This diff is collapsed.
Click to expand it.
src/engine.c
+
11
−
5
View file @
ec6a47c9
...
@@ -2612,8 +2612,6 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
...
@@ -2612,8 +2612,6 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
engine_rebuild
(
e
);
engine_rebuild
(
e
);
// engine_prepare(e);
engine_marktasks
(
e
);
engine_marktasks
(
e
);
/* No time integration. We just want the density and ghosts */
/* No time integration. We just want the density and ghosts */
...
@@ -2726,8 +2724,6 @@ void engine_step(struct engine *e) {
...
@@ -2726,8 +2724,6 @@ void engine_step(struct engine *e) {
/* Prepare the tasks to be launched. */
/* Prepare the tasks to be launched. */
engine_prepare
(
e
);
engine_prepare
(
e
);
if
(
e
->
step
==
1
)
e
->
forcerebuild
=
1
;
/* Print the number of active tasks ? */
/* Print the number of active tasks ? */
if
(
e
->
verbose
)
engine_print_task_counts
(
e
);
if
(
e
->
verbose
)
engine_print_task_counts
(
e
);
...
@@ -2742,6 +2738,17 @@ void engine_step(struct engine *e) {
...
@@ -2742,6 +2738,17 @@ void engine_step(struct engine *e) {
engine_launch
(
e
,
e
->
nr_threads
);
engine_launch
(
e
,
e
->
nr_threads
);
TIMER_TOC
(
timer_runners
);
TIMER_TOC
(
timer_runners
);
/* Collect the values of rebuild from all nodes. */
#ifdef WITH_MPI
int
buff
=
0
;
if
(
MPI_Allreduce
(
&
e
->
forcerebuild
,
&
buff
,
1
,
MPI_INT
,
MPI_MAX
,
MPI_COMM_WORLD
)
!=
MPI_SUCCESS
)
error
(
"Failed to aggregate the rebuild flag across nodes."
);
e
->
forcerebuild
=
buff
;
#endif
/* Do we want a snapshot? */
if
(
e
->
ti_end_min
>=
e
->
ti_nextSnapshot
&&
e
->
ti_nextSnapshot
>
0
)
if
(
e
->
ti_end_min
>=
e
->
ti_nextSnapshot
&&
e
->
ti_nextSnapshot
>
0
)
e
->
dump_snapshot
=
1
;
e
->
dump_snapshot
=
1
;
...
@@ -2762,7 +2769,6 @@ void engine_step(struct engine *e) {
...
@@ -2762,7 +2769,6 @@ void engine_step(struct engine *e) {
message
(
"snap=%d, rebuild=%d repart=%d"
,
e
->
dump_snapshot
,
e
->
forcerebuild
,
message
(
"snap=%d, rebuild=%d repart=%d"
,
e
->
dump_snapshot
,
e
->
forcerebuild
,
e
->
forcerepart
);
e
->
forcerepart
);
/* Write a snapshot ? */
/* Write a snapshot ? */
if
(
e
->
dump_snapshot
)
{
if
(
e
->
dump_snapshot
)
{
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment