Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dorie
dorie
Commits
1861f3b1
Commit
1861f3b1
authored
Sep 27, 2018
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in H5File
Already opened groups were not closed when calling 'open_group' again.
parent
568a1a24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
dune/dorie/solver/util_h5file.hh
dune/dorie/solver/util_h5file.hh
+10
-2
No files found.
dune/dorie/solver/util_h5file.hh
View file @
1861f3b1
...
...
@@ -30,7 +30,9 @@ public:
* \param verbose Verbosity of the output
*/
explicit
H5File
(
const
std
::
string
&
file_path
,
const
int
verbose
)
:
_verbose
(
verbose
)
_verbose
(
verbose
),
_file_id
(
-
1
),
_group_id
(
-
1
)
{
// set up property list for collective I/O
hid_t
h5_plist_id
=
H5Pcreate
(
H5P_FILE_ACCESS
);
...
...
@@ -72,7 +74,13 @@ public:
*/
void
open_group
(
const
std
::
string
&
group_path
=
"./"
)
{
// open the group
// close the group if we already opened it
if
(
_group_id
>=
0
)
{
herr_t
status
=
H5Gclose
(
_group_id
);
assert
(
status
>
-
1
);
}
// open the new group
_group_id
=
H5Gopen
(
_file_id
,
group_path
.
c_str
(),
H5P_DEFAULT
);
if
(
_group_id
<
0
)
{
throw
std
::
runtime_error
(
"Cannot open H5 group "
+
group_path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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