Commit 1e5b4b13 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

use particle information for checkpointing

parent da7480f6
......@@ -327,14 +327,23 @@ void kraichnan_field<rnumber>::update_checkpoint()
hsize_t fields_stored;
hid_t fid, group_id;
fid = H5Fopen(fname.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
group_id = H5Gopen(fid, "velocity/real", H5P_DEFAULT);
H5Gget_num_objs(
group_id = H5Gopen(fid, "tracers0/state", H5P_DEFAULT);
bool dset_exists;
if (group_id > 0)
{
H5Gget_num_objs(
group_id,
&fields_stored);
bool dset_exists = H5Lexists(
dset_exists = H5Lexists(
group_id,
std::to_string(this->iteration).c_str(),
H5P_DEFAULT);
}
else
{
fields_stored = 0;
dset_exists = false;
}
H5Gclose(group_id);
H5Fclose(fid);
if ((int(fields_stored) >= this->checkpoints_per_file) &&
......@@ -351,13 +360,13 @@ void kraichnan_field<rnumber>::update_checkpoint()
H5P_DEFAULT);
hid_t gg = H5Gcreate(
fid,
"velocity",
"tracers0",
H5P_DEFAULT,
H5P_DEFAULT,
H5P_DEFAULT);
hid_t ggg = H5Gcreate(
gg,
"real",
"state",
H5P_DEFAULT,
H5P_DEFAULT,
H5P_DEFAULT);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment