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
8145ecbb
Commit
8145ecbb
authored
Jun 29, 2018
by
Loic Hausammann
Browse files
Remove logger_struct
parent
74782b71
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro_part.h
View file @
8145ecbb
...
...
@@ -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
{
...
...
src/logger.h
View file @
8145ecbb
...
...
@@ -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
,
...
...
src/logger_struct.h
deleted
100644 → 0
View file @
74782b71
/*******************************************************************************
* 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
src/parallel_io.h
View file @
8145ecbb
...
...
@@ -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
,
...
...
src/swift.h
View file @
8145ecbb
...
...
@@ -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"
...
...
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