Commit cd78138f authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Format

parent eb83729b
...@@ -253,8 +253,8 @@ int main(int argc, char *argv[]) { ...@@ -253,8 +253,8 @@ int main(int argc, char *argv[]) {
"Overwrite the CPU " "Overwrite the CPU "
"frequency (Hz) to be used for time measurements.", "frequency (Hz) to be used for time measurements.",
NULL, 0, 0), NULL, 0, 0),
OPT_BOOLEAN(0, "logger", &with_logger, OPT_BOOLEAN(0, "logger", &with_logger, "Run with the particle logger.",
"Run with the particle logger.", NULL, 0, 0), NULL, 0, 0),
OPT_INTEGER('n', "steps", &nsteps, OPT_INTEGER('n', "steps", &nsteps,
"Execute a fixed number of time steps. When unset use the " "Execute a fixed number of time steps. When unset use the "
"time_end parameter to stop.", "time_end parameter to stop.",
...@@ -335,7 +335,9 @@ int main(int argc, char *argv[]) { ...@@ -335,7 +335,9 @@ int main(int argc, char *argv[]) {
#if !defined(WITH_LOGGER) #if !defined(WITH_LOGGER)
if (with_logger) { if (with_logger) {
printf("Error: the particle logger is not available, please compile with --enable-logger."); printf(
"Error: the particle logger is not available, please compile with "
"--enable-logger.");
return 1; return 1;
} }
#endif #endif
...@@ -599,7 +601,7 @@ int main(int argc, char *argv[]) { ...@@ -599,7 +601,7 @@ int main(int argc, char *argv[]) {
error("Can't run with time-step synchronization over MPI (yet)"); error("Can't run with time-step synchronization over MPI (yet)");
#endif #endif
/* Temporary early aborts for modes not supported with hand-vec. */ /* Temporary early aborts for modes not supported with hand-vec. */
#if defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \ #if defined(WITH_VECTORIZATION) && defined(GADGET2_SPH) && \
!defined(CHEMISTRY_NONE) !defined(CHEMISTRY_NONE)
error( error(
......
...@@ -123,8 +123,7 @@ const char *engine_policy_names[] = {"none", ...@@ -123,8 +123,7 @@ const char *engine_policy_names[] = {"none",
"fof search", "fof search",
"time-step limiter", "time-step limiter",
"time-step sync", "time-step sync",
"logger" "logger"};
};
/** The rank of the engine as a global variable (for messages). */ /** The rank of the engine as a global variable (for messages). */
int engine_rank; int engine_rank;
...@@ -457,15 +456,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts, ...@@ -457,15 +456,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts,
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (e->policy & engine_policy_logger) { if (e->policy & engine_policy_logger) {
const uint32_t logger_flag = logger_pack_flags_and_data( const uint32_t logger_flag =
logger_flag_mpi_exit, node_id); logger_pack_flags_and_data(logger_flag_mpi_exit, node_id);
/* Log the particle when leaving a rank. */ /* Log the particle when leaving a rank. */
logger_log_part(e->logger, &s->parts[offset_parts + k], logger_log_part(
&s->xparts[offset_parts + k], e->logger, &s->parts[offset_parts + k], &s->xparts[offset_parts + k],
logger_masks_all_part | logger_masks_all_part | logger_mask_data[logger_special_flags].mask,
logger_mask_data[logger_special_flags].mask, logger_flag);
logger_flag);
} }
#endif #endif
} }
...@@ -506,14 +504,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts, ...@@ -506,14 +504,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts,
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (e->policy & engine_policy_logger) { if (e->policy & engine_policy_logger) {
const uint32_t logger_flag = logger_pack_flags_and_data( const uint32_t logger_flag =
logger_flag_mpi_exit, node_id); logger_pack_flags_and_data(logger_flag_mpi_exit, node_id);
/* Log the particle when leaving a rank. */ /* Log the particle when leaving a rank. */
logger_log_spart(e->logger, &s->sparts[offset_sparts + k], logger_log_spart(
logger_masks_all_spart | e->logger, &s->sparts[offset_sparts + k],
logger_mask_data[logger_special_flags].mask, logger_masks_all_spart | logger_mask_data[logger_special_flags].mask,
logger_flag); logger_flag);
} }
#endif #endif
} }
...@@ -592,14 +590,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts, ...@@ -592,14 +590,14 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts,
if ((e->policy & engine_policy_logger) && if ((e->policy & engine_policy_logger) &&
s->gparts[offset_gparts + k].type == swift_type_dark_matter) { s->gparts[offset_gparts + k].type == swift_type_dark_matter) {
const uint32_t logger_flag = logger_pack_flags_and_data( const uint32_t logger_flag =
logger_flag_mpi_exit, node_id); logger_pack_flags_and_data(logger_flag_mpi_exit, node_id);
/* Log the particle when leaving a rank. */ /* Log the particle when leaving a rank. */
logger_log_gpart(e->logger, &s->gparts[offset_gparts + k], logger_log_gpart(
logger_masks_all_gpart | e->logger, &s->gparts[offset_gparts + k],
logger_mask_data[logger_special_flags].mask, logger_masks_all_gpart | logger_mask_data[logger_special_flags].mask,
logger_flag); logger_flag);
} }
#endif #endif
} }
...@@ -824,8 +822,8 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts, ...@@ -824,8 +822,8 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts,
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (e->policy & engine_policy_logger) { if (e->policy & engine_policy_logger) {
const uint32_t flag = logger_pack_flags_and_data(logger_flag_mpi_enter, const uint32_t flag =
prox->nodeID); logger_pack_flags_and_data(logger_flag_mpi_enter, prox->nodeID);
struct part *parts = &s->parts[offset_parts + count_parts]; struct part *parts = &s->parts[offset_parts + count_parts];
struct xpart *xparts = &s->xparts[offset_parts + count_parts]; struct xpart *xparts = &s->xparts[offset_parts + count_parts];
...@@ -833,21 +831,21 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts, ...@@ -833,21 +831,21 @@ void engine_exchange_strays(struct engine *e, const size_t offset_parts,
struct gpart *gparts = &s->gparts[offset_gparts + count_gparts]; struct gpart *gparts = &s->gparts[offset_gparts + count_gparts];
/* Log the gas particles */ /* Log the gas particles */
logger_log_parts(e->logger, parts, xparts, logger_log_parts(
prox->nr_parts_in, logger_masks_all_part | e->logger, parts, xparts, prox->nr_parts_in,
logger_mask_data[logger_special_flags].mask, logger_masks_all_part | logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the stellar particles */ /* Log the stellar particles */
logger_log_sparts(e->logger, sparts, prox->nr_sparts_in, logger_log_sparts(e->logger, sparts, prox->nr_sparts_in,
logger_masks_all_spart | logger_masks_all_spart |
logger_mask_data[logger_special_flags].mask, logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the gparts */ /* Log the gparts */
logger_log_gparts(e->logger, gparts, prox->nr_gparts_in, logger_log_gparts(e->logger, gparts, prox->nr_gparts_in,
logger_masks_all_gpart | logger_masks_all_gpart |
logger_mask_data[logger_special_flags].mask, logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the bparts */ /* Log the bparts */
...@@ -5184,7 +5182,7 @@ void engine_struct_restore(struct engine *e, FILE *stream) { ...@@ -5184,7 +5182,7 @@ void engine_struct_restore(struct engine *e, FILE *stream) {
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (e->policy & engine_policy_logger) { if (e->policy & engine_policy_logger) {
struct logger_writer *log = struct logger_writer *log =
(struct logger_writer *)malloc(sizeof(struct logger_writer)); (struct logger_writer *)malloc(sizeof(struct logger_writer));
logger_struct_restore(log, stream); logger_struct_restore(log, stream);
e->logger = log; e->logger = log;
} }
......
...@@ -867,8 +867,7 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) { ...@@ -867,8 +867,7 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
/* Create a variable in order to avoid to many ifdef */ /* Create a variable in order to avoid to many ifdef */
kick2_or_logger = c->logger; kick2_or_logger = c->logger;
} } else {
else {
kick2_or_logger = c->kick2; kick2_or_logger = c->kick2;
} }
#else #else
...@@ -1186,8 +1185,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c, ...@@ -1186,8 +1185,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (with_logger) { if (with_logger) {
scheduler_addunlock(s, c->super->logger, c->stars.stars_in); scheduler_addunlock(s, c->super->logger, c->stars.stars_in);
} } else {
else {
scheduler_addunlock(s, c->super->kick2, c->stars.stars_in); scheduler_addunlock(s, c->super->kick2, c->stars.stars_in);
} }
#else #else
...@@ -1223,10 +1221,11 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c, ...@@ -1223,10 +1221,11 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
if (with_logger) { if (with_logger) {
scheduler_addunlock(s, c->super->logger, c->black_holes.black_holes_in); scheduler_addunlock(s, c->super->logger,
} c->black_holes.black_holes_in);
else { } else {
scheduler_addunlock(s, c->super->kick2, c->black_holes.black_holes_in); scheduler_addunlock(s, c->super->kick2,
c->black_holes.black_holes_in);
} }
#else #else
scheduler_addunlock(s, c->super->kick2, c->black_holes.black_holes_in); scheduler_addunlock(s, c->super->kick2, c->black_holes.black_holes_in);
......
...@@ -984,7 +984,7 @@ void engine_redistribute(struct engine *e) { ...@@ -984,7 +984,7 @@ void engine_redistribute(struct engine *e) {
size_t gpart_offset = 0; size_t gpart_offset = 0;
size_t bpart_offset = 0; size_t bpart_offset = 0;
for(int i = 0; i < nr_nodes; i++) { for (int i = 0; i < nr_nodes; i++) {
const size_t c_ind = engine_rank * nr_nodes + i; const size_t c_ind = engine_rank * nr_nodes + i;
/* No need to log the local particles. */ /* No need to log the local particles. */
...@@ -995,27 +995,25 @@ void engine_redistribute(struct engine *e) { ...@@ -995,27 +995,25 @@ void engine_redistribute(struct engine *e) {
bpart_offset += b_counts[c_ind]; bpart_offset += b_counts[c_ind];
continue; continue;
} }
const uint32_t flag = logger_pack_flags_and_data( const uint32_t flag = logger_pack_flags_and_data(logger_flag_mpi_exit, i);
logger_flag_mpi_exit, i);
/* Log the hydro parts. */ /* Log the hydro parts. */
logger_log_parts(e->logger, &parts[part_offset], logger_log_parts(
&xparts[part_offset], counts[c_ind], e->logger, &parts[part_offset], &xparts[part_offset], counts[c_ind],
logger_masks_all_part | logger_masks_all_part | logger_mask_data[logger_special_flags].mask,
logger_mask_data[logger_special_flags].mask, flag);
flag);
/* Log the stellar parts. */ /* Log the stellar parts. */
logger_log_sparts(e->logger, &sparts[spart_offset], s_counts[c_ind], logger_log_sparts(
logger_masks_all_spart | e->logger, &sparts[spart_offset], s_counts[c_ind],
logger_mask_data[logger_special_flags].mask, logger_masks_all_spart | logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the gparts */ /* Log the gparts */
logger_log_gparts(e->logger, &gparts[gpart_offset], g_counts[c_ind], logger_log_gparts(
logger_masks_all_gpart | e->logger, &gparts[gpart_offset], g_counts[c_ind],
logger_mask_data[logger_special_flags].mask, logger_masks_all_gpart | logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the bparts */ /* Log the bparts */
if (b_counts[c_ind] > 0) { if (b_counts[c_ind] > 0) {
...@@ -1090,7 +1088,7 @@ void engine_redistribute(struct engine *e) { ...@@ -1090,7 +1088,7 @@ void engine_redistribute(struct engine *e) {
size_t gpart_offset = 0; size_t gpart_offset = 0;
size_t bpart_offset = 0; size_t bpart_offset = 0;
for(int i = 0; i < nr_nodes; i++) { for (int i = 0; i < nr_nodes; i++) {
const size_t c_ind = i * nr_nodes + engine_rank; const size_t c_ind = i * nr_nodes + engine_rank;
/* No need to log the local particles. */ /* No need to log the local particles. */
...@@ -1102,27 +1100,26 @@ void engine_redistribute(struct engine *e) { ...@@ -1102,27 +1100,26 @@ void engine_redistribute(struct engine *e) {
continue; continue;
} }
const uint32_t flag = logger_pack_flags_and_data( const uint32_t flag =
logger_flag_mpi_enter, i); logger_pack_flags_and_data(logger_flag_mpi_enter, i);
/* Log the hydro parts. */ /* Log the hydro parts. */
logger_log_parts(e->logger, &parts[part_offset], logger_log_parts(
&xparts[part_offset], counts[c_ind], e->logger, &parts[part_offset], &xparts[part_offset], counts[c_ind],
logger_masks_all_part | logger_masks_all_part | logger_mask_data[logger_special_flags].mask,
logger_mask_data[logger_special_flags].mask, flag);
flag);
/* Log the stellar parts. */ /* Log the stellar parts. */
logger_log_sparts(e->logger, &sparts[spart_offset], s_counts[c_ind], logger_log_sparts(
logger_masks_all_spart | e->logger, &sparts[spart_offset], s_counts[c_ind],
logger_mask_data[logger_special_flags].mask, logger_masks_all_spart | logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the gparts */ /* Log the gparts */
logger_log_gparts(e->logger, &gparts[gpart_offset], g_counts[c_ind], logger_log_gparts(
logger_masks_all_gpart | e->logger, &gparts[gpart_offset], g_counts[c_ind],
logger_mask_data[logger_special_flags].mask, logger_masks_all_gpart | logger_mask_data[logger_special_flags].mask,
flag); flag);
/* Log the bparts */ /* Log the bparts */
if (b_counts[c_ind] > 0) { if (b_counts[c_ind] > 0) {
......
...@@ -181,8 +181,7 @@ void logger_log_all(struct logger_writer *log, const struct engine *e) { ...@@ -181,8 +181,7 @@ void logger_log_all(struct logger_writer *log, const struct engine *e) {
/* loop over all parts. */ /* loop over all parts. */
for (size_t i = 0; i < s->nr_parts; i++) { for (size_t i = 0; i < s->nr_parts; i++) {
logger_log_part(log, &s->parts[i], &s->xparts[i], logger_log_part(log, &s->parts[i], &s->xparts[i], logger_masks_all_part,
logger_masks_all_part,
/* Special flags */ 0); /* Special flags */ 0);
} }
...@@ -214,10 +213,9 @@ void logger_log_all(struct logger_writer *log, const struct engine *e) { ...@@ -214,10 +213,9 @@ void logger_log_all(struct logger_writer *log, const struct engine *e) {
* @param buff The buffer to use when writing. * @param buff The buffer to use when writing.
* @param special_flags The data for the special flags. * @param special_flags The data for the special flags.
*/ */
void logger_copy_part_fields( void logger_copy_part_fields(const struct part *p, unsigned int mask,
const struct part *p, unsigned int mask, size_t *offset, size_t offset_new, char *buff,
size_t *offset, size_t offset_new, char *buff, const uint32_t special_flags) {
const uint32_t special_flags) {
/* Make sure we're not writing a timestamp. */ /* Make sure we're not writing a timestamp. */
if (mask & logger_mask_data[logger_timestamp].mask) if (mask & logger_mask_data[logger_timestamp].mask)
...@@ -281,7 +279,6 @@ void logger_copy_part_fields( ...@@ -281,7 +279,6 @@ void logger_copy_part_fields(
memcpy(buff, &special_flags, logger_mask_data[logger_special_flags].size); memcpy(buff, &special_flags, logger_mask_data[logger_special_flags].size);
buff += logger_mask_data[logger_special_flags].size; buff += logger_mask_data[logger_special_flags].size;
} }
} }
/** /**
...@@ -297,8 +294,7 @@ void logger_log_part(struct logger_writer *log, const struct part *p, ...@@ -297,8 +294,7 @@ void logger_log_part(struct logger_writer *log, const struct part *p,
struct xpart *xp, unsigned int mask, struct xpart *xp, unsigned int mask,
const uint32_t special_flags) { const uint32_t special_flags) {
logger_log_parts(log, p, xp, /* count */ 1, mask, logger_log_parts(log, p, xp, /* count */ 1, mask, special_flags);
special_flags);
} }
/** /**
...@@ -311,7 +307,7 @@ void logger_log_part(struct logger_writer *log, const struct part *p, ...@@ -311,7 +307,7 @@ void logger_log_part(struct logger_writer *log, const struct part *p,
* @param special_flags The value of the special flags. * @param special_flags The value of the special flags.
*/ */
void logger_log_parts(struct logger_writer *log, const struct part *p, void logger_log_parts(struct logger_writer *log, const struct part *p,
struct xpart *xp, int count, unsigned int mask, struct xpart *xp, int count, unsigned int mask,
const uint32_t special_flags) { const uint32_t special_flags) {
/* Start by computing the size of the message. */ /* Start by computing the size of the message. */
const int size = logger_compute_chunk_size(mask); const int size = logger_compute_chunk_size(mask);
...@@ -320,7 +316,7 @@ void logger_log_parts(struct logger_writer *log, const struct part *p, ...@@ -320,7 +316,7 @@ void logger_log_parts(struct logger_writer *log, const struct part *p,
size_t offset_new; size_t offset_new;
char *buff = (char *)dump_get(&log->dump, count * size, &offset_new); char *buff = (char *)dump_get(&log->dump, count * size, &offset_new);
for(int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
/* Copy everything into the buffer */ /* Copy everything into the buffer */
logger_copy_part_fields(&p[i], mask, &xp[i].logger_data.last_offset, logger_copy_part_fields(&p[i], mask, &xp[i].logger_data.last_offset,
offset_new, buff, special_flags); offset_new, buff, special_flags);
...@@ -343,10 +339,9 @@ void logger_log_parts(struct logger_writer *log, const struct part *p, ...@@ -343,10 +339,9 @@ void logger_log_parts(struct logger_writer *log, const struct part *p,
* @param buff The buffer to use when writing. * @param buff The buffer to use when writing.
* @param special_flags The data for the special flags. * @param special_flags The data for the special flags.
*/ */
void logger_copy_spart_fields( void logger_copy_spart_fields(const struct spart *sp, unsigned int mask,
const struct spart *sp, unsigned int mask, size_t *offset, size_t offset_new, char *buff,
size_t *offset, size_t offset_new, char *buff, const uint32_t special_flags) {
const uint32_t special_flags) {
/* Make sure we're not writing a timestamp. */ /* Make sure we're not writing a timestamp. */
if (mask & logger_mask_data[logger_timestamp].mask) if (mask & logger_mask_data[logger_timestamp].mask)
...@@ -401,8 +396,7 @@ void logger_copy_spart_fields( ...@@ -401,8 +396,7 @@ void logger_copy_spart_fields(
void logger_log_spart(struct logger_writer *log, struct spart *sp, void logger_log_spart(struct logger_writer *log, struct spart *sp,
unsigned int mask, const uint32_t special_flags) { unsigned int mask, const uint32_t special_flags) {
logger_log_sparts(log, sp, /* count */ 1, mask, logger_log_sparts(log, sp, /* count */ 1, mask, special_flags);
special_flags);
} }
/** /**
...@@ -414,9 +408,8 @@ void logger_log_spart(struct logger_writer *log, struct spart *sp, ...@@ -414,9 +408,8 @@ void logger_log_spart(struct logger_writer *log, struct spart *sp,
* @param count The number of particle to dump. * @param count The number of particle to dump.
* @param special_flags The value of the special flags. * @param special_flags The value of the special flags.
*/ */
void logger_log_sparts(struct logger_writer *log, struct spart *sp, void logger_log_sparts(struct logger_writer *log, struct spart *sp, int count,
int count, unsigned int mask, unsigned int mask, const uint32_t special_flags) {
const uint32_t special_flags) {
/* Start by computing the size of the message. */ /* Start by computing the size of the message. */
const int size = logger_compute_chunk_size(mask); const int size = logger_compute_chunk_size(mask);
...@@ -424,7 +417,7 @@ void logger_log_sparts(struct logger_writer *log, struct spart *sp, ...@@ -424,7 +417,7 @@ void logger_log_sparts(struct logger_writer *log, struct spart *sp,
size_t offset_new; size_t offset_new;
char *buff = (char *)dump_get(&log->dump, count * size, &offset_new); char *buff = (char *)dump_get(&log->dump, count * size, &offset_new);
for(int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
/* Copy everything into the buffer */ /* Copy everything into the buffer */
logger_copy_spart_fields(&sp[i], mask, &sp[i].logger_data.last_offset, logger_copy_spart_fields(&sp[i], mask, &sp[i].logger_data.last_offset,
offset_new, buff, special_flags); offset_new, buff, special_flags);
...@@ -447,10 +440,9 @@ void logger_log_sparts(struct logger_writer *log, struct spart *sp, ...@@ -447,10 +440,9 @@ void logger_log_sparts(struct logger_writer *log, struct spart *sp,
* @param buff The buffer to use when writing. * @param buff The buffer to use when writing.
* @param special_flags The data of the special flag. * @param special_flags The data of the special flag.
*/ */
void logger_copy_gpart_fields( void logger_copy_gpart_fields(const struct gpart *gp, unsigned int mask,
const struct gpart *gp, unsigned int mask, size_t *offset, size_t offset_new, char *buff,
size_t *offset, size_t offset_new, char *buff, const uint32_t special_flags) {
const uint32_t special_flags) {
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
if (gp->id_or_neg_offset < 0) { if (gp->id_or_neg_offset < 0) {
...@@ -503,7 +495,6 @@ void logger_copy_gpart_fields( ...@@ -503,7 +495,6 @@ void logger_copy_gpart_fields(
memcpy(buff, &special_flags, logger_mask_data[logger_special_flags].size); memcpy(buff, &special_flags, logger_mask_data[logger_special_flags].size);
buff += logger_mask_data[logger_special_flags].size; buff += logger_mask_data[logger_special_flags].size;
} }
} }
/** /**
...@@ -528,9 +519,8 @@ void logger_log_gpart(struct logger_writer *log, struct gpart *p, ...@@ -528,9 +519,8 @@ void logger_log_gpart(struct logger_writer *log, struct gpart *p,
* @param count The number of particle to dump. * @param count The number of particle to dump.
* @param special_flags The value of the special flags. * @param special_flags The value of the special flags.
*/ */
void logger_log_gparts(struct logger_writer *log, struct gpart *p, void logger_log_gparts(struct logger_writer *log, struct gpart *p, int count,
int count, unsigned int mask, unsigned int mask, const uint32_t special_flags) {
const uint32_t special_flags) {
/* Start by computing the size of the message. */ /* Start by computing the size of the message. */
const int size = logger_compute_chunk_size(mask); const int size = logger_compute_chunk_size(mask);
...@@ -538,7 +528,7 @@ void logger_log_gparts(struct logger_writer *log, struct gpart *p, ...@@ -538,7 +528,7 @@ void logger_log_gparts(struct logger_writer *log, struct gpart *p,
size_t offset_new; size_t offset_new;
char *buff = (char *)dump_get(&log->dump, count * size, &offset_new); char *buff = (char *)dump_get(&log->dump, count * size, &offset_new);
for(int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
/* Log only the dark matter */ /* Log only the dark matter */
if (p[i].type != swift_type_dark_matter) continue; if (p[i].type != swift_type_dark_matter) continue;
...@@ -945,7 +935,6 @@ int logger_read_timestamp(unsigned long long int *t, double *time, ...@@ -945,7 +935,6 @@ int logger_read_timestamp(unsigned long long int *t, double *time,
return mask; return mask;
} }
/** /**
* @brief Write a swift_params struct to the given FILE as a stream of bytes. * @brief Write a swift_params struct to the given FILE as a stream of bytes.
* *
...@@ -957,7 +946,6 @@ void logger_struct_dump(const struct logger_writer *log, FILE *stream) { ...@@ -957,7 +946,6 @@ void logger_struct_dump(const struct logger_writer *log, FILE *stream) {
"logger", "logger"); "logger", "logger");
} }
/** /**
* @brief Restore a logger struct from the given FILE as a stream of * @brief Restore a logger struct from the given FILE as a stream of
* bytes. * bytes.
......
...@@ -88,27 +88,28 @@ enum logger_masks_number { ...@@ -88,27 +88,28 @@ enum logger_masks_number {
logger_rho = 5, logger_rho = 5,
logger_consts = 6, logger_consts = 6,
logger_special_flags = 7, /* Flag for special cases */