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
e29c1a60
Commit
e29c1a60
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Do not compress the datasets if there are 0 elements.
parent
5076dc36
No related branches found
No related tags found
1 merge request
!990
Distributed snapshots
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/distributed_io.c
+28
-19
28 additions, 19 deletions
src/distributed_io.c
with
28 additions
and
19 deletions
src/distributed_io.c
+
28
−
19
View file @
e29c1a60
...
...
@@ -99,7 +99,12 @@ void write_distributed_array(const struct engine* e, hid_t grp,
io_copy_temp_buffer
(
temp
,
e
,
props
,
N
,
internal_units
,
snapshot_units
);
/* Create data space */
const
hid_t
h_space
=
H5Screate
(
H5S_SIMPLE
);
hid_t
h_space
;
if
(
N
>
0
)
h_space
=
H5Screate
(
H5S_SIMPLE
);
else
h_space
=
H5Screate
(
H5S_NULL
);
if
(
h_space
<
0
)
error
(
"Error while creating data space for field '%s'."
,
props
.
name
);
...
...
@@ -132,28 +137,32 @@ void write_distributed_array(const struct engine* e, hid_t grp,
/* Dataset properties */
const
hid_t
h_prop
=
H5Pcreate
(
H5P_DATASET_CREATE
);
/* Set chunk size */
h_err
=
H5Pset_chunk
(
h_prop
,
rank
,
chunk_shape
);
if
(
h_err
<
0
)
error
(
"Error while setting chunk size (%llu, %llu) for field '%s'."
,
chunk_shape
[
0
],
chunk_shape
[
1
],
props
.
name
);
/* Impose check-sum to verify data corruption */
h_err
=
H5Pset_fletcher32
(
h_prop
);
if
(
h_err
<
0
)
error
(
"Error while setting checksum options for field '%s'."
,
props
.
name
);
/* Create filters and set compression level if we have something to write */
if
(
N
>
0
)
{
/* Impose data compression */
if
(
e
->
snapshot_compression
>
0
)
{
h_err
=
H5Pset_shuffle
(
h_prop
);
/* Set chunk size */
h_err
=
H5Pset_chunk
(
h_prop
,
rank
,
chunk_shape
);
if
(
h_err
<
0
)
error
(
"Error while setting
s
hu
ffling options
for field '%s'."
,
props
.
name
);
error
(
"Error while setting
c
hu
nk size (%llu, %llu)
for field '%s'."
,
chunk_shape
[
0
],
chunk_shape
[
1
],
props
.
name
);
h_err
=
H5Pset_deflate
(
h_prop
,
e
->
snapshot_compression
);
/* Impose check-sum to verify data corruption */
h_err
=
H5Pset_fletcher32
(
h_prop
);
if
(
h_err
<
0
)
error
(
"Error while setting compression options for field '%s'."
,
props
.
name
);
error
(
"Error while setting checksum options for field '%s'."
,
props
.
name
);
/* Impose data compression */
if
(
e
->
snapshot_compression
>
0
)
{
h_err
=
H5Pset_shuffle
(
h_prop
);
if
(
h_err
<
0
)
error
(
"Error while setting shuffling options for field '%s'."
,
props
.
name
);
h_err
=
H5Pset_deflate
(
h_prop
,
e
->
snapshot_compression
);
if
(
h_err
<
0
)
error
(
"Error while setting compression options for field '%s'."
,
props
.
name
);
}
}
/* Create dataset */
...
...
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