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() ...@@ -327,14 +327,23 @@ void kraichnan_field<rnumber>::update_checkpoint()
hsize_t fields_stored; hsize_t fields_stored;
hid_t fid, group_id; hid_t fid, group_id;
fid = H5Fopen(fname.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); fid = H5Fopen(fname.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
group_id = H5Gopen(fid, "velocity/real", H5P_DEFAULT); group_id = H5Gopen(fid, "tracers0/state", H5P_DEFAULT);
H5Gget_num_objs( bool dset_exists;
if (group_id > 0)
{
H5Gget_num_objs(
group_id, group_id,
&fields_stored); &fields_stored);
bool dset_exists = H5Lexists( dset_exists = H5Lexists(
group_id, group_id,
std::to_string(this->iteration).c_str(), std::to_string(this->iteration).c_str(),
H5P_DEFAULT); H5P_DEFAULT);
}
else
{
fields_stored = 0;
dset_exists = false;
}
H5Gclose(group_id); H5Gclose(group_id);
H5Fclose(fid); H5Fclose(fid);
if ((int(fields_stored) >= this->checkpoints_per_file) && if ((int(fields_stored) >= this->checkpoints_per_file) &&
...@@ -351,13 +360,13 @@ void kraichnan_field<rnumber>::update_checkpoint() ...@@ -351,13 +360,13 @@ void kraichnan_field<rnumber>::update_checkpoint()
H5P_DEFAULT); H5P_DEFAULT);
hid_t gg = H5Gcreate( hid_t gg = H5Gcreate(
fid, fid,
"velocity", "tracers0",
H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT); H5P_DEFAULT);
hid_t ggg = H5Gcreate( hid_t ggg = H5Gcreate(
gg, gg,
"real", "state",
H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT); H5P_DEFAULT);
......
Supports Markdown
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