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
dea65855
Commit
dea65855
authored
Oct 29, 2018
by
Loic Hausammann
Browse files
Fix error formating and update a few logger functions
parent
ae1c3f5a
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/cell.h
View file @
dea65855
...
...
@@ -279,9 +279,6 @@ struct cell {
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float
h_max_old
;
/*! The task to compute time-steps */
struct
task
*
timestep
;
/*! Values of dx_max before the drifts, used for sub-cell tasks. */
float
dx_max_part_old
;
...
...
src/engine.c
View file @
dea65855
...
...
@@ -4257,7 +4257,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* logger tasks ? */
else
if
(
t
->
type
==
task_type_logger
)
{
if
(
cell_is_active_hydro
(
t
->
ci
,
e
)
||
cell_is_active_gravity
(
t
->
ci
,
e
))
if
(
cell_is_active_hydro
(
t
->
ci
,
e
)
||
cell_is_active_gravity
(
t
->
ci
,
e
)
||
cell_is_active_stars
(
t
->
ci
,
e
))
scheduler_activate
(
s
,
t
);
}
...
...
@@ -6513,16 +6514,31 @@ void engine_dump_index(struct engine *e) {
e
->
policy
&
engine_policy_self_gravity
);
/* Be verbose about this */
if
(
e
->
nodeID
==
0
)
message
(
"writing index at t=%e."
,
e
->
time
);
if
(
e
->
nodeID
==
0
)
{
if
(
e
->
policy
&
engine_policy_cosmology
)
message
(
"Writing index at a=%e"
,
exp
(
e
->
ti_current
*
e
->
time_base
)
*
e
->
cosmology
->
a_begin
);
else
message
(
"Writing index at t=%e"
,
e
->
ti_current
*
e
->
time_base
+
e
->
time_begin
);
}
#else
if
(
e
->
verbose
)
message
(
"writing index at t=%e."
,
e
->
time
);
if
(
e
->
verbose
)
{
if
(
e
->
policy
&
engine_policy_cosmology
)
message
(
"Writing index at a=%e"
,
exp
(
e
->
ti_current
*
e
->
time_base
)
*
e
->
cosmology
->
a_begin
);
else
message
(
"Writing index at t=%e"
,
e
->
ti_current
*
e
->
time_base
+
e
->
time_begin
);
}
#endif
/* Dump... */
write_index_single
(
e
,
e
->
log
->
base_name
,
e
->
internal_units
,
e
->
snapshot_units
);
e
->
dump_snapshot
=
0
;
/* Flag that we dumped a snapshot */
e
->
step_props
|=
engine_step_prop_snapshot
;
clocks_gettime
(
&
time2
);
if
(
e
->
verbose
)
...
...
src/engine.h
View file @
dea65855
...
...
@@ -317,9 +317,6 @@ struct engine {
struct
logger
*
log
;
#endif
/* Need to dump a snapshot ? */
int
dump_snapshot
;
/* How many steps have we done with the same set of tasks? */
int
tasks_age
;
...
...
src/task.c
View file @
dea65855
...
...
@@ -47,38 +47,18 @@
#include
"lock.h"
/* Task type names. */
const
char
*
taskID_names
[
task_type_count
]
=
{
"none"
,
"sort"
,
"self"
,
"pair"
,
"sub_self"
,
"sub_pair"
,
"init_grav"
,
"init_grav_out"
,
"ghost_in"
,
"ghost"
,
"ghost_out"
,
"extra_ghost"
,
"drift_part"
,
"drift_gpart"
,
"end_force"
,
"kick1"
,
"kick2"
,
"timestep"
,
"send"
,
"recv"
,
"grav_long_range"
,
"grav_mm"
,
"grav_down_in"
,
"grav_down"
,
"grav_mesh"
,
"cooling"
,
"star_formation"
,
"sourceterms"
,
"stars_ghost_in"
,
"stars_ghost"
,
"stars_ghost_out"
,
"logger"
};
const
char
*
taskID_names
[
task_type_count
]
=
{
"none"
,
"sort"
,
"self"
,
"pair"
,
"sub_self"
,
"sub_pair"
,
"init_grav"
,
"init_grav_out"
,
"ghost_in"
,
"ghost"
,
"ghost_out"
,
"extra_ghost"
,
"drift_part"
,
"drift_gpart"
,
"end_force"
,
"kick1"
,
"kick2"
,
"timestep"
,
"send"
,
"recv"
,
"grav_long_range"
,
"grav_mm"
,
"grav_down_in"
,
"grav_down"
,
"grav_mesh"
,
"cooling"
,
"star_formation"
,
"sourceterms"
,
"logger"
,
"stars_ghost_in"
,
"stars_ghost"
,
"stars_ghost_out"
};
/* Sub-task type names. */
const
char
*
subtaskID_names
[
task_subtype_count
]
=
{
...
...
@@ -325,8 +305,8 @@ void task_unlock(struct task *t) {
case
task_type_end_force
:
case
task_type_kick1
:
case
task_type_logger
:
case
task_type_kick2
:
case
task_type_logger
:
case
task_type_timestep
:
cell_unlocktree
(
ci
);
cell_gunlocktree
(
ci
);
...
...
src/task.h
View file @
dea65855
...
...
@@ -67,10 +67,10 @@ enum task_types {
task_type_cooling
,
task_type_star_formation
,
task_type_sourceterms
,
task_type_logger
,
task_type_stars_ghost_in
,
task_type_stars_ghost
,
task_type_stars_ghost_out
,
task_type_logger
,
task_type_count
}
__attribute__
((
packed
));
...
...
src/timers.c
View file @
dea65855
...
...
@@ -35,65 +35,67 @@
ticks
timers
[
timer_count
];
/* Timer names. */
const
char
*
timers_names
[
timer_count
]
=
{
"none"
,
"prepare"
,
"init"
,
"init_grav"
,
"drift_part"
,
"drift_gpart"
,
"kick1"
,
"kick2"
,
"timestep"
,
"endforce"
,
"dosort"
,
"doself_density"
,
"doself_gradient"
,
"doself_force"
,
"doself_grav_pp"
,
"dopair_density"
,
"dopair_gradient"
,
"dopair_force"
,
"dopair_grav_mm"
,
"dopair_grav_pp"
,
"dograv_external"
,
"dograv_down"
,
"dograv_mesh"
,
"dograv_top_level"
,
"dograv_long_range"
,
"dosource"
,
"dosub_self_density"
,
"dosub_self_gradient"
,
"dosub_self_force"
,
"dosub_self_grav"
,
"dosub_pair_density"
,
"dosub_pair_gradient"
,
"dosub_pair_force"
,
"dosub_pair_grav"
,
"doself_subset"
,
"dopair_subset"
,
"dopair_subset_naive"
,
"dosub_subset"
,
"do_ghost"
,
"do_extra_ghost"
,
"dorecv_part"
,
"dorecv_gpart"
,
"dorecv_spart"
,
"do_cooling"
,
"do_star_formation"
,
"gettask"
,
"qget"
,
"qsteal"
,
"locktree"
,
"runners"
,
"step"
,
"doself_stars_density"
,
"dopair_stars_density"
,
"do_stars_ghost"
,
"doself_subset_stars_density"
,
"dopair_subset_stars_density"
,
"dosubpair_stars_density"
,
"dosub_self_stars_density"
,
"logger"
};
const
char
*
timers_names
[
timer_count
]
=
{
"none"
,
"prepare"
,
"init"
,
"init_grav"
,
"drift_part"
,
"drift_gpart"
,
"kick1"
,
"kick2"
,
"timestep"
,
"endforce"
,
"dosort"
,
"doself_density"
,
"doself_gradient"
,
"doself_force"
,
"doself_grav_pp"
,
"dopair_density"
,
"dopair_gradient"
,
"dopair_force"
,
"dopair_grav_mm"
,
"dopair_grav_pp"
,
"dograv_external"
,
"dograv_down"
,
"dograv_mesh"
,
"dograv_top_level"
,
"dograv_long_range"
,
"dosource"
,
"dosub_self_density"
,
"dosub_self_gradient"
,
"dosub_self_force"
,
"dosub_self_grav"
,
"dosub_pair_density"
,
"dosub_pair_gradient"
,
"dosub_pair_force"
,
"dosub_pair_grav"
,
"doself_subset"
,
"dopair_subset"
,
"dopair_subset_naive"
,
"dosub_subset"
,
"do_ghost"
,
"do_extra_ghost"
,
"dorecv_part"
,
"dorecv_gpart"
,
"dorecv_spart"
,
"do_cooling"
,
"do_star_formation"
,
"gettask"
,
"qget"
,
"qsteal"
,
"locktree"
,
"runners"
,
"step"
,
"doself_stars_density"
,
"dopair_stars_density"
,
"do_stars_ghost"
,
"doself_subset_stars_density"
,
"dopair_subset_stars_density"
,
"dosubpair_stars_density"
,
"dosub_self_stars_density"
,
"logger"
,
};
/* File to store the timers */
static
FILE
*
timers_file
;
...
...
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