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

Make required change to logger

parent dbeeeb42
...@@ -57,7 +57,7 @@ AC_C_RESTRICT ...@@ -57,7 +57,7 @@ AC_C_RESTRICT
# logger # logger
AC_ARG_ENABLE([logger], AC_ARG_ENABLE([logger],
[AS_HELP_STRING([--enable-logger], [AS_HELP_STRING([--enable-logger],
[enable the logger output format] [enable the particle logger]
)], )],
[with_logger="${enableval}"], [with_logger="${enableval}"],
[with_logger="no"] [with_logger="no"]
...@@ -1622,7 +1622,7 @@ AC_MSG_RESULT([ ...@@ -1622,7 +1622,7 @@ AC_MSG_RESULT([
CPU profiler : $have_profiler CPU profiler : $have_profiler
Pthread barriers : $have_pthread_barrier Pthread barriers : $have_pthread_barrier
VELOCIraptor enabled : $have_velociraptor VELOCIraptor enabled : $have_velociraptor
Logger : $with_logger Particle Logger : $with_logger
Hydro scheme : $with_hydro Hydro scheme : $with_hydro
Dimensionality : $with_dimension Dimensionality : $with_dimension
......
...@@ -34,9 +34,3 @@ InitialConditions: ...@@ -34,9 +34,3 @@ InitialConditions:
file_name: ./sedov.hdf5 file_name: ./sedov.hdf5
periodic: 1 periodic: 1
smoothing_length_scaling: 3.33 smoothing_length_scaling: 3.33
# Parameters governing the logger snapshot system
Logger:
delta_step: 10 # (Optional) Update the particle log every this many updates
mmaped_buffer_size: .05 # buffer size in GB
basename: indice # Common part of the filenames
...@@ -1008,7 +1008,6 @@ int main(int argc, char *argv[]) { ...@@ -1008,7 +1008,6 @@ int main(int argc, char *argv[]) {
/* Write the state of the system before starting time integration. */ /* Write the state of the system before starting time integration. */
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
logger_ensure_size(e.log, e.total_nr_parts, e.total_nr_gparts, 0);
logger_log_all(e.log, &e); logger_log_all(e.log, &e);
engine_dump_index(&e); engine_dump_index(&e);
#endif #endif
......
...@@ -93,10 +93,10 @@ Snapshots: ...@@ -93,10 +93,10 @@ Snapshots:
# Parameters governing the logger snapshot system # Parameters governing the logger snapshot system
Logger: Logger:
delta_step: 10 # (Optional) Update the particle log every this many updates delta_step: 10 # Update the particle log every this many updates
mmaped_buffer_size: .01 # buffer size in GB initial_buffer_size: 1 # buffer size in GB
buffer_scale: 1.2 # (Optional) When buffer size is too small, update it with required memory times buffer_scale buffer_scale: 10 # (Optional) When buffer size is too small, update it with required memory times buffer_scale
basename: indice # Common part of the filenames basename: index # Common part of the filenames
# Parameters governing the conserved quantities statistics # Parameters governing the conserved quantities statistics
Statistics: Statistics:
......
...@@ -57,11 +57,15 @@ void *dump_get(struct dump *d, size_t count, size_t *offset) { ...@@ -57,11 +57,15 @@ void *dump_get(struct dump *d, size_t count, size_t *offset) {
/** /**
* @brief Ensure that at least size bytes are available in the #dump. * @brief Ensure that at least size bytes are available in the #dump.
*
* @param d The #dump.
* @param required_size The required size for the #dump
* @param increase_size If not enough size, increase by this amount
*/ */
void dump_ensure(struct dump *d, size_t size) { void dump_ensure(struct dump *d, size_t required_size, size_t increase_size) {
/* If we have enough space already, just bail. */ /* If we have enough space already, just bail. */
if (d->size - d->count > size) return; if (d->size - d->count > required_size) return;
/* Unmap the current data. */ /* Unmap the current data. */
if (munmap(d->data, d->size) != 0) { if (munmap(d->data, d->size) != 0) {
...@@ -73,7 +77,7 @@ void dump_ensure(struct dump *d, size_t size) { ...@@ -73,7 +77,7 @@ void dump_ensure(struct dump *d, size_t size) {
const size_t trunc_count = d->count & d->page_mask; const size_t trunc_count = d->count & d->page_mask;
d->file_offset += trunc_count; d->file_offset += trunc_count;
d->count -= trunc_count; d->count -= trunc_count;
d->size = (size * dump_grow_ensure_factor + ~d->page_mask) & d->page_mask; d->size = (increase_size + ~d->page_mask) & d->page_mask;
/* Re-allocate the file size. */ /* Re-allocate the file size. */
if (posix_fallocate(d->fd, d->file_offset, d->size) != 0) { if (posix_fallocate(d->fd, d->file_offset, d->size) != 0) {
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
/* Standard headers */ /* Standard headers */
#include <stdlib.h> #include <stdlib.h>
/* Some constants. */
#define dump_grow_ensure_factor 10
/** The dump struct. */ /** The dump struct. */
struct dump { struct dump {
...@@ -54,7 +51,7 @@ struct dump { ...@@ -54,7 +51,7 @@ struct dump {
/* Function prototypes. */ /* Function prototypes. */
void dump_init(struct dump *d, const char *filename, size_t size); void dump_init(struct dump *d, const char *filename, size_t size);
void dump_ensure(struct dump *d, size_t size); void dump_ensure(struct dump *d, size_t required_size, size_t increase_size);
void dump_sync(struct dump *d); void dump_sync(struct dump *d);
void dump_close(struct dump *d); void dump_close(struct dump *d);
void *dump_get(struct dump *d, size_t count, size_t *offset); void *dump_get(struct dump *d, size_t count, size_t *offset);
......
...@@ -114,8 +114,7 @@ const char *engine_policy_names[] = {"none", ...@@ -114,8 +114,7 @@ const char *engine_policy_names[] = {"none",
"stars", "stars",
"structure finding", "structure finding",
"star formation", "star formation",
"feedback", "feedback"};
"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;
...@@ -5213,7 +5212,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs, ...@@ -5213,7 +5212,10 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
space_init_sparts(s, e->verbose); space_init_sparts(s, e->verbose);
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Mark the first time step in the particle logger file. */
logger_log_timestamp(e->log, e->ti_current, &e->log->timestamp_offset); logger_log_timestamp(e->log, e->ti_current, &e->log->timestamp_offset);
/* Make sure that we have enough space in the particle logger file
* to store the particles in current time step. */
logger_ensure_size(e->log, e->total_nr_parts, e->total_nr_gparts, 0); logger_ensure_size(e->log, e->total_nr_parts, e->total_nr_gparts, 0);
#endif #endif
...@@ -5467,7 +5469,10 @@ void engine_step(struct engine *e) { ...@@ -5467,7 +5469,10 @@ void engine_step(struct engine *e) {
e->forcerebuild = 1; e->forcerebuild = 1;
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Mark the current time step in the particle logger file. */
logger_log_timestamp(e->log, e->ti_current, &e->log->timestamp_offset); logger_log_timestamp(e->log, e->ti_current, &e->log->timestamp_offset);
/* Make sure that we have enough space in the particle logger file
* to store the particles in current time step. */
logger_ensure_size(e->log, e->total_nr_parts, e->total_nr_gparts, 0); logger_ensure_size(e->log, e->total_nr_parts, e->total_nr_gparts, 0);
#endif #endif
...@@ -5622,6 +5627,7 @@ void engine_check_for_dumps(struct engine *e) { ...@@ -5622,6 +5627,7 @@ void engine_check_for_dumps(struct engine *e) {
/* Dump everything */ /* Dump everything */
engine_print_stats(e); engine_print_stats(e);
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Write a file containing the offsets in the particle logger. */
engine_dump_index(e); engine_dump_index(e);
#else #else
engine_dump_snapshot(e); engine_dump_snapshot(e);
...@@ -5656,6 +5662,7 @@ void engine_check_for_dumps(struct engine *e) { ...@@ -5656,6 +5662,7 @@ void engine_check_for_dumps(struct engine *e) {
/* Dump snapshot */ /* Dump snapshot */
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Write a file containing the offsets in the particle logger. */
engine_dump_index(e); engine_dump_index(e);
#else #else
engine_dump_snapshot(e); engine_dump_snapshot(e);
...@@ -5678,6 +5685,7 @@ void engine_check_for_dumps(struct engine *e) { ...@@ -5678,6 +5685,7 @@ void engine_check_for_dumps(struct engine *e) {
/* Dump snapshot */ /* Dump snapshot */
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Write a file containing the offsets in the particle logger. */
engine_dump_index(e); engine_dump_index(e);
#else #else
engine_dump_snapshot(e); engine_dump_snapshot(e);
...@@ -5717,6 +5725,7 @@ void engine_check_for_dumps(struct engine *e) { ...@@ -5717,6 +5725,7 @@ void engine_check_for_dumps(struct engine *e) {
/* Dump... */ /* Dump... */
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Write a file containing the offsets in the particle logger. */
engine_dump_index(e); engine_dump_index(e);
#else #else
engine_dump_snapshot(e); engine_dump_snapshot(e);
...@@ -6506,23 +6515,6 @@ void engine_dump_index(struct engine *e) { ...@@ -6506,23 +6515,6 @@ void engine_dump_index(struct engine *e) {
struct clocks_time time1, time2; struct clocks_time time1, time2;
clocks_gettime(&time1); clocks_gettime(&time1);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that all cells have been drifted to the current time.
* That can include cells that have not
* previously been active on this rank. */
space_check_drift_point(e->s, e->ti_current,
e->policy & engine_policy_self_gravity);
/* Be verbose about this */
if (e->nodeID == 0) {
if (e->policy & engine_policy_cosmology)
message("Writing index at a=%e",
exp(e->ti_current * e->time_base) * e->cosmology->a_begin);
else
message("Writing index at t=%e",
e->ti_current * e->time_base + e->time_begin);
}
#else
if (e->verbose) { if (e->verbose) {
if (e->policy & engine_policy_cosmology) if (e->policy & engine_policy_cosmology)
message("Writing index at a=%e", message("Writing index at a=%e",
...@@ -6531,14 +6523,13 @@ void engine_dump_index(struct engine *e) { ...@@ -6531,14 +6523,13 @@ void engine_dump_index(struct engine *e) {
message("Writing index at t=%e", message("Writing index at t=%e",
e->ti_current * e->time_base + e->time_begin); e->ti_current * e->time_base + e->time_begin);
} }
#endif
/* Dump... */ /* Dump... */
write_index_single(e, e->log->base_name, e->internal_units, write_index_single(e, e->log->base_name, e->internal_units,
e->snapshot_units); e->snapshot_units);
/* Flag that we dumped a snapshot */ /* Flag that we dumped a snapshot */
e->step_props |= engine_step_prop_snapshot; e->step_props |= engine_step_prop_logger_index;
clocks_gettime(&time2); clocks_gettime(&time2);
if (e->verbose) if (e->verbose)
......
...@@ -78,7 +78,7 @@ enum engine_policy { ...@@ -78,7 +78,7 @@ enum engine_policy {
engine_policy_feedback = (1 << 18) engine_policy_feedback = (1 << 18)
}; };
#define engine_maxpolicy 18 #define engine_maxpolicy 18
extern const char *engine_policy_names[]; extern const char *engine_policy_names[engine_maxpolicy+2];
/** /**
* @brief The different unusual events that can take place in a time-step. * @brief The different unusual events that can take place in a time-step.
...@@ -90,7 +90,8 @@ enum engine_step_properties { ...@@ -90,7 +90,8 @@ enum engine_step_properties {
engine_step_prop_repartition = (1 << 2), engine_step_prop_repartition = (1 << 2),
engine_step_prop_statistics = (1 << 3), engine_step_prop_statistics = (1 << 3),
engine_step_prop_snapshot = (1 << 4), engine_step_prop_snapshot = (1 << 4),
engine_step_prop_restarts = (1 << 5) engine_step_prop_restarts = (1 << 5),
engine_step_prop_logger_index = (1 << 6)
}; };
/* Some constants */ /* Some constants */
......
...@@ -751,10 +751,6 @@ __attribute__((always_inline)) INLINE static void hydro_first_init_part( ...@@ -751,10 +751,6 @@ __attribute__((always_inline)) INLINE static void hydro_first_init_part(
xp->a_grav[2] = 0.f; xp->a_grav[2] = 0.f;
xp->entropy_full = p->entropy; xp->entropy_full = p->entropy;
#ifdef WITH_LOGGER
logger_part_data_init(&xp->logger_data);
#endif
hydro_reset_acceleration(p); hydro_reset_acceleration(p);
hydro_init_part(p, NULL); hydro_init_part(p, NULL);
} }
...@@ -776,19 +772,4 @@ hydro_set_init_internal_energy(struct part *p, float u_init) { ...@@ -776,19 +772,4 @@ hydro_set_init_internal_energy(struct part *p, float u_init) {
p->entropy = u_init; p->entropy = u_init;
} }
#ifdef WITH_LOGGER
/**
* @brief Should this particle write its data now ?
*
* @param xp The #xpart.
* @param e The #engine containing information about the current time.
* @return 1 if the #part should write, 0 otherwise.
*/
__attribute__((always_inline)) INLINE static int xpart_should_write(
const struct xpart *xp, const struct engine *e) {
return (xp->logger_data.last_output > e->log->delta_step);
}
#endif
#endif /* SWIFT_GADGET2_HYDRO_H */ #endif /* SWIFT_GADGET2_HYDRO_H */
...@@ -188,33 +188,6 @@ INLINE static void hydro_write_particles(const struct part* parts, ...@@ -188,33 +188,6 @@ INLINE static void hydro_write_particles(const struct part* parts,
#endif #endif
} }
/**
* @brief Specifies which particle fields to write to a dataset
*
* @param parts The particle array.
* @param list The list of i/o properties to write.
* @param num_fields The number of i/o fields to write.
*
* In this version, we only want the ids and the offset.
*/
__attribute__((always_inline)) INLINE static void hydro_write_index(
const struct part* parts, const struct xpart* xparts, struct io_props* list,
int* num_fields) {
#ifdef WITH_LOGGER
*num_fields = 2;
/* List what we want to write */
list[0] = io_make_output_field("ParticleIDs", ULONGLONG, 1,
UNIT_CONV_NO_UNITS, parts, id);
list[1] = io_make_output_field("Offset", ULONGLONG, 1, UNIT_CONV_NO_UNITS,
xparts, logger_data.last_offset);
#else
error("Cannot write index without logger");
#endif
}
/** /**
* @brief Writes the current model of SPH to the file * @brief Writes the current model of SPH to the file
* @param h_grpsph The HDF5 group in which to write * @param h_grpsph The HDF5 group in which to write
......
...@@ -57,6 +57,7 @@ struct xpart { ...@@ -57,6 +57,7 @@ struct xpart {
struct cooling_xpart_data cooling_data; struct cooling_xpart_data cooling_data;
#ifdef WITH_LOGGER #ifdef WITH_LOGGER
/* Additional data for the particle logger */
struct logger_part_data logger_data; struct logger_part_data logger_data;
#endif #endif
......
...@@ -48,7 +48,9 @@ const unsigned int logger_datatype_size[logger_data_count] = { ...@@ -48,7 +48,9 @@ const unsigned int logger_datatype_size[logger_data_count] = {
}; };
/** /**
* @brief Write the header of a chunk (offset + mask) * @brief Write the header of a chunk (offset + mask).
*
* This is maybe broken for big(?) endian.
* *
* @param buff The writing buffer * @param buff The writing buffer
* @param mask The mask to write * @param mask The mask to write
...@@ -91,6 +93,8 @@ void logger_write_data(struct dump *d, size_t *offset, size_t size, ...@@ -91,6 +93,8 @@ void logger_write_data(struct dump *d, size_t *offset, size_t size,
/** /**
* @brief Write a parameter to the file * @brief Write a parameter to the file
* *
* TODO Make it thread safe or remove it.
*
* write data in the following order: name, data type, data. * write data in the following order: name, data type, data.
* It should be used only for the file header. * It should be used only for the file header.
* *
...@@ -179,6 +183,13 @@ int logger_compute_chunk_size(unsigned int mask) { ...@@ -179,6 +183,13 @@ int logger_compute_chunk_size(unsigned int mask) {
* @param e The #engine * @param e The #engine
*/ */
void logger_log_all(struct logger *log, const struct engine *e) { void logger_log_all(struct logger *log, const struct engine *e) {
/* Ensure that enough space is available */
logger_ensure_size(log, e->total_nr_parts, e->total_nr_gparts, 0);
#ifdef SWIFT_DEBUG_CHECKS
message("Need to implement stars");
#endif
/* some constants */ /* some constants */
const struct space *s = e->s; const struct space *s = e->s;
const unsigned int mask = logger_mask_x | logger_mask_v | logger_mask_a | const unsigned int mask = logger_mask_x | logger_mask_v | logger_mask_a |
...@@ -189,7 +200,7 @@ void logger_log_all(struct logger *log, const struct engine *e) { ...@@ -189,7 +200,7 @@ void logger_log_all(struct logger *log, const struct engine *e) {
for (long long i = 0; i < e->total_nr_parts; i++) { for (long long i = 0; i < e->total_nr_parts; i++) {
logger_log_part(log, &s->parts[i], mask, logger_log_part(log, &s->parts[i], mask,
&s->xparts[i].logger_data.last_offset); &s->xparts[i].logger_data.last_offset);
s->xparts[i].logger_data.last_output = 0; s->xparts[i].logger_data.steps_since_last_output = 0;
} }
/* loop over all gparts */ /* loop over all gparts */
...@@ -384,21 +395,10 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts, ...@@ -384,21 +395,10 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts,
struct logger_parameters *log_params = log->params; struct logger_parameters *log_params = log->params;
/* count part memory */ /* count part memory */
size_t limit = log_params->offset_size + log_params->mask_size; size_t limit = log_params->total_size;
for (size_t i = 0; i < log_params->nber_mask; i++) {
if (log_params->masks[i] != logger_mask_timestamp)
limit += log_params->masks_data_size[i];
}
limit *= total_nr_parts; limit *= total_nr_parts;
/* check if enough place for all particles */
if (log->buffer_size < limit) {
log->buffer_size = log->buffer_scale * limit;
message("Increasing buffer size to %.3f GB", log->buffer_size * 1e-9);
}
/* count gpart memory */ /* count gpart memory */
if (total_nr_gparts > 0) error("Not implemented"); if (total_nr_gparts > 0) error("Not implemented");
...@@ -406,7 +406,7 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts, ...@@ -406,7 +406,7 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts,
if (total_nr_sparts > 0) error("Not implemented"); if (total_nr_sparts > 0) error("Not implemented");
/* ensure enough space in dump */ /* ensure enough space in dump */
dump_ensure(log->dump, log->buffer_size); dump_ensure(log->dump, limit, log->buffer_scale * limit);
} }
/** /**
...@@ -418,10 +418,9 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts, ...@@ -418,10 +418,9 @@ void logger_ensure_size(struct logger *log, size_t total_nr_parts,
void logger_init(struct logger *log, struct swift_params *params) { void logger_init(struct logger *log, struct swift_params *params) {
/* read parameters */ /* read parameters */
log->delta_step = parser_get_param_int(params, "Logger:delta_step"); log->delta_step = parser_get_param_int(params, "Logger:delta_step");
log->buffer_size = size_t buffer_size = parser_get_param_float(params, "Logger:initial_buffer_size") * 1e9;
parser_get_param_float(params, "Logger:mmaped_buffer_size") * 1e9;
log->buffer_scale = log->buffer_scale =
parser_get_opt_param_float(params, "Logger:buffer_scale", 1.2); parser_get_opt_param_float(params, "Logger:buffer_scale", 10);
parser_get_param_string(params, "Logger:basename", log->base_name); parser_get_param_string(params, "Logger:basename", log->base_name);
/* set initial value of parameters */ /* set initial value of parameters */
...@@ -441,10 +440,8 @@ void logger_init(struct logger *log, struct swift_params *params) { ...@@ -441,10 +440,8 @@ void logger_init(struct logger *log, struct swift_params *params) {
log->dump = malloc(sizeof(struct dump)); log->dump = malloc(sizeof(struct dump));
struct dump *dump_file = log->dump; struct dump *dump_file = log->dump;
dump_init(dump_file, logger_name_file, log->buffer_size); dump_init(dump_file, logger_name_file, buffer_size);
/* ensure enough place in dump */
dump_ensure(dump_file, log->buffer_size);
} }
/** /**
...@@ -490,7 +487,7 @@ void logger_write_file_header(struct logger *log, const struct engine *e) { ...@@ -490,7 +487,7 @@ void logger_write_file_header(struct logger *log, const struct engine *e) {
logger_write_data(dump, &file_offset, logger_datatype_size[logger_data_bool], logger_write_data(dump, &file_offset, logger_datatype_size[logger_data_bool],
&reversed); &reversed);
/* will write the offset of the first particle here */ /* placeholder to write the offset of the first log here */
char *skip_header = dump_get(dump, log_params.offset_size, &file_offset); char *skip_header = dump_get(dump, log_params.offset_size, &file_offset);
/* write number of bytes used for names */ /* write number of bytes used for names */
...@@ -507,11 +504,11 @@ void logger_write_file_header(struct logger *log, const struct engine *e) { ...@@ -507,11 +504,11 @@ void logger_write_file_header(struct logger *log, const struct engine *e) {
/* write number of masks */ /* write number of masks */
logger_write_data(dump, &file_offset, log_params.number_size, logger_write_data(dump, &file_offset, log_params.number_size,
&log_params.nber_mask); &log_params.number_mask);
/* write masks */ /* write masks */
// loop over all mask type // loop over all mask type
for (size_t i = 0; i < log_params.nber_mask; i++) { for (size_t i = 0; i < log_params.number_mask; i++) {
// mask name // mask name
size_t j = i * log_params.label_size; size_t j = i * log_params.label_size;
logger_write_data(dump, &file_offset, log_params.label_size, logger_write_data(dump, &file_offset, log_params.label_size,
...@@ -544,8 +541,6 @@ void logger_write_file_header(struct logger *log, const struct engine *e) { ...@@ -544,8 +541,6 @@ void logger_write_file_header(struct logger *log, const struct engine *e) {
/* free memory */ /* free memory */
free(name); free(name);
dump_ensure(log->dump, log->buffer_size);
} }
/** /**
...@@ -561,10 +556,10 @@ void logger_parameters_init(struct logger_parameters *log_params) { ...@@ -561,10 +556,10 @@ void logger_parameters_init(struct logger_parameters *log_params) {
log_params->number_size = 1; log_params->number_size = 1;
log_params->data_type_size = 1; log_params->data_type_size = 1;
log_params->nber_mask = 8; log_params->number_mask = 8;
/* set masks array */ /* set masks array */
log_params->masks = malloc(sizeof(size_t) * log_params->nber_mask); log_params->masks = malloc(sizeof(size_t) * log_params->number_mask);
log_params->masks[0] = logger_mask_x; log_params->masks[0] = logger_mask_x;
log_params->masks[1] = logger_mask_v; log_params->masks[1] = logger_mask_v;
log_params->masks[2] = logger_mask_a; log_params->masks[2] = logger_mask_a;
...@@ -575,7 +570,7 @@ void logger_parameters_init(struct logger_parameters *log_params) { ...@@ -575,7 +570,7 @@ void logger_parameters_init(struct logger_parameters *log_params) {
log_params->masks[7] = logger_mask_timestamp; log_params->masks[7] = logger_mask_timestamp;
/* set the mask names */ /* set the mask names */
size_t block_size = log_params->label_size * log_params->nber_mask; size_t block_size = log_params->label_size * log_params->number_mask;
log_params->masks_name = malloc(block_size); log_params->masks_name = malloc(block_size);
char *cur_name = log_params->masks_name;