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
c3277aea
Commit
c3277aea
authored
Oct 22, 2019
by
Matthieu Schaller
Browse files
Changed the name of the time-step limiter policy. Added a time-step synchronization policy.
parent
0fd1bbd4
Changes
8
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
c3277aea
...
...
@@ -163,7 +163,8 @@ int main(int argc, char *argv[]) {
int
with_star_formation
=
0
;
int
with_feedback
=
0
;
int
with_black_holes
=
0
;
int
with_limiter
=
0
;
int
with_timestep_limiter
=
0
;
int
with_timestep_sync
=
0
;
int
with_fp_exceptions
=
0
;
int
with_drift_all
=
0
;
int
with_mpole_reconstruction
=
0
;
...
...
@@ -219,7 +220,9 @@ int main(int argc, char *argv[]) {
NULL
,
0
,
0
),
OPT_BOOLEAN
(
'x'
,
"velociraptor"
,
&
with_structure_finding
,
"Run with structure finding."
,
NULL
,
0
,
0
),
OPT_BOOLEAN
(
0
,
"limiter"
,
&
with_limiter
,
"Run with time-step limiter."
,
OPT_BOOLEAN
(
0
,
"limiter"
,
&
with_timestep_limiter
,
"Run with time-step limiter."
,
NULL
,
0
,
0
),
OPT_BOOLEAN
(
0
,
"sync"
,
&
with_timestep_sync
,
"Run with time-step sync."
,
NULL
,
0
,
0
),
OPT_GROUP
(
" Control options:
\n
"
),
...
...
@@ -555,7 +558,8 @@ int main(int argc, char *argv[]) {
#ifdef WITH_MPI
if
(
with_mpole_reconstruction
&&
nr_nodes
>
1
)
error
(
"Cannot reconstruct m-poles every step over MPI (yet)."
);
if
(
with_limiter
)
error
(
"Can't run with time-step limiter over MPI (yet)"
);
if
(
with_timestep_limiter
)
error
(
"Can't run with time-step limiter over MPI (yet)"
);
#ifdef WITH_LOGGER
error
(
"Can't run with the particle logger over MPI (yet)"
);
#endif
...
...
@@ -1105,7 +1109,9 @@ int main(int argc, char *argv[]) {
engine_policies
|=
engine_policy_external_gravity
;
if
(
with_cosmology
)
engine_policies
|=
engine_policy_cosmology
;
if
(
with_temperature
)
engine_policies
|=
engine_policy_temperature
;
if
(
with_limiter
)
engine_policies
|=
engine_policy_limiter
;
if
(
with_timestep_limiter
)
engine_policies
|=
engine_policy_timestep_limiter
;
if
(
with_timestep_sync
)
engine_policies
|=
engine_policy_timestep_sync
;
if
(
with_cooling
)
engine_policies
|=
engine_policy_cooling
;
if
(
with_stars
)
engine_policies
|=
engine_policy_stars
;
if
(
with_star_formation
)
engine_policies
|=
engine_policy_star_formation
;
...
...
src/cell.c
View file @
c3277aea
...
...
@@ -2915,7 +2915,7 @@ void cell_activate_stars_sorts(struct cell *c, int sid, struct scheduler *s) {
void
cell_activate_subcell_hydro_tasks
(
struct
cell
*
ci
,
struct
cell
*
cj
,
struct
scheduler
*
s
)
{
const
struct
engine
*
e
=
s
->
space
->
e
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
/* Store the current dx_max and h_max values. */
ci
->
hydro
.
dx_max_part_old
=
ci
->
hydro
.
dx_max_part
;
...
...
@@ -3011,7 +3011,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
struct
scheduler
*
s
,
const
int
with_star_formation
)
{
const
struct
engine
*
e
=
s
->
space
->
e
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
/* Store the current dx_max and h_max values. */
ci
->
stars
.
dx_max_part_old
=
ci
->
stars
.
dx_max_part
;
...
...
@@ -3381,7 +3381,7 @@ void cell_activate_subcell_external_grav_tasks(struct cell *ci,
int
cell_unskip_hydro_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
)
{
struct
engine
*
e
=
s
->
space
->
e
;
const
int
nodeID
=
e
->
nodeID
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
#ifdef WITH_MPI
const
int
with_star_formation
=
e
->
policy
&
engine_policy_star_formation
;
...
...
@@ -3787,7 +3787,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
const
int
with_star_formation
)
{
struct
engine
*
e
=
s
->
space
->
e
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
const
int
nodeID
=
e
->
nodeID
;
int
rebuild
=
0
;
...
...
src/engine.c
View file @
c3277aea
...
...
@@ -117,7 +117,8 @@ const char *engine_policy_names[] = {"none",
"feedback"
,
"black holes"
,
"fof search"
,
"time-step limiter"
};
"time-step limiter"
,
"time-step sync"
};
/** The rank of the engine as a global variable (for messages). */
int
engine_rank
;
...
...
@@ -1353,7 +1354,7 @@ int engine_estimate_nr_tasks(const struct engine *e) {
#endif
#endif
}
if
(
e
->
policy
&
engine_policy_limiter
)
{
if
(
e
->
policy
&
engine_policy_
timestep_
limiter
)
{
n1
+=
18
;
n2
+=
1
;
}
...
...
src/engine.h
View file @
c3277aea
...
...
@@ -79,9 +79,10 @@ enum engine_policy {
engine_policy_feedback
=
(
1
<<
18
),
engine_policy_black_holes
=
(
1
<<
19
),
engine_policy_fof
=
(
1
<<
20
),
engine_policy_limiter
=
(
1
<<
21
)
engine_policy_timestep_limiter
=
(
1
<<
21
),
engine_policy_timestep_sync
=
(
1
<<
22
)
};
#define engine_maxpolicy 2
2
#define engine_maxpolicy 2
3
extern
const
char
*
engine_policy_names
[
engine_maxpolicy
+
1
];
/**
...
...
src/engine_maketasks.c
View file @
c3277aea
...
...
@@ -792,7 +792,7 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
struct
scheduler
*
s
=
&
e
->
sched
;
const
int
with_star_formation
=
(
e
->
policy
&
engine_policy_star_formation
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
/* Are we at the top-level? */
if
(
c
->
top
==
c
&&
c
->
nodeID
==
e
->
nodeID
)
{
...
...
@@ -1023,7 +1023,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
const
int
with_cooling
=
(
e
->
policy
&
engine_policy_cooling
);
const
int
with_star_formation
=
(
e
->
policy
&
engine_policy_star_formation
);
const
int
with_black_holes
=
(
e
->
policy
&
engine_policy_black_holes
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
/* Are we are the level where we create the stars' resort tasks?
* If the tree is shallow, we need to do this at the super-level if the
...
...
@@ -1809,7 +1809,7 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
struct
scheduler
*
sched
=
&
e
->
sched
;
const
int
nodeID
=
e
->
nodeID
;
const
int
with_cooling
=
(
e
->
policy
&
engine_policy_cooling
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_
timestep_
limiter
);
const
int
with_feedback
=
(
e
->
policy
&
engine_policy_feedback
);
const
int
with_black_holes
=
(
e
->
policy
&
engine_policy_black_holes
);
#ifdef EXTRA_HYDRO_LOOP
...
...
src/engine_marktasks.c
View file @
c3277aea
...
...
@@ -69,7 +69,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
struct
scheduler
*
s
=
(
struct
scheduler
*
)(((
size_t
*
)
extra_data
)[
2
]);
struct
engine
*
e
=
(
struct
engine
*
)((
size_t
*
)
extra_data
)[
0
];
const
int
nodeID
=
e
->
nodeID
;
const
int
with_limiter
=
e
->
policy
&
engine_policy_limiter
;
const
int
with_limiter
=
e
->
policy
&
engine_policy_
timestep_
limiter
;
const
int
with_star_formation
=
e
->
policy
&
engine_policy_star_formation
;
#ifdef WITH_MPI
const
int
with_feedback
=
e
->
policy
&
engine_policy_feedback
;
...
...
src/space.c
View file @
c3277aea
...
...
@@ -5347,7 +5347,7 @@ void space_check_limiter_mapper(void *map_data, int nr_parts,
/* Unpack the data */
struct
part
*
restrict
parts
=
(
struct
part
*
)
map_data
;
const
struct
space
*
s
=
(
struct
space
*
)
extra_data
;
const
int
with_limiter
=
(
s
->
e
->
policy
&
engine_policy_limiter
);
const
int
with_limiter
=
(
s
->
e
->
policy
&
engine_policy_
timestep_
limiter
);
/* Verify that all limited particles have been treated */
for
(
int
k
=
0
;
k
<
nr_parts
;
k
++
)
{
...
...
src/timeline.h
View file @
c3277aea
...
...
@@ -53,7 +53,6 @@ typedef int8_t timebin_t;
/* Maximal difference in time-bins between neighbouring particles */
#define time_bin_neighbour_max_delta_bin 2
/**
* @brief Returns the integer time interval corresponding to a time bin
*
...
...
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