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 {
/*! 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;
......
......@@ -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)
......
......@@ -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;
......
......@@ -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);
......
......@@ -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));
......
......@@ -35,7 +35,8 @@
ticks timers[timer_count];
/* Timer names. */
const char* timers_names[timer_count] = {"none",
const char* timers_names[timer_count] = {
"none",
"prepare",
"init",
"init_grav",
......@@ -93,7 +94,8 @@ const char* timers_names[timer_count] = {"none",
"dopair_subset_stars_density",
"dosubpair_stars_density",
"dosub_self_stars_density",
"logger"};
"logger",
};
/* File to store the timers */
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