Commit 4c05c63e authored by Loic Hausammann's avatar Loic Hausammann

Logger: format

parent 7da712fa
......@@ -18,10 +18,10 @@
******************************************************************************/
#include "logger_header.h"
#include "logger_reader.h"
#include "logger_loader_io.h"
#include "logger_tools.h"
#include "logger_logfile.h"
#include "logger_reader.h"
#include "logger_tools.h"
#include <stdio.h>
#include <stdlib.h>
......@@ -29,11 +29,11 @@
/* Name of each offset direction. */
const char *logger_offset_name[logger_offset_count] = {
"Forward", "Backward", "Corrupted",
"Forward",
"Backward",
"Corrupted",
};
/**
* @brief Print the properties of the header to stdout.
*
......@@ -87,12 +87,14 @@ int header_get_field_index(const struct header *h, const char *field) {
* @param new_value The new value to write.
*
*/
void header_change_offset_direction(struct header *h, enum logger_offset_direction new_value) {
void header_change_offset_direction(struct header *h,
enum logger_offset_direction new_value) {
h->offset_direction = new_value;
/* Skip file format and version numbers. */
size_t offset = LOGGER_VERSION_SIZE + 2 * sizeof(int);
logger_loader_io_write_data(h->log->log.map + offset, sizeof(unsigned int), &new_value);
logger_loader_io_write_data(h->log->log.map + offset, sizeof(unsigned int),
&new_value);
}
/**
......@@ -120,8 +122,7 @@ void header_read(struct header *h, struct logger_logfile *log) {
map = logger_loader_io_read_data(map, sizeof(int), &h->minor_version);
struct logger_reader *reader = log->reader;
if (&reader->log != log)
error("Wrong link to the reader.");
if (&reader->log != log) error("Wrong link to the reader.");
if (reader->verbose > 0)
message("File version %i.%i", h->major_version, h->minor_version);
......@@ -134,10 +135,12 @@ void header_read(struct header *h, struct logger_logfile *log) {
error("Wrong offset value in the header (%i)", h->offset_direction);
/* Read offset to first record. */
map = logger_loader_io_read_data(map, LOGGER_OFFSET_SIZE, &h->offset_first_record);
map = logger_loader_io_read_data(map, LOGGER_OFFSET_SIZE,
&h->offset_first_record);
/* Read the size of the strings. */
map = logger_loader_io_read_data(map, sizeof(unsigned int), &h->string_length);
map =
logger_loader_io_read_data(map, sizeof(unsigned int), &h->string_length);
/* Check if value defined in this file is large enough. */
if (STRING_SIZE < h->string_length) {
......@@ -159,15 +162,16 @@ void header_read(struct header *h, struct logger_logfile *log) {
h->masks[i].mask = 1 << i;
/* Read the mask data size. */
map = logger_loader_io_read_data(map, sizeof(unsigned int), &h->masks[i].size);
map = logger_loader_io_read_data(map, sizeof(unsigned int),
&h->masks[i].size);
}
/* Check the logfile header's size. */
if (map != log->log.map + h->offset_first_record) {
header_print(h);
size_t offset = map - log->log.map;
error("Wrong header size (in header %zi, current %zi)", h->offset_first_record,
offset);
error("Wrong header size (in header %zi, current %zi)",
h->offset_first_record, offset);
}
};
......@@ -179,7 +183,8 @@ void header_read(struct header *h, struct logger_logfile *log) {
*
* @return number of bits in mask.
*/
size_t header_get_record_size_from_mask(const struct header *h, const size_t mask) {
size_t header_get_record_size_from_mask(const struct header *h,
const size_t mask) {
size_t count = 0;
/* Loop over each masks. */
for (size_t i = 0; i < h->number_mask; i++) {
......
......@@ -41,7 +41,6 @@ enum logger_offset_direction {
*/
extern const char *logger_offset_name[];
struct logger_logfile;
/**
......@@ -85,9 +84,10 @@ void header_print(const struct header *h);
void header_free(struct header *h);
int header_get_field_index(const struct header *h, const char *field);
void header_read(struct header *h, struct logger_logfile *log);
size_t header_get_record_size_from_mask(const struct header *h, const size_t mask);
void header_change_offset_direction(struct header *h, enum logger_offset_direction new_value);
size_t header_get_record_size_from_mask(const struct header *h,
const size_t mask);
void header_change_offset_direction(struct header *h,
enum logger_offset_direction new_value);
/**
* @brief Check if the offset are forward.
......
......@@ -37,10 +37,11 @@
* @param filename The filename.
*/
void logger_index_init(struct logger_index *index, struct logger_reader *reader,
char *filename) {
char *filename) {
/* Open file. */
index->data = logger_loader_io_mmap_file(filename, &index->file_size, /* read_only */ 1);
index->data = logger_loader_io_mmap_file(filename, &index->file_size,
/* read_only */ 1);
/* Read the double time. */
size_t offset = 0;
......@@ -48,15 +49,16 @@ void logger_index_init(struct logger_index *index, struct logger_reader *reader,
map = logger_loader_io_read_data(map, sizeof(double), &index->time);
/* Read the integer time. */
map = logger_loader_io_read_data(map, sizeof(integertime_t), &index->int_time);
map =
logger_loader_io_read_data(map, sizeof(integertime_t), &index->int_time);
/* Read the number of particles. */
map = logger_loader_io_read_data(map, swift_type_count * sizeof(long long),
&index->number_particles);
&index->number_particles);
/* Count total number of particles. */
long long N = 0;
for(int j = 0; j < swift_type_count; j++) {
for (int j = 0; j < swift_type_count; j++) {
N += index->number_particles[j];
}
......@@ -76,8 +78,7 @@ void logger_index_free(struct logger_index *index) {
/* Set variables to default value. */
index->total_number_particles = 0;
for(int i = 0; i < swift_type_count; i++) {
for (int i = 0; i < swift_type_count; i++) {
index->number_particles[i] = 0;
}
}
......@@ -28,7 +28,6 @@
struct logger_reader;
struct logger_index_data {
/* The particle's id. */
uint64_t id;
......@@ -65,12 +64,11 @@ struct logger_index {
/* Integer time of the index file. */
integertime_t int_time;
};
void logger_index_init(struct logger_index *index, struct logger_reader *reader,
char *filename);
char *filename);
void logger_index_free(struct logger_index *index);
#endif // __LOGGER_LOGGER_INDEX_H__
#endif // __LOGGER_LOGGER_INDEX_H__
......@@ -49,7 +49,8 @@ size_t logger_loader_io_get_file_size(int fd) {
* @param read_only Open the file in read only mode?
*
*/
void *logger_loader_io_mmap_file(char *filename, size_t *file_size, int read_only) {
void *logger_loader_io_mmap_file(char *filename, size_t *file_size,
int read_only) {
/* open the file. */
int fd;
......@@ -57,17 +58,15 @@ void *logger_loader_io_mmap_file(char *filename, size_t *file_size, int read_onl
fd = open(filename, O_RDONLY);
else
fd = open(filename, O_RDWR);
if (fd == -1)
error("Unable to open file %s (%s)", filename, strerror(errno));
if (fd == -1) error("Unable to open file %s (%s)", filename, strerror(errno));
/* get the file size. */
*file_size = logger_loader_io_get_file_size(fd);
/* map the memory. */
int mode = PROT_READ;
if (!read_only)
mode |= PROT_WRITE;
if (!read_only) mode |= PROT_WRITE;
void *map = mmap(NULL, *file_size, mode, MAP_SHARED, fd, 0);
if (map == MAP_FAILED)
......@@ -92,5 +91,4 @@ void logger_loader_io_munmap_file(void *map, size_t file_size) {
if (munmap(map, file_size) != 0) {
error("Unable to unmap the file (%s)", strerror(errno));
}
}
......@@ -30,7 +30,8 @@
#include <stdlib.h>
size_t logger_loader_io_get_file_size(int fd);
void *logger_loader_io_mmap_file(char *filename, size_t *file_size, int read_only);
void *logger_loader_io_mmap_file(char *filename, size_t *file_size,
int read_only);
void logger_loader_io_munmap_file(void *map, size_t file_size);
/**
......@@ -39,13 +40,13 @@ void logger_loader_io_munmap_file(void *map, size_t file_size);
* @param h #header file structure.
* @param data Pointer to the data to read.
* @param mask (output) mask read from the data.
* @param diff_offset (output) offset difference to previous/next corresponding record.
* @param diff_offset (output) offset difference to previous/next corresponding
* record.
*
* @return memory after the record header.
*/
__attribute__((always_inline)) INLINE static void* logger_loader_io_read_mask(
const struct header *h, void *data, size_t *mask,
size_t *diff_offset) {
__attribute__((always_inline)) INLINE static void *logger_loader_io_read_mask(
const struct header *h, void *data, size_t *mask, size_t *diff_offset) {
/* read mask */
if (mask) {
*mask = 0;
......@@ -72,7 +73,7 @@ __attribute__((always_inline)) INLINE static void* logger_loader_io_read_mask(
* @return memory after the data written.
*/
__attribute__((always_inline)) INLINE static void* logger_loader_io_read_data(
__attribute__((always_inline)) INLINE static void *logger_loader_io_read_data(
void *data, const size_t size, void *p) {
memcpy(p, data, size);
return data + size;
......@@ -87,7 +88,7 @@ __attribute__((always_inline)) INLINE static void* logger_loader_io_read_data(
*
* @return memory after the data written.
*/
__attribute__((always_inline)) INLINE static void* logger_loader_io_write_data(
__attribute__((always_inline)) INLINE static void *logger_loader_io_write_data(
void *data, const size_t size, const void *p) {
memcpy(data, p, size);
......
......@@ -17,8 +17,8 @@
*
******************************************************************************/
#include "logger_logfile.h"
#include "logger_reader.h"
#include "logger_loader_io.h"
#include "logger_reader.h"
/**
* @brief Initialize the #logger_logfile.
......@@ -29,27 +29,24 @@
* @param reader The #logger_reader.
* @param only_header Read only the header.
*/
void logger_logfile_init_from_file(
struct logger_logfile *log, char *filename,
struct logger_reader *reader, int only_header) {
void logger_logfile_init_from_file(struct logger_logfile *log, char *filename,
struct logger_reader *reader,
int only_header) {
/* Set the pointer to the reader. */
log->reader = reader;
if (&reader->log != log)
error("Wrong link to the reader.");
if (&reader->log != log) error("Wrong link to the reader.");
/* Set pointers to zero. */
time_array_init(&log->times);
/* Open file, map it and get its size. */
if (reader->verbose > 1)
message("Mapping the log file.");
log->log.map = logger_loader_io_mmap_file(
filename, &log->log.file_size, /* read_only */ 1);
if (reader->verbose > 1) message("Mapping the log file.");
log->log.map = logger_loader_io_mmap_file(filename, &log->log.file_size,
/* read_only */ 1);
/* Read the header. */
if (reader->verbose > 1)
message("Reading the header.");
if (reader->verbose > 1) message("Reading the header.");
header_read(&log->header, log);
/* Print the header. */
......@@ -59,8 +56,7 @@ void logger_logfile_init_from_file(
/* No need to continue if only the
header is required. */
if (only_header)
return;
if (only_header) return;
/* Check if the offset are corrupted. */
if (header_is_corrupted(&log->header)) {
......@@ -73,15 +69,13 @@ void logger_logfile_init_from_file(
}
/* Initialize the time array. */
if (reader->verbose > 1)
message("Reading the time stamps.");
if (reader->verbose > 1) message("Reading the time stamps.");
time_array_populate(&log->times, log);
/* Print the time array. */
if (reader->verbose > 0) {
time_array_print(&log->times);
}
}
/**
......@@ -95,7 +89,6 @@ void logger_logfile_free(struct logger_logfile *log) {
time_array_free(&log->times);
}
/**
* @brief Reverse offset in log file
*
......@@ -106,30 +99,29 @@ void logger_logfile_reverse_offset(struct logger_logfile *log, char *filename) {
/* Close and reopen the file in write mode. */
logger_loader_io_munmap_file(log->log.map, log->log.file_size);
log->log.map = logger_loader_io_mmap_file(
filename, &log->log.file_size, /* read_only */ 0);
log->log.map = logger_loader_io_mmap_file(filename, &log->log.file_size,
/* read_only */ 0);
/* Get pointers */
struct header *header = &log->header;
const struct logger_reader *reader = log->reader;
if (&reader->log != log)
error("Wrong link to the reader.");
if (&reader->log != log) error("Wrong link to the reader.");
/* Check if the offsets need to be reversed. */
if (!header_is_backward(header)) {
error("The offsets are already reversed.");
}
#ifdef SWIFT_DEBUG_CHECKS
if (reader->verbose > 0) {
message("Check record's headers...");
}
/* check that the record offset points to another record. */
for(size_t offset_debug = header->offset_first_record;
offset_debug < log->log.file_size;
offset_debug = tools_check_record_consistency(reader, offset_debug)) {}
for (size_t offset_debug = header->offset_first_record;
offset_debug < log->log.file_size;
offset_debug = tools_check_record_consistency(reader, offset_debug)) {
}
if (reader->verbose > 0) {
message("Record's headers are correct.");
......@@ -140,15 +132,15 @@ void logger_logfile_reverse_offset(struct logger_logfile *log, char *filename) {
/* Set the offset direction to a corrupted status. */
header_change_offset_direction(header, logger_offset_corrupted);
if (reader->verbose > 0) {
message("Reversing offsets...");
}
/* reverse the record's offset. */
for(size_t offset = header->offset_first_record;
offset < log->log.file_size;
offset = tools_reverse_offset(header, log->log.map, offset)) {}
for (size_t offset = header->offset_first_record; offset < log->log.file_size;
offset = tools_reverse_offset(header, log->log.map, offset)) {
}
if (reader->verbose > 0) {
message("Reversing done");
......@@ -166,9 +158,10 @@ void logger_logfile_reverse_offset(struct logger_logfile *log, char *filename) {
}
/* check that the record offset points to another record. */
for(size_t offset_debug = header->offset_first_record;
offset_debug < log->log.file_size;
offset_debug = tools_check_record_consistency(reader, offset_debug)) {}
for (size_t offset_debug = header->offset_first_record;
offset_debug < log->log.file_size;
offset_debug = tools_check_record_consistency(reader, offset_debug)) {
}
if (reader->verbose > 0) {
message("Record's headers are correct.");
......@@ -177,6 +170,6 @@ void logger_logfile_reverse_offset(struct logger_logfile *log, char *filename) {
/* Close and reopen the file in read mode. */
logger_loader_io_munmap_file(log->log.map, log->log.file_size);
log->log.map = logger_loader_io_mmap_file(
filename, &log->log.file_size, /* read_only */ 1);
log->log.map = logger_loader_io_mmap_file(filename, &log->log.file_size,
/* read_only */ 1);
}
......@@ -58,13 +58,12 @@ struct logger_logfile {
size_t file_size;
} log;
};
void logger_logfile_init_from_file(struct logger_logfile *log, char *filename, struct logger_reader *reader,
int only_header);
void logger_logfile_init_from_file(struct logger_logfile *log, char *filename,
struct logger_reader *reader,
int only_header);
void logger_logfile_reverse_offset(struct logger_logfile *log, char *filename);
void logger_logfile_free(struct logger_logfile *log);
#endif // __LOGGER_LOGGER_LOGFILE_H__
#endif // __LOGGER_LOGGER_LOGFILE_H__
......@@ -73,8 +73,8 @@ void logger_particle_init(struct logger_particle *part) {
*
* @return mapped data after the block read.
*/
void* logger_particle_read_field(struct logger_particle *part, void *map,
const char *field, const size_t size) {
void *logger_particle_read_field(struct logger_particle *part, void *map,
const char *field, const size_t size) {
void *p = NULL;
/* Get the correct pointer. */
......@@ -124,9 +124,10 @@ void* logger_particle_read_field(struct logger_particle *part, void *map,
*
* @return position after the record.
*/
size_t logger_particle_read(struct logger_particle *part, const struct logger_reader *reader,
size_t offset, const double time,
const enum logger_reader_type reader_type) {
size_t logger_particle_read(struct logger_particle *part,
const struct logger_reader *reader, size_t offset,
const double time,
const enum logger_reader_type reader_type) {
/* Get a few pointers. */
const struct header *h = &reader->log.header;
......@@ -149,23 +150,21 @@ size_t logger_particle_read(struct logger_particle *part, const struct logger_re
for (size_t i = 0; i < h->number_mask; i++) {
if (mask & h->masks[i].mask) {
map = logger_particle_read_field(part, map, h->masks[i].name,
h->masks[i].size);
h->masks[i].size);
}
}
/* Get the time of current record. */
if (times->next) {
part->time = time_array_get_time(times, offset);
}
else
} else
part->time = -1;
/* update the offset. */
offset = (size_t) (map - reader->log.log.map);
offset = (size_t)(map - reader->log.log.map);
/* Check if an interpolation is required. */
if (reader_type == logger_reader_const)
return offset;
if (reader_type == logger_reader_const) return offset;
/* Start reading next record. */
struct logger_particle part_next;
......@@ -176,19 +175,18 @@ size_t logger_particle_read(struct logger_particle *part, const struct logger_re
}
/* No next particle. */
if (h_offset == 0)
return (size_t) (map - reader->log.log.map);
if (h_offset == 0) return (size_t)(map - reader->log.log.map);
/* get absolute offset of next particle. */
h_offset += offset - header_get_record_size_from_mask(h, mask) - LOGGER_MASK_SIZE -
LOGGER_OFFSET_SIZE;
h_offset += offset - header_get_record_size_from_mask(h, mask) -
LOGGER_MASK_SIZE - LOGGER_OFFSET_SIZE;
/* Get time of next record. */
part_next.time = time_array_get_time(times, h_offset);
/* Read next record. */
h_offset = logger_particle_read(&part_next, reader, h_offset, part_next.time,
logger_reader_const);
logger_reader_const);
/* Interpolate the two particles. */
logger_particle_interpolate(part, &part_next, time);
......@@ -205,9 +203,9 @@ size_t logger_particle_read(struct logger_particle *part, const struct logger_re
* @param time interpolation time
*
*/
void logger_particle_interpolate(
struct logger_particle *part_curr, const struct logger_particle *part_next,
const double time) {
void logger_particle_interpolate(struct logger_particle *part_curr,
const struct logger_particle *part_next,
const double time) {
/* Check that a particle is provided. */
if (!part_curr) error("part_curr is NULL");
......
......@@ -85,19 +85,20 @@ struct logger_particle {
*/
enum logger_reader_type {
logger_reader_const, /* Constant interpolation. */
logger_reader_lin, /* Linear interpolation. */
logger_reader_lin, /* Linear interpolation. */
};
void logger_particle_print(const struct logger_particle *p);
size_t logger_particle_read(struct logger_particle *part, const struct logger_reader *reader,
size_t offset, const double time,
const enum logger_reader_type reader_type);
size_t logger_particle_read(struct logger_particle *part,
const struct logger_reader *reader, size_t offset,
const double time,
const enum logger_reader_type reader_type);
void logger_particle_init(struct logger_particle *part);
void* logger_particle_read_field(struct logger_particle *part, void *map,
const char *field, const size_t size);
void *logger_particle_read_field(struct logger_particle *part, void *map,
const char *field, const size_t size);
void logger_particle_interpolate(struct logger_particle *part_curr,
const struct logger_particle *part_next,
......
......@@ -123,8 +123,7 @@ static PyObject *loadFromIndex(__attribute__((unused)) PyObject *self,
id = (PyArrayObject *)PyArray_SimpleNew(1, PyArray_DIMS(offset), NPY_ULONG);
}
if (verbose > 1)
message("Reading particles.");
if (verbose > 1) message("Reading particles.");
/* loop over all particles. */
for (npy_intp i = 0; i < PyArray_DIMS(offset)[0]; i++) {
......@@ -134,7 +133,8 @@ static PyObject *loadFromIndex(__attribute__((unused)) PyObject *self,
size_t offset_particle = *(size_t *)PyArray_GETPTR1(offset, i);
/* Read the particle. */
logger_particle_read(&part, &reader, offset_particle, time, logger_reader_lin);
logger_particle_read(&part, &reader, offset_particle, time,
logger_reader_lin);
double *dtmp;
float *ftmp;
......
......@@ -26,19 +26,18 @@
* @param filename The log filename.
* @param verbose The verbose level.
*/
void logger_reader_init(struct logger_reader *reader, char *filename, int verbose) {
if (verbose > 1)
message("Initializing the reader");
void logger_reader_init(struct logger_reader *reader, char *filename,
int verbose) {
if (verbose > 1) message("Initializing the reader");
/* Initialize the reader variables. */
reader->verbose = verbose;
/* Initialize the log file. */
logger_logfile_init_from_file(&reader->log, filename, reader,
/* only_header */ 0);
/* only_header */ 0);
if (verbose > 1)
message("Initialization done.");
if (verbose > 1) message("Initialization done.");
}
/**
......@@ -62,8 +61,9 @@ void logger_reader_free(struct logger_reader *reader) {
*
* @return The offset after this record.
*/
size_t reader_read_record(struct logger_reader *reader, struct logger_particle *lp,
double *time, int *is_particle, size_t offset) {
size_t reader_read_record(struct logger_reader *reader,
struct logger_particle *lp, double *time,
int *is_particle, size_t offset) {
struct logger_logfile *log = &reader->log;
......@@ -80,10 +80,10 @@ size_t reader_read_record(struct logger_reader *reader, struct logger_particle *
*is_particle = 0;
integertime_t int_time = 0;
offset = time_read(&int_time, time, reader, offset);
}
else {
} else {
*is_particle = 1;
offset = logger_particle_read(lp, reader, offset, *time, logger_reader_const);
offset =
logger_particle_read(lp, reader, offset, *time, logger_reader_const);
}
return offset;
......
......@@ -23,27 +23,33 @@
* Here is a quick summary of our different elements:
*
* The logger is a time adaptive way to write snapshots.
* It consists of a set of files: the log file, the parameter file and the index files.
* It consists of a set of files: the log file, the parameter file and the index
* files.
*
* The <b>parameter file</b> contains all the information related to the code (e.g. boxsize).
* The <b>parameter file</b> contains all the information related to the code
* (e.g. boxsize).
*
* The <b>index files</b> are not mandatory files that indicates the position of the particles in
* the log file at a given time step. They are useful to speedup the reading.
* The <b>index files</b> are not mandatory files that indicates the position of
* the particles in the log file at a given time step. They are useful to
* speedup the reading.
*
* The <b>log file</b> consists in a large file where the particles are logged one after the other.
* It contains a <b>log file header</b> at the beginning of the file and a large collection of <b>records</b>.
* The <b>log file</b> consists in a large file where the particles are logged
* one after the other. It contains a <b>log file header</b> at the beginning of
* the file and a large collection of <b>records</b>.
*
* The records are logged one after the other and each contains a <b>record header</b> and then a list of <b>named entries</b>.
* In the record header, a <b>mask</b> is provided that corresponds to the type of named entries present in this record.
* It also contains the <b>offset</b> to the previous or next record for this particle.
* The records are logged one after the other and each contains a <b>record
* header</b> and then a list of <b>named entries</b>. In the record header, a
* <b>mask</b> is provided that corresponds to the type of named entries present
* in this record. It also contains the <b>offset</b> to the previous or next
* record for this particle.
*/
#ifndef __LOGGER_LOGGER_READER_H__
#define __LOGGER_LOGGER_READER_H__
#include "logger_index.h"
#include "logger_loader_io.h"
#include "logger_logfile.h"
#include "logger_index.h"
#include "logger_particle.h"
/**
......@@ -62,7 +68,7 @@ struct logger_reader {
/* Information contained in the index file. */
struct logger_index index;
/* Informations contained in the file header. */
struct logger_logfile log;
......@@ -70,8 +76,10 @@ struct logger_reader {
int verbose;
};
void logger_reader_init(struct logger_reader *reader, char *filename, int verbose);
void logger_reader_init(struct logger_reader *reader, char *filename,
int verbose);
void logger_reader_free(struct logger_reader *reader);
size_t reader_read_record(struct logger_reader *reader, struct logger_particle *lp,
double *time, int *is_particle, size_t offset);
size_t reader_read_record(struct logger_reader *reader,
struct logger_particle *lp, double *time,
int *is_particle, size_t offset);
#endif // __LOGGER_LOGGER_READER_H__
......@@ -30,8 +30,8 @@
* @param offset position in the file.
*
*/
size_t time_read(integertime_t *int_time, double *time, const struct logger_reader *reader,
size_t offset) {
size_t time_read(integertime_t *int_time, double *time,
const struct logger_reader *reader, size_t offset) {
/* Initialize variables. */
const struct header *h = &reader->log.header;
......@@ -56,11 +56,11 @@ size_t time_read(integertime_t *int_time, double *time, const struct logger_read
#endif
/* read the record. */
map = logger_loader_io_read_data(map, sizeof(unsigned long long int), int_time);
map =
logger_loader_io_read_data(map, sizeof(unsigned long long int), int_time);
map = logger_loader_io_read_data(map, sizeof(double), time);
return map - h->log->log.map;