Commit 58533d22 authored by lhausamm's avatar lhausamm Committed by Loic Hausammann
Browse files

Remove bug when logger is disabled

parent e4adbf64
...@@ -322,13 +322,13 @@ struct engine { ...@@ -322,13 +322,13 @@ struct engine {
/* timestamp offset for logger*/ /* timestamp offset for logger*/
size_t logger_time_offset; size_t logger_time_offset;
/* Need to dump a snapshot ? */
int dump_snapshot;
/* Size of the dump file */ /* Size of the dump file */
int logger_size; int logger_size;
#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;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "../config.h" #include "../config.h"
#ifdef HAVE_POSIX_FALLOCATE /* Are we on a sensible platform? */ #ifdef HAVE_POSIX_FALLOCATE /* Are we on a sensible platform? */
#ifdef WITH_LOGGER
/* Some standard headers. */ /* Some standard headers. */
#include <stdint.h> #include <stdint.h>
...@@ -432,4 +433,7 @@ int logger_read_timestamp(unsigned long long int *t, size_t *offset, ...@@ -432,4 +433,7 @@ int logger_read_timestamp(unsigned long long int *t, size_t *offset,
return mask; return mask;
} }
#endif /* WITH_LOGGER */
#endif /* HAVE_POSIX_FALLOCATE */ #endif /* HAVE_POSIX_FALLOCATE */
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef SWIFT_LOGGER_H #ifndef SWIFT_LOGGER_H
#define SWIFT_LOGGER_H #define SWIFT_LOGGER_H
#ifdef WITH_LOGGER
/* Includes. */ /* Includes. */
#include "part.h" #include "part.h"
#include "units.h" #include "units.h"
...@@ -130,4 +132,6 @@ __attribute__((always_inline)) INLINE static int spart_should_write( ...@@ -130,4 +132,6 @@ __attribute__((always_inline)) INLINE static int spart_should_write(
return (sp->last_output > e->logger_max_steps); return (sp->last_output > e->logger_max_steps);
} }
#endif /* WITH_LOGGER */
#endif /* SWIFT_LOGGER_H */ #endif /* SWIFT_LOGGER_H */
...@@ -2704,6 +2704,7 @@ void *runner_main(void *data) { ...@@ -2704,6 +2704,7 @@ void *runner_main(void *data) {
*/ */
void runner_do_logger(struct runner *r, struct cell *c, int timer) { void runner_do_logger(struct runner *r, struct cell *c, int timer) {
#ifdef WITH_LOGGER
const struct engine *e = r->e; const struct engine *e = r->e;
struct part *restrict parts = c->parts; struct part *restrict parts = c->parts;
struct xpart *restrict xparts = c->xparts; struct xpart *restrict xparts = c->xparts;
...@@ -2779,4 +2780,9 @@ void runner_do_logger(struct runner *r, struct cell *c, int timer) { ...@@ -2779,4 +2780,9 @@ void runner_do_logger(struct runner *r, struct cell *c, int timer) {
} }
if (timer) TIMER_TOC(timer_logger); if (timer) TIMER_TOC(timer_logger);
#else
error("Logger disabled, please enable it during configuration");
#endif
} }
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