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
e4adbf64
Commit
e4adbf64
authored
Nov 06, 2017
by
lhausamm
Committed by
Loic Hausammann
Oct 31, 2018
Browse files
Ensure size of the log
parent
602f8dcb
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/parameter_example.yml
View file @
e4adbf64
...
...
@@ -91,6 +91,7 @@ Snapshots:
output_list_on
:
0
# (Optional) Enable the output list
output_list
:
snaplist.txt
# (Optional) File containing the output times (see documentation in "Parameter File" section)
logger_max_steps
:
10
# (Optional) Number of particle steps between two chunk writing if using logger
logger_size
:
1e7
# buffer size of the logger file in bytes
# Parameters governing the conserved quantities statistics
Statistics
:
...
...
src/engine.c
View file @
e4adbf64
...
...
@@ -5461,6 +5461,7 @@ void engine_step(struct engine *e) {
((
double
)
e
->
total_nr_gparts
)
*
e
->
gravity_properties
->
rebuild_frequency
))
e
->
forcerebuild
=
1
;
#ifdef WITH_LOGGER
logger_log_timestamp
(
e
->
ti_old
,
&
e
->
logger_time_offset
,
e
->
logger_dump
);
...
...
@@ -6700,10 +6701,11 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
/* Logger params */
char
logger_name_file
[
PARSER_MAX_LINE_SIZE
];
e
->
logger_max_steps
=
parser_get_opt_param_int
(
params
,
"Snapshots:logger_max_steps"
,
10
);
parser_get_opt_param_string
(
params
,
"Snapshots:dump_file"
,
logger_name_file
,
e
->
snapshotBaseName
);
e
->
logger_size
=
parser_get_param_float
(
params
,
"Snapshots:logger_size"
);
strcpy
(
logger_name_file
,
e
->
snapshotBaseName
);
strcat
(
logger_name_file
,
".dump"
);
e
->
logger_dump
=
malloc
(
sizeof
(
struct
dump
));
dump_init
(
e
->
logger_dump
,
logger_name_file
,
1024
*
1024
*
100
);
dump_init
(
e
->
logger_dump
,
logger_name_file
,
e
->
logger_size
);
e
->
logger_time_offset
=
0
;
#endif
...
...
src/engine.h
View file @
e4adbf64
...
...
@@ -325,6 +325,10 @@ struct engine {
/* Need to dump a snapshot ? */
int
dump_snapshot
;
/* Size of the dump file */
int
logger_size
;
#endif
/* How many steps have we done with the same set of tasks? */
int
tasks_age
;
...
...
src/runner.c
View file @
e4adbf64
...
...
@@ -899,7 +899,7 @@ void runner_do_init_grav(struct runner *r, struct cell *c, int timer) {
* @param timer Are we timing this ?
*/
void
runner_do_extra_ghost
(
struct
runner
*
r
,
struct
cell
*
c
,
int
timer
)
{
#ifdef EXTRA_HYDRO_LOOP
struct
part
*
restrict
parts
=
c
->
hydro
.
parts
;
...
...
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