Commit dea65855 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Fix error formating and update a few logger functions

parent ae1c3f5a
...@@ -279,9 +279,6 @@ struct cell { ...@@ -279,9 +279,6 @@ struct cell {
/*! Values of h_max before the drifts, used for sub-cell tasks. */ /*! Values of h_max before the drifts, used for sub-cell tasks. */
float h_max_old; 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. */ /*! Values of dx_max before the drifts, used for sub-cell tasks. */
float dx_max_part_old; float dx_max_part_old;
......
...@@ -4257,7 +4257,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements, ...@@ -4257,7 +4257,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* logger tasks ? */ /* logger tasks ? */
else if (t->type == task_type_logger) { 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); scheduler_activate(s, t);
} }
...@@ -6513,16 +6514,31 @@ void engine_dump_index(struct engine *e) { ...@@ -6513,16 +6514,31 @@ void engine_dump_index(struct engine *e) {
e->policy & engine_policy_self_gravity); e->policy & engine_policy_self_gravity);
/* Be verbose about this */ /* 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 #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 #endif
/* Dump... */ /* Dump... */
write_index_single(e, e->log->base_name, e->internal_units, write_index_single(e, e->log->base_name, e->internal_units,
e->snapshot_units); e->snapshot_units);
e->dump_snapshot = 0; /* Flag that we dumped a snapshot */
e->step_props |= engine_step_prop_snapshot;
clocks_gettime(&time2); clocks_gettime(&time2);
if (e->verbose) if (e->verbose)
......
...@@ -317,9 +317,6 @@ struct engine { ...@@ -317,9 +317,6 @@ struct engine {
struct logger *log; struct logger *log;
#endif #endif
/* Need to dump a snapshot ? */
int dump_snapshot;
/* How many steps have we done with the same set of tasks? */ /* How many steps have we done with the same set of tasks? */
int tasks_age; int tasks_age;
......
...@@ -47,38 +47,18 @@ ...@@ -47,38 +47,18 @@
#include "lock.h" #include "lock.h"
/* Task type names. */ /* Task type names. */
const char *taskID_names[task_type_count] = {"none", const char *taskID_names[task_type_count] = {
"sort", "none", "sort", "self",
"self", "pair", "sub_self", "sub_pair",
"pair", "init_grav", "init_grav_out", "ghost_in",
"sub_self", "ghost", "ghost_out", "extra_ghost",
"sub_pair", "drift_part", "drift_gpart", "end_force",
"init_grav", "kick1", "kick2", "timestep",
"init_grav_out", "send", "recv", "grav_long_range",
"ghost_in", "grav_mm", "grav_down_in", "grav_down",
"ghost", "grav_mesh", "cooling", "star_formation",
"ghost_out", "sourceterms", "logger", "stars_ghost_in",
"extra_ghost", "stars_ghost", "stars_ghost_out"};
"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"};
/* Sub-task type names. */ /* Sub-task type names. */
const char *subtaskID_names[task_subtype_count] = { const char *subtaskID_names[task_subtype_count] = {
...@@ -325,8 +305,8 @@ void task_unlock(struct task *t) { ...@@ -325,8 +305,8 @@ void task_unlock(struct task *t) {
case task_type_end_force: case task_type_end_force:
case task_type_kick1: case task_type_kick1:
case task_type_logger:
case task_type_kick2: case task_type_kick2:
case task_type_logger:
case task_type_timestep: case task_type_timestep:
cell_unlocktree(ci); cell_unlocktree(ci);
cell_gunlocktree(ci); cell_gunlocktree(ci);
......
...@@ -67,10 +67,10 @@ enum task_types { ...@@ -67,10 +67,10 @@ enum task_types {
task_type_cooling, task_type_cooling,
task_type_star_formation, task_type_star_formation,
task_type_sourceterms, task_type_sourceterms,
task_type_logger,
task_type_stars_ghost_in, task_type_stars_ghost_in,
task_type_stars_ghost, task_type_stars_ghost,
task_type_stars_ghost_out, task_type_stars_ghost_out,
task_type_logger,
task_type_count task_type_count
} __attribute__((packed)); } __attribute__((packed));
......
...@@ -35,65 +35,67 @@ ...@@ -35,65 +35,67 @@
ticks timers[timer_count]; ticks timers[timer_count];
/* Timer names. */ /* Timer names. */
const char* timers_names[timer_count] = {"none", const char* timers_names[timer_count] = {
"prepare", "none",
"init", "prepare",
"init_grav", "init",
"drift_part", "init_grav",
"drift_gpart", "drift_part",
"kick1", "drift_gpart",
"kick2", "kick1",
"timestep", "kick2",
"endforce", "timestep",
"dosort", "endforce",
"doself_density", "dosort",
"doself_gradient", "doself_density",
"doself_force", "doself_gradient",
"doself_grav_pp", "doself_force",
"dopair_density", "doself_grav_pp",
"dopair_gradient", "dopair_density",
"dopair_force", "dopair_gradient",
"dopair_grav_mm", "dopair_force",
"dopair_grav_pp", "dopair_grav_mm",
"dograv_external", "dopair_grav_pp",
"dograv_down", "dograv_external",
"dograv_mesh", "dograv_down",
"dograv_top_level", "dograv_mesh",
"dograv_long_range", "dograv_top_level",
"dosource", "dograv_long_range",
"dosub_self_density", "dosource",
"dosub_self_gradient", "dosub_self_density",
"dosub_self_force", "dosub_self_gradient",
"dosub_self_grav", "dosub_self_force",
"dosub_pair_density", "dosub_self_grav",
"dosub_pair_gradient", "dosub_pair_density",
"dosub_pair_force", "dosub_pair_gradient",
"dosub_pair_grav", "dosub_pair_force",
"doself_subset", "dosub_pair_grav",
"dopair_subset", "doself_subset",
"dopair_subset_naive", "dopair_subset",
"dosub_subset", "dopair_subset_naive",
"do_ghost", "dosub_subset",
"do_extra_ghost", "do_ghost",
"dorecv_part", "do_extra_ghost",
"dorecv_gpart", "dorecv_part",
"dorecv_spart", "dorecv_gpart",
"do_cooling", "dorecv_spart",
"do_star_formation", "do_cooling",
"gettask", "do_star_formation",
"qget", "gettask",
"qsteal", "qget",
"locktree", "qsteal",
"runners", "locktree",
"step", "runners",
"doself_stars_density", "step",
"dopair_stars_density", "doself_stars_density",
"do_stars_ghost", "dopair_stars_density",
"doself_subset_stars_density", "do_stars_ghost",
"dopair_subset_stars_density", "doself_subset_stars_density",
"dosubpair_stars_density", "dopair_subset_stars_density",
"dosub_self_stars_density", "dosubpair_stars_density",
"logger"}; "dosub_self_stars_density",
"logger",
};
/* File to store the timers */ /* File to store the timers */
static FILE* timers_file; static FILE* timers_file;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment