FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5L.c
Go to the documentation of this file.
1#include "F5L.h"
2#include "F5X.h"
3#include "F5defs.h"
4#include "F5private.h"
5#include "F5A.h"
6
7#include <assert.h>
8
9/* #if defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__) */
10#include <stdlib.h>
11/* #else */
12/* #include <malloc.h> */
13/* #endif */
14
15/*
16
17Contigous compound vs. separated compound:
18
19
20 /"fieldname": {x,y,z}{x,y,z}{x,y,z}{x,y,z}{x,y,z}{x,y,z}{x,y,z}{x,y,z}
21
22vs.
23
24/"fieldname"/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
25/"fieldname"/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
26/"fieldname"/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
27
28 */
29
30/**
31 Check whether the specified type is already committed in
32 the file. This is only relevant for compound structures.
33 */
34int F5Tcheck_committed(hid_t fieldtype)
35{
36 F5printf(200, "F5Tcheck_committed()" );
37 switch(H5Tget_class( fieldtype ) )
38 {
39 case H5T_COMPOUND:
40 if (H5Tcommitted(fieldtype)>0)
41 return 1;
42 return 0;
43
44 default:
45 return 1;
46 }
47}
48
49/*
50 AMR support:
51
52 /field/block/{x,y,z}{x,y,z}...
53 /field/block/{xxxxxx}{yyyyyy}{zzzzz}
54 /field/{x,y,z}{x,y,z}...
55 /field/{xxxxxx}{yyyyyy}{zzzzz}
56 */
57
58/*
59*/
60hid_t F5Lcreate(hid_t R_id, const char*fieldname, int dimension, const hsize_t*dims,
61 hid_t fieldtype, hid_t dataset_creation_property_id)
62{
63hid_t ds_id, creator_id, id;
64
65 if (fieldtype<0)
66 {
67 F5printf(30, "F5Lcreate(%s): INVALID field type %d!?", fieldname, (int)fieldtype);
68 return -1;
69 }
70
71 ds_id = H5Screate_simple(dimension, dims, NULL); /* F5Lcreate() */
72 if (ds_id<0)
73 {
74 F5printf(30, "F5Lcreate(): cannot create dataset!?");
75 return -1;
76 }
77
78/* H5Sselect_order (dataspace_id, perm_vector); */
79
80 creator_id = dataset_creation_property_id<0 ? H5Pcreate(H5P_DATASET_CREATE) : dataset_creation_property_id;
81 id = F5Dcreate(R_id, fieldname, fieldtype, ds_id, creator_id);
82 if (id<0)
83 {
84 F5printf(30, "F5Lcreate(): F5Dappend(loc=%d,%s,dims=%d,,type=%d...) FAILED!\n",
85 (int)R_id, fieldname, dimension, (int)fieldtype );
86 }
87 else
88 {
89 F5printf(40, "F5Lcreate(): F5Dappend(%d,%s,...) DONE!\n", (int)R_id, fieldname);
90 }
91
92 /*H5Dwrite(id, fieldtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, dataPtr); */
93
94 H5Sclose(ds_id);
95
96 /*
97 Review this "auto-closing" feature of property lists,this is unlikely to be good. WB SEP 2016
98 */
99 if (dataset_creation_property_id<0)
100 H5Pclose(creator_id);
101
102 return id;
103}
104
105typedef struct
106{
107 hid_t * type_id;
108 hid_t fapl_id;
109}
111
112static herr_t get_type_by_iteration(hid_t group_id, const char *member_name, void *operator_data)
113{
115hid_t loc_id;
116int FieldIDisGroup = 0;
117hid_t lapl_id = H5P_DEFAULT;
118
119/* todo: use F5Iignore() here */
120 if (member_name[0] == '.')
121 {
122 F5printf(1, "F5Lget_type(): ** performance warning ** - identifying field type by iteration, but skipping dot-fragment %s", member_name );
123 return 0;
124 }
125
126 {
127 H5L_info_t link_info;
128 herr_t status = H5Lget_info(group_id, member_name, &link_info, H5P_DEFAULT);
129 if (status < 0)
130 {
131 F5printf(1, "F5Lget_type(): ** performance warning ** - cannot receive link status for fragment %s", member_name );
132 return 0;
133 }
134 if (link_info.type == H5L_TYPE_EXTERNAL)
135 {
136 F5printf(1, "F5Lget_type(): ** performance warning ** - identifying field type by inspecting skipped fragment %s", member_name );
137 // return 0;
138 }
139 }
140
141 F5printf(1, "F5Lget_type(): ** performance warning ** - identifying field type by inspecting fragment %s", member_name );
142
143 H5E_BEGIN_TRY
144 loc_id = H5Dopen2(group_id, member_name, lapl_id);
145 H5E_END_TRY
146 if (loc_id<0)
147 {
148 FieldIDisGroup = 1;
149
150 if (T->fapl_id)
151 {
152 H5Pclose( lapl_id );
153 lapl_id = H5Pcreate( H5P_GROUP_ACCESS );
154 H5Pset_elink_fapl( lapl_id, T->fapl_id);
155 }
156
157 loc_id = H5Gopen2(group_id, member_name, lapl_id);
158 }
159
160 if (lapl_id != H5P_DEFAULT)
161 H5Pclose( lapl_id );
162
163 if (loc_id<0) return 0;
164
165 *T->type_id = F5Lget_type(loc_id, FieldIDisGroup, lapl_id);
166
167 if (FieldIDisGroup) H5Gclose(loc_id);
168 else H5Dclose(loc_id);
169
170 return *T->type_id > 0; /* positive return value indicates stop of iteration. */
171}
172
173hid_t F5Lget_type(hid_t Field_hid, int FieldIDisGroup, hid_t fapl_id)
174{
175 F5printf(40, "F5Lget_type(%lu,%s)", (unsigned long)Field_hid, FieldIDisGroup?"Is group":"Is dataset");
176
177 if (Field_hid<1)
178 {
179 F5printf(40, "F5Lget_type(): no valid Field id specified");
180 return -1;
181 }
182
183 if (FieldIDisGroup)
184 {
185 hid_t attr_hid, Type_id = -1;
186
187 H5E_BEGIN_TRY
188 attr_hid = F5Aopen_name(Field_hid, FIBER_HDF5_TYPEID_ATTRIB);
189 H5E_END_TRY
190 if (attr_hid>0)
191 {
192 Type_id = H5Aget_type(attr_hid);
193 H5Aclose(attr_hid);
194 F5printf(40, "F5Lget_type(): found `%s' attribute, return its type.", FIBER_HDF5_TYPEID_ATTRIB);
195 return Type_id;
196 }
197 H5E_BEGIN_TRY
198 attr_hid = F5Aopen_name(Field_hid, FIBER_UNIFORMARRAY_BASE_ATTRIBUTE);
199 H5E_END_TRY
200
201 if (attr_hid>0)
202 {
203 Type_id = H5Aget_type(attr_hid);
204 H5Aclose(attr_hid);
205 F5printf(40, "F5Lget_type(): no `%s' attribute, but uniform base attribute %s found.",
207 return Type_id;
208 }
209 F5printf(1, "F5Lget_type(): no `%s' attribute, ** performance warning ** - identifying field type by iteration over field fragments!",
211 {
213 T.type_id = &Type_id;
214 T.fapl_id = fapl_id;
215 H5Giterate(Field_hid, ".", 0, get_type_by_iteration, &T);
216 return Type_id;
217 }
218 }
219 else
220 {
221 hid_t NCSA_image_version = F5Atry_to_open(Field_hid, "IMAGE_VERSION");
222 if (NCSA_image_version>0)
223 {
224 hid_t attr_hid = F5Atry_to_open(Field_hid, FIBER_HDF5_TYPEID_ATTRIB);
225 H5Aclose( NCSA_image_version );
226 if (attr_hid>0)
227 {
228 hid_t Type_id = H5Aget_type(attr_hid);
229 H5Aclose(attr_hid);
230 F5printf(40, "F5Lget_type(): found NCSA image with `%s' attribute, return its type.", FIBER_HDF5_TYPEID_ATTRIB);
231fprintf(stderr, "F5Lget_type(): found NCSA image with `%s' attribute, return its type.\n", FIBER_HDF5_TYPEID_ATTRIB);
232 return Type_id;
233 }
234 }
235#if 0
236 {
237 hid_t type_id = H5Dget_type(Field_hid);
238 if (H5Tis_commmitted(type_id)
239 {
240 int NAttribs = H5Aget_num_attrs( type_id );
241 F5printf(20, "HDF5 Type %lu has %d attributes", (unsigned long)type_id, NAttribs);
242 }
243 return type_id;
244 }
245#endif
246 return H5Dget_type(Field_hid);
247 }
248}
249
250hid_t F5Lget_space(hid_t Field_id)
251{
252hid_t space_id, attr_id;
253int rank = -1, i, Dims[FIBER_MAX_RANK];
254hsize_t dims[FIBER_MAX_RANK];
255
256 F5printf(40, "-- F5Lget_space(): Determine skeleton topology.");
257
258 H5E_BEGIN_TRY
260 H5E_END_TRY
261
262 if (attr_id>0)
263 {
264 hsize_t TotalNumber = 1;
265
266 space_id = H5Aget_space(attr_id);
267 rank = H5Sget_simple_extent_npoints(space_id);
268
270 H5Aclose(attr_id);
271 H5Sclose(space_id);
272
273 for(i=0; i<rank; i++)
274 {
275 dims[i] = Dims[i];
276 TotalNumber *= dims[i];
277 }
278 if (TotalNumber==0) /* no known regular topology here */
279 {
280 F5printf(20, " F5Lget_space(): Unknown topology, might be complex.");
281 return -1;
282 }
283
284 space_id = H5Screate_simple(rank, dims, dims);
285 return space_id;
286 }
287
288 space_id = H5Dget_space(Field_id);
289 return space_id;
290}
291
292int F5Lset_space(hid_t Field_id, int rank, const hsize_t*dims)
293{
295 if (!ok)
296 F5printf(20, " F5Lset_space(): field already has dimensions set or invalid Field id or write error.");
297 return ok;
298}
299
300/*
301 */
302int F5Lget_compound_extent_dims(hid_t CompoundGroupID, hsize_t*dims)
303{
304hid_t type_id = F5Lget_type( CompoundGroupID, 1, 0);
305int nComponents = H5Tget_nmembers( type_id );
306int rank = -1;
307int i;
308
309 for(i=0; i<nComponents; i++)
310 {
311 char * comp_name = H5Tget_member_name( type_id, i );
312 hid_t sep_id = H5Dopen2(CompoundGroupID, comp_name, H5P_DEFAULT);
313 H5free_memory( comp_name );
314
315 hid_t space_id = H5Dget_space( sep_id );
316
317 rank = H5Sget_simple_extent_dims(space_id, dims, NULL);
318
319 H5Dclose(sep_id);
320 H5Sclose(space_id);
321 break;
322 }
323 H5Tclose( type_id );
324 return rank;
325}
326
327hid_t F5Lget_compound_space(hid_t CompoundGroupID)
328{
329hid_t type_id = F5Lget_type( CompoundGroupID, 1, 0);
330int nComponents = H5Tget_nmembers( type_id );
331hid_t space_id = -1;
332int i;
333 for(i=0; i<nComponents; i++)
334 {
335 char * comp_name = H5Tget_member_name( type_id, i );
336 hid_t sep_id = H5Dopen2(CompoundGroupID, comp_name, H5P_DEFAULT);
337 H5free_memory( comp_name );
338
339 space_id = H5Dget_space( sep_id );
340
341 H5Dclose(sep_id);
342 H5Sclose(space_id);
343 break;
344 }
345 H5Tclose( type_id );
346 return space_id;
347}
348
349
350/*******************************************************************************************/
351
352/**
353@todo Expose xfer_plist_id parameter
354
355 @return An HDF5 \b dataset ID. The caller must issue H5Dclose() on the returned identifier.
356 */
357hid_t F5Lwrite(hid_t R_id, const char*fieldname, int dimension, const hsize_t*dims,
358 hid_t fieldtype, hid_t memtype, const void * dataPtr,
359 hid_t enum_type, hid_t dcpl_id)
360{
361hid_t id;
362 if (fieldtype<=0)
363 {
364 F5printf(3, "F5Lwrite(%d,%s,%d,...): INVALID field type %d!",
365 (int)R_id, fieldname, dimension, (int)fieldtype );
366 return -1;
367 }
368 if (!dataPtr) /* possibly create a null data space? */
369 {
370 F5printf(3, "F5Lwrite(%d,%s,%d,...): WARNING - NO DATA!\n",
371 (int)R_id, fieldname, dimension );
372 }
373
374 id = F5Lcreate(R_id, fieldname, dimension, dims, fieldtype, dcpl_id);
375 if (!F5Tcheck_committed(fieldtype))
376 F5printf(10, "F5 Warning: F5Lwrite(%s): type not committed!\n", fieldname);
377
378 if (id<0)
379 {
380 F5printf(3, "F5Lwrite(%d,%s,%d,...): Could not create field!",
381 (int)R_id, fieldname, dimension);
382 return -2;
383 }
384
385 F5printf(30, "F5Lwrite(): Field created, set enum");
386 F5Tset_field_enum(id, enum_type, Contiguous);
387
388 {
389 hid_t xfer_plist_id = H5P_DEFAULT;
390 if (dataPtr)
391 {
392 herr_t err = H5Dwrite(id, memtype>0?memtype:fieldtype, H5S_ALL, H5S_ALL, xfer_plist_id, dataPtr);
393
394 /* Returns a non-negative value if successful; otherwise returns a negative value. */
395 if (err<0)
396 {
397 F5printf(3, "F5Lwrite(%d,%s,%d,...): Could not write field!",
398 (int)R_id, fieldname, dimension);
399 H5Dclose( id );
400 return -3;
401 }
402 }
403 }
404
405 return id;
406}
407
408hid_t F5Lwrite1D(hid_t R_id, const char*fieldname,
409 hsize_t nElements, hid_t fieldtype, hid_t memtype,
410 const void * dataPtr, hid_t enum_type, hid_t property_id)
411{
412 return F5Lwrite(R_id, fieldname, 1, &nElements,
413 fieldtype, memtype, dataPtr, enum_type, property_id);
414
415}
416
417
418hid_t F5LwriteS(hid_t R_id, const char*fieldname, int dimension, const hsize_t*dims,
419 hid_t fieldtype, hid_t memtype, const void * dataPtr,
420 hid_t enum_type, hid_t dcpl_id)
421{
422int nComponents;
423hid_t id;
424 if (fieldtype<=0)
425 {
426 F5printf(30, "F5LwriteS(%d,%s,%d,...): INVALID field type %d!",
427 (int)R_id, fieldname, dimension, (int)fieldtype );
428 return -1;
429 }
430
431 if ( H5Tget_class( fieldtype ) != H5T_COMPOUND )
432 {
433 F5printf(30, "F5LwriteS(%d,%s,%d,...): Not a compound type %d!",
434 (int)R_id, fieldname, dimension, (int)fieldtype );
435 return -1;
436 }
437 if (!F5Tcheck_committed(fieldtype))
438 printf("F5 Warning: F5LwriteS(%s): type not committed!\n", fieldname);
439
440
441 if (!dataPtr)
442 {
443 F5printf(30, "F5LwriteS(%d,%s,%d,...): WARNING - NO DATA!\n",
444 (int)R_id, fieldname, dimension );
445 }
446
447 nComponents = H5Tget_nmembers(fieldtype);
448
449 id = F5Gappend(R_id, fieldname);
450
451//OR id = F5Gcreate(R_id, fieldname, Ncomponents, 16);
452
453 if (id<0)
454 {
455 F5printf(30, "F5LwriteS(%d,%s,%d,...): Could not create compound group!",
456 (int)R_id, fieldname, dimension);
457 return -1;
458 }
459
460 F5printf(30, "F5Lwrite(): Field created, set enum");
461 F5Tset_field_enum(id, enum_type, SeparatedCompound);
462 F5Dset_type_attribute(id, fieldtype);
463
464 if (!dataPtr)
465 return id;
466
467 {
468 hid_t ds_id = H5Screate_simple(dimension, dims, NULL);
469 int comp;
470 herr_t herr;
471
472 for(comp=0; comp<nComponents; comp++)
473 {
474 char* ComponentName = H5Tget_member_name(fieldtype, comp);
475 hid_t ComponentType = H5Tget_member_type(fieldtype, comp);
476 hid_t MemComponentType;
477 if (memtype)
478 {
479 /* Retrieves the index of a compound or enumeration datatype member. */
480 int mem_idx = H5Tget_member_index(memtype, ComponentName);
481 if (mem_idx<0)
482 {
483 F5printf(10, "**F5LwriteS(%s) could not find memory equivalent "
484 " of save component %s!",
485 fieldname, ComponentName);
486 MemComponentType = ComponentType;
487 H5Iinc_ref( MemComponentType );
488 }
489 else
490 {
491 F5printf(10, "F5LwriteS(%s): member type %s : %d -> %d",
492 fieldname, ComponentName, mem_idx, comp);
493 MemComponentType = H5Tget_member_type(memtype, mem_idx);
494 }
495 }
496 else
497 {
498 MemComponentType = ComponentType;
499 H5Iinc_ref( MemComponentType );
500 }
501
502 hid_t D_id = H5Dcreate2(id, ComponentName, ComponentType, ds_id,
503 H5P_DEFAULT, /* link creation */
504 dcpl_id, /* dataset creation */
505 H5P_DEFAULT); /* dataset access */
506
507
508 /* setup hyperslab for data writing
509 */
510 {
511 hid_t xfer_plist_id = H5P_DEFAULT;
512 hid_t mem_space_id;
513 hsize_t mem_dataspace[FIBER_MAX_RANK];
514 hsize_t start [FIBER_MAX_RANK];
515 hsize_t stride[FIBER_MAX_RANK];
516
517 const int FastestDimension = dimension-1;
518 int k;
519 for(k=0; k<dimension; k++)
520 {
521 mem_dataspace[k] = dims[k];
522 start[k] = 0;
523 stride[k] = 1;
524 }
525 mem_dataspace[FastestDimension] = nComponents*dims[FastestDimension];
526 start [FastestDimension] = comp;
527 stride[FastestDimension] = nComponents; //nDimensions;
528
529 mem_space_id = H5Screate_simple(dimension, mem_dataspace, NULL);
530 H5Sselect_hyperslab(mem_space_id, H5S_SELECT_SET, start, stride, dims, NULL);
531
532 herr = H5Dwrite(D_id, MemComponentType, mem_space_id, H5S_ALL, xfer_plist_id, dataPtr);
533
534 if (herr<0)
535 F5printf(1, "**F5LwriteS(%s) could not save component %s!",
536 fieldname, ComponentName);
537 }
538
539 H5Dclose(D_id);
540 H5free_memory(ComponentName);
541 H5Tclose( ComponentType );
542 H5Tclose( MemComponentType );
543 }
544
545 H5Sclose( ds_id );
546 }
547
548 return id;
549}
550
551
552int F5LreadS(hid_t Container_id, hid_t LoadID, void * dataPtr,
553 hid_t ElementLoadID)
554{
555int nDimensions = -1;
556int nComponents = H5Tget_nmembers( LoadID );
557hid_t dapl_id = H5P_DEFAULT;
558int read_ok = 0;
559int i;
560 for(i=0; i<nComponents; i++)
561 {
562 char * comp_name = H5Tget_member_name( LoadID, i );
563 hid_t comp_id = H5Dopen2(Container_id, comp_name, dapl_id);
564
565 hid_t space_id = H5Dget_space( comp_id );
566 hsize_t mem_dataspace[FIBER_MAX_RANK],
567 blocksize[FIBER_MAX_RANK];
568 hsize_t start [FIBER_MAX_RANK];
569 hsize_t stride[FIBER_MAX_RANK];
570 int subrank = H5Sget_simple_extent_dims(space_id, blocksize, NULL);
571 int k, FastestDimension;
572
573 if (i==0)
574 nDimensions = subrank;
575 else if (subrank != nDimensions)
576 {
577 F5printf(-1, "F5LreadS() Incompatible component subspace!?!!?");
578 }
579 FastestDimension = nDimensions-1;
580 for(k=0; k<nDimensions; k++)
581 {
582 mem_dataspace[k] = blocksize[k];
583 start[k] = 0;
584 stride[k] = 1;
585 }
586 mem_dataspace[FastestDimension] = nComponents*blocksize[FastestDimension];
587 start [FastestDimension] = i;
588 stride[FastestDimension] = nComponents;
589
590 /*
591 ** Create the HDF5 Hyperslab
592 */
593 {
594 hid_t mem_space_id = H5Screate_simple(subrank, mem_dataspace, NULL);
595 H5Sselect_hyperslab(mem_space_id, H5S_SELECT_SET, start, stride, blocksize, NULL);
596
597 {
598 herr_t read_error = H5Dread(comp_id, ElementLoadID, mem_space_id, space_id, H5P_DEFAULT, dataPtr);
599 if (read_error<0)
600 {
601 F5printf(0, "F5readS() Component subspace read error at %s", comp_name);
602 }
603 else
604 read_ok++;
605 }
606
607 H5free_memory( comp_name );
608
609 H5Dclose(comp_id);
610 H5Sclose(space_id);
611 H5Sclose(mem_space_id);
612 }
613 }
614
615 return read_ok;
616}
617
618
619/*******************************************************************************************/
620/** Fragmented Datasets **/
621/*******************************************************************************************/
622
623#define MAX_BLOCKNAME 1024
624
625static const char*blockname(char*dest, int dimensions, const hsize_t*start)
626{
627 puts("Default blockname is unimplemented!");
628 return "block";
629}
630
631hid_t F5Lwrite_fraction(hid_t R_id, const char*fieldname,
632 int rank, const hsize_t*full_dims,
633 const hsize_t*datasize,
634 hid_t fieldtype, hid_t memtype, const void * dataPtr,
635 const hsize_t*datastart,
636 const hsize_t*start_border, const hsize_t*end_border,
637 const char*fraction_name,
638 hid_t enum_type, hid_t property_id)
639{
640hid_t F_id, B_id;
641
642 if (!datastart)
643 {
644 F5printf(0, "F5Lwrite_fraction() for field %s has no datastart given for fragment %s",
645 fieldname, fraction_name);
646 return -1;
647 }
648
649 F5printf(20, "F5Lwrite_fraction(rank=%d)", rank);
650 if (rank==3)
651 F5printf(20, "F5Lwrite_fraction(%lux%lux%lu)",
652 (long)datasize[0], (long)datasize[1], (long)datasize[2]);
653
654 F_id = F5Gappend(R_id, fieldname);
655 if (F_id<0)
656 {
657 F5printf(1, "F5Lwrite_fraction() - FAILED to append field fragment group.");
658 return F_id;
659 }
660
661 {
662 char myBlockname[ MAX_BLOCKNAME ];
663 B_id = F5Lwrite(F_id, fraction_name?fraction_name:blockname(myBlockname, rank, datastart),
664 rank, datasize, fieldtype, memtype, dataPtr, enum_type, property_id);
665 }
666 if (B_id<=0)
667 {
668 F5printf(1, "F5Lwrite_fraction() - FAILED to append field fragment data.");
669 F5Xclose(F_id);
670 return B_id;
671 }
672
673 if (full_dims)
674 F5Lset_space(F_id, rank, full_dims);
675
676 if (1 != F5LAsave_dimensions(B_id, FIBER_FRAGMENT_OFFSET_ATTRIBUTE, rank, datastart))
677 {
678 F5printf(1, "F5Lwrite_fraction() - FAILED to write FIBER_FRAGMENT_OFFSET_ATTRIBUTE");
679 }
680
681 if (start_border)
683
684 if (end_border)
686
687 F5Xclose(B_id);
688 return F_id;
689}
690
691hid_t F5Lwrite_fractionS(hid_t R_id, const char*fieldname,
692 int rank, const hsize_t*full_dims,
693 const hsize_t*datasize,
694 hid_t fieldtype, hid_t memtype, const void * dataPtr,
695 const hsize_t*datastart,
696 const hsize_t*start_border, const hsize_t*end_border,
697 const char*fraction_name,
698 hid_t enum_type, hid_t property_id)
699{
700hid_t F_id, B_id;
701
702 F5printf(-1, "F5Lwrite_fractionS(rank=%d)", rank);
703
704 F_id = F5Gappend(R_id, fieldname);
705 if (F_id<0)
706 {
707 F5printf(1, "F5Lwrite_fractionS() - FAILED to append field fragment group.");
708 return F_id;
709 }
710 {
711 char myBlockname[MAX_BLOCKNAME];
712 B_id = F5LwriteS(F_id, fraction_name?fraction_name:blockname(myBlockname, rank, datastart),
713 rank, datasize, fieldtype, memtype, dataPtr, enum_type, property_id);
714 }
715 if (B_id<0)
716 {
717 F5printf(1, "F5Lwrite_fractionS() - FAILED to append field fragment data.");
718 F5Xclose(F_id);
719 return B_id;
720 }
721
722 if (full_dims)
723 F5Lset_space(F_id, rank, full_dims);
724
726
727 if (start_border)
729
730 if (end_border)
732
733 F5Xclose(B_id);
734 return F_id;
735}
736
737
738hid_t F5Lwrite_fraction_external(hid_t R_id, const char*fieldname,
739
740 const char *target_file_name,
741 const char *target_obj_name,
742 const char *prefix,
743
744 int rank, const hsize_t*full_dims,
745 const hsize_t*datasize,
746 hid_t fieldtype, hid_t memtype, const void * dataPtr,
747 const hsize_t*datastart,
748 const hsize_t*start_border, const hsize_t*end_border,
749 const char*fraction_name,
750 hid_t enum_type, hid_t property_id)
751{
752hid_t F_id, B_id;
753
754 F5printf(20, "F5Lwrite_fraction(rank=%d)", rank);
755 if (rank==3)
756 F5printf(20, "F5Lwrite_fraction(%lux%lux%lu)",
757 (long)datasize[0], (long)datasize[1], (long)datasize[2]);
758
759 F_id = F5Gappend_external(R_id, fieldname, target_file_name, target_obj_name, prefix );
760 if (F_id<0)
761 {
762 F5printf(20, "F5Lwrite_fraction_external() - FAILED to create external field fragment.");
763 return F_id;
764 }
765
766 {
767 char myBlockname[ MAX_BLOCKNAME ];
768 B_id = F5Lwrite(F_id, fraction_name?fraction_name:blockname(myBlockname, rank, datastart),
769 rank, datasize, fieldtype, memtype, dataPtr, enum_type, property_id);
770
771 if (B_id<=0)
772 {
773 F5printf(1, "F5Lwrite_fraction_external() - FAILED to append field fragment data.");
774 F5Xclose(F_id);
775 return B_id;
776 }
777 }
778 if (full_dims)
779 F5Lset_space(F_id, rank, full_dims);
780
782
783 if (start_border)
785
786 if (end_border)
788
789 F5Xclose(B_id);
790 return F_id;
791}
792
793hid_t F5LSwrite_fraction(hid_t R_id, const char*fieldname,
794 int rank, const hsize_t*full_dims,
795 const hsize_t*datasize,
796 hid_t fieldtype, hid_t memtype, const void *const*dataPtr,
797 const hsize_t*datastart,
798 const hsize_t*start_border, const hsize_t*end_border,
799 const char*fraction_name,
800 hid_t enum_type, hid_t property_id)
801{
802hid_t F_id;
803hid_t B_id;
804
805 F5printf(10, "F5LSwrite_fraction(field=%s, fragment=%s)",
806 fieldname, fraction_name);
807
808 if (rank==3)
809 {
810 F5printf(60, " start=[%d,%d,%d] size=[%d,%d,%d] full=[%d,%d,%d]\n",
811 (int)full_dims[0], (int)full_dims[1], (int)full_dims[2],
812 (int)datastart[0], (int)datastart[1], (int)datastart[2],
813 (int)datasize[0], (int)datasize[1] , (int)datasize[2]
814 );
815 }
816
817
818 F_id = F5Gappend(R_id, fieldname);
819 {
820 char myBlockname[ MAX_BLOCKNAME ];
821 B_id = F5Lwrites(F_id, fraction_name?fraction_name:blockname(myBlockname, rank, datastart),
822 rank, datasize, fieldtype, memtype, dataPtr, enum_type, property_id);
823 }
824 F5Dset_type_attribute(F_id, fieldtype);
825
826 if (full_dims)
827 F5Lset_space(F_id, rank, full_dims);
828
830
831 if (start_border)
833
834 if (end_border)
836
837 F5Xclose(B_id);
838
839 F5printf(11, "~F5LSwrite_fraction(field=%s, fragment=%s)\n",
840 fieldname, fraction_name);
841
842 return F_id;
843}
844
845
846/********************************************************************************************/
847
848/**
849 Write a field that is a linear map from coordinate indices to some data value.
850 @return A HDF5 \b group ID. The caller must issue H5Gclose() on the returned identifier.
851 */
852hid_t F5Lwrite_linear(hid_t R_id, const char*fieldname, int dimension, const hsize_t*dims,
853 hid_t fieldtype,
854 const void * base, const void * delta)
855{
856hid_t F_id;
857hid_t space_hid;
858hid_t attr_hid;
859
860/*
861int rank = H5Tget_nmembers( fieldtype );
862 if (rank<1)
863 {
864 F5printf(5, "F5Lwrite_linear(%s): Unknown field type!\n", fieldname);
865 return -1;
866 }
867*/
868
869 H5E_BEGIN_TRY
870 F_id = F5Gcreate(R_id, fieldname, 0, 0);
871 H5E_END_TRY
872
873 if (F_id<0)
874 {
875 F5printf(50, "F5 Warning: F5Lwrite_linear(%s): cannot create group (already exists?)\n", fieldname);
876 return -1;
877 }
878
879 if (!F5Tcheck_committed(fieldtype))
880 printf("F5 Warning: F5Lwrite_linear(%s): type not committed!\n", fieldname);
881
882 /* Set the dataspace attribute */
883/* F5Lset_space(F_id, rank, dims); */
884
885 F5Lset_space(F_id, dimension, dims);
886
887 space_hid = H5Screate(H5S_SCALAR);
888
889 attr_hid = H5Acreate2(F_id, FIBER_UNIFORMARRAY_BASE_ATTRIBUTE, fieldtype, space_hid,
890 H5P_DEFAULT, H5P_DEFAULT);
891 /* Write scalar attribute. */
892 H5Awrite(attr_hid, fieldtype, base );
893 /* Close attribute. */
894 H5Aclose(attr_hid);
895
896
897 attr_hid = H5Acreate2(F_id, FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE, fieldtype, space_hid,
898 H5P_DEFAULT, H5P_DEFAULT);
899 /* Write scalar attribute. */
900 H5Awrite(attr_hid, fieldtype, delta );
901 /* Close attribute. */
902 H5Aclose(attr_hid);
903
904 /* Close attribute dataspace. */
905 H5Sclose(space_hid);
906
907 return F_id;
908}
909
910
911hid_t F5Lread_linear(hid_t F_id, hsize_t*dims,
912 hid_t fieldtype,
913 void * base, void * delta)
914{
915 /* A linear map must be a group, not a dataset. */
916int rank, i;
917hid_t attr_id, space_id;
918hssize_t file_rank;
919int UADims[FIBER_MAX_RANK];
920
921 if (F_id < 0)
922 return F_id;
923
924 /* If so, it must have a FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE,
925 which is an alias for the corresponding dataspace of this
926 field.
927 */
928
929 rank = H5Tget_nmembers( fieldtype );
930 H5E_BEGIN_TRY
932 H5E_END_TRY
933 if (attr_id<0)
934 {
935#ifdef F5_BACKWARD_COMPATIBILITY
936 /* OLD FILE SUPPORT */
937 attr_id = F5Aopen_name(F_id, "Size");
938 if (attr_id<0)
939 {
940 printf("F5Lread_linear(): ERROR: "FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE" or Size attribute not found!\n");
941#else
942 printf("F5Lread_linear(): ERROR: "FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE" attribute not found!\n");
943#endif
944 return -1;
945#ifdef F5_BACKWARD_COMPATIBILITY
946 }
947#endif
948 }
949 space_id = H5Aget_space(attr_id);
950 file_rank = H5Sget_simple_extent_npoints(space_id);
951 H5Sclose(space_id);
952
953 if (file_rank != rank)
954 {
955 printf("F5Lread_linear(): ERROR: "FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE" does not have %d elements, but %d!\n",
956 rank, (int)file_rank);
957 H5Gclose(F_id);
958 return -1;
959 }
960
961 /* Read the dimensional values, which corresponds to retrieving the
962 dataspace of this field. However, there is no true dataspace stored
963 in the HDF5 file, but it is formulated via a special F5-internal
964 attribute. */
965
966 F_H5Aread(attr_id, H5T_NATIVE_INT, UADims, FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE);
967 H5Aclose(attr_id);
968
969 for(i=0; i<rank; i++)
970 dims[i] = UADims[i];
971
972 /* Moreover, a linear field must contain a base attribute */
974 F_H5Aread(attr_id, fieldtype, base, FIBER_UNIFORMARRAY_BASE_ATTRIBUTE);
975 H5Aclose(attr_id);
976
977 /* and a delta attribute */
979 F_H5Aread(attr_id, fieldtype, delta, FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE);
980 H5Aclose(attr_id);
981
982 return F_id;
983}
984
985int F5Lis_linear(hid_t Rep_id, const char*fieldname)
986{
987hid_t attr_id, F_id;
988
989 H5E_BEGIN_TRY
990 F_id = H5Gopen2(Rep_id, fieldname, H5P_DEFAULT);
991 H5E_END_TRY
992
993 if (F_id<0)
994 return 0;
995
996 H5E_BEGIN_TRY
998 H5E_END_TRY
999
1000 if (attr_id<0)
1001 {
1002 puts("no "FIBER_UNIFORMARRAY_BASE_ATTRIBUTE" attribute!");
1003 H5Gclose( F_id );
1004 return 0;
1005 }
1006 H5Aclose(attr_id);
1007
1008 H5E_BEGIN_TRY
1010 H5E_END_TRY
1011
1012 if (attr_id<0)
1013 {
1014 H5Gclose( F_id );
1015 return 0;
1016 }
1017 H5Aclose(attr_id);
1018 H5Gclose( F_id );
1019
1020 return 1;
1021}
1022
1023/******************** Constant Dataset *********************************************/
1024
1025/**
1026 Write a field that is a constant for all elements.
1027 @return A HDF5 \b dataset ID. The caller must issue H5Dclose() on the returned identifier.
1028 */
1029hid_t F5Lwrite_entity(hid_t R_id, const char*fieldname,
1030 hid_t fieldtype,
1031 const void * value)
1032{
1033hid_t ds_id = H5Screate(H5S_SCALAR);
1034hid_t creator_id = H5Pcreate(H5P_DATASET_CREATE);
1035
1036hid_t F_id = H5Dcreate2(R_id, fieldname, fieldtype, ds_id, creator_id, H5P_DEFAULT, H5P_DEFAULT);
1037\
1038 H5Dwrite(F_id, fieldtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, value);
1039
1040 H5Sclose(ds_id);
1041 H5Pclose(creator_id);
1042
1043 return F_id;
1044}
1045
1046/************************************ Separated Compound ****************************/
1047
1048/**
1049 Add an attribute to the given group that designates this group
1050 as storing multiple components of some compound data types.
1051 */
1052int F5Dset_type_attribute(hid_t F_id, hid_t fieldtype)
1053{
1054hid_t TypeAttrDS_hid;
1055hid_t TypeAttr_hid;
1056herr_t herr;
1057void *buf;
1058
1059 TypeAttr_hid = F5Atry_to_open( F_id, FIBER_HDF5_TYPEID_ATTRIB );
1060 if (TypeAttr_hid>0)
1061 {
1062 F5printf(5, "F5 Warning: F5Dset_type_attribute(): type already exists!\n");
1063 H5Aclose(TypeAttr_hid);
1064 return -1;
1065 }
1066
1067 TypeAttrDS_hid = H5Screate(H5S_SCALAR);
1068 TypeAttr_hid = H5Acreate2(F_id, FIBER_HDF5_TYPEID_ATTRIB, fieldtype, TypeAttrDS_hid,
1069 H5P_DEFAULT, H5P_DEFAULT);
1070 if (TypeAttr_hid<0)
1071 {
1072 F5printf(1, "F5Dset_type_attribute::H5Acreate() failed.");
1073 H5Sclose(TypeAttrDS_hid);
1074 return -3;
1075 }
1076
1077 buf = calloc( H5Tget_size(fieldtype), 1);
1078 herr = H5Awrite(TypeAttr_hid, fieldtype, buf);
1079 if (herr<0) F5printf(1, "F5Dset_type_attribute::H5Awrite() failed.");
1080 H5Sclose(TypeAttrDS_hid);
1081 H5Aclose(TypeAttr_hid);
1082 free(buf);
1083
1084 if (!F5Tcheck_committed(fieldtype))
1085 F5printf(0, "F5 Warning: F5Dset_type_attribute(): compound type not committed!\n");
1086
1087 return 0;
1088}
1089
1090/**
1091 @return A HDF5 \b group ID. The caller must issue H5Gclose() on the returned identifier.
1092
1093 \note If some component array is undefined (NULL), then its place will be left
1094 empty in the file.
1095 */
1096hid_t F5Lwrites(hid_t R_id, const char*fieldname, int dimension, const hsize_t*dims,
1097 hid_t fieldtype, hid_t memtype, const void *const*dataPtr,
1098 hid_t enum_type, hid_t property_id)
1099{
1100hid_t ds_id = H5Screate_simple(dimension, dims, NULL);
1101hid_t creator_id = property_id<0 ? H5Pcreate(H5P_DATASET_CREATE) : property_id;
1102hid_t F_id = -1;
1103
1104 if (dimension==3)
1105 F5printf(10, "F5Lwrites(field=%s) %dx%dx%d",
1106 fieldname, (int)dims[0], (int)dims[1], (int)dims[2] );
1107 else
1108 F5printf(10, "F5Lwrites(field=%s)\n", fieldname);
1109
1110
1111 if (!F5Tcheck_committed(fieldtype))
1112 printf("F5 Warning: F5Lwrites(%s): type not committed!\n", fieldname);
1113
1114 switch( H5Tget_class( fieldtype ) )
1115 {
1116 case H5T_COMPOUND:
1117 {
1118 int comp;
1119 int Ncomponents = H5Tget_nmembers(fieldtype);
1120
1121 F_id = F5Gcreate(R_id, fieldname, Ncomponents, 16);
1122 if (F_id<0)
1123 F5printf(1, "**F5Lwrites(%s) could not create separated compound group!",
1124 fieldname);
1125
1126 F5Dset_type_attribute(F_id, fieldtype);
1127 F5Tset_field_enum(F_id, enum_type, SeparatedCompound);
1128
1129 for(comp=0; comp<Ncomponents; comp++)
1130 {
1131 hid_t id, ComponentType, MemComponentType;
1132 char * ComponentName;
1133 const void * data = dataPtr[comp];
1134 herr_t herr;
1135
1136 if (!data) continue;
1137 ComponentName = H5Tget_member_name(fieldtype, comp);
1138 ComponentType = H5Tget_member_type(fieldtype, comp);
1139 if (memtype)
1140 {
1141 /* Retrieves the index of a compound or enumeration datatype member. */
1142 int mem_idx = H5Tget_member_index(memtype, ComponentName);
1143 if (mem_idx<0)
1144 {
1145 F5printf(10, "**F5Lwrites(%s) could not find memory equivalent "
1146 " of save component %s!",
1147 fieldname, ComponentName);
1148 MemComponentType = ComponentType;
1149 H5Iinc_ref( MemComponentType );
1150 }
1151 else
1152 {
1153 F5printf(10, "F5Lwrites(%s): member type %s : %d -> %d",
1154 fieldname, ComponentName, mem_idx, comp);
1155
1156 data = dataPtr[mem_idx];
1157 MemComponentType = H5Tget_member_type(memtype, mem_idx);
1158 }
1159 }
1160 else
1161 {
1162 MemComponentType = ComponentType;
1163 H5Iinc_ref( MemComponentType );
1164 }
1165
1166 id = H5Dcreate2(F_id, ComponentName, ComponentType, ds_id, creator_id, H5P_DEFAULT, H5P_DEFAULT);
1167 herr = H5Dwrite(id, MemComponentType, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
1168 if (herr<0)
1169 F5printf(1, "**F5Lwrites(%s) could not save component %s!",
1170 fieldname, ComponentName);
1171
1172 H5Dclose(id);
1173 H5free_memory(ComponentName);
1174 H5Tclose(ComponentType);
1175 H5Tclose( MemComponentType );
1176 }
1177 break;
1178 }
1179
1180 case H5T_FLOAT:
1181 {
1182 F_id = H5Dcreate2(R_id, fieldname, fieldtype, ds_id, creator_id, H5P_DEFAULT, H5P_DEFAULT);
1183 H5Dwrite(F_id, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, *dataPtr);
1184 F5Tset_field_enum(F_id, enum_type, Contiguous);
1185 break;
1186 }
1187
1188 default:
1189 F5printf(-1, "F5Lwrites(field=%s) CANNOT WRITE SPECIFIED FIELD TYPE as seperated compound, because it is not a compound\n", fieldname, F_id);
1190 break;
1191 }
1192 H5Sclose(ds_id);
1193
1194 if (property_id<0)
1195 H5Pclose(creator_id);
1196
1197 F5printf(10, "~F5Lwrites(field=%s), id=%d\n", fieldname, F_id);
1198 return F_id;
1199}
1200
1201
1202hid_t F5LwriteX(hid_t R_id, const char*fieldname, int rank, const hsize_t*dims,
1203 hid_t fieldtype, hid_t memtype,
1204 const void *const*dataPtr, const int*polynom_order,
1205 const int component_map[],
1206 hid_t property_id,
1207 hid_t ProcIDLocation)
1208{
1209hid_t creator_id;
1210hid_t F_id = -1;
1211int i, comp;
1212int Ncomponents;
1213const int MaxComponentNameLength = 16; /* component names are usually very short, maybe just one letter */
1214
1215 if (rank==3) F5printf(10, "F5LwriteX(field=%s) %dx%dx%d", fieldname, (int)dims[0], (int)dims[1], (int)dims[2] );
1216 if (rank==2) F5printf(10, "F5LwriteX(field=%s) %dx%d" , fieldname, (int)dims[0], (int)dims[1] );
1217 else F5printf(10, "F5LwriteX(field=%s)\n", fieldname);
1218
1219 if ( H5Tget_class( fieldtype ) != H5T_COMPOUND)
1220 {
1221 printf("F5 Warning: F5LwriteX(%s): type is not a compound type!\n", fieldname);
1222 return -2;
1223 }
1224 if (!component_map)
1225 {
1226 printf("F5 Warning: F5LwriteX(%s): no component map!\n", fieldname);
1227 return -3;
1228 }
1229
1230 Ncomponents = H5Tget_nmembers(fieldtype);
1231 for(i=0; i<rank; i++)
1232 {
1233 if (component_map[i]<0 || component_map[i]>=Ncomponents)
1234 {
1235 printf("F5 Warning: F5LwriteX(%s): invalid component map!\n", fieldname);
1236 return -4;
1237 }
1238 }
1239
1240 if (!F5Tcheck_committed(fieldtype))
1241 printf("F5 Warning: F5LwriteX(%s): type not committed?!\n", fieldname);
1242
1243 F_id = F5Gcreate(R_id, fieldname, Ncomponents, MaxComponentNameLength);
1244 if (F_id<0)
1245 {
1246 F5printf(1, "**F5LwriteX(%s) could not create direct product group!", fieldname);
1247 return -1;
1248 }
1249
1250 creator_id = property_id<0 ? H5Pcreate(H5P_DATASET_CREATE) : property_id;
1251
1252 F5Dset_type_attribute(F_id, fieldtype);
1253 F5Asave_ints(F_id, FIBER_HDF5_COMPONENTMAP_ATTRIB, component_map, rank);
1254
1255 for(comp=0; comp<Ncomponents; comp++)
1256 {
1257 hid_t ds_id;
1258 hid_t id, ComponentType, MemComponentType;
1259 char * ComponentName;
1260 const void * data = dataPtr[comp];
1261 herr_t herr;
1262 hsize_t poly_order = polynom_order[comp];
1263/* hsize_t extent = dims[comp]; */
1264
1265 if (!data) continue;
1266 ComponentName = H5Tget_member_name(fieldtype, comp);
1267 ComponentType = H5Tget_member_type(fieldtype, comp);
1268 if (memtype)
1269 {
1270 int mem_idx = H5Tget_member_index(memtype, ComponentName);
1271 if (mem_idx<0)
1272 {
1273 F5printf(10, "**F5LwriteX(%s) could not find memory equivalent of save component %s!",
1274 fieldname, ComponentName);
1275 MemComponentType = ComponentType;
1276 }
1277 else
1278 {
1279 data = dataPtr[mem_idx];
1280 poly_order = polynom_order[mem_idx];
1281/* extent = dims[mem_idx]; */
1282 MemComponentType = H5Tget_member_type(memtype, mem_idx);
1283
1284 F5printf(10, "F5LwriteX(%s): member type %s : %d -> %d (polynomial order %d, data at %p)",
1285 fieldname, ComponentName, mem_idx, comp, (int)(poly_order), data);
1286
1287 if (!data)
1288 {
1289 F5printf(10, "F5LwriteX(%s): member type %s : No polynom data - member not saved!",
1290 fieldname, ComponentName );
1291
1292 H5free_memory(ComponentName);
1293 H5Tclose(ComponentType);
1294 continue;
1295 }
1296 }
1297 }
1298 else
1299 {
1300 MemComponentType = ComponentType;
1301 F5printf(10, "F5LwriteX(%s): no component type remapping...", fieldname);
1302 }
1303
1304 ds_id = H5Screate_simple(1, &poly_order, NULL);
1305 id = H5Dcreate2(F_id, ComponentName, ComponentType, ds_id, creator_id, H5P_DEFAULT, H5P_DEFAULT);
1306 if (id<0)
1307 {
1308 F5printf(1, "**F5LwriteX(%s) could not create component %s!",
1309 fieldname, ComponentName);
1310 }
1311
1312 herr = H5Dwrite(id, MemComponentType, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
1313 if (herr<0)
1314 {
1315 F5printf(1, "**F5LwriteX(%s) could not save component %s!",
1316 fieldname, ComponentName);
1317 }
1318
1319 F5printf(1, "**F5LwriteX() set field ProcArray enum...");
1320 if (poly_order>0)
1322 else
1324
1325 H5Dclose(id);
1326 H5Sclose(ds_id);
1327
1328 H5free_memory(ComponentName);
1329 H5Tclose(ComponentType);
1330 }
1331
1332 if (property_id<0)
1333 H5Pclose(creator_id);
1334
1335 F5printf(10, "~F5LwriteX(%s), id=%d\n", fieldname, F_id);
1336 return F_id;
1337}
hid_t F5Atry_to_open(hid_t location, const char *name)
Definition F5A.c:23
int F5Asave_ints(hid_t loc_id, const char *name, const int data[], hsize_t n)
Definition F5A.c:355
int F5Tcheck_committed(hid_t fieldtype)
Definition F5L.c:34
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
hid_t F5Lget_space(hid_t Field_id)
Definition F5L.c:250
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
#define MAX_BLOCKNAME
Definition F5L.c:623
return ok
Definition F5P.c:95
H5Tclose(type_id)
free(name)
#define FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE
Definition F5defs.h:159
#define FIBER_HDF5_TYPEID_ATTRIB
Definition F5defs.h:144
@ ExplicitProcArray
Definition F5defs.h:285
@ PolynomialProcArray
Definition F5defs.h:286
#define FIBER_MAX_RANK
Definition F5defs.h:105
@ Contiguous
Definition F5defs.h:269
@ SeparatedCompound
Definition F5defs.h:270
#define FIBER_UNIFORMARRAY_BASE_ATTRIBUTE
Definition F5defs.h:158
#define FIBER_FRAGMENT_NOOVERLAP_START_ATTRIBUTE
Definition F5defs.h:175
#define FIBER_FRAGMENT_NOOVERLAP_END_ATTRIBUTE
Definition F5defs.h:176
#define FIBER_FIELD_DATASPACE_DIMENSIONS_ATTRIBUTE
Definition F5defs.h:153
#define FIBER_HDF5_COMPONENTMAP_ATTRIB
Definition F5defs.h:146
#define FIBER_FRAGMENT_OFFSET_ATTRIBUTE
Definition F5defs.h:174
herr_t F_H5Aread(hid_t attr_id, hid_t mem_type_id, void *buf, const char *name)
Definition F5private.c:332
#define F5printf(verbosity,...)
Definition F5private.h:60
herr_t F5Tset_field_ProcArray_enum(hid_t loc_id, ProceduralArrayType what, hid_t ProcTypeIdLocation)
Definition F5types.c:455
herr_t F5Tset_field_enum(hid_t loc_id, hid_t enum_type_id, ArrayType what)
Definition F5types.c:268
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 F5Lget_compound_extent_dims(hid_t CompoundGroupID, hsize_t *dims)
Definition F5L.c:302
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 *dataPtr, hid_t enum_type, hid_t dcpl_id)
Definition F5L.c:418
int F5LreadS(hid_t Container_id, hid_t LoadID, void *dataPtr, hid_t ElementLoadID)
Definition F5L.c:552
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
hid_t F5Lwrite_entity(hid_t R_id, const char *fieldname, hid_t fieldtype, const void *value)
Definition F5L.c:1029
hid_t F5Lget_compound_space(hid_t CompoundGroupID)
Definition F5L.c:327
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
hid_t F5Aopen_name(hid_t location, const char *name)
Definition F5A.c:34
#define H5Gclose(x)
Definition F5X.h:144
hid_t F5Gcreate(hid_t loc_id, const char *name, int est_num_entries, int est_name_len)
Definition F5X.c:65
hid_t F5Gappend_external(hid_t loc_id, const char *name, const char *target_file_name, const char *target_obj_name, const char *prefix)
Definition F5X.c:136
hid_t F5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist_id)
Definition F5X.c:278
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