Skip to content
Snippets Groups Projects
Commit 58533d22 authored by lhausamm's avatar lhausamm Committed by Loic Hausammann
Browse files

Remove bug when logger is disabled

parent e4adbf64
Branches
Tags
1 merge request!502Logger
......@@ -322,13 +322,13 @@ struct engine {
/* timestamp offset for logger*/
size_t logger_time_offset;
/* Need to dump a snapshot ? */
int dump_snapshot;
/* Size of the dump file */
int logger_size;
#endif
/* Need to dump a snapshot ? */
int dump_snapshot;
/* How many steps have we done with the same set of tasks? */
int tasks_age;
......
......@@ -21,6 +21,7 @@
#include "../config.h"
#ifdef HAVE_POSIX_FALLOCATE /* Are we on a sensible platform? */
#ifdef WITH_LOGGER
/* Some standard headers. */
#include <stdint.h>
......@@ -432,4 +433,7 @@ int logger_read_timestamp(unsigned long long int *t, size_t *offset,
return mask;
}
#endif /* WITH_LOGGER */
#endif /* HAVE_POSIX_FALLOCATE */
......@@ -19,6 +19,8 @@
#ifndef SWIFT_LOGGER_H
#define SWIFT_LOGGER_H
#ifdef WITH_LOGGER
/* Includes. */
#include "part.h"
#include "units.h"
......@@ -130,4 +132,6 @@ __attribute__((always_inline)) INLINE static int spart_should_write(
return (sp->last_output > e->logger_max_steps);
}
#endif /* WITH_LOGGER */
#endif /* SWIFT_LOGGER_H */
......@@ -2704,6 +2704,7 @@ void *runner_main(void *data) {
*/
void runner_do_logger(struct runner *r, struct cell *c, int timer) {
#ifdef WITH_LOGGER
const struct engine *e = r->e;
struct part *restrict parts = c->parts;
struct xpart *restrict xparts = c->xparts;
......@@ -2779,4 +2780,9 @@ void runner_do_logger(struct runner *r, struct cell *c, int timer) {
}
if (timer) TIMER_TOC(timer_logger);
#else
error("Logger disabled, please enable it during configuration");
#endif
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment