Lines Matching refs:hdf5

71   PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)v->data;  in PetscViewerSetFromOptions_HDF5()  local
75 …get 2 dimensions in HDF5", "PetscViewerHDF5SetBaseDimension2", hdf5->basedimension2, &hdf5->basedi… in PetscViewerSetFromOptions_HDF5()
76 …to be written in single precision", "PetscViewerHDF5SetSPOutput", hdf5->spoutput, &hdf5->spoutput,… in PetscViewerSetFromOptions_HDF5()
82 …f5_compress", "Enable compression", "PetscViewerHDF5SetCompress", hdf5->compress, &hdf5->compress,… in PetscViewerSetFromOptions_HDF5()
89 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)v->data; in PetscViewerView_HDF5() local
93 if (hdf5->filename) PetscCall(PetscViewerASCIIPrintf(viewer, "Filename: %s\n", hdf5->filename)); in PetscViewerView_HDF5()
94 …(viewer, "Vectors with blocksize 1 saved as 2D datasets: %s\n", PetscBools[hdf5->basedimension2])); in PetscViewerView_HDF5()
95 …scViewerASCIIPrintf(viewer, "Enforce single precision storage: %s\n", PetscBools[hdf5->spoutput])); in PetscViewerView_HDF5()
98 …PetscCall(PetscViewerASCIIPrintf(viewer, "Default timestepping: %s\n", PetscBools[hdf5->defTimeste… in PetscViewerView_HDF5()
99 PetscCall(PetscViewerASCIIPrintf(viewer, "Compression: %s\n", PetscBools[hdf5->compress])); in PetscViewerView_HDF5()
105 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerFileClose_HDF5() local
108 PetscCall(PetscFree(hdf5->filename)); in PetscViewerFileClose_HDF5()
109 if (hdf5->file_id) PetscCallHDF5(H5Fclose, (hdf5->file_id)); in PetscViewerFileClose_HDF5()
115 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerFlush_HDF5() local
118 if (hdf5->file_id) PetscCallHDF5(H5Fflush, (hdf5->file_id, H5F_SCOPE_LOCAL)); in PetscViewerFlush_HDF5()
124 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerDestroy_HDF5() local
127 PetscCallHDF5(H5Pclose, (hdf5->dxpl_id)); in PetscViewerDestroy_HDF5()
129 while (hdf5->groups) { in PetscViewerDestroy_HDF5()
130 PetscViewerHDF5GroupList *tmp = hdf5->groups->next; in PetscViewerDestroy_HDF5()
132 PetscCall(PetscFree(hdf5->groups->name)); in PetscViewerDestroy_HDF5()
133 PetscCall(PetscFree(hdf5->groups)); in PetscViewerDestroy_HDF5()
134 hdf5->groups = tmp; in PetscViewerDestroy_HDF5()
136 PetscCall(PetscFree(hdf5)); in PetscViewerDestroy_HDF5()
154 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerFileSetMode_HDF5() local
157 hdf5->btype = type; in PetscViewerFileSetMode_HDF5()
163 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerFileGetMode_HDF5() local
166 *type = hdf5->btype; in PetscViewerFileGetMode_HDF5()
172 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetBaseDimension2_HDF5() local
175 hdf5->basedimension2 = flg; in PetscViewerHDF5SetBaseDimension2_HDF5()
230 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetBaseDimension2() local
234 *flg = hdf5->basedimension2; in PetscViewerHDF5GetBaseDimension2()
240 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetSPOutput_HDF5() local
243 hdf5->spoutput = flg; in PetscViewerHDF5SetSPOutput_HDF5()
296 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetSPOutput() local
300 *flg = hdf5->spoutput; in PetscViewerHDF5GetSPOutput()
311 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetCollective_HDF5() local
312 …PetscCallHDF5(H5Pset_dxpl_mpio, (hdf5->dxpl_id, flg ? H5FD_MPIO_COLLECTIVE : H5FD_MPIO_INDEPENDENT… in PetscViewerHDF5SetCollective_HDF5()
357 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetCollective_HDF5() local
365 PetscCallHDF5(H5Pget_dxpl_mpio, (hdf5->dxpl_id, &mode)); in PetscViewerHDF5GetCollective_HDF5()
402 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerFileSetName_HDF5() local
406 if (hdf5->file_id) PetscCallHDF5(H5Fclose, (hdf5->file_id)); in PetscViewerFileSetName_HDF5()
407 if (hdf5->filename) PetscCall(PetscFree(hdf5->filename)); in PetscViewerFileSetName_HDF5()
408 PetscCall(PetscStrallocpy(name, &hdf5->filename)); in PetscViewerFileSetName_HDF5()
415 switch (hdf5->btype) { in PetscViewerFileSetName_HDF5()
423 PetscCall(PetscTestFile(hdf5->filename, 'r', &flg)); in PetscViewerFileSetName_HDF5()
424 …SC_COMM_SELF, PETSC_ERR_FILE_OPEN, "File %s requested for reading does not exist", hdf5->filename); in PetscViewerFileSetName_HDF5()
428 PetscCallHDF5Return(hdf5->file_id, H5Fopen, (name, H5F_ACC_RDONLY, plist_id)); in PetscViewerFileSetName_HDF5()
433 PetscCall(PetscTestFile(hdf5->filename, 'r', &flg)); in PetscViewerFileSetName_HDF5()
434 if (flg) PetscCallHDF5Return(hdf5->file_id, H5Fopen, (name, H5F_ACC_RDWR, plist_id)); in PetscViewerFileSetName_HDF5()
435 else PetscCallHDF5Return(hdf5->file_id, H5Fcreate, (name, H5F_ACC_EXCL, H5P_DEFAULT, plist_id)); in PetscViewerFileSetName_HDF5()
439 PetscCallHDF5Return(hdf5->file_id, H5Fcreate, (name, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id)); in PetscViewerFileSetName_HDF5()
444 …Comm((PetscObject)viewer), PETSC_ERR_SUP, "Unsupported file mode %s", PetscFileModes[hdf5->btype]); in PetscViewerFileSetName_HDF5()
446 PetscCheck(hdf5->file_id >= 0, PETSC_COMM_SELF, PETSC_ERR_LIB, "H5Fcreate failed for %s", name); in PetscViewerFileSetName_HDF5()
473 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetDefaultTimestepping_HDF5() local
476 hdf5->defTimestepping = flg; in PetscViewerHDF5SetDefaultTimestepping_HDF5()
482 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetDefaultTimestepping_HDF5() local
485 *flg = hdf5->defTimestepping; in PetscViewerHDF5GetDefaultTimestepping_HDF5()
541 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetCompress_HDF5() local
544 hdf5->compress = flg; in PetscViewerHDF5SetCompress_HDF5()
550 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetCompress_HDF5() local
553 *flg = hdf5->compress; in PetscViewerHDF5GetCompress_HDF5()
617 PetscViewer_HDF5 *hdf5; in PetscViewerCreate_HDF5() local
628 PetscCall(PetscNew(&hdf5)); in PetscViewerCreate_HDF5()
630 v->data = (void *)hdf5; in PetscViewerCreate_HDF5()
636 hdf5->btype = FILE_MODE_UNDEFINED; in PetscViewerCreate_HDF5()
637 hdf5->filename = NULL; in PetscViewerCreate_HDF5()
638 hdf5->timestep = -1; in PetscViewerCreate_HDF5()
639 hdf5->groups = NULL; in PetscViewerCreate_HDF5()
641 PetscCallHDF5Return(hdf5->dxpl_id, H5Pcreate, (H5P_DATASET_XFER)); in PetscViewerCreate_HDF5()
722 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetFileId() local
726 if (file_id) *file_id = hdf5->file_id; in PetscViewerHDF5GetFileId()
765 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5PushGroup() local
779 gname = (hdf5->groups && hdf5->groups->name) ? hdf5->groups->name : NULL; in PetscViewerHDF5PushGroup()
790 const char *parent = (hdf5->groups && hdf5->groups->name) ? hdf5->groups->name : ""; in PetscViewerHDF5PushGroup()
797 groupNode->next = hdf5->groups; in PetscViewerHDF5PushGroup()
798 hdf5->groups = groupNode; in PetscViewerHDF5PushGroup()
816 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5PopGroup() local
821 …PetscCheck(hdf5->groups, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "HDF5 gro… in PetscViewerHDF5PopGroup()
822 groupNode = hdf5->groups; in PetscViewerHDF5PopGroup()
823 hdf5->groups = hdf5->groups->next; in PetscViewerHDF5PopGroup()
831 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetGroup_Internal() local
836 if (hdf5->groups) *name = hdf5->groups->name; in PetscViewerHDF5GetGroup_Internal()
947 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5PushTimestepping() local
951 …PetscCheck(!hdf5->timestepping, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "T… in PetscViewerHDF5PushTimestepping()
952 hdf5->timestepping = PETSC_TRUE; in PetscViewerHDF5PushTimestepping()
953 if (hdf5->timestep < 0) hdf5->timestep = 0; in PetscViewerHDF5PushTimestepping()
974 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5PopTimestepping() local
978 …PetscCheck(hdf5->timestepping, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "Ti… in PetscViewerHDF5PopTimestepping()
979 hdf5->timestepping = PETSC_FALSE; in PetscViewerHDF5PopTimestepping()
1003 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5IsTimestepping() local
1007 *flg = hdf5->timestepping; in PetscViewerHDF5IsTimestepping()
1028 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5IncrementTimestep() local
1032 …PetscCheck(hdf5->timestepping, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "Ti… in PetscViewerHDF5IncrementTimestep()
1033 ++hdf5->timestep; in PetscViewerHDF5IncrementTimestep()
1055 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5SetTimestep() local
1061 …PetscCheck(hdf5->timestepping, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "Ti… in PetscViewerHDF5SetTimestep()
1062 hdf5->timestep = timestep; in PetscViewerHDF5SetTimestep()
1086 PetscViewer_HDF5 *hdf5 = (PetscViewer_HDF5 *)viewer->data; in PetscViewerHDF5GetTimestep() local
1091 …PetscCheck(hdf5->timestepping, PetscObjectComm((PetscObject)viewer), PETSC_ERR_ARG_WRONGSTATE, "Ti… in PetscViewerHDF5GetTimestep()
1092 *timestep = hdf5->timestep; in PetscViewerHDF5GetTimestep()