Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dd5c60cf
Commit
dd5c60cf
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting
parent
f346d944
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!98
Compressed i/o
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/parallel_io.c
+9
-5
9 additions, 5 deletions
src/parallel_io.c
src/serial_io.c
+5
-3
5 additions, 3 deletions
src/serial_io.c
with
14 additions
and
8 deletions
src/parallel_io.c
+
9
−
5
View file @
dd5c60cf
...
...
@@ -183,7 +183,8 @@ void writeArrayBackEnd(hid_t grp, char* fileName, FILE* xmfFile, char* name,
int
mpi_rank
,
long
long
offset
,
char
*
part_c
,
struct
UnitSystem
*
us
,
enum
UnitConversionFactor
convFactor
)
{
hid_t
h_data
=
0
,
h_err
=
0
,
h_memspace
=
0
,
h_filespace
=
0
,
h_plist_id
=
0
,
h_prop
=
0
;
hid_t
h_data
=
0
,
h_err
=
0
,
h_memspace
=
0
,
h_filespace
=
0
,
h_plist_id
=
0
,
h_prop
=
0
;
hsize_t
shape
[
2
],
shape_total
[
2
],
offsets
[
2
],
chunk_shape
[
2
];
void
*
temp
=
0
;
int
i
=
0
,
rank
=
0
;
...
...
@@ -267,7 +268,8 @@ void writeArrayBackEnd(hid_t grp, char* fileName, FILE* xmfFile, char* name,
}
/* Create dataset */
h_data
=
H5Dcreate
(
grp
,
name
,
hdf5Type
(
type
),
h_filespace
,
H5P_DEFAULT
,
h_prop
,
H5P_DEFAULT
);
h_data
=
H5Dcreate
(
grp
,
name
,
hdf5Type
(
type
),
h_filespace
,
H5P_DEFAULT
,
h_prop
,
H5P_DEFAULT
);
if
(
h_data
<
0
)
{
error
(
"Error while creating dataset '%s'."
,
name
);
}
...
...
@@ -528,7 +530,8 @@ void write_output_parallel(struct engine* e, struct UnitSystem* us,
/* Open header to write simulation properties */
/* message("Writing runtime parameters..."); */
h_grp
=
H5Gcreate
(
h_file
,
"/RuntimePars"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
h_grp
=
H5Gcreate
(
h_file
,
"/RuntimePars"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
if
(
h_grp
<
0
)
error
(
"Error while creating runtime parameters group
\n
"
);
/* Write the relevant information */
...
...
@@ -566,7 +569,7 @@ void write_output_parallel(struct engine* e, struct UnitSystem* us,
writeCodeDescription
(
h_file
);
/* Print the SPH parameters */
h_grpsph
=
H5Gcreate
(
h_file
,
"/SPH"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
h_grpsph
=
H5Gcreate
(
h_file
,
"/SPH"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
if
(
h_grpsph
<
0
)
error
(
"Error while creating SPH group"
);
writeSPHflavour
(
h_grpsph
);
H5Gclose
(
h_grpsph
);
...
...
@@ -576,7 +579,8 @@ void write_output_parallel(struct engine* e, struct UnitSystem* us,
/* Create SPH particles group */
/* message("Writing particle arrays..."); */
h_grp
=
H5Gcreate
(
h_file
,
"/PartType0"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
h_grp
=
H5Gcreate
(
h_file
,
"/PartType0"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
if
(
h_grp
<
0
)
error
(
"Error while creating particle group.
\n
"
);
/* Write particle fields from the particle structure */
...
...
This diff is collapsed.
Click to expand it.
src/serial_io.c
+
5
−
3
View file @
dd5c60cf
...
...
@@ -225,7 +225,7 @@ void prepareArray(hid_t grp, char* fileName, FILE* xmfFile, char* name,
/* Create dataset */
h_data
=
H5Dcreate
(
grp
,
name
,
hdf5Type
(
type
),
h_space
,
H5P_DEFAULT
,
h_prop
,
H5P_DEFAULT
);
H5P_DEFAULT
);
if
(
h_data
<
0
)
{
error
(
"Error while creating dataspace '%s'."
,
name
);
}
...
...
@@ -586,7 +586,8 @@ void write_output_serial(struct engine* e, struct UnitSystem* us, int mpi_rank,
/* Open header to write simulation properties */
/* message("Writing runtime parameters..."); */
h_grp
=
H5Gcreate
(
h_file
,
"/RuntimePars"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
h_grp
=
H5Gcreate
(
h_file
,
"/RuntimePars"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
if
(
h_grp
<
0
)
error
(
"Error while creating runtime parameters group
\n
"
);
/* Write the relevant information */
...
...
@@ -634,7 +635,8 @@ void write_output_serial(struct engine* e, struct UnitSystem* us, int mpi_rank,
/* Create SPH particles group */
/* message("Writing particle arrays..."); */
h_grp
=
H5Gcreate
(
h_file
,
"/PartType0"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
h_grp
=
H5Gcreate
(
h_file
,
"/PartType0"
,
H5P_DEFAULT
,
H5P_DEFAULT
,
H5P_DEFAULT
);
if
(
h_grp
<
0
)
error
(
"Error while creating particle group.
\n
"
);
/* Close particle group */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment