Skip to content
Snippets Groups Projects
Commit 8145ecbb authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Remove logger_struct

parent 74782b71
No related branches found
No related tags found
1 merge request!502Logger
......@@ -33,7 +33,7 @@
#include "chemistry_struct.h"
#include "cooling_struct.h"
#include "logger_struct.h"
#include "logger.h"
/* Extra particle data not needed during the SPH loops over neighbours. */
struct xpart {
......
......@@ -23,13 +23,15 @@
/* Includes. */
#include "common_io.h"
#include "engine.h"
#include "logger_struct.h"
#include "part.h"
#include "inline.h"
#include "timeline.h"
#include "units.h"
/* Forward declaration */
struct dump;
struct part;
struct gpart;
struct engine;
/**
* Logger entries contain messages representing the particle data at a given
......@@ -98,6 +100,80 @@ struct dump;
extern char logger_version[logger_version_size];
#define LOGGER_STRING_LENGTH 200
/* parameters of the logger */
struct logger_parameters {
/* size of a label in bytes */
size_t label_size;
/* size of an offset in bytes */
size_t offset_size;
/* size of a mask in bytes */
size_t mask_size;
/* size of a number in bytes */
size_t number_size;
/* size of a data type in bytes */
size_t data_type_size;
/* number of different mask */
size_t nber_mask;
/* value of each masks */
size_t *masks;
/* data size of each mask */
size_t *masks_data_size;
/* label of each mask */
char *masks_name;
};
/* structure containing global data */
struct logger {
/* Number of particle steps between dumping a chunk of data */
short int delta_step;
/* Logger basename */
char base_name[LOGGER_STRING_LENGTH];
/* File name of the dump file */
struct dump *dump;
/* timestamp offset for logger*/
size_t timestamp_offset;
/* size of the buffer */
size_t buffer_size;
/* scaling factor when buffer is too small */
float buffer_scale;
/* logger parameters */
struct logger_parameters *params;
} SWIFT_STRUCT_ALIGN;
/* required structure for each particle type */
struct logger_part_data {
/* Number of particle updates since last output */
short int last_output;
/* offset of last particle log entry */
size_t last_offset;
};
INLINE static void logger_part_data_init(
struct logger_part_data *logger ) {
logger->last_offset = 0;
logger->last_output = SHRT_MAX;
}
enum logger_datatype {
logger_data_int,
logger_data_float,
......
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2017 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_LOGGER_STRUCT_H
#define SWIFT_LOGGER_STRUCT_H
#ifdef WITH_LOGGER
#include <limits.h>
/* Local Includes */
#include "dump.h"
#define LOGGER_STRING_LENGTH 200
/* parameters of the logger */
struct logger_parameters {
/* size of a label in bytes */
size_t label_size;
/* size of an offset in bytes */
size_t offset_size;
/* size of a mask in bytes */
size_t mask_size;
/* size of a number in bytes */
size_t number_size;
/* size of a data type in bytes */
size_t data_type_size;
/* number of different mask */
size_t nber_mask;
/* value of each masks */
size_t *masks;
/* data size of each mask */
size_t *masks_data_size;
/* label of each mask */
char *masks_name;
};
/* structure containing global data */
struct logger {
/* Number of particle steps between dumping a chunk of data */
short int delta_step;
/* Logger basename */
char base_name[LOGGER_STRING_LENGTH];
/* File name of the dump file */
struct dump *dump;
/* timestamp offset for logger*/
size_t timestamp_offset;
/* size of the buffer */
size_t buffer_size;
/* scaling factor when buffer is too small */
float buffer_scale;
/* logger parameters */
struct logger_parameters *params;
} SWIFT_STRUCT_ALIGN;
/* required structure for each particle type */
struct logger_part_data {
/* Number of particle updates since last output */
short int last_output;
/* offset of last particle log entry */
size_t last_offset;
};
__attribute__((always_inline)) INLINE static void logger_part_data_init(
struct logger_part_data *logger ) {
logger->last_offset = 0;
logger->last_output = SHRT_MAX;
}
#endif // WITH_LOGGER
#endif // SWIFT_LOGGER_STRUCT_H
......@@ -47,7 +47,7 @@ void write_output_parallel(struct engine* e, const char* baseName,
int mpi_rank, int mpi_size, MPI_Comm comm,
MPI_Info info);
void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
void writeArray(struct engine* e, hid_t grp, char* fileName,
char* partTypeGroupName, struct io_props props, size_t N,
long long N_total, int mpi_rank, long long offset,
const struct unit_system* internal_units,
......
......@@ -47,7 +47,6 @@
#include "lock.h"
#include "logger.h"
#include "logger_io.h"
#include "logger_struct.h"
#include "map.h"
#include "mesh_gravity.h"
#include "multipole.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment