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
a8ca16e0
Commit
a8ca16e0
authored
May 25, 2018
by
lhausamm
Committed by
Loic Hausammann
Oct 31, 2018
Browse files
Modifications done outside logger
parent
11db740c
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
a8ca16e0
...
...
@@ -5214,8 +5214,8 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
space_init_sparts
(
s
,
e
->
verbose
);
#ifdef WITH_LOGGER
logger_
write
_timestamp
(
e
->
log
);
logger_ensure_size
(
e
->
total_nr_parts
,
e
->
log
ger_
buffer_size
);
logger_
log
_timestamp
(
e
->
log
,
e
->
ti_current
,
&
e
->
log
->
timestamp_offset
);
logger_ensure_size
(
e
->
total_nr_parts
,
e
->
log
->
buffer_size
);
#endif
/* Now, launch the calculation */
...
...
@@ -6518,7 +6518,7 @@ void engine_dump_index(struct engine *e) {
#endif
/* Dump... */
write_index_single
(
e
,
e
->
log
gerB
ase
N
ame
,
e
->
internal_units
,
write_index_single
(
e
,
e
->
log
->
b
ase
_n
ame
,
e
->
internal_units
,
e
->
snapshotUnits
);
e
->
dump_snapshot
=
0
;
...
...
@@ -6700,7 +6700,7 @@ void engine_init(struct engine *e, struct space *s, struct swift_params *params,
#if defined(WITH_LOGGER)
e
->
log
=
(
struct
logger
*
)
malloc
(
sizeof
(
struct
logger
));
logger_init
(
e
->
log
);
logger_init
(
e
->
log
,
params
);
#endif
/* Make the space link back to the engine. */
...
...
@@ -7310,7 +7310,7 @@ void engine_config(int restart, struct engine *e, struct swift_params *params,
}
#ifdef WITH_LOGGER
logger_write_file_header
(
e
->
log
ger_
dump
,
e
);
logger_write_file_header
(
e
->
log
->
dump
,
e
);
#endif
/* Free the affinity stuff */
...
...
src/hydro/Gadget2/hydro_io.h
View file @
a8ca16e0
...
...
@@ -199,7 +199,8 @@ INLINE static void hydro_write_particles(const struct part* parts,
* In this version, we only want the ids and the offset.
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_write_index
(
struct
part
*
parts
,
struct
io_props
*
list
,
const
struct
part
*
parts
,
const
struct
xpart
*
xparts
,
struct
io_props
*
list
,
int
*
num_fields
)
{
#ifdef WITH_LOGGER
...
...
@@ -210,7 +211,7 @@ __attribute__((always_inline)) INLINE static void hydro_write_index(
UNIT_CONV_NO_UNITS
,
parts
,
id
);
list
[
1
]
=
io_make_output_field
(
"Offset"
,
ULONGLONG
,
1
,
UNIT_CONV_NO_UNITS
,
parts
,
last_offset
);
UNIT_CONV_NO_UNITS
,
x
parts
,
logger
.
last_offset
);
#else
error
(
"Cannot write index without logger"
);
#endif
...
...
src/logger.c
View file @
a8ca16e0
...
...
@@ -396,7 +396,7 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts) {
*
* @param log The #logger
*/
void
logger_init
(
struct
logger
*
log
)
{
void
logger_init
(
struct
logger
*
log
,
struct
swift_params
*
params
)
{
/* read parameters */
log
->
delta_step
=
parser_get_param_int
(
params
,
"Logger:delta_step"
);
log
->
buffer_size
=
parser_get_param_float
(
params
,
"Logger:mmaped_buffer_size"
)
*
1e9
;
...
...
src/logger.h
View file @
a8ca16e0
...
...
@@ -128,8 +128,9 @@ void logger_log_part(const struct part *p, const unsigned int mask, size_t *offs
struct
dump
*
dump
);
void
logger_log_gpart
(
const
struct
gpart
*
p
,
const
unsigned
int
mask
,
size_t
*
offset
,
struct
dump
*
dump
);
void
logger_log_timestamp
(
integertime_t
t
,
size_t
*
offset
,
struct
dump
*
dump
);
void
logger_init
(
struct
logger
*
log
,
const
struct
swift_params
*
params
);
void
logger_clean
(
struct
logger
*
log
);
void
logger_log_timestamp
(
struct
logger
*
log
,
integertime_t
t
,
size_t
*
offset
);
int
logger_read_part
(
struct
part
*
p
,
size_t
*
offset
,
const
char
*
buff
);
int
logger_read_gpart
(
struct
gpart
*
p
,
size_t
*
offset
,
const
char
*
buff
);
int
logger_read_timestamp
(
unsigned
long
long
int
*
t
,
size_t
*
offset
,
...
...
src/logger_io.c
View file @
a8ca16e0
...
...
@@ -248,7 +248,7 @@ void write_index_single(struct engine* e, const char* baseName,
case
swift_type_gas
:
N
=
Ngas
;
hydro_write_index
(
parts
,
list
,
&
num_fields
);
hydro_write_index
(
parts
,
xparts
,
list
,
&
num_fields
);
break
;
case
swift_type_dark_matter
:
...
...
src/runner.c
View file @
a8ca16e0
...
...
@@ -2738,14 +2738,14 @@ void runner_do_logger(struct runner *r, struct cell *c, int timer) {
logger_log_part
(
p
,
logger_mask_x
|
logger_mask_v
|
logger_mask_a
|
logger_mask_u
|
logger_mask_h
|
logger_mask_rho
|
logger_mask_consts
,
&
p
->
last_offset
,
e
->
log
ger_
dump
);
&
x
p
->
logger
.
last_offset
,
e
->
log
->
dump
);
//message("Offset: %lu", p->last_offset);
/* Set counter back to zero */
xp
->
last_output
=
0
;
xp
->
logger
.
last_output
=
0
;
}
else
/* Update counter */
xp
->
last_output
+=
1
;
xp
->
logger
.
last_output
+=
1
;
}
}
...
...
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