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
ee351587
Commit
ee351587
authored
May 23, 2020
by
Matthieu Schaller
Browse files
Also add an output type to the header of all the snapshots
parent
b8944f8a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/distributed_io.c
View file @
ee351587
...
...
@@ -391,6 +391,7 @@ void write_output_distributed(struct engine* e,
swift_type_count
);
io_write_attribute_i
(
h_grp
,
"NumFilesPerSnapshot"
,
numFiles
);
io_write_attribute_i
(
h_grp
,
"ThisFile"
,
mpi_rank
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"Snapshot"
);
/* Close header */
H5Gclose
(
h_grp
);
...
...
src/line_of_sight.c
View file @
ee351587
...
...
@@ -488,17 +488,19 @@ void write_hdf5_header(hid_t h_file, const struct engine *e,
e
->
s
->
dim
[
2
]
*
factor_length
};
io_write_attribute
(
h_grp
,
"BoxSize"
,
DOUBLE
,
dim
,
3
);
io_write_attribute
(
h_grp
,
"Time"
,
DOUBLE
,
&
dblTime
,
1
);
const
int
dimension
=
(
int
)
hydro_dimension
;
io_write_attribute
(
h_grp
,
"Dimension"
,
INT
,
&
dimension
,
1
);
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_d
(
h_grp
,
"Time"
,
dblTime
);
io_write_attribute_d
(
h_grp
,
"Dimension"
,
(
int
)
hydro_dimension
);
io_write_attribute_d
(
h_grp
,
"Redshift"
,
e
->
cosmology
->
z
);
io_write_attribute_d
(
h_grp
,
"Scale-factor"
,
e
->
cosmology
->
a
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
io_write_attribute_s
(
h_grp
,
"RunName"
,
e
->
run_name
);
const
int
num_files_per_snapshot
=
1
;
io_write_attribute
(
h_grp
,
"NumFilesPerSnapshot"
,
INT
,
&
num_files_per_snapshot
,
1
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"LineOfSight"
);
/* Store the time at which the snapshot was written */
time_t
tm
=
time
(
NULL
);
struct
tm
*
timeinfo
=
localtime
(
&
tm
);
char
snapshot_date
[
64
];
strftime
(
snapshot_date
,
64
,
"%T %F %Z"
,
timeinfo
);
io_write_attribute_s
(
h_grp
,
"Snapshot date"
,
snapshot_date
);
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
@@ -516,13 +518,9 @@ void write_hdf5_header(hid_t h_file, const struct engine *e,
swift_type_count
);
io_write_attribute
(
h_grp
,
"NumPart_Total_HighWord"
,
UINT
,
numParticlesHighWord
,
swift_type_count
);
/* Store the time at which the snapshot was written */
time_t
tm
=
time
(
NULL
);
struct
tm
*
timeinfo
=
localtime
(
&
tm
);
char
snapshot_date
[
64
];
strftime
(
snapshot_date
,
64
,
"%T %F %Z"
,
timeinfo
);
io_write_attribute_s
(
h_grp
,
"Snapshot date"
,
snapshot_date
);
io_write_attribute_i
(
h_grp
,
"NumFilesPerSnapshot"
,
1
);
io_write_attribute_i
(
h_grp
,
"ThisFile"
,
0
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"LineOfSight"
);
/* Close group */
H5Gclose
(
h_grp
);
...
...
src/parallel_io.c
View file @
ee351587
...
...
@@ -1139,6 +1139,7 @@ void prepare_file(struct engine* e, const char* fileName,
swift_type_count
);
io_write_attribute
(
h_grp
,
"NumFilesPerSnapshot"
,
INT
,
&
numFiles
,
1
);
io_write_attribute_i
(
h_grp
,
"ThisFile"
,
0
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"Snapshot"
);
/* Close header */
H5Gclose
(
h_grp
);
...
...
src/serial_io.c
View file @
ee351587
...
...
@@ -1006,6 +1006,7 @@ void write_output_serial(struct engine* e,
swift_type_count
);
io_write_attribute
(
h_grp
,
"NumFilesPerSnapshot"
,
INT
,
&
numFiles
,
1
);
io_write_attribute_i
(
h_grp
,
"ThisFile"
,
0
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"Snapshot"
);
/* Close header */
H5Gclose
(
h_grp
);
...
...
src/single_io.c
View file @
ee351587
...
...
@@ -851,6 +851,7 @@ void write_output_single(struct engine* e,
swift_type_count
);
io_write_attribute
(
h_grp
,
"NumFilesPerSnapshot"
,
INT
,
&
numFiles
,
1
);
io_write_attribute_i
(
h_grp
,
"ThisFile"
,
0
);
io_write_attribute_s
(
h_grp
,
"OutputType"
,
"Snapshot"
);
/* Close header */
H5Gclose
(
h_grp
);
...
...
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