FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5F.c
Go to the documentation of this file.
1#include "F5F.h"
2#include "F5X.h"
3#include "F5A.h"
4#include "F5private.h"
5#include "F5Bchart.h"
6#include "F5L.h"
7/* #if defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__) */
8#include <stdlib.h>
9/* #else */
10/* #include <malloc.h> */
11/* #endif */
12#include <string.h>
13#include <assert.h>
14
15#define DO_DATASPACE_CONSISTENCY_CHECK
16
17ArrayType F5Fget_field_enum(const F5Path*fpath, const char*fieldname,
18 int*major_version, int*minor_version, int*release_version)
19{
20ArrayType retval;
21int is_group = -1;
22hid_t loc_id;
23
24 F5printf(50, "F5Fget_field_enum(%s)", fieldname);
25
26 if (!fpath)
27 {
28 F5printf(50, "F5Fget_field_enum(%s): No valid F5Path given.", fieldname);
29 *major_version = *minor_version = *release_version = 0;
30 return UnknownArrayType;
31 }
32
33 if (fieldname)
34 {
35 H5E_BEGIN_TRY
36 is_group = 0;
37 loc_id = H5Dopen2(fpath->Representation_hid, fieldname, H5P_DEFAULT);
38 H5E_END_TRY
39 if (loc_id<0)
40 {
41 loc_id = H5Gopen2(fpath->Representation_hid, fieldname, H5P_DEFAULT);
42 if (loc_id<0)
43 {
44 F5printf(50, "F5Fget_field_enum(%s): Cannot determine field type!", fieldname);
45 }
46 is_group = 1;
47 }
48 }
49 else
50 loc_id = fpath->Field_hid;
51
52 retval = F5Tget_field_Array_enum(loc_id,
53 major_version, minor_version, release_version);
54
55 switch(is_group)
56 {
57 case 1: H5Gclose(loc_id); break;
58 case 0: H5Dclose(loc_id); break;
59 }
60
61 F5printf(50, "~F5Fget_field_enum(%s)", fieldname);
62 return retval;
63}
64
65
66int F5Fopen(F5Path*f, const char*fieldname)
67{
68 F5Fclose(f);
69
70 H5E_BEGIN_TRY
71 f->Field_hid = H5Dopen2(f->Representation_hid, fieldname, H5P_DEFAULT);
72 H5E_END_TRY
73
74 if (f->Field_hid<0)
75 {
76 H5E_BEGIN_TRY
77 f->Field_hid = H5Gopen2(f->Representation_hid, fieldname, H5P_DEFAULT);
78 H5E_END_TRY
79 if (f->Field_hid<0)
80 {
81 F5printf(10,"F5Fopen(,%s) Path entry is neither a group nor a data set (could be a named data type)\n", fieldname);
82 return 0;
83 }
84 }
85
86 if (f->Field_hid<0)
87 return 0;
88
89 return 1;
90}
91
93{
94 if (!f) return;
95
96 if (f->Field_hid>0)
97 {
98 if (F5Fis_group(f) )
99 H5Gclose( f->Field_hid );
100 else
101 H5Dclose( f->Field_hid );
102
103 f->Field_hid = 0;
104 }
105}
106
108{
109 if (!f) return -1;
110
111 if (f->Field_hid>0)
112 {
113 hid_t id = f->Field_hid;
114 /*
115 if (F5Fis_group(f) )
116 H5Gclose( f->Field_hid );
117 else
118 H5Dclose( f->Field_hid );
119 */
120 f->Field_hid = 0;
121 return id;
122 }
123 return -1;
124}
125
126int F5Fis_group(const F5Path*fpath)
127{
128 if (!fpath) return 0;
129 if (H5Iget_type( fpath->Field_hid ) == H5I_GROUP)
130 return 1;
131
132 return 0;
133}
134
135int F5Ffragment_is_group(const F5Path*fpath, const char*fragment_name )
136{
137 if (!fpath) return 0;
138
139H5G_stat_t info;
140
141 herr_t status = H5Gget_objinfo(fpath->Field_hid, fragment_name, 0, &info);
142
143 if (status < 0)
144 return 0;
145
146 if (info.type == H5G_GROUP)
147 {
148 F5printf(5, "F5Ffragment_is_group == true");
149 return 1;
150 }
151
152 return 0;
153}
154
155
157{
158 return F5Fget_type2(f,0);
159}
160
161hid_t F5Fget_type2(F5Path*f, hid_t elink_fapl_id)
162{
163 return F5Lget_type(f->Field_hid, F5Fis_group(f),
164 elink_fapl_id);
165}
166
168{
169hsize_t dims[FIBER_MAX_RANK];
170int rank;
171
172 F5printf(40, "F5Tget_space()");
173
174 if (!f) return -1;
175 if (f->Topology_hid<0) return -1;
176
179 dims);
180
181 /* NOTE: This code could go into versioning-specific execution, i.e.
182 do only if the version is 0.0.0
183 */
184#ifdef F5_BACKWARD_COMPATIBILITY
185 if (rank<0 && f->Field_hid>0)
186 {
187 F5printf(40, "F5Tget_space(): F5LAget_dimensions() attribute "FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE
188 " not found on enveloping Topology, inspecting dataset.");
190 }
191 if (rank<0 && f->Field_hid>0)
192 {
193 F5printf(40, "F5Tget_space(): F5LAget_dimensions() attribute "FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE
194 " not found on data set, trying old `Size' attribute\n");
195 rank = F5LAget_dimensions(f->Field_hid, "Size", dims);
196 }
197#endif
198 if (rank<0 && f->Field_hid>0 && !F5Fis_group(f) )
199 {
200 F5printf(40, "F5Tget_space(): no data dims attribute found, returning field's data space...\n" );
201 return H5Dget_space(f->Field_hid);
202 }
203 if (rank<0)
204 {
205 F5printf(40, "F5Tget_space(): rank could not be determined...\n");
206 return -1;
207 }
208
209 F5printf(40, "F5Tget_space(): F5LAget_dimensions() reported rank %d\n", rank);
210 {
211 int i;
212 for(i=0; i<rank; i++)
213 {
214 if (dims[i] == 0)
215 {
216 F5printf(40, "F5Tget_space(): No topology associated...\n");
217 return -1;
218 }
219 }
220 }
221
222 return H5Screate_simple(rank, dims, dims );
223}
224
225
226int F5Tget_extent(F5Path*f, hsize_t*dims, int maxDims)
227{
228hsize_t mdims[FIBER_MAX_RANK], Dims[FIBER_MAX_RANK];
229int mrank;
230hid_t space_id = F5Tget_space(f);
231
232
233 if (space_id<0)
234 return 0;
235
236 mrank = H5Sget_simple_extent_dims(space_id, mdims, NULL);
237
238 H5Sclose(space_id);
239
240 F5Tpermute_dimensions(f, mrank, Dims, mdims);
241
242 if (mrank>maxDims)
243 mrank = maxDims;
244
245
246 {int i;
247 for(i=0; i<mrank; i++)
248 dims[i] = Dims[i];
249 }
250
251 return mrank;
252}
253
254
255int F5Tget_index_depth(F5Path*f, int*result)
256{
257 F5printf(40, "F5Fget_index_depth()");
258
259 if (!f)
260 return 0;
261
262 if (f->Topology_hid<0)
263 return 0;
264
267 result, 1) != 1)
268 {
269 F5printf(40, "F5Fget_index_depth(): could not read index depth attribute");
270 return 0;
271 }
272
273 return 1;
274}
275
276/* this should be renamed into F5Fpermute_dimensions */
278 int rank,
279 hsize_t*target_dims,
280 const hsize_t*source_dims)
281{
282int ChartDims;
283 F5printf(50, "F5Tpermute_dimensions()");
284
285 /* added by mr, not sure if this is good */
286 if( !target_dims || !source_dims)
287 {
288 F5printf(40, "F5Tpermute_dimensions() Invalid target or source");
289 return NULL;
290 }
291
292 {
293 int i = 0;
294 for(i=0; i<rank; i++)
295 if (source_dims[i]) break;
296
297 if (i==rank)
298 {
299 for(i=0; i<rank; i++)
300 target_dims[i] = source_dims[i];
301
302 F5printf(40, "F5Tpermute_dimensions() All source data are zero, skipping permutation...");
303 return target_dims;
304 }
305 }
306
307 if (!fpath || !fpath->myChart)
308 {
309 F5printf(50, "F5Tpermute_dimensions() No Chart given, assuming default (FORTRAN) index permutation!");
310 return F5B_permute_dimensions(target_dims, rank, source_dims, NULL, 0);
311 }
312 F5printf(50, "F5Tpermute_dimensions() params ok, rank=%d.", rank);
313 for(int i=0; i<rank; i++)
314 F5printf(50, "F5Tpermute_dimensions() source[%d]=%d.", i, source_dims[i] );
315
316/* cannot occur because perm_vector is static member
317 if (!fpath->myChart->perm_vector )
318 {
319 F5printf(10, "F5Tpermute_dimensions() has no permutation vector!");
320 return NULL;
321 }
322*/
323 ChartDims = F5Bget_chart_dims(fpath->myChart);
324
325 return F5B_permute_dimensions(target_dims, rank, source_dims, fpath->myChart->perm_vector, ChartDims );
326}
327
328int F5Fcreate(F5Path*fpath, const char*fieldname, int rank, hsize_t*dims,
329 hid_t fieldtype, hid_t property_id)
330{
331hsize_t save_dims[FIBER_MAX_RANK];
332
333 F5printf(40,"F5Fcreate()");
334
335 if (!fpath) return 0;
336
337 F5Fclose(fpath);
338
340 F5B_permute_dimensions(save_dims, rank, dims, fpath->myChart->perm_vector, F5Bget_chart_dims(fpath->myChart));
342
343 if (!F5LTset_dataspace(fpath, rank, save_dims))
344 {
345 F5printf(-1, "F5Fcreate(%s): cannot create, inconsistent dataspace!", fieldname);
346 return 0;
347 }
348
349 fpath->Field_hid = F5Lcreate(fpath->Representation_hid, fieldname,
350 rank, save_dims,
351 F5file_type(fpath, fieldtype), property_id);
352
353 if (fpath->Field_hid<0)
354 {
355 F5printf(0,"F5Fcreate -> F5Lcreate() FAILED!");
356 return 0;
357 }
358 else
360
361 F5I_add_field(fpath, fieldname);
362
363 F5printf(40,"~F5Fcreate() ok");
364 return 1;
365}
366
368{
369 switch(EC)
370 {
371 case F5_SUCCESS: return "OK";
372 case F5ERROR_INVALID_FPATH: return "Invalid Path";
373 case F5ERROR_INCONSISTENT_DATASPACE: return "Inconsistent Dataspace";
374 case F5ERROR_INVALID_FRAGMENT_START: return "Fragment starts beyond dataspace";
375 case F5ERROR_INVALID_FRAGMENT_END: return "Fragment extends beyond dataspace";
376 case F5ERROR_ALREADY_EXISTS: return "Object already exists";
377 case F5ERROR_COMPOUND_EXPECTED: return "Compound type expected";
378 case F5ERROR_COMPONENTMAP_EXPECTED: return "Component map expected";
379 case F5ERROR_COMPONENTMAP_INVALID: return "Component map invalid";
380
381 case F5ERROR_NONSPECIFIED: return "Unspecified error";
382
383 default: return "Invalid error code (compile-time bug)";
384 }
385}
386
387
388
389F5ErrorCode F5Fwrite_flexible(F5Path*fpath, const char*fieldname,
390 int rank, hsize_t*dims,
391 hid_t fieldtype, hid_t memtype, const void * dataPtr,
392 hid_t property_id, int do_check )
393{
394hsize_t save_dims[FIBER_MAX_RANK];
395
396 F5printf(40,"F5Fwrite(%s, rank=%d, dims=%dx%dx%dx%d)", fieldname, rank, rank>0?(int)dims[0]:1,
397 rank>1?(int)dims[1]:1,rank>2?(int)dims[2]:1, rank>3?(int)dims[3]:1
398 );
399
400 if (!fpath)
402
403 F5Fclose(fpath);
404
405 /*
406 Detect the special case of 2D RGB data, in which case we try to
407 write the data compatible to the official HDF5 specification for
408 images.
409 */
410 if ( (H5Tequal(fieldtype, F5T_RGB_REAL)>0 || H5Tequal(fieldtype, F5T_RGB)>0) && rank == 2)
411 {
412 return F5FwriteIMAGE(fpath, fieldname,
413 rank, dims,
414 fieldtype, memtype, dataPtr,
415 property_id);
416 }
417
419 F5Tpermute_dimensions(fpath, rank, save_dims, dims );
421
422 F5printf(41,"F5Fwrite(%s): permuted dims: rank=%d, dims=%dx%dx%dx%d)", fieldname, rank,
423 rank>0?(int)save_dims[0]:1, rank>1?(int)save_dims[1]:1, rank>2?(int)save_dims[2]:1, rank>3?(int)save_dims[3]:1 );
424
425 if (!F5LTset_dataspace(fpath, rank, save_dims))
426 {
427 if( do_check )
428 {
429 if (rank==3)
430 F5printf(-1, "F5Fwrite(%s): cannot write 3D field, inconsistent 3D dataspace, trying to write %dx%dx%d as HDF5 dataspace %dx%dx%d (run again with F5_VERBOSITY=30 to see more details)!",
431 fieldname, (int)dims[0], (int)dims[1], (int)dims[2],
432 (int)save_dims[0], (int)save_dims[1], (int)save_dims[2]
433 );
434 else
435 F5printf(-1, "F5Fwrite(%s): cannot write field, inconsistent dataspace (run again with F5_VERBOSITY=30 to see more details)!", fieldname);
436
438 }
439 else
440 F5printf(-1, "F5Fwrite(%s): warning during field write, inconsistent dataspace!", fieldname);
441 }
442
443 fpath->Field_hid = 0;
444
445 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
446 rank, save_dims,
447 F5file_type(fpath, fieldtype), memtype, dataPtr,
448 F5LTmake_enum_type(fpath),
449 property_id);
450
451 if (fpath->Field_hid<=0)
452 {
453 F5printf(3,"F5Fwrite(): F5Lwrite() FAILED!");
454 fpath->Field_hid = 0;
455 }
456 else
457 {
459 F5I_add_field(fpath, fieldname);
460 }
461
462 F5printf(40,"F5Fwrite() ok");
463 return F5_SUCCESS;
464}
465
466
467F5ErrorCode F5Fwrite(F5Path*fpath, const char*fieldname,
468 int rank, hsize_t*dims,
469 hid_t fieldtype, hid_t memtype, const void * dataPtr,
470 hid_t property_id)
471{
472 return F5Fwrite_flexible( fpath, fieldname, rank, dims, fieldtype, memtype, dataPtr, property_id, 1 );
473}
474
475
476F5ErrorCode F5FwriteHyperDimensional(F5Path*fpath, const char*fieldname,
477 int rank, hsize_t*dims,
478 hid_t fieldtype, hid_t memtype, const void * dataPtr,
479 hid_t property_id)
480{
481// TODO: Implement consistency check on the base space dimensions!
482
483 return F5Fwrite_flexible( fpath, fieldname, rank, dims, fieldtype, memtype, dataPtr, property_id, 0 );
484}
485
486
487F5_API F5ErrorCode F5FwriteIMAGE(F5Path*fpath, const char*fieldname,
488 int rank, hsize_t*dims,
489 hid_t fieldtype, hid_t memtype, const void * dataPtr,
490 hid_t dcpl_id)
491{
492hsize_t save_dims[FIBER_MAX_RANK];
493 if (rank!=2)
494 {
495 F5printf(40,"F5FwriteIMAGE(%s, rank=%d, dims=%dx%dx%dx%d) INVALID RANK (must be 2)! \n", fieldname, rank, rank>0?(int)dims[0]:1,
496 rank>1?(int)dims[1]:1,rank>2?(int)dims[2]:1, rank>3?(int)dims[3]:1
497 );
499 }
500
501 F5printf(40,"F5FwriteIMAGE(%s, rank=%d, dims=%dx%dx%dx%d)\n", fieldname, rank, rank>0?(int)dims[0]:1,
502 rank>1?(int)dims[1]:1,rank>2?(int)dims[2]:1, rank>3?(int)dims[3]:1
503 );
504 if (!fpath)
506
507 F5Fclose(fpath);
508
510 F5Tpermute_dimensions(fpath, rank, save_dims, dims );
512
513 F5printf(41,"F5Fwrite(%s): permuted dims: rank=%d, dims=%dx%dx%dx%d)\n", fieldname, rank,
514 rank>0?(int)save_dims[0]:1, rank>1?(int)save_dims[1]:1, rank>2?(int)save_dims[2]:1, rank>3?(int)save_dims[3]:1 );
515
516 if (!F5LTset_dataspace(fpath, rank, save_dims))
517 {
518 F5printf(-1, "F5Fwrite(%s): cannot create, inconsistent dataspace!", fieldname);
520 }
521
522 if (fieldtype == F5T_RGB_REAL)
523 {
524 save_dims[2] = 3;
525 rank = 3;
526 fieldtype = H5T_NATIVE_FLOAT;
527 memtype = H5T_NATIVE_FLOAT;
528 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
529 rank, save_dims,
530 F5file_type(fpath, fieldtype), memtype, dataPtr,
531 F5LTmake_enum_type(fpath),
532 dcpl_id);
533
534 if (fpath->Field_hid<=0)
535 {
536 F5printf(1, "F5Fwrite_IMAGE() - FAILED to append field fragment data.");
537 return -1;
538 }
539
540 /* FROM: http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/ImageSpec.html */
541 F5Asave_string(fpath->Field_hid, "CLASS", "IMAGE");
542 F5Asave_string(fpath->Field_hid, "INTERLACE_MODE", "INTERLACE_PIXEL");
543 F5Asave_string(fpath->Field_hid, "DISPLAY_ORIGIN", "LL");
544 F5Asave_string(fpath->Field_hid, "IMAGE_VERSION", "1.2");
545 F5Asave_string(fpath->Field_hid, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR");
546 F5Asave_string(fpath->Field_hid, "IMAGE_COLORMODEL", "RGB");
547
549 }
550 else if (fieldtype == F5T_RGB)
551 {
552 save_dims[2] = 3;
553 rank = 3;
554 fieldtype = H5T_NATIVE_UCHAR;
555 memtype = H5T_NATIVE_UCHAR;
556 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
557 rank, save_dims,
558 F5file_type(fpath, fieldtype), memtype, dataPtr,
559 F5LTmake_enum_type(fpath),
560 dcpl_id);
561
562 /* FROM: http://www.hdfgroup.org/HDF5/doc/ADGuide/ImageSpec.html */
563#if 0
564 F5Asave_string(fpath->Field_hid, "CLASS", "IMAGE");
565 F5Asave_string(fpath->Field_hid, "INTERLACE_MODE", "INTERLACE_PIXEL");
566 F5Asave_string(fpath->Field_hid, "DISPLAY_ORIGIN", "LL");
567 F5Asave_string(fpath->Field_hid, "IMAGE_VERSION", "1.2");
568 F5Asave_string(fpath->Field_hid, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR");
569 F5Asave_string(fpath->Field_hid, "IMAGE_COLORMODEL", "RGB");
570#else
571 F5Asave_strings(fpath->Field_hid, "CLASS", "IMAGE",1);
572 F5Asave_strings(fpath->Field_hid, "INTERLACE_MODE", "INTERLACE_PIXEL",1);
573 F5Asave_strings(fpath->Field_hid, "DISPLAY_ORIGIN", "LL",1);
574 F5Asave_strings(fpath->Field_hid, "IMAGE_VERSION", "1.2",1);
575 F5Asave_strings(fpath->Field_hid, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR",1);
576 F5Asave_strings(fpath->Field_hid, "IMAGE_COLORMODEL", "RGB",1);
577#endif
578
579/* unsigned char MinMax[] = { 0, 0xFF };
580 F5Asave(fpath->Field_hid, "IMAGE_MINMAXRANGE",
581 H5T_NATIVE_UCHAR, H5T_NATIVE_UCHAR, MinMax, 2);
582*/
583// F5Dset_type_attribute(fpath->Field_hid, F5T_RGB);
584 }
585 else if (fieldtype == H5T_NATIVE_USHORT)
586 {
587 save_dims[2] = 1;
588 rank = 2;
589 fieldtype = H5T_NATIVE_USHORT;
590 memtype = H5T_NATIVE_USHORT;
591 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
592 rank, save_dims,
593 F5file_type(fpath, fieldtype), memtype, dataPtr,
594 F5LTmake_enum_type(fpath),
595 dcpl_id);
596
597 /* FROM: http://www.hdfgroup.org/HDF5/doc/ADGuide/ImageSpec.html */
598#if 0
599 F5Asave_string(fpath->Field_hid, "CLASS", "IMAGE");
600 F5Asave_string(fpath->Field_hid, "INTERLACE_MODE", "INTERLACE_PIXEL");
601 F5Asave_string(fpath->Field_hid, "DISPLAY_ORIGIN", "LL");
602 F5Asave_string(fpath->Field_hid, "IMAGE_VERSION", "1.2");
603 F5Asave_string(fpath->Field_hid, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR");
604 F5Asave_string(fpath->Field_hid, "IMAGE_COLORMODEL", "RGB");
605#else
606 F5Asave_strings(fpath->Field_hid, "CLASS", "IMAGE",1);
607 F5Asave_strings(fpath->Field_hid, "DISPLAY_ORIGIN", "LL",1);
608 F5Asave_strings(fpath->Field_hid, "IMAGE_VERSION", "1.2",1);
609 F5Asave_strings(fpath->Field_hid, "IMAGE_SUBCLASS", "IMAGE_GRAYSCALE",1);
610#endif
611 unsigned short MinMax[] = { 0, 0xFFFF };
612 F5Asave(fpath->Field_hid, "IMAGE_MINMAXRANGE",
613 H5T_NATIVE_USHORT, H5T_NATIVE_USHORT, MinMax, 2);
614 }
615 else
616 {
617 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
618 rank, save_dims,
619 F5file_type(fpath, fieldtype), memtype, dataPtr,
620 F5LTmake_enum_type(fpath),
621 dcpl_id);
622 }
623
625 F5I_add_field(fpath, fieldname);
626
627 F5printf(40,"F5Fwrite() ok");
628 return F5_SUCCESS;
629}
630
631F5_API F5ErrorCode F5Fwrite_1D(F5Path*fpath, const char*fieldname,
632 hsize_t nElements, hid_t fieldtype, hid_t memtype,
633 const void * dataPtr, hid_t property_id)
634{
635hid_t file_type;
636 F5printf(40,"F5Fwrite1D(%s)", fieldname);
637 if (!fpath)
638 {
639 F5printf(41,"F5Fwrite1D(%s): no fpath given!", fieldname);
641 }
642 if (nElements<1)
643 {
644 F5printf(30,"F5Fwrite1D(%s): No elements given, field not created!",fieldname);
646 }
647 if (fpath->Representation_hid<0)
648 {
649 F5printf(30,"F5Fwrite1D(%s): INVALID Representation ID given!",fieldname);
651 }
652 if (fieldtype<0)
653 {
654 F5printf(30,"F5Fwrite1D(%s): INVALID field type ID given!",fieldname);
656 }
657
658 file_type = F5file_type(fpath, fieldtype);
659 if (file_type<0)
660 {
661 F5printf(30,"F5Fwrite1D(%s): CANNOT created file type from field type %d given!",
662 fieldname, (int)fieldtype );
664 }
665
666 F5Fclose(fpath);
667
668/* TODO: Check the consistency of the number of elements here */
669
670 fpath->Field_hid = F5Lwrite1D(fpath->Representation_hid, fieldname,
671 nElements,
672 file_type, memtype, dataPtr,
673 F5LTmake_enum_type(fpath),
674 property_id);
675
676 if (fpath->Field_hid < 0)
677 {
678 F5printf(30,"F5Fwrite1D(): F5Lwrite1D FAILED!");
680 }
681
683 F5I_add_field(fpath, fieldname);
684 F5printf(40,"F5Fwrite1D() ok");
685
686 return F5_SUCCESS;
687}
688
689
690F5_API int F5Fwrites(F5Path*fpath, const char*fieldname,
691 int rank, hsize_t*dims,
692 hid_t fieldtype, hid_t memtype, const void ** dataPtr,
693 hid_t property_id)
694{
695hsize_t save_dims[FIBER_MAX_RANK];
696hid_t file_type;
697
698 F5printf(40,"F5Fwrites()");
699 if (!fpath) return 0;
700
701 F5Fclose(fpath);
702
704 F5Tpermute_dimensions(fpath, rank, save_dims, dims);
706
707 if (!F5LTset_dataspace(fpath, rank, save_dims))
708 {
709 F5printf(-1, "F5Fwrites(%s): cannot create, inconsistent dataspace!", fieldname);
711 }
712
713 file_type = F5file_type(fpath, fieldtype);
714
715 fpath->Field_hid = F5Lwrites(fpath->Representation_hid, fieldname,
716 rank, save_dims,
717 file_type, memtype, dataPtr,
718 F5LTmake_enum_type(fpath),
719 property_id);
720
721 if (fpath->Field_hid <0)
722 F5printf(1, "**F5Fwrites(%s) could not write separated compound type!", fieldname);
723
724 switch( H5Tget_class(file_type ) )
725 {
726 case H5T_COMPOUND:
728 break;
729
730 case H5T_INTEGER:
731 case H5T_FLOAT:
733 break;
734
735 default:
737 break;
738 }
739
740 F5I_add_field(fpath, fieldname);
741
742 F5printf(40,"F5Fwrites() ok");
743 return F5_SUCCESS;
744}
745
746static int F5B_identical_dims(int rank, const hsize_t*A, const hsize_t*B)
747{
748int i;
749 if (A && B)
750 {
751 for(i=0; i<rank; i++)
752 {
753 if (A[i] != B[i])
754 return 0;
755 }
756 return 1;
757 }
758
759 if (!A) A = B;
760 if (!A) return 1;
761
762 for(i=0; i<rank; i++)
763 if (A[i]) return 0;
764
765 return 1;
766}
767
768int F5Fexpand_dataspace(F5Path*fpath, int rank, hsize_t*Dims)
769{
770hsize_t full_dims[FIBER_MAX_RANK];
771int retval;
772 F5Tpermute_dimensions(fpath, rank, full_dims , Dims);
773 retval = F5LTexpand_dataspace(fpath, rank, full_dims);
774 F5Tpermute_dimensions(fpath, rank, Dims, full_dims);
775 return retval;
776}
777
778F5ErrorCode F5Fwrite_fraction(F5Path*fpath, const char*fieldname,
779 int rank, const hsize_t*Dims, const hsize_t*fraction_dims,
780 hid_t fieldtype, hid_t memtype, const void * dataPtr,
781 const hsize_t*datastart,
782 const hsize_t*start_border, const hsize_t*end_border,
783 const char*fraction_name, hid_t property_id)
784{
785hid_t field_id;
786int i;
787hsize_t full_dims[FIBER_MAX_RANK], start_dims[FIBER_MAX_RANK], ldims[FIBER_MAX_RANK],
788 sborder[FIBER_MAX_RANK], eborder[FIBER_MAX_RANK];
789
790 if (!fpath)
792
793 if (!fieldname)
794 {
795 F5printf(0, "F5Fwrite_fraction() invalid field name!");
797 }
798 if (!datastart)
799 {
800 F5printf(0, "F5Fwrite_fraction() for field %s has no datastart given for fragment %s",
801 fieldname, fraction_name);
803 }
804 if (!fraction_dims)
805 {
806 F5printf(0, "F5Fwrite_fraction() for field %s has no fragment dimensions given for fragment %s",
807 fieldname, fraction_name);
809 }
810
811 F5print_dimensions(20, "F5Fwrite_fraction", rank, fraction_dims);
812
814 F5Tpermute_dimensions(fpath, rank, full_dims , Dims );
815 F5Tpermute_dimensions(fpath, rank, start_dims, datastart );
816 F5Tpermute_dimensions(fpath, rank, ldims , fraction_dims);
817 F5Tpermute_dimensions(fpath, rank, sborder , start_border );
818 F5Tpermute_dimensions(fpath, rank, eborder , end_border );
820
821 if (Dims) for(i=0; i<rank; i++)
822 {
823 if (datastart[i] >= Dims[i])
824 {
825 F5printf(-1, "F5Fwrite_fraction(%s): fragment starts beyond dataspace in dimension %d: %d (max %d allowed)!",
826 fieldname, i, (int)datastart[i], (int)Dims[i] );
828 }
829 if (datastart[i]+fraction_dims[i] > Dims[i])
830 {
831 F5printf(-1, "F5Fwrite_fraction(%s): fragment extends beyond dataspace in dimension %d: %d (max %d allowed)!",
832 fieldname, i, (int)(datastart[i]+fraction_dims[i]), (int)Dims[i] );
834 }
835 }
836 //
837 // closing the field in the FPath here
838 // because it will be overwritten with a new field ID soon
839 //
840 F5Fclose( fpath );
841
842#ifdef DO_DATASPACE_CONSISTENCY_CHECK
843 if (Dims)
844 {
845 if (!F5LTset_dataspace(fpath, rank, full_dims))
846 {
847 F5printf(-1, "F5Fwrite_fraction(%s): cannot create, inconsistent dataspace!", fieldname);
848 return F5_SUCCESS; /* ??? */
849 }
850 }
851#endif
852
853#if 0
854 hm, we better drop this idea of automatically writing a contiguous field
855 if a field covers the full dimension, because then the topology is
856 no longer expandable...
857
858 if (F5B_identical_dims(rank, full_dims, ldims) && F5B_identical_dims(rank, start_dims, 0) )
859 {
860 fpath->Field_hid = F5Lwrite(fpath->Representation_hid, fieldname,
861 rank, full_dims,
862 F5file_type(fpath, fieldtype), memtype, dataPtr,
863 F5LTmake_enum_type(fpath), property_id);
864
865 F5Tset_field_enum(fpath->Field_hid, F5LTmake_enum_type(fpath), Contigous);
866 F5I_add_field(fpath, fieldname, FIBER_HDF5_REGULAR_FIELD);
867
868 F5printf(30, "~F5Fwrite_fraction(%s) wrote contigous field", fieldname);
869 return F5_SUCCESS;
870 }
871#endif
872 field_id = F5Lwrite_fraction(fpath->Representation_hid, fieldname, rank, Dims ? full_dims : NULL, ldims,
873 F5file_type(fpath, fieldtype), memtype, dataPtr,
874 start_dims,
875 start_border?sborder:NULL, end_border?eborder:NULL,
876 fraction_name, F5LTmake_enum_type(fpath), property_id);
877
878 if (field_id<=0)
879 {
880 F5printf(0, "F5Fwrite_fraction(%s) error in writing field, illegal ID returned from low-level function.", fieldname);
882 }
883 assert( field_id );
884
885 fpath->Field_hid = field_id;
886
887 assert( fpath->Field_hid );
888
889#if 1
890/*
891 there must be a reason why the type attribute writing was not enabled, but forgot why...
892 It should be set because type identification should be faster on reading as no iteration
893 over the group is required then.
894 WB 2.SEP.16 */
895
896/* F5printf(10,"~F5Fwrite_fraction(%s) temporarily set type attribute...", fieldname); */
897 F5Dset_type_attribute(fpath->Field_hid, F5file_type(fpath, fieldtype) );
898#endif
899
901
902 assert( fpath->Field_hid );
903 F5I_add_field(fpath, fieldname);
904
905 F5printf(30, "~F5Fwrite_fraction(%s) wrote fragmented contigous field", fieldname);
906 return F5_SUCCESS;
907}
908
909
910
911
912
913F5ErrorCode F5Fwrite_fractionS(F5Path*fpath, const char*fieldname,
914 int rank, const hsize_t*Dims, const hsize_t*fraction_dims,
915 hid_t fieldtype, hid_t memtype, const void * dataPtr,
916 const hsize_t*datastart,
917 const hsize_t*start_border, const hsize_t*end_border,
918 const char*fraction_name, hid_t property_id)
919{
920hid_t field_id;
921int i;
922hsize_t full_dims[FIBER_MAX_RANK], start_dims[FIBER_MAX_RANK], ldims[FIBER_MAX_RANK],
923 sborder[FIBER_MAX_RANK], eborder[FIBER_MAX_RANK];
924
925 if (!fpath)
927
928 F5print_dimensions(20, "F5Fwrite_fractionS", rank, fraction_dims);
929
931 F5Tpermute_dimensions(fpath, rank, full_dims , Dims );
932 F5Tpermute_dimensions(fpath, rank, start_dims, datastart );
933 F5Tpermute_dimensions(fpath, rank, ldims , fraction_dims);
934 F5Tpermute_dimensions(fpath, rank, sborder , start_border );
935 F5Tpermute_dimensions(fpath, rank, eborder , end_border );
937
938 if (Dims) for(i=0; i<rank; i++)
939 {
940 if (datastart[i] >= Dims[i])
941 {
942 F5printf(-1, "F5Fwrite_fractionS(%s): fragment starts beyond dataspace in dimension %d: %d (max %d allowed)!",
943 fieldname, i, (int)datastart[i], (int)Dims[i] );
945 }
946 if (datastart[i]+fraction_dims[i] > Dims[i])
947 {
948 F5printf(-1, "F5Fwrite_fractionS(%s): fragment extends beyond dataspace in dimension %d: %d (max %d allowed)!",
949 fieldname, i, (int)(datastart[i]+fraction_dims[i]), (int)Dims[i] );
951 }
952 }
953 //
954 // closing the field in the FPath here
955 // because it will be overwritten with a new field ID soon
956 //
957 F5Fclose( fpath );
958
959#ifdef DO_DATASPACE_CONSISTENCY_CHECK
960 if (Dims)
961 {
962 if (!F5LTset_dataspace(fpath, rank, full_dims))
963 {
964 F5printf(-1, "F5Fwrite_fractionS(%s): cannot create, inconsistent dataspace!", fieldname);
965 return F5_SUCCESS; /* ??? */
966 }
967 }
968#endif
969
970 field_id = F5Lwrite_fractionS(fpath->Representation_hid, fieldname, rank, Dims ? full_dims : NULL, ldims,
971 F5file_type(fpath, fieldtype), memtype, dataPtr,
972 start_dims,
973 start_border?sborder:NULL, end_border?eborder:NULL,
974 fraction_name, F5LTmake_enum_type(fpath), property_id);
975
976 if (field_id<=0)
977 {
979 }
980
981 fpath->Field_hid = field_id;
982
983 F5printf(10,"~F5Fwrite_fractionS(%s) temporarily set type attribute...", fieldname);
984 F5Dset_type_attribute(fpath->Field_hid, F5file_type(fpath, fieldtype) );
985
987
988 F5I_add_field(fpath, fieldname);
989
990 F5printf(30, "~F5Fwrite_fraction(%s) wrote fragmented contigous field", fieldname);
991 return F5_SUCCESS;
992}
993
994
995
996
997
998
999
1000
1002
1003 const char *target_file_name,
1004 const char *target_obj_name,
1005 const char *prefix,
1006
1007 int rank, const hsize_t*Dims, const hsize_t*fraction_dims,
1008 hid_t fieldtype, hid_t memtype, const void * dataPtr,
1009 const hsize_t*datastart,
1010 const hsize_t*start_border, const hsize_t*end_border,
1011 const char*fraction_name, hid_t property_id)
1012{
1013hid_t field_id;
1014int i;
1015hsize_t full_dims[FIBER_MAX_RANK], start_dims[FIBER_MAX_RANK], ldims[FIBER_MAX_RANK],
1016 sborder[FIBER_MAX_RANK], eborder[FIBER_MAX_RANK];
1017
1018 if (!fpath)
1019 return F5ERROR_INVALID_FPATH;
1020
1021 F5printf(30, "F5Fwrite_fraction_external(%s, rank=%d)", fieldname, rank);
1022 if (rank==3)
1023 F5printf(20, "F5Fwrite_fraction_external(%lux%lux%lu)",
1024 (int)fraction_dims[0], (int)fraction_dims[1], (int)fraction_dims[2]);
1025 else if(rank==2)
1026 F5printf(20, "F5Fwrite_fraction_external(%lux%lu)",
1027 (int)fraction_dims[0], (int)fraction_dims[1]);
1028 else if (rank==1)
1029 F5printf(20, "F5Fwrite_fraction_external(%lu)",
1030 (int)fraction_dims[0]);
1031
1033
1034 F5Tpermute_dimensions(fpath, rank, full_dims , Dims );
1035 F5Tpermute_dimensions(fpath, rank, start_dims, datastart );
1036 F5Tpermute_dimensions(fpath, rank, ldims , fraction_dims);
1037 F5Tpermute_dimensions(fpath, rank, sborder , start_border );
1038 F5Tpermute_dimensions(fpath, rank, eborder , end_border );
1040
1041 if (Dims) for(i=0; i<rank; i++)
1042 {
1043 if (datastart[i] >= Dims[i])
1044 {
1045 F5printf(-1, "F5Fwrite_fraction(%s): fragment starts beyond dataspace in dimension %d: %d (max %d allowed)!",
1046 fieldname, i, (int)datastart[i], (int)Dims[i] );
1048 }
1049 if (datastart[i]+fraction_dims[i] > Dims[i])
1050 {
1051 F5printf(-1, "F5Fwrite_fraction(%s): fragment extends beyond dataspace in dimension %d: %d (max %d allowed)!",
1052 fieldname, i, (int)(datastart[i]+fraction_dims[i]), (int)Dims[i] );
1054 }
1055 }
1056 //
1057 // closing the field in the FPath here
1058 // because it will be overwritten with a new field ID soon
1059 //
1060 F5Fclose( fpath );
1061
1062#ifdef DO_DATASPACE_CONSISTENCY_CHECK
1063 if (Dims)
1064 {
1065 if (!F5LTset_dataspace(fpath, rank, full_dims))
1066 {
1067 F5printf(-1, "F5Fwrite_fraction(%s): cannot create, inconsistent dataspace!", fieldname);
1068 return F5_SUCCESS; /* ??? */
1069 }
1070 }
1071#endif
1072 field_id = F5Lwrite_fraction_external(fpath->Representation_hid, fieldname,
1073
1074 target_file_name,
1075 target_obj_name,
1076 prefix,
1077
1078 rank, Dims ? full_dims : NULL, ldims,
1079 F5file_type(fpath, fieldtype), memtype, dataPtr,
1080 start_dims,
1081 start_border?sborder:NULL, end_border?eborder:NULL,
1082 fraction_name, F5LTmake_enum_type(fpath), property_id);
1083
1084 fpath->Field_hid = field_id;
1085
1086/* F5printf(10,"~F5Fwrite_fraction(%s) temporarily set type attribute...", fieldname);
1087 F5Dset_type_attribute(fpath->Field_hid, F5file_type(fpath, fieldtype) );
1088*/
1089#if 0
1090/*
1091 As with HDF5 1.8.14 - 1.8.17, 1.10.0 , saving attributes with a named type that
1092 has been committed to another file than the external file does not work.
1093 */
1095#else
1097#endif
1098
1099 F5I_add_field(fpath, fieldname);
1100
1101 F5printf(30, "~F5Fwrite_fraction(%s) wrote fragmented contigous field", fieldname);
1102 return F5_SUCCESS;
1103}
1104
1105
1106int F5Fis_fragmented(F5Path*fpath, const char*fieldname)
1107{
1108int major_version, minor_version, release_version;
1109ArrayType at = F5Fget_field_enum(fpath, fieldname,
1110 &major_version, &minor_version, &release_version);
1111
1112 if (major_version != FIBER_MAJOR_VERSION ||
1113 minor_version != FIBER_MINOR_VERSION ||
1114 release_version != FIBER_RELEASE_VERSION)
1115 return 0;
1116
1117 switch(at)
1118 {
1122 return 1;
1123
1124 default: return 0;
1125 }
1126}
1127
1128int F5Fis_separatedcompound(F5Path*fpath, const char*fieldname)
1129{
1130int major_version, minor_version, release_version;
1131ArrayType at = F5Fget_field_enum(fpath, fieldname,
1132 &major_version, &minor_version, &release_version);
1133
1134 if (major_version != FIBER_MAJOR_VERSION ||
1135 minor_version != FIBER_MINOR_VERSION ||
1136 release_version != FIBER_RELEASE_VERSION)
1137 return 0;
1138
1139 switch(at)
1140 {
1142 return 1;
1143
1144 default: return 0;
1145 }
1146}
1147
1148int F5B_iszero_dims(int rank, hsize_t*dims)
1149{
1150int i;
1151 for(i=0; i<rank; i++)
1152 if (dims[i]>0) return 0;
1153
1154 return 1;
1155}
1156
1157int F5FSwrite_fraction(F5Path*fpath, const char*fieldname,
1158 int rank, const hsize_t*dims, const hsize_t*frag_dims,
1159 hid_t fieldtype, hid_t memtype, const void *const* dataPtr,
1160 const hsize_t*datastart,
1161 const hsize_t*start_border, const hsize_t*end_border,
1162 const char*fraction_name, hid_t property_id,
1163 int AllowFullCoverage)
1164{
1165hid_t field_id;
1166hsize_t full_dims[FIBER_MAX_RANK], start_dims[FIBER_MAX_RANK], ldims[FIBER_MAX_RANK],
1167 sborder[FIBER_MAX_RANK], eborder[FIBER_MAX_RANK];
1168
1169 F5printf(40, "F5FSwrite_fraction()");
1171 F5Tpermute_dimensions(fpath, rank, full_dims , dims );
1172 F5Tpermute_dimensions(fpath, rank, start_dims, datastart );
1173 F5Tpermute_dimensions(fpath, rank, ldims , frag_dims );
1174 F5Tpermute_dimensions(fpath, rank, sborder , start_border );
1175 F5Tpermute_dimensions(fpath, rank, eborder , end_border );
1176
1177 if (rank==3)
1178 {
1179#ifdef DO_DATASPACE_CONSISTENCY_CHECK
1180 if (dims)
1181 {
1182 F5printf(60, "F5FSwrite_fraction() : "
1183 "global dims=[%d,%d,%d] datastart=[%d,%d,%d] ldims=[%d,%d,%d]",
1184 (int)dims[0], (int)dims[1], (int)dims[2],
1185 (int)datastart[0], (int)datastart[1], (int)datastart[2],
1186 (int)ldims[0], (int)ldims[1] , (int)ldims[2]
1187 );
1188
1189 F5printf(60, "F5FSwrite_fraction()->"
1190 "full dataset=[%d,%d,%d] start=[%d,%d,%d] ldims=[%d,%d,%d]",
1191 (int)full_dims[0], (int)full_dims[1], (int)full_dims[2],
1192 (int)start_dims[0],(int)start_dims[1],(int)start_dims[2],
1193 (int)ldims[0], (int)ldims[1] , (int)ldims[2]
1194 );
1195 }
1196 else
1197 {
1198 F5printf(60, "F5FSwrite_fraction() : "
1199 "(no global dims) datastart=[%d,%d,%d] ldims=[%d,%d,%d]",
1200 (int)datastart[0], (int)datastart[1], (int)datastart[2],
1201 (int)ldims[0], (int)ldims[1] , (int)ldims[2]
1202 );
1203
1204 F5printf(60, "F5FSwrite_fraction()->"
1205 "(no full data dimensions) start=[%d,%d,%d] ldims=[%d,%d,%d]",
1206 (int)start_dims[0],(int)start_dims[1],(int)start_dims[2],
1207 (int)ldims[0], (int)ldims[1] , (int)ldims[2]
1208 );
1209 }
1210#endif
1211 }
1213 F5Fclose( fpath );
1214
1215#ifdef DO_DATASPACE_CONSISTENCY_CHECK
1216 if (dims)
1217 {
1218 if (!F5LTset_dataspace(fpath, rank, full_dims))
1219 {
1220 F5printf(-1, "F5FSwrite_fraction(%s): cannot create, inconsistent dataspace!", fieldname);
1221 return 0;
1222 }
1223 }
1224#endif
1225
1226#if 0
1227 if (F5B_identical_dims(rank, full_dims, end_dims) )
1228 F5printf(80, "F5FSwrite_fraction(%s) dimensions cover full dataset", fieldname);
1229 else
1230 F5printf(80, "F5FSwrite_fraction(%s) dimensions do not cover full dataset", fieldname);
1231
1232 if (F5B_iszero_dims(rank, start_dims) )
1233 F5printf(80, "F5FSwrite_fraction(%s) fragment starts at zero", fieldname);
1234 else
1235 F5printf(80, "F5FSwrite_fraction(%s) fragment starts at some offset", fieldname);
1236#endif
1237
1238 if (AllowFullCoverage && F5B_identical_dims(rank, full_dims, ldims) && F5B_iszero_dims(rank, start_dims) )
1239 {
1240 F5printf(8, "F5FSwrite_fraction(%s) writing full dataset", fieldname);
1241
1242 fpath->Field_hid = F5Lwrites(fpath->Representation_hid, fieldname,
1243 rank, full_dims,
1244 F5file_type(fpath, fieldtype), memtype, dataPtr,
1245 F5LTmake_enum_type(fpath), property_id);
1246
1247 if (fpath->Field_hid<=0)
1248 return -1;
1249
1251 F5I_add_field(fpath, fieldname);
1252 F5printf(9, "~F5FSwrite_fraction(%s) writing full dataset\n", fieldname);
1253
1254 return 1;
1255 }
1256 F5printf(8, "F5FSwrite_fraction(%s) writing dataset fragment\n", fieldname);
1257
1258 field_id = F5LSwrite_fraction(fpath->Representation_hid, fieldname, rank, full_dims, ldims,
1259 F5file_type(fpath, fieldtype), memtype, dataPtr,
1260 datastart?start_dims:NULL,
1261 start_border?sborder:NULL, end_border?eborder:NULL,
1262 fraction_name, F5LTmake_enum_type(fpath), property_id);
1263
1264 fpath->Field_hid = field_id;
1265
1266 if (fpath->Field_hid<=0)
1267 return -1;
1268
1269/*
1270 F5printf(10,"~F5FSwrite_fraction(%s) temporarily set type attribute...", fieldname);
1271 F5Dset_type_attribute(fpath->Field_hid, F5file_type(fpath, fieldtype) );
1272*/
1273
1275
1276 F5I_add_field(fpath, fieldname);
1277
1278 F5printf(9, "F5FSwrite_fraction(%s) writing dataset fragment\n", fieldname);
1279 return 1;
1280}
1281
1282static double poly_eval(const double coefficients[], int order, int x)
1283{
1284double f = coefficients[0];
1285 if (order==1)
1286 f += x*coefficients[1];
1287 else
1288 return 0; /* not coded yet... */
1289
1290 return f;
1291}
1292
1293void F5FevalX(double*result, int Mrank, const int index[],
1294 int components, const double*const polynomials[], const int polynom_order[],
1295 const int component_map[])
1296{
1297int i;
1298 for(i=0; i<Mrank; i++)
1299 {
1300 int c = component_map[ i ];
1301 result[ c ] = poly_eval( polynomials[c], polynom_order[c], index[ i ] );
1302 }
1303/*
1304 for(i=0; i<components; i++)
1305 {
1306 result[i] = poly_eval( polynomials[i], polynom_order[i], index[ component_map[ i ] ] );
1307 }
1308*/
1309}
1310
1311
1312F5ErrorCode F5FwriteX(F5Path*fpath, const char*fieldname,
1313 int rank, const hsize_t dims[],
1314 hid_t fieldtype, hid_t memtype,
1315 const void *const dataPtr[], const int polynom_order[],
1316 const int component_map[],
1317 hid_t property_id)
1318{
1319hid_t field_id;
1320hsize_t full_dims[FIBER_MAX_RANK];
1321
1322 F5printf(40, "F5FwriteX()");
1323 F5Tpermute_dimensions(fpath, rank, full_dims , dims );
1324
1325 if (!F5LTset_dataspace(fpath, rank, full_dims))
1326 {
1327 F5printf(-1, "F5FSwriteX(%s): cannot create, inconsistent dataspace!", fieldname);
1329 }
1330
1331 field_id = F5LwriteX(fpath->Representation_hid, fieldname,
1332 rank, dims,
1333 F5file_type(fpath, fieldtype), memtype,
1334 dataPtr, polynom_order,
1335 component_map,
1336 property_id,
1337 fpath->GlobalChart_hid);
1338
1339 if (field_id<0)
1340 {
1341 F5printf(-1, "F5FSwriteX(%s): cannot create direct product field!",
1342 fieldname);
1343
1344 if (field_id == -2) return F5ERROR_COMPOUND_EXPECTED;
1345 if (field_id == -3) return F5ERROR_COMPONENTMAP_EXPECTED;
1346 if (field_id == -4) return F5ERROR_COMPONENTMAP_INVALID;
1347
1349 }
1350
1351 F5Fclose( fpath );
1352 fpath->Field_hid = field_id;
1353
1354/*
1355 F5printf(10,"~F5FSwrite_fraction(%s) temporarily set type attribute...", fieldname);
1356 F5Dset_type_attribute(fpath->Field_hid, F5file_type(fpath, fieldtype) );
1357*/
1358
1360
1361 F5I_add_field(fpath, fieldname);
1362
1363 F5printf(9, "F5FSwriteX(%s) writing direct product\n", fieldname);
1364 return F5_SUCCESS;
1365}
1366
1367
1368static const char*F5Fblockname(int dimensions, const hsize_t*start)
1369{
1370 puts("Default blockname is unimplemented!");
1371 return "block";
1372}
1373
1374static int is_all_zero(int rank, const hsize_t*data)
1375{
1376int i = 0;
1377 for(i=0; i<rank; i++)
1378 if (data[i]) return 0;
1379
1380 return 1;
1381}
1382
1384 int rank,
1385 const hsize_t*start_border,
1386 const hsize_t*end_border,
1387 const char*fraction_name)
1388{
1389 if (!myPath ) return 0;
1390 if (!myPath->Field_hid) return 0;
1391 if (!fraction_name) return 0;
1392
1393hid_t B_id = H5Gopen2( myPath->Field_hid, fraction_name, H5P_DEFAULT);
1394 if (start_border)
1395 {
1396 hsize_t sborder[FIBER_MAX_RANK];
1397 if (!is_all_zero(rank, start_border))
1398 {
1399 F5Tpermute_dimensions(myPath, rank, sborder , start_border );
1401 }
1402 }
1403 if (end_border)
1404 {
1405 hsize_t eborder[FIBER_MAX_RANK];
1406 if (!is_all_zero(rank, end_border))
1407 {
1408 F5Tpermute_dimensions(myPath, rank, eborder , end_border );
1410 }
1411 }
1412 F5Xclose(B_id);
1413 return 1;
1414}
1415
1416int F5Fwrite_linear_fraction(F5Path*fpath, const char*fieldname,
1417 int rank, const hsize_t*full_dims,
1418 const hsize_t*local_dims,
1419 hid_t fieldtype, const void*base, const void*delta,
1420 const hsize_t*datastart,
1421 const char*fraction_name)
1422{
1423hid_t F_id = F5Gappend(fpath->Representation_hid, fieldname);
1424hid_t B_id;
1425hsize_t ldims[FIBER_MAX_RANK];
1426hsize_t offset[FIBER_MAX_RANK];
1427//int i;
1428const char*fragment_name = fraction_name?fraction_name:F5Fblockname(rank, datastart);
1429 F5Fclose( fpath );
1430
1431 F5printf(8, "F5Fwrite_linear_fraction(%s)\n", fieldname);
1432
1433 F5Tpermute_dimensions(fpath, rank, ldims, local_dims );
1434 F5Tpermute_dimensions(fpath, rank, offset, datastart );
1435
1436 B_id = F5Lwrite_linear(F_id, fragment_name, rank, ldims,
1437 F5file_type(fpath, fieldtype),
1438 base, delta);
1439
1440 if (B_id<=0)
1441 return 0;
1442
1444
1445 if (full_dims)
1446 F5Lset_space(F_id, rank, full_dims);
1447
1449
1450 F5Xclose(B_id);
1451
1452 fpath->Field_hid = F_id;
1453
1455
1456 F5I_add_field(fpath, fieldname);
1457
1458 F5printf(9, "~F5Fwrite_linear_fraction(%s)\n", fieldname);
1459 return 1;
1460}
1461
1462
1463
1464F5_API int F5Fwrite_linear(F5Path*fpath, const char*fieldname,
1465 int rank, hsize_t*dims,
1466 hid_t fieldtype, const void * base, const void*delta)
1467{
1468hid_t field_id;
1469hsize_t save_dims[FIBER_MAX_RANK];
1470
1471 F5printf(40,"F5Fwrite_linear(%s): rank=%d, dims=%dx%dx%dx%d)", fieldname, rank,
1472 rank>0?(int)dims[0]:1, rank>1?(int)dims[1]:1, rank>2?(int)dims[2]:1, rank>3?(int)dims[3]:1 );
1473
1475 F5Tpermute_dimensions(fpath, rank, save_dims, dims );
1477
1478 F5Fclose( fpath );
1479
1480 F5printf(41,"F5Fwrite_linear(%s): permuted dims: rank=%d, dims=%dx%dx%dx%d)", fieldname, rank,
1481 rank>0?(int)save_dims[0]:1, rank>1?(int)save_dims[1]:1, rank>2?(int)save_dims[2]:1, rank>3?(int)save_dims[3]:1 );
1482
1483 if (!F5LTset_dataspace(fpath, rank, save_dims))
1484 {
1485 F5printf(-1, "F5Fwrite_linear(%s): cannot create, inconsistent dataspace!", fieldname);
1486 return 0;
1487 }
1488
1489 field_id = F5Lwrite_linear(fpath->Representation_hid, fieldname,
1490 rank, save_dims,
1491 F5file_type(fpath, fieldtype),
1492 base, delta);
1493
1494 if (field_id<0) return 0; /* already exists? */
1495
1496 {
1497 int rank = H5Tget_nmembers( fieldtype );
1498
1500 }
1501
1502 fpath->Field_hid = field_id;
1503
1505
1506 F5I_add_field(fpath, fieldname);
1507
1508 F5printf(40, "~F5Fwrite_linear()");
1509 return 1;
1510}
1511
1512int F5Fis_linear(F5Path*fpath, const char*fieldname)
1513{
1514 return F5Lis_linear(fpath->Representation_hid, fieldname);
1515}
1516
1518 hsize_t*dims,
1519 hid_t fieldtype, void * base, void*delta)
1520{
1521hid_t field_id;
1522int rank;
1523hsize_t file_dims[FIBER_MAX_RANK];
1524
1525 F5printf(40, "F5Fread_linear()");
1526/* F5Fclose( fpath ); */
1527
1528/* field_id = F5Lread_linear(fpath->Representation_hid, fieldname, */
1529
1530 field_id = F5Lread_linear(fpath->Field_hid,
1531 file_dims,
1532 fieldtype,
1533 base, delta);
1534
1535 if (field_id < 0 )
1536 return 0;
1537
1538 if (dims)
1539 {
1540 rank = H5Tget_nmembers( fieldtype );
1542 F5Tpermute_dimensions(fpath, rank, dims, file_dims );
1544 }
1545
1546 F5printf(40, "~F5Fread_linear()");
1547 return 1;
1548}
1549
1551 hid_t fragment_hid,
1552 hsize_t*dims,
1553 hid_t fieldtype, void * base, void*delta)
1554{
1555hid_t field_id;
1556int rank;
1557hsize_t file_dims[FIBER_MAX_RANK];
1558
1559 F5printf(40, "F5Fread_linear()");
1560 /* F5Fclose( fpath ); */
1561
1562 /* field_id = F5Lread_linear(fpath->Representation_hid, fieldname, */
1563
1564 field_id = F5Lread_linear(fragment_hid,
1565 file_dims,
1566 fieldtype,
1567 base, delta);
1568
1569 if (field_id < 0 )
1570 return 0;
1571
1572 if (dims)
1573 {
1574 rank = H5Tget_nmembers( fieldtype );
1576 F5Tpermute_dimensions(fpath, rank, dims, file_dims );
1578 }
1579
1580 F5printf(40, "~F5Fread_linear()");
1581 return 1;
1582}
1583
1584
1585
1586
1587/************************************************
1588
1589 Attribute functions operating on fields.
1590
1591*************************************************/
1592
1593int F5Fget_attribute_byname( F5Path*f, const char*attribute_name,
1594 void*data, hsize_t N, hid_t mem_type_id,
1595 const char*fragment_name)
1596{
1597herr_t err;
1598hid_t attr_id, type_id;
1599 if (!f)
1600 {
1601 F5printf(5, "Open attribute %s without path object cannot succeed!", attribute_name);
1602 return 0;
1603 }
1604
1605 if (fragment_name)
1606 {
1607 hid_t frag_id = F5Gtry_to_open(f->Field_hid, fragment_name);
1608 if (frag_id<0)
1609 {
1610 frag_id = F5Dtry_to_open(f->Field_hid, fragment_name);
1611 if (frag_id<0)
1612 {
1613 F5printf(5, "F5Fget_attribute_byname(%s,%s). No such fragment.", attribute_name, fragment_name);
1614 return 0;
1615 }
1616 }
1617
1618 attr_id = F5Atry_to_open( frag_id, attribute_name);
1619 F5Xclose( frag_id );
1620 }
1621 else
1622 attr_id = F5Atry_to_open( f->Field_hid, attribute_name);
1623
1624 if (attr_id<0)
1625 {
1626 /* attribute not found */
1627 F5printf(5, "Open attribute %s in fragment %s not found.", attribute_name, fragment_name);
1628 return 0;
1629 }
1630
1631 {
1632 hid_t space_id = H5Aget_space(attr_id);
1633 hsize_t NumberofExistingAttributeElements = H5Sget_simple_extent_npoints(space_id);
1634 H5Sclose(space_id);
1635 if (NumberofExistingAttributeElements != N)
1636 {
1637 F5printf(1,"F5Fget_attribute_byname() MISMATCH - trying to read %d elements for attribute %s which has %d elements in file.",
1638 (int)N, attribute_name, (int)NumberofExistingAttributeElements);
1639 return 0;
1640 }
1641 }
1642
1643 if (mem_type_id)
1644 type_id = mem_type_id;
1645 else
1646 type_id = H5Aget_type(attr_id);
1647
1648 {
1649 H5E_BEGIN_TRY
1650 err = F_H5Aread(attr_id, type_id, data, attribute_name);
1651 H5E_END_TRY
1652 }
1653
1654 H5Aclose(attr_id);
1655
1656 if (!mem_type_id)
1657 H5Tclose(type_id);
1658
1659 if (err<0)
1660 return 0;
1661 else
1662 return 1;
1663}
1664
1665
1666int F5Fget_range( F5Path*f, const char* fragment_name, void*minmax )
1667{
1668hid_t type_id = F5Fget_type(f);
1669
1670int check = F5Fget_attribute_byname( f, FIBER_FIELD_COMPONENT_RANGE, minmax, 2, type_id , fragment_name);
1671
1672 if( H5Iis_valid( type_id ) )
1673 if( H5Iget_type( type_id ) >= 0 )
1674 H5Tclose(type_id);
1675 return check;
1676}
1677
1678
1679
1680int F5Fset_attribute_byname( F5Path*f, const char*attribute_name,
1681 const void*data, hsize_t N,
1682 hid_t mem_type_id,
1683 const char*fragment_name)
1684{
1685hid_t attr_id, space_id;
1686 if (!f)
1687 {
1688 F5printf(5,"F5Fset_attribute() got NULL F5Path, cannot set attribute %s .",attribute_name);
1689 return 0;
1690 }
1691 if (f->Field_hid<1)
1692 {
1693 F5printf(5,"F5Fset_attribute() F5Path has no field ID, cannot set attribute %s .",attribute_name);
1694 return 0;
1695 }
1696
1697 space_id = H5Screate_simple(1, &N, &N );
1698
1699 if (fragment_name)
1700 {
1701 hid_t frag_id;
1702 H5E_BEGIN_TRY
1703 frag_id = H5Gopen2(f->Field_hid, fragment_name, H5P_DEFAULT);
1704 H5E_END_TRY
1705 if (frag_id<0)
1706 {
1707 frag_id = F5Dtry_to_open(f->Field_hid, fragment_name);
1708 }
1709
1710 attr_id = F5Atry_to_open( frag_id, attribute_name);
1711 if (attr_id<0)
1712 attr_id = F5Acreate( frag_id, attribute_name, mem_type_id, space_id, H5P_DEFAULT);
1713
1714 F5Xclose( frag_id );
1715 }
1716 else
1717 {
1718 attr_id = F5Atry_to_open( f->Field_hid, attribute_name);
1719 if (attr_id<0)
1720 attr_id = F5Acreate( f->Field_hid, attribute_name, mem_type_id, space_id, H5P_DEFAULT);
1721 }
1722
1723 H5Sclose( space_id );
1724
1725 if (attr_id<0)
1726 {
1727 F5printf(5,"F5Fset_attribute() Could neither open or create attribute %s .",attribute_name);
1728 return 0;
1729 }
1730
1731 H5Awrite(attr_id, mem_type_id, data );
1732 H5Aclose(attr_id);
1733 return 1;
1734}
1735
1736
1737F5_API int F5Fset_range(F5Path*f, const char*fragment_name, const void*minmax)
1738{
1739hid_t type_id = F5Fget_type(f);
1740int check;
1741 if (type_id<=0)
1742 return 0;
1743
1744 check = F5Fset_attribute_byname(f,
1745 FIBER_FIELD_COMPONENT_RANGE, minmax, 2,
1746 type_id, fragment_name);
1747
1748 H5Tclose(type_id);
1749
1750 return check;
1751}
long F5Aget_ints(hid_t loc_id, const char *name, int *data, hsize_t n)
Definition F5A.c:406
hid_t F5Atry_to_open(hid_t location, const char *name)
Definition F5A.c:23
int F5Asave_string(hid_t loc_id, const char *name, const char *buf)
Definition F5A.c:45
int F5Asave(hid_t loc_id, const char *name, hid_t file_type_id, hid_t mem_type_id, const void *data, hsize_t n)
Definition F5A.c:529
int F5Asave_strings(hid_t loc_id, const char *name, const char *buf, int HowMany)
Definition F5A.c:79
int F5Bget_chart_dims(const ChartDomain_IDs *IDs)
Definition F5Bchart.c:899
hsize_t * F5B_permute_dimensions(hsize_t *target_dims, int rank, const hsize_t *source_dims, int perm_vector[FIBER_MAX_RANK], int perm_vector_size)
Definition F5Bchart.c:72
hid_t F5file_type(F5Path *fpath, hid_t fieldtype)
Definition F5Bchart.c:941
int F5Tget_extent(F5Path *f, hsize_t *dims, int maxDims)
Definition F5F.c:226
int F5Fexpand_dataspace(F5Path *fpath, int rank, hsize_t *Dims)
Definition F5F.c:768
int F5Fis_group(const F5Path *fpath)
Definition F5F.c:126
int F5Fget_range(F5Path *f, const char *fragment_name, void *minmax)
Definition F5F.c:1666
int F5Fread_linear_fragment(F5Path *fpath, hid_t fragment_hid, hsize_t *dims, hid_t fieldtype, void *base, void *delta)
Definition F5F.c:1550
int F5Fset_attribute_byname(F5Path *f, const char *attribute_name, const void *data, hsize_t N, hid_t mem_type_id, const char *fragment_name)
Definition F5F.c:1680
F5ErrorCode F5Fwrite_fraction_external(F5Path *fpath, const char *fieldname, const char *target_file_name, const char *target_obj_name, const char *prefix, int rank, const hsize_t *Dims, const hsize_t *fraction_dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id)
Definition F5F.c:1001
void F5FevalX(double *result, int Mrank, const int index[], int components, const double *const polynomials[], const int polynom_order[], const int component_map[])
Definition F5F.c:1293
F5_API int F5Fset_range(F5Path *f, const char *fragment_name, const void *minmax)
Definition F5F.c:1737
F5_API F5ErrorCode F5Fwrite_1D(F5Path *fpath, const char *fieldname, hsize_t nElements, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
Definition F5F.c:631
hid_t F5Fget_type(F5Path *f)
Definition F5F.c:156
int F5B_iszero_dims(int rank, hsize_t *dims)
Definition F5F.c:1148
int F5Fget_attribute_byname(F5Path *f, const char *attribute_name, void *data, hsize_t N, hid_t mem_type_id, const char *fragment_name)
Definition F5F.c:1593
int F5Tget_index_depth(F5Path *f, int *result)
Definition F5F.c:255
int F5Fwrite_linear_fraction_overlap(F5Path *myPath, int rank, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name)
Definition F5F.c:1383
F5_API hsize_t * F5Tpermute_dimensions(F5Path *fpath, int rank, hsize_t *target_dims, const hsize_t *source_dims)
Definition F5F.c:277
F5_API int F5Fwrites(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void **dataPtr, hid_t property_id)
Definition F5F.c:690
int F5Fis_separatedcompound(F5Path *fpath, const char *fieldname)
Definition F5F.c:1128
int F5Ffragment_is_group(const F5Path *fpath, const char *fragment_name)
Definition F5F.c:135
int F5Fis_fragmented(F5Path *fpath, const char *fieldname)
Definition F5F.c:1106
F5ErrorCode F5Fwrite_flexible(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id, int do_check)
Definition F5F.c:389
ArrayType F5Fget_field_enum(const F5Path *fpath, const char *fieldname, int *major_version, int *minor_version, int *release_version)
Definition F5F.c:17
enum F5ErrorCode_type F5ErrorCode
Definition F5F.h:267
F5_API int F5LTset_dataspace(F5Path *f, int rank, hsize_t *dims)
Definition F5LT.c:43
F5_API int F5LTexpand_dataspace(F5Path *f, int rank, hsize_t *dims)
Definition F5LT.c:120
@ F5ERROR_COMPONENTMAP_INVALID
Definition F5F.h:262
@ F5ERROR_INVALID_FRAGMENT_START
Definition F5F.h:236
@ F5ERROR_INVALID_FRAGMENT_END
Definition F5F.h:239
@ F5ERROR_ALREADY_EXISTS
Definition F5F.h:253
@ F5_SUCCESS
Definition F5F.h:226
@ F5ERROR_INVALID_FPATH
Definition F5F.h:229
@ F5ERROR_NONSPECIFIED
Definition F5F.h:264
@ F5ERROR_INCONSISTENT_DATASPACE
Definition F5F.h:233
@ F5ERROR_INVALID_FIELDNAME
Definition F5F.h:242
@ F5ERROR_INVALID_PARAMETERS
Definition F5F.h:251
@ F5ERROR_COMPOUND_EXPECTED
Definition F5F.h:256
@ F5ERROR_COMPONENTMAP_EXPECTED
Definition F5F.h:259
hid_t F5LTmake_enum_type(F5Path *fpath)
Definition F5LT.c:179
hid_t F5Lwrite_fractionS(hid_t R_id, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *datasize, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t enum_type, hid_t property_id)
Definition F5L.c:691
hid_t F5Lwrite_fraction_external(hid_t R_id, const char *fieldname, const char *target_file_name, const char *target_obj_name, const char *prefix, int rank, const hsize_t *full_dims, const hsize_t *datasize, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t enum_type, hid_t property_id)
Definition F5L.c:738
int F5Dset_type_attribute(hid_t F_id, hid_t fieldtype)
Definition F5L.c:1052
hid_t F5LwriteX(hid_t R_id, const char *fieldname, int rank, const hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, const int *polynom_order, const int component_map[], hid_t property_id, hid_t ProcIDLocation)
Definition F5L.c:1202
int F5Lis_linear(hid_t Rep_id, const char *fieldname)
Definition F5L.c:985
H5Tclose(type_id)
#define F5_API
Definition F5WinDLLApi.h:11
#define FIBER_HDF5_INDEXDEPTH_ATTRIB
Definition F5defs.h:228
#define FIBER_FIELD_COMPONENT_RANGE
Definition F5defs.h:186
#define FIBER_RELEASE_VERSION
Definition F5defs.h:16
#define FIBER_MAX_RANK
Definition F5defs.h:105
#define FIBER_UNIFORMARRAY_ELEMENTS_ATTRIBUTE
Definition F5defs.h:157
ArrayType
Definition F5defs.h:267
@ Contiguous
Definition F5defs.h:269
@ FragmentedContiguous
Definition F5defs.h:272
@ SeparatedCompound
Definition F5defs.h:270
@ FragmentedUniformSampling
Definition F5defs.h:277
@ UniformSampling
Definition F5defs.h:276
@ DirectProduct
Definition F5defs.h:274
@ UnknownArrayType
Definition F5defs.h:268
@ FragmentedSeparatedCompound
Definition F5defs.h:273
#define FIBER_FRAGMENT_NOOVERLAP_START_ATTRIBUTE
Definition F5defs.h:175
#define FIBER_FRAGMENT_NOOVERLAP_END_ATTRIBUTE
Definition F5defs.h:176
#define FIBER_MAJOR_VERSION
Definition F5defs.h:14
#define FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE
Definition F5defs.h:153
#define FIBER_MINOR_VERSION
Definition F5defs.h:15
#define FIBER_FRAGMENT_OFFSET_ATTRIBUTE
Definition F5defs.h:174
void F5I_add_field(F5Path *fpath, const char *fieldname)
Definition F5private.c:178
herr_t F_H5Aread(hid_t attr_id, hid_t mem_type_id, void *buf, const char *name)
Definition F5private.c:332
void F5print_dimensions(int verbosity, const char *prefix, int rank, const hsize_t dims[])
Definition F5private.c:394
hid_t F5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist)
Definition F5private.c:11
int F5printf_indent
Definition F5private.c:349
#define F5printf(verbosity,...)
Definition F5private.h:60
hid_t F5Ttransient_F5field_Array_enum()
Definition F5types.c:189
herr_t F5Tset_field_enum(hid_t loc_id, hid_t enum_type_id, ArrayType what)
Definition F5types.c:268
ArrayType F5Tget_field_Array_enum(hid_t loc_id, int *major_version, int *minor_version, int *release_version)
Definition F5types.c:305
#define F5T_RGB
Definition F5types.h:37
#define F5T_RGB_REAL
Definition F5types.h:42
hid_t F5Tget_space(F5Path *f)
Definition F5F.c:167
int F5Fis_linear(F5Path *fpath, const char *fieldname)
Definition F5F.c:1512
F5_API int F5Fwrite_linear(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, const void *base, const void *delta)
Definition F5F.c:1464
int F5Fopen(F5Path *f, const char *fieldname)
Definition F5F.c:66
F5_API F5ErrorCode F5FwriteIMAGE(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t dcpl_id)
Definition F5F.c:487
int F5Fwrite_linear_fraction(F5Path *fpath, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *local_dims, hid_t fieldtype, const void *base, const void *delta, const hsize_t *datastart, const char *fraction_name)
Definition F5F.c:1416
void F5Fclose(F5Path *f)
Definition F5F.c:92
const char * F5Fwhatsup(F5ErrorCode EC)
Definition F5F.c:367
F5ErrorCode F5FwriteX(F5Path *fpath, const char *fieldname, int rank, const hsize_t dims[], hid_t fieldtype, hid_t memtype, const void *const dataPtr[], const int polynom_order[], const int component_map[], hid_t property_id)
Definition F5F.c:1312
hid_t F5Fgrab(F5Path *f)
Definition F5F.c:107
F5ErrorCode F5Fwrite_fractionS(F5Path *fpath, const char *fieldname, int rank, const hsize_t *Dims, const hsize_t *fraction_dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id)
Definition F5F.c:913
F5ErrorCode F5Fwrite(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
Definition F5F.c:467
F5ErrorCode F5FwriteHyperDimensional(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
Definition F5F.c:476
hid_t F5Fget_type2(F5Path *f, hid_t elink_fapl_id)
Definition F5F.c:161
int F5Fcreate(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t property_id)
Definition F5F.c:328
F5ErrorCode F5Fwrite_fraction(F5Path *fpath, const char *fieldname, int rank, const hsize_t *Dims, const hsize_t *fraction_dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id)
Definition F5F.c:778
int F5FSwrite_fraction(F5Path *fpath, const char *fieldname, int rank, const hsize_t *dims, const hsize_t *frag_dims, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id, int AllowFullCoverage)
Definition F5F.c:1157
hid_t F5Lread_linear(hid_t F_id, hsize_t *dims, hid_t fieldtype, void *base, void *delta)
Definition F5L.c:911
int F5LAsave_dimensions(hid_t Field_id, const char *aname, int rank, const hsize_t *dims)
Definition F5A.c:192
hid_t F5Lcreate(hid_t R_id, const char *fieldname, int dimension, const hsize_t *dims, hid_t fieldtype, hid_t dataset_creation_property_id)
Definition F5L.c:60
hid_t F5Lwrite(hid_t R_id, const char *fieldname, int dimension, const hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t enum_type, hid_t dcpl_id)
Definition F5L.c:357
int F5Lset_space(hid_t Field_id, int rank, const hsize_t *dims)
Definition F5L.c:292
int F5LAget_dimensions(hid_t Field_id, const char *aname, hsize_t dims[FIBER_MAX_RANK])
Definition F5A.c:233
hid_t F5Lwrite_fraction(hid_t R_id, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *datasize, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t enum_type, hid_t property_id)
Definition F5L.c:631
hid_t F5Lwrites(hid_t R_id, const char *fieldname, int dimension, const hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, hid_t enum_type, hid_t property_id)
Definition F5L.c:1096
int F5Fread_linear(F5Path *fpath, hsize_t *dims, hid_t fieldtype, void *base, void *delta)
Definition F5F.c:1517
hid_t F5Lwrite_linear(hid_t R_id, const char *fieldname, int dimension, const hsize_t *dims, hid_t fieldtype, const void *base, const void *delta)
Definition F5L.c:852
hid_t F5LSwrite_fraction(hid_t R_id, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *datasize, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t enum_type, hid_t property_id)
Definition F5L.c:793
hid_t F5Lget_type(hid_t Field_hid, int FieldIDisGroup, hid_t fapl_id)
Definition F5L.c:173
hid_t F5Lwrite1D(hid_t R_id, const char *fieldname, hsize_t nElements, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t enum_type, hid_t property_id)
Definition F5L.c:408
#define H5Gclose(x)
Definition F5X.h:144
hid_t F5Dtry_to_open(hid_t location, const char *name)
Definition F5X.c:335
hid_t F5Gtry_to_open(hid_t location, const char *name)
Definition F5X.c:297
herr_t F5Xclose(hid_t obj_id)
Definition F5X.c:347
hid_t F5Gappend(hid_t loc_id, const char *name)
Definition F5X.c:59
int perm_vector[FIBER_MAX_RANK]
Definition F5Bchart.h:141
hid_t GlobalChart_hid
Definition F5Path.h:54
hid_t Representation_hid
Definition F5Path.h:58
hid_t Field_hid
Definition F5Path.h:59
hid_t Topology_hid
Definition F5Path.h:57
ChartDomain_IDs * myChart
Definition F5Path.h:33