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
58533d22
Commit
58533d22
authored
Nov 06, 2017
by
lhausamm
Committed by
Loic Hausammann
Oct 31, 2018
Browse files
Remove bug when logger is disabled
parent
e4adbf64
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/engine.h
View file @
58533d22
...
...
@@ -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
;
...
...
src/logger.c
View file @
58533d22
...
...
@@ -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 */
src/logger.h
View file @
58533d22
...
...
@@ -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 */
src/runner.c
View file @
58533d22
...
...
@@ -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
}
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