summaryrefslogtreecommitdiffstats
path: root/src/H5B2leaf.c
blob: beca40c03df92481af6087bb78d17d85d1410da8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*-------------------------------------------------------------------------
 *
 * Created:		H5B2leaf.c
 *			Dec 01 2016
 *			Quincey Koziol <koziol@lbl.gov>
 *
 * Purpose:		Routines for managing v2 B-tree leaf ndoes.
 *
 *-------------------------------------------------------------------------
 */

/****************/
/* Module Setup */
/****************/

#include "H5B2module.h"         /* This source code file is part of the H5B2 module */


/***********/
/* Headers */
/***********/
#include "H5private.h"		/* Generic Functions			*/
#include "H5B2pkg.h"		/* v2 B-trees				*/
#include "H5Eprivate.h"		/* Error handling		  	*/
#include "H5MFprivate.h"	/* File memory management		*/
#include "H5MMprivate.h"	/* Memory management			*/


/****************/
/* Local Macros */
/****************/


/******************/
/* Local Typedefs */
/******************/


/********************/
/* Package Typedefs */
/********************/


/********************/
/* Local Prototypes */
/********************/
static herr_t H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr);


/*********************/
/* Package Variables */
/*********************/

/* Declare a free list to manage the H5B2_leaf_t struct */
H5FL_DEFINE(H5B2_leaf_t);


/*****************************/
/* Library Private Variables */
/*****************************/


/*******************/
/* Local Variables */
/*******************/



/*-------------------------------------------------------------------------
 * Function:	H5B2__create_leaf
 *
 * Purpose:	Creates empty leaf node of a B-tree and update node pointer
 *              to point to it.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Feb  2 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr)
{
    H5B2_leaf_t *leaf = NULL;           /* Pointer to new leaf node created */
    hbool_t inserted = FALSE;           /* Whether the leaf node was inserted into cache */
    herr_t ret_value = SUCCEED;         /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(node_ptr);

    /* Allocate memory for leaf information */
    if(NULL == (leaf = H5FL_CALLOC(H5B2_leaf_t)))
	HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree leaf info")

    /* Increment ref. count on B-tree header */
    if(H5B2__hdr_incr(hdr) < 0)
        HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, FAIL, "can't increment ref. count on B-tree header")

    /* Share B-tree header information */
    leaf->hdr = hdr;

    /* Allocate space for the native keys in memory */
    if(NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(hdr->node_info[0].nat_rec_fac)))
        HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree leaf native keys")
    HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec);

    /* Set parent */
    leaf->parent = parent;

    /* Set shadowed epoch to header's epoch */
    leaf->shadow_epoch = hdr->shadow_epoch;

    /* Allocate space on disk for the leaf */
    if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size)))
        HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree leaf node")

    /* Cache the new B-tree node */
    if(H5AC_insert_entry(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0)
        HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache")
    inserted = TRUE;

    /* Add leaf node as child of 'top' proxy */
    if(hdr->top_proxy) {
        if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree node as child of proxy")
        leaf->top_proxy = hdr->top_proxy;
    } /* end if */

done:
    if(ret_value < 0) {
        if(leaf) {
            /* Remove from cache, if inserted */
            if(inserted)
                if(H5AC_remove_entry(leaf) < 0)
                    HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, FAIL, "unable to remove v2 B-tree leaf node from cache")

            /* Release leaf node's disk space */
            if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, node_ptr->addr, (hsize_t)hdr->node_size) < 0)
                HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release file space for v2 B-tree leaf node")

            /* Destroy leaf node */
            if(H5B2__leaf_free(leaf) < 0)
                HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree leaf node")
        } /* end if */
    } /* end if */

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__create_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__protect_leaf
 *
 * Purpose:	"Protect" an leaf node in the metadata cache
 *
 * Return:	Pointer to leaf node on success/NULL on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@hdfgroup.org
 *		May  5 2010
 *
 *-------------------------------------------------------------------------
 */
H5B2_leaf_t *
H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr,
    hbool_t shadow, unsigned flags)
{
    H5B2_leaf_cache_ud_t udata;         /* User-data for callback */
    H5B2_leaf_t *leaf;                  /* v2 B-tree leaf node */
    H5B2_leaf_t *ret_value = NULL;      /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(node_ptr);
    HDassert(H5F_addr_defined(node_ptr->addr));

    /* only H5AC__READ_ONLY_FLAG may appear in flags */
    HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);

    /* Set up user data for callback */
    udata.f = hdr->f;
    udata.hdr = hdr;
    udata.parent = parent;
    udata.nrec = node_ptr->node_nrec;

    /* Protect the leaf node */
    if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, &udata, flags)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree leaf node")

    /* Create top proxy, if it doesn't exist */
    if(hdr->top_proxy && NULL == leaf->top_proxy) {
        /* Add leaf node as child of 'top' proxy */
        if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree leaf node as child of proxy")
        leaf->top_proxy = hdr->top_proxy;
    } /* end if */

    /* Shadow the node, if requested */
    if(shadow)
        if(H5B2__shadow_leaf(leaf, node_ptr) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, NULL, "unable to shadow leaf node")

    /* Set return value */
    ret_value = leaf;

done:
    /* Clean up on error */
    if(!ret_value) {
        /* Release the leaf node, if it was protected */
        if(leaf) {
            /* Remove from v2 B-tree's proxy, if added */
            if(leaf->top_proxy) {
                if(H5AC_proxy_entry_remove_child(leaf->top_proxy, leaf) < 0)
                    HDONE_ERROR(H5E_BTREE, H5E_CANTUNDEPEND, NULL, "unable to destroy flush dependency between leaf node and v2 B-tree 'top' proxy")
                leaf->top_proxy = NULL;
            } /* end if */

            /* Unprotect leaf node */
            if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0)
                HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree leaf node, address = %llu", (unsigned long long)node_ptr->addr)
        } /* end if */
    } /* end if */

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__protect_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__neighbor_leaf
 *
 * Purpose:	Locate a record relative to the specified information in a
 *              B-tree leaf node and return that information by filling in
 *              fields of the
 *              caller-supplied UDATA pointer depending on the type of leaf node
 *		requested.  The UDATA can point to additional data passed
 *		to the key comparison function.
 *
 *              The 'OP' routine is called with the record found and the
 *              OP_DATA pointer, to allow caller to return information about
 *              the record.
 *
 *              The RANGE indicates whether to search for records less than or
 *              equal to, or greater than or equal to the information passed
 *              in with UDATA.
 *
 * Return:	Non-negative on success, negative on failure.
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Mar  9 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
    void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op,
    void *op_data)
{
    H5B2_leaf_t *leaf;                  /* Pointer to leaf node */
    unsigned    idx = 0;                /* Location of record which matches key */
    int         cmp = 0;                /* Comparison value of records */
    herr_t	ret_value = SUCCEED;    /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));
    HDassert(op);

    /* Lock current B-tree node */
    if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")

    /* Locate node pointer for child */
    if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0)
        HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
    if(cmp > 0)
        idx++;
    else
        if(cmp == 0 && comp == H5B2_COMPARE_GREATER)
            idx++;

    /* Set the neighbor location, if appropriate */
    if(comp == H5B2_COMPARE_LESS) {
        if(idx > 0)
            neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx - 1);
    } /* end if */
    else {
        HDassert(comp == H5B2_COMPARE_GREATER);

        if(idx < leaf->nrec)
            neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx);
    } /* end else */

    /* Make callback if neighbor record has been found */
    if(neighbor_loc) {
        /* Make callback for current record */
        if((op)(neighbor_loc, op_data) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree neighbor operation")
    } /* end if */
    else
        HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree")

done:
    /* Release the B-tree leaf node */
    if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0)
        HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node")

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__neighbor_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__insert_leaf
 *
 * Purpose:	Adds a new record to a B-tree leaf node.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Mar  3 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
    H5B2_nodepos_t curr_pos, void *parent, void *udata)
{
    H5B2_leaf_t *leaf;                  /* Pointer to leaf node */
    unsigned leaf_flags = H5AC__NO_FLAGS_SET;   /* Flags for unprotecting the leaf node */
    int         cmp;                    /* Comparison value of records */
    unsigned    idx = 0;                /* Location of record which matches key */
    herr_t	ret_value = SUCCEED;    /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));

    /* Lock current B-tree node */
    if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")

    /* Must have a leaf node with enough space to insert a record now */
    HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);

    /* Sanity check number of records */
    HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
    HDassert(leaf->nrec == curr_node_ptr->node_nrec);

    /* Check for inserting into empty leaf */
    if(leaf->nrec == 0)
        idx = 0;
    else {
        /* Find correct location to insert this record */
        if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
        if(cmp == 0)
            HGOTO_ERROR(H5E_BTREE, H5E_EXISTS, FAIL, "record is already in B-tree")
        if(cmp > 0)
            idx++;

        /* Make room for new record */
        if(idx < leaf->nrec)
            HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size * (leaf->nrec - idx));
    } /* end else */

    /* Make callback to store record in native form */
    if((hdr->cls->store)(H5B2_LEAF_NREC(leaf, hdr, idx), udata) < 0)
        HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into leaf node")

    /* Mark the node as dirty */
    leaf_flags |= H5AC__DIRTIED_FLAG;

    /* Update record count for node pointer to current node */
    curr_node_ptr->all_nrec++;
    curr_node_ptr->node_nrec++;

    /* Update record count for current node */
    leaf->nrec++;

    /* Check for new record being the min or max for the tree */
    /* (Don't use 'else' for the idx check, to allow for root leaf node) */
    if(H5B2_POS_MIDDLE != curr_pos) {
        if(idx == 0) {
            if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->min_native_rec == NULL)
                    if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
                        HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
                H5MM_memcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
            } /* end if */
        } /* end if */
        if(idx == (unsigned)(leaf->nrec - 1)) {
            if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->max_native_rec == NULL)
                    if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
                        HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
                H5MM_memcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
            } /* end if */
        } /* end if */
    } /* end if */

done:
    /* Release the B-tree leaf node (marked as dirty) */
    if(leaf) {
        /* Shadow the node if doing SWMR writes */
        if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG))
            if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0)
                HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node")

        /* Unprotect leaf node */
        if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0)
            HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node")
    } /* end if */

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__insert_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__update_leaf
 *
 * Purpose:	Insert or modify a record in a B-tree leaf node.
 *		If the record exists already, it is modified as if H5B2_modify
 *		was called).  If it doesn't exist, it is inserted as if
 *		H5B2_insert was called.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@hdfgroup.org
 *		Dec 23 2015
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
    H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent,
    void *udata, H5B2_modify_t op, void *op_data)
{
    H5B2_leaf_t *leaf;                  /* Pointer to leaf node */
    unsigned leaf_flags = H5AC__NO_FLAGS_SET;   /* Flags for unprotecting the leaf node */
    int         cmp = -1;               /* Comparison value of records */
    unsigned    idx = 0;                /* Location of record which matches key */
    herr_t	ret_value = SUCCEED;    /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));

    /* Lock current B-tree node */
    if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")

    /* Sanity check number of records */
    HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
    HDassert(leaf->nrec == curr_node_ptr->node_nrec);

    /* Check for inserting into empty leaf */
    if(leaf->nrec == 0)
        idx = 0;
    else {
        /* Find correct location to insert this record */
        if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")

        /* Check for inserting a record */
        if(0 != cmp) {
            /* Check if the leaf node is full */
            if(curr_node_ptr->node_nrec == hdr->node_info[0].split_nrec) {
                /* Indicate that the leaf is full, but we need to insert */
                *status = H5B2_UPDATE_INSERT_CHILD_FULL;

                /* Let calling routine handle insertion */
                HGOTO_DONE(SUCCEED)
            } /* end if */

            /* Adjust index to leave room for record to insert */
            if(cmp > 0)
                idx++;

            /* Make room for new record */
            if(idx < leaf->nrec)
                HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx + 1), H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size * (leaf->nrec - idx));
        } /* end if */
    } /* end else */

    /* Check for modifying existing record */
    if(0 == cmp) {
        hbool_t changed = FALSE;        /* Whether the 'modify' callback changed the record */

        /* Make callback for current record */
        if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) {
            /* Make certain that the callback didn't modify the value if it failed */
            HDassert(changed == FALSE);

            HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree update operation")
        } /* end if */

        /* Mark the node as dirty if it changed */
        leaf_flags |= (changed ? H5AC__DIRTIED_FLAG : 0);

        /* Indicate that the record was modified */
        *status = H5B2_UPDATE_MODIFY_DONE;
    } /* end if */
    else {
        /* Must have a leaf node with enough space to insert a record now */
        HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec);

        /* Make callback to store record in native form */
        if((hdr->cls->store)(H5B2_LEAF_NREC(leaf, hdr, idx), udata) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into leaf node")

        /* Mark the node as dirty */
        leaf_flags |= H5AC__DIRTIED_FLAG;

        /* Indicate that the record was inserted */
        *status = H5B2_UPDATE_INSERT_DONE;

        /* Update record count for node pointer to current node */
        curr_node_ptr->all_nrec++;
        curr_node_ptr->node_nrec++;

        /* Update record count for current node */
        leaf->nrec++;
    } /* end else */

    /* Check for new record being the min or max for the tree */
    /* (Don't use 'else' for the idx check, to allow for root leaf node) */
    if(H5B2_POS_MIDDLE != curr_pos) {
        if(idx == 0) {
            if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->min_native_rec == NULL)
                    if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
                        HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
                H5MM_memcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
            } /* end if */
        } /* end if */
        if(idx == (unsigned)(leaf->nrec - 1)) {
            if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->max_native_rec == NULL)
                    if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
                        HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
                H5MM_memcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
            } /* end if */
        } /* end if */
    } /* end if */

done:
    /* Release the B-tree leaf node */
    if(leaf) {
        /* Check if we should shadow this node */
        if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG)) {
            /* Attempt to shadow the node if doing SWMR writes */
            if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0)
                HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node")

            /* Change the state to "shadowed" if only modified currently */
            /* (Triggers parent to be marked dirty) */
            if(*status == H5B2_UPDATE_MODIFY_DONE)
                *status = H5B2_UPDATE_SHADOW_DONE;
        } /* end if */

        /* Unprotect leaf node */
        if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0)
            HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node")
    } /* end if */

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__update_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__swap_leaf
 *
 * Purpose:	Swap a record in a node with a record in a leaf node
 *
 * Return:	Success:	Non-negative
 *
 *		Failure:	Negative
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Mar  4 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
    unsigned *internal_flags_ptr, unsigned idx, void *swap_loc)
{
    const H5AC_class_t *child_class;    /* Pointer to child node's class info */
    haddr_t child_addr;                 /* Address of child node */
    void *child = NULL;                 /* Pointer to child node */
    uint8_t *child_native;              /* Pointer to child's native records */
    herr_t ret_value = SUCCEED;         /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(internal);
    HDassert(internal_flags_ptr);
    HDassert(idx <= internal->nrec);

    /* Check for the kind of B-tree node to swap */
    if(depth > 1) {
        H5B2_internal_t *child_internal;        /* Pointer to internal node */

        /* Setup information for unlocking child node */
        child_class = H5AC_BT2_INT;

        /* Lock B-tree child nodes */
        if(NULL == (child_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET)))
            HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
        child_addr = internal->node_ptrs[idx].addr;

        /* More setup for accessing child node information */
        child = child_internal;
        child_native = child_internal->int_native;
    } /* end if */
    else {
        H5B2_leaf_t *child_leaf;        /* Pointer to leaf node */

        /* Setup information for unlocking child nodes */
        child_class = H5AC_BT2_LEAF;

        /* Lock B-tree child node */
        if(NULL == (child_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], FALSE, H5AC__NO_FLAGS_SET)))
            HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
        child_addr = internal->node_ptrs[idx].addr;

        /* More setup for accessing child node information */
        child = child_leaf;
        child_native = child_leaf->leaf_native;
    } /* end else */

    /* Swap records (use disk page as temporary buffer) */
    H5MM_memcpy(hdr->page, H5B2_NAT_NREC(child_native, hdr, 0), hdr->cls->nrec_size);
    H5MM_memcpy(H5B2_NAT_NREC(child_native, hdr, 0), swap_loc, hdr->cls->nrec_size);
    H5MM_memcpy(swap_loc, hdr->page, hdr->cls->nrec_size);

    /* Mark parent as dirty */
    *internal_flags_ptr |= H5AC__DIRTIED_FLAG;

#ifdef H5B2_DEBUG
    H5B2__assert_internal((hsize_t)0, hdr, internal);
    if(depth > 1)
        H5B2__assert_internal(internal->node_ptrs[idx].all_nrec, hdr, (H5B2_internal_t *)child);
    else
        H5B2__assert_leaf(hdr, (H5B2_leaf_t *)child);
#endif /* H5B2_DEBUG */

done:
    /* Unlock child node */
    if(child && H5AC_unprotect(hdr->f, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0)
        HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node")

    FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2__swap_leaf() */


/*-------------------------------------------------------------------------
 * Function:    H5B2__shadow_leaf
 *
 * Purpose:     "Shadow" a leaf node - copy it to a new location, leaving
 *              the data in the old location intact (for now).  This is
 *              done when writing in SWMR mode to ensure that readers do
 *              not see nodes that are out of date with respect to each
 *              other and thereby inconsistent.
 *
 * Return:      Non-negative on success/Negative on failure
 *
 * Programmer:  Neil Fortner
 *              Apr 27 2012
 *
 *-------------------------------------------------------------------------
 */
static herr_t
H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr)
{
    H5B2_hdr_t *hdr;                    /* B-tree header */
    herr_t ret_value = SUCCEED;         /* Return value */

    FUNC_ENTER_STATIC

    /*
     * Check arguments.
     */
    HDassert(leaf);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));
    hdr = leaf->hdr;
    HDassert(hdr);
    HDassert(hdr->swmr_write);

    /* We only need to shadow the node if it has not been shadowed since the
     * last time the header was flushed, as otherwise it will be unreachable by
     * the readers so there will be no need to shadow.  To check if it has been
     * shadowed, compare the epoch of this node and the header.  If this node's
     * epoch is <= to the header's, it hasn't been shadowed yet. */
    if(leaf->shadow_epoch <= hdr->shadow_epoch) {
        haddr_t new_node_addr;              /* Address to move node to */

        /*
        * We must clone the old node so readers with an out-of-date version of
        * the parent can still see the correct number of children, via the
        * shadowed node.  Remove it from cache but do not mark it free on disk.
        */
        /* Allocate space for the cloned node */
        if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size)))
            HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move B-tree node")

        /* Move the location of the old child on the disk */
        if(H5AC_move_entry(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, new_node_addr) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node")
        curr_node_ptr->addr = new_node_addr;

        /* Should free the space in the file, but this is not supported by
         * SWMR_WRITE code yet - QAK, 2016/12/01
         */

        /* Set shadow epoch for node ahead of header */
        leaf->shadow_epoch = hdr->shadow_epoch + 1;
    } /* end if */

done:
    FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2__shadow_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__remove_leaf
 *
 * Purpose:	Removes a record from a B-tree leaf node.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Mar  3 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
    H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data)
{
    H5B2_leaf_t *leaf;                  /* Pointer to leaf node */
    haddr_t     leaf_addr = HADDR_UNDEF;  /* Leaf address on disk */
    unsigned    leaf_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting leaf node */
    unsigned    idx = 0;                /* Location of record which matches key */
    int         cmp;                    /* Comparison value of records */
    herr_t	ret_value = SUCCEED;    /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));

    /* Lock current B-tree node */
    if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
    leaf_addr = curr_node_ptr->addr;

    /* Sanity check number of records */
    HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
    HDassert(leaf->nrec == curr_node_ptr->node_nrec);

    /* Find correct location to remove this record */
    if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0)
        HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
    if(cmp != 0)
        HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "record is not in B-tree")

    /* Check for invalidating the min/max record for the tree */
    if(H5B2_POS_MIDDLE != curr_pos) {
        /* (Don't use 'else' for the idx check, to allow for root leaf node) */
        if(idx == 0) {
            if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->min_native_rec)
                    hdr->min_native_rec = H5MM_xfree(hdr->min_native_rec);
            } /* end if */
        } /* end if */
        if(idx == (unsigned)(leaf->nrec - 1)) {
            if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->max_native_rec)
                    hdr->max_native_rec = H5MM_xfree(hdr->max_native_rec);
            } /* end if */
        } /* end if */
    } /* end if */

    /* Make 'remove' callback if there is one */
    if(op)
        if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record into leaf node")

    /* Update number of records in node */
    leaf->nrec--;

    if(leaf->nrec > 0) {
        /* Shadow the node if doing SWMR writes */
        if(hdr->swmr_write) {
            if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0)
                HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
            leaf_addr = curr_node_ptr->addr;
        } /* end if */

        /* Pack record out of leaf */
        if(idx < leaf->nrec)
            HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)), hdr->cls->nrec_size * (leaf->nrec - idx));

        /* Mark leaf node as dirty also */
        leaf_flags |= H5AC__DIRTIED_FLAG;
    } /* end if */
    else {
        /* Let the cache know that the object is deleted */
        leaf_flags |= H5AC__DELETED_FLAG;
        if(!hdr->swmr_write)
            leaf_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;

        /* Reset address of parent node pointer */
        curr_node_ptr->addr = HADDR_UNDEF;
    } /* end else */

    /* Update record count for parent of leaf node */
    curr_node_ptr->node_nrec--;

done:
    /* Release the B-tree leaf node */
    if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0)
        HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node")

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__remove_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__remove_leaf_by_idx
 *
 * Purpose:	Removes a record from a B-tree leaf node, according to the
 *              offset in the B-tree records.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@hdfgroup.org
 *		Nov 14 2006
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
    H5B2_nodepos_t curr_pos, void *parent, unsigned idx, H5B2_remove_t op,
    void *op_data)
{
    H5B2_leaf_t *leaf;                  /* Pointer to leaf node */
    haddr_t     leaf_addr = HADDR_UNDEF;  /* Leaf address on disk */
    unsigned    leaf_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting leaf node */
    herr_t	ret_value = SUCCEED;    /* Return value */

    FUNC_ENTER_PACKAGE

    /* Check arguments. */
    HDassert(hdr);
    HDassert(curr_node_ptr);
    HDassert(H5F_addr_defined(curr_node_ptr->addr));

    /* Lock B-tree leaf node */
    if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET)))
        HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
    leaf_addr = curr_node_ptr->addr;

    /* Sanity check number of records */
    HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec);
    HDassert(leaf->nrec == curr_node_ptr->node_nrec);
    HDassert(idx < leaf->nrec);

    /* Check for invalidating the min/max record for the tree */
    if(H5B2_POS_MIDDLE != curr_pos) {
        /* (Don't use 'else' for the idx check, to allow for root leaf node) */
        if(idx == 0) {
            if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->min_native_rec)
                    hdr->min_native_rec = H5MM_xfree(hdr->min_native_rec);
            } /* end if */
        } /* end if */
        if(idx == (unsigned)(leaf->nrec - 1)) {
            if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
                if(hdr->max_native_rec)
                    hdr->max_native_rec = H5MM_xfree(hdr->max_native_rec);
            } /* end if */
        } /* end if */
    } /* end if */

    /* Make 'remove' callback if there is one */
    if(op)
        if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0)
            HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record into leaf node")

    /* Update number of records in node */
    leaf->nrec--;

    if(leaf->nrec > 0) {
        /* Shadow the node if doing SWMR writes */
        if(hdr->swmr_write) {
            if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0)
                HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
            leaf_addr = curr_node_ptr->addr;
        } /* end if */

        /* Pack record out of leaf */
        if(idx < leaf->nrec)
            HDmemmove(H5B2_LEAF_NREC(leaf, hdr, idx), H5B2_LEAF_NREC(leaf, hdr, (idx + 1)), hdr->cls->nrec_size * (leaf->nrec - idx));

        /* Mark leaf node as dirty also */
        leaf_flags |= H5AC__DIRTIED_FLAG;
    } /* end if */
    else {
        /* Let the cache know that the object is deleted */
        leaf_flags |= H5AC__DELETED_FLAG;
        if(!hdr->swmr_write)
            leaf_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;

        /* Reset address of parent node pointer */
        curr_node_ptr->addr = HADDR_UNDEF;
    } /* end else */

    /* Update record count for parent of leaf node */
    curr_node_ptr->node_nrec--;

done:
    /* Release the B-tree leaf node */
    if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0)
        HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node")

    FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2__remove_leaf_by_idx() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__leaf_free
 *
 * Purpose:	Destroys a B-tree leaf node in memory.
 *
 * Return:	Non-negative on success/Negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Feb 2 2005
 *
 *-------------------------------------------------------------------------
 */
herr_t
H5B2__leaf_free(H5B2_leaf_t *leaf)
{
    herr_t ret_value = SUCCEED;         /* Return value */

    FUNC_ENTER_PACKAGE

    /*
     * Check arguments.
     */
    HDassert(leaf);

    /* Release leaf's native key buffer */
    if(leaf->leaf_native)
        leaf->leaf_native = (uint8_t *)H5FL_FAC_FREE(leaf->hdr->node_info[0].nat_rec_fac, leaf->leaf_native);

    /* Decrement ref. count on B-tree header */
    if(H5B2__hdr_decr(leaf->hdr) < 0)
	HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header")

    /* Sanity check */
    HDassert(NULL == leaf->top_proxy);

    /* Free B-tree leaf node info */
    leaf = H5FL_FREE(H5B2_leaf_t, leaf);

done:
    FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2__leaf_free() */

#ifdef H5B2_DEBUG

/*-------------------------------------------------------------------------
 * Function:	H5B2__assert_leaf
 *
 * Purpose:	Verify than a leaf node is mostly sane
 *
 * Return:	Non-negative on success, negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Feb 19 2005
 *
 *-------------------------------------------------------------------------
 */
H5_ATTR_PURE herr_t
H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf)
{
    /* General sanity checking on node */
    HDassert(leaf->nrec <= hdr->node_info->split_nrec);

    return(0);
} /* end H5B2__assert_leaf() */


/*-------------------------------------------------------------------------
 * Function:	H5B2__assert_leaf2
 *
 * Purpose:	Verify than a leaf node is mostly sane
 *
 * Return:	Non-negative on success, negative on failure
 *
 * Programmer:	Quincey Koziol
 *		koziol@ncsa.uiuc.edu
 *		Feb 19 2005
 *
 *-------------------------------------------------------------------------
 */
H5_ATTR_PURE herr_t
H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t H5_ATTR_UNUSED *leaf2)
{
    /* General sanity checking on node */
    HDassert(leaf->nrec <= hdr->node_info->split_nrec);

    return(0);
} /* end H5B2__assert_leaf2() */
#endif /* H5B2_DEBUG */

! February, 2008 -! ! Comment: This function is overloaded to write INTEGER, ! REAL, DOUBLE PRECISION and CHARACTER buffers ! up to 7 dimensions. @@ -1483,7 +1478,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_integer_s_c @@ -1495,12 +1490,13 @@ CONTAINS !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AREAD_INTEGER_S_C'::h5aread_integer_s_c !DEC$ ENDIF - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT)::buf + INTEGER, INTENT(OUT)::buf END FUNCTION h5aread_integer_s_c END INTERFACE + hdferr = h5aread_integer_s_c(attr_id, memtype_id, buf, dims) END SUBROUTINE h5aread_integer_scalar @@ -1514,7 +1510,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT), & + DIMENSION(dims(1)) :: buf INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_integer_1_c @@ -1529,7 +1526,8 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT), & + DIMENSION(dims(1)) :: buf END FUNCTION h5aread_integer_1_c END INTERFACE @@ -1547,7 +1545,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT), & + DIMENSION(dims(1),dims(2)) :: buf INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_integer_2_c @@ -1562,7 +1561,8 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT), & + DIMENSION(dims(1),dims(2)) :: buf END FUNCTION h5aread_integer_2_c END INTERFACE @@ -1580,8 +1580,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_integer_3_c @@ -1596,7 +1596,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf END FUNCTION h5aread_integer_3_c END INTERFACE @@ -1615,7 +1615,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1632,7 +1632,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf END FUNCTION h5aread_integer_4_c END INTERFACE @@ -1651,7 +1651,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1668,7 +1668,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf END FUNCTION h5aread_integer_5_c END INTERFACE @@ -1687,7 +1687,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1704,7 +1704,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf END FUNCTION h5aread_integer_6_c END INTERFACE @@ -1723,7 +1723,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1740,7 +1740,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - INTEGER, INTENT(INOUT), & + INTEGER, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf END FUNCTION h5aread_integer_7_c END INTERFACE @@ -1759,7 +1759,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT) :: buf ! Attribute data + REAL, INTENT(OUT) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_real_s_c @@ -1774,7 +1774,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT)::buf + REAL, INTENT(OUT)::buf END FUNCTION h5aread_real_s_c END INTERFACE @@ -1791,7 +1791,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1808,7 +1808,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1)) :: buf END FUNCTION h5aread_real_1_c END INTERFACE @@ -1827,7 +1827,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1844,7 +1844,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2)) :: buf END FUNCTION h5aread_real_2_c END INTERFACE @@ -1863,7 +1863,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1880,7 +1880,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf END FUNCTION h5aread_real_3_c END INTERFACE @@ -1899,7 +1899,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1916,7 +1916,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf END FUNCTION h5aread_real_4_c END INTERFACE @@ -1935,7 +1935,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1952,7 +1952,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf END FUNCTION h5aread_real_5_c END INTERFACE @@ -1971,7 +1971,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1988,7 +1988,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf END FUNCTION h5aread_real_6_c END INTERFACE @@ -2007,7 +2007,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2024,7 +2024,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - REAL, INTENT(INOUT), & + REAL, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf END FUNCTION h5aread_real_7_c END INTERFACE @@ -2043,7 +2043,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT) :: buf ! Attribute data + DOUBLE PRECISION, INTENT(OUT) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aread_double_s_c @@ -2058,7 +2058,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT)::buf + DOUBLE PRECISION, INTENT(OUT)::buf END FUNCTION h5aread_double_s_c END INTERFACE @@ -2075,7 +2075,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2092,7 +2092,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1)) :: buf END FUNCTION h5aread_double_1_c END INTERFACE @@ -2111,7 +2111,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2128,7 +2128,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2)) :: buf END FUNCTION h5aread_double_2_c END INTERFACE @@ -2147,7 +2147,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2164,7 +2164,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf END FUNCTION h5aread_double_3_c END INTERFACE @@ -2183,7 +2183,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2200,7 +2200,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf END FUNCTION h5aread_double_4_c END INTERFACE @@ -2219,7 +2219,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2236,7 +2236,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf END FUNCTION h5aread_double_5_c END INTERFACE @@ -2255,7 +2255,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2272,7 +2272,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf END FUNCTION h5aread_double_6_c END INTERFACE @@ -2291,7 +2291,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2308,7 +2308,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - DOUBLE PRECISION, INTENT(INOUT), & + DOUBLE PRECISION, INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf END FUNCTION h5aread_double_7_c END INTERFACE @@ -2327,7 +2327,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT) :: buf + CHARACTER(LEN=*), INTENT(OUT) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2344,7 +2344,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT) :: buf + CHARACTER(LEN=*) :: buf END FUNCTION h5areadc_s_c END INTERFACE @@ -2361,7 +2361,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2379,8 +2379,8 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf + CHARACTER(LEN=*), INTENT(OUT), & + DIMENSION(dims(1)) :: buf END FUNCTION h5areadc_1_c END INTERFACE @@ -2398,8 +2398,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf + CHARACTER(LEN=*), INTENT(OUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2416,7 +2416,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2)) :: buf END FUNCTION h5areadc_2_c END INTERFACE @@ -2435,7 +2435,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2453,7 +2453,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3)) :: buf END FUNCTION h5areadc_3_c END INTERFACE @@ -2472,7 +2472,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2490,7 +2490,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf END FUNCTION h5areadc_4_c END INTERFACE @@ -2509,7 +2509,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2527,7 +2527,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf END FUNCTION h5areadc_5_c END INTERFACE @@ -2546,7 +2546,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2564,7 +2564,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf END FUNCTION h5areadc_6_c END INTERFACE @@ -2583,7 +2583,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -2601,7 +2601,7 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(INOUT), & + CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf END FUNCTION h5areadc_7_c END INTERFACE @@ -2740,147 +2740,37 @@ CONTAINS !---------------------------------------------------------------------- - SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr) + SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5aget_name_f !DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Buffer to hold attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! name length is successful, - ! -1 if fail - + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size + CHARACTER(LEN=*), INTENT(INOUT) :: buf + ! Buffer to hold attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! name length is successful, + ! -1 if fail +! INTEGER, EXTERNAL :: h5aget_name_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_C'::h5aget_name_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5aget_name_c - END INTERFACE - - hdferr = h5aget_name_c(attr_id, size, buf) - END SUBROUTINE h5aget_name_f - -!---------------------------------------------------------------------- -! Name: h5aget_name_by_idx_f -! -! Purpose: Gets an attribute name, by attribute index position. -! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index; Possible values are: -! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N _F - Number of indices defined -! -! order - Order in which to iterate over index; Possible values are: -! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! order - Index traversal order -! n - Attribute’s position in index -! size - Size, in bytes, of attribute name -! -! Outputs: -! name - Attribute name -! name_size_out - Size of Attribute name returned from function -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -!---------------------------------------------------------------------- + INTERFACE + INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_C'::h5aget_name_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(OUT) :: buf + END FUNCTION h5aget_name_c + END INTERFACE - SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, & - n, name, size, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_name_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed *TEST* check NULL - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders - - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - - CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name - - INTEGER(SIZE_T), INTENT(INOUT) :: size ! Buffer size ! *TEST* check for 0 value *CHECK* should this return the correct value - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! Returns attribute name size, - ! -1 if fail - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & - n, name, size, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NAME_BY_IDX_C'::h5aget_name_by_idx_c - !DEC$ ENDIF - - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(SIZE_T), INTENT(INOUT) :: size - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5aget_name_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & - n, name, size, lapl_id_default) - - END SUBROUTINE h5aget_name_by_idx_f + hdferr = h5aget_name_c(attr_id, size, buf) + END SUBROUTINE h5aget_name_f !---------------------------------------------------------------------- @@ -2908,33 +2798,33 @@ CONTAINS ! !---------------------------------------------------------------------- - SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr) + SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5aget_num_attrs_f !DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the - ! object - INTEGER, INTENT(OUT) :: hdferr ! Error code + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the + ! object + INTEGER, INTENT(OUT) :: hdferr ! Error code ! INTEGER, EXTERNAL :: h5aget_num_attrs_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NUM_ATTRS_C'::h5aget_num_attrs_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: attr_num - END FUNCTION h5aget_num_attrs_c - END INTERFACE - - hdferr = h5aget_num_attrs_c(obj_id, attr_num) - END SUBROUTINE h5aget_num_attrs_f + INTERFACE + INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_NUM_ATTRS_C'::h5aget_num_attrs_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: attr_num + END FUNCTION h5aget_num_attrs_c + END INTERFACE + + hdferr = h5aget_num_attrs_c(obj_id, attr_num) + END SUBROUTINE h5aget_num_attrs_f !---------------------------------------------------------------------- ! Name: h5adelete_f @@ -2962,38 +2852,38 @@ CONTAINS ! !---------------------------------------------------------------------- - SUBROUTINE h5adelete_f(obj_id, name, hdferr) + SUBROUTINE h5adelete_f(obj_id, name, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5adelete_f !DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T) :: namelen + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T) :: namelen ! INTEGER, EXTERNAL :: h5adelete_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5adelete_c(obj_id, name, namelen) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_C'::h5adelete_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T) :: namelen - END FUNCTION h5adelete_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5adelete_c(obj_id, name, namelen) - END SUBROUTINE h5adelete_f - -!---------------------------------------------------------------------- + INTERFACE + INTEGER FUNCTION h5adelete_c(obj_id, name, namelen) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_C'::h5adelete_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(SIZE_T) :: namelen + END FUNCTION h5adelete_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5adelete_c(obj_id, name, namelen) + END SUBROUTINE h5adelete_f + +!---------------------------------------------------------------------- ! Name: h5aclose_f ! ! Purpose: Closes the specified attribute. @@ -3017,1177 +2907,29 @@ CONTAINS ! !---------------------------------------------------------------------- - SUBROUTINE h5aclose_f(attr_id, hdferr) + SUBROUTINE h5aclose_f(attr_id, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5aclose_f !DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: ! INTEGER, EXTERNAL :: h5aclose_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5aclose_c(attr_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACLOSE_C'::h5aclose_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - END FUNCTION h5aclose_c - END INTERFACE - - hdferr = h5aclose_c(attr_id) - END SUBROUTINE h5aclose_f - -!---------------------------------------------------------------------- -! Name: h5aget_storage_size_f -! -! Purpose: Returns the amount of storage required for an attribute. -! -! Inputs: -! attr_id - attribute identifier -! Outputs: -! size - attribute storage size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M. S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_storage_size_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Attribute storage requirement - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_storage_size_c(attr_id, size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_STORAGE_SIZE_C'::h5aget_storage_size_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5aget_storage_size_c - END INTERFACE - - hdferr = h5aget_storage_size_c(attr_id, size) - END SUBROUTINE h5aget_storage_size_f - -!---------------------------------------------------------------------- -! Name: h5aget_create_plist_f -! -! Purpose: Gets an attribute creation property list identifier -! -! Inputs: -! attr_id - Identifier of the attribute -! Outputs: -! creation_prop_id - Identifier for the attribute’s creation property -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M. S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_create_plist_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Identifier of the attribute - INTEGER(HID_T), INTENT(OUT) :: creation_prop_id ! Identifier for the attribute’s creation property - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_create_plist_c(attr_id, creation_prop_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_CREATE_PLIST_C'::h5aget_create_plist_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: creation_prop_id - END FUNCTION h5aget_create_plist_c - END INTERFACE - - hdferr = h5aget_create_plist_c(attr_id, creation_prop_id) - END SUBROUTINE h5aget_create_plist_f - -!---------------------------------------------------------------------- -! Name: h5arename_by_name_f -! -! Purpose: Renames an attribute -! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, -! whose attribute is to be renamed -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name -! lapl_id - Link access property list identifier -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & - hdferr, lapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5arename_by_name_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! whose attribute is to be renamed - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_BY_NAME_C'::h5arename_by_name_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION h5arename_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default=lapl_id - - hdferr = h5arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) - - END SUBROUTINE h5arename_by_name_f - -!---------------------------------------------------------------------- -! Name: h5aopen_f -! -! Purpose: Opens an attribute for an object specified by object -! identifier and attribute name -! -! Inputs: -! obj_id - Identifer for object to which attribute is attached -! attr_name - Name of attribute to open -! Outputs: -! attr_id - attribute identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aopen_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list - INTEGER(HID_T) :: aapl_id_default - - INTEGER(SIZE_T) :: attr_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_C'::h5aopen_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(HID_T) :: aapl_id_default - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_c - END INTERFACE - - attr_namelen = LEN(attr_name) - - aapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - - hdferr = h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) - - END SUBROUTINE h5aopen_f - -!---------------------------------------------------------------------- -! Name: h5adelete_by_idx_f -! -! Purpose: Deletes an attribute from an object according to index order -! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, from which attribute is to be removed -! idx_type - Type of index; Possible values are: -! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order in which to iterate over index; Possible values are: -! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! n - Offset within index -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5adelete_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders -! - INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_IDX_C'::h5adelete_by_idx_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5adelete_by_idx_c - END INTERFACE - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - obj_namelen = LEN(obj_name) - hdferr = h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) - - END SUBROUTINE h5adelete_by_idx_f - -!---------------------------------------------------------------------- -! Name: h5adelete_by_name_f -! -! Purpose: Removes an attribute from a specified location -! -! Inputs: -! loc_id - Identifer for object to which attribute is attached -! obj_name - Name of attribute to open -! attr_name - Attribute access property list -! lapl_id - Link access property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5adelete_by_name_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, - ! from which attribute is to be removed - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(SIZE_T) :: attr_namelen - INTEGER(SIZE_T) :: obj_namelen - - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ADELETE_BY_NAME_C'::h5adelete_by_name_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: attr_namelen - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5adelete_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) - - END SUBROUTINE h5adelete_by_name_f - -!---------------------------------------------------------------------- -! Name: h5aopen_by_idx_f -! -! Purpose: Opens an existing attribute that is attached to an object specified by location and name -! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aopen_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_IDX_C'::h5aopen_by_idx_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - END FUNCTION h5aopen_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - - aapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) - - END SUBROUTINE h5aopen_by_idx_f - -!---------------------------------------------------------------------- -! Name: h5aget_info_f -! -! Purpose: Retrieves attribute information, by attribute identifier -! -! Inputs: -! attr_id - attribute identifier -! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t -! -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M. S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_info_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER :: corder_valid - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_C'::h5aget_info_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: attr_id - - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - END FUNCTION h5aget_info_c - END INTERFACE - - hdferr = h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - - - END SUBROUTINE h5aget_info_f - -!---------------------------------------------------------------------- -! Name: h5aget_info_by_idx_f -! -! Purpose: Retrieves attribute information, by attribute index position -! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index -! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_info_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER :: corder_valid - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & - corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_IDX_C'::h5aget_info_by_idx_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - - INTEGER(SIZE_T) :: obj_namelen - END FUNCTION h5aget_info_by_idx_c - END INTERFACE - - obj_namelen = LEN(obj_name) - - lapl_id_default = H5P_DEFAULT_F - IF(present(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aget_info_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default, & - corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5aget_info_by_idx_f - -!---------------------------------------------------------------------- -! Name: h5aget_info_by_name_f -! -! Purpose: Retrieves attribute information, by attribute name -! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! attr_name - Attribute name -! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aget_info_by_name_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - - - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER :: corder_valid - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default - - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & - corder_valid, corder, cset, data_size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AGET_INFO_BY_NAME_C'::h5aget_info_by_name_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - - END FUNCTION h5aget_info_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aget_info_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, & - corder_valid, corder, cset, data_size) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5aget_info_by_name_f - -!---------------------------------------------------------------------- -! Name: H5Acreate_by_name_f -! -! Purpose: Creates an attribute attached to a specified object -! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name, relative to loc_id, of object that attribute is to be attached to -! attr_name - Attribute name -! type_id - Attribute datatype identifier -! space_id - Attribute dataspace identifier -! -! Outputs: -! attr - an attribute identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! acpl_id - Attribute creation property list identifier (Currently not used.) -! aapl_id - Attribute access property list identifier (Currently not used.) -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! February, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & - acpl_id, aapl_id, lapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5acreate_by_name_f -!DEC$endif - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - - INTEGER(HID_T), INTENT(IN) :: type_id ! Attribute datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier - - INTEGER(HID_T), INTENT(OUT) :: attr ! an attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id ! Attribute creation property list identifier (Currently not used.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list identifier (Currently not used.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACREATE_BY_NAME_C'::h5acreate_by_name_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr - - END FUNCTION h5acreate_by_name_c - END INTERFACE - - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) - - acpl_id_default = H5P_DEFAULT_F - aapl_id_default = H5P_DEFAULT_F - lapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(acpl_id)) acpl_id_default = acpl_id - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) - END SUBROUTINE h5acreate_by_name_f - -!---------------------------------------------------------------------- -! Name: H5Aexists_f -! -! Purpose: Determines whether an attribute with a given name exists on an object -! -! Inputs: -! obj_id - Object identifier -! attr_name - Attribute name -! -! Outputs: -! attr_exists - attribute exists status -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M. S. Breitenfeld -! February, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aexists_f -!DEC$endif - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER :: attr_exists_c - INTEGER(SIZE_T) :: attr_namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_C'::h5aexists_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_exists_c - END FUNCTION h5aexists_c - END INTERFACE - - attr_namelen = LEN(attr_name) - - hdferr = h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) - - attr_exists = .FALSE. - IF(attr_exists_c.GT.0) attr_exists = .TRUE. - - END SUBROUTINE h5aexists_f - -!---------------------------------------------------------------------- -! Name: H5Aexists_by_name_f -! -! Purpose: Determines whether an attribute with a given name exists on an object -! -! Inputs: -! loc_id - Location identifier -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name -! -! Outputs: -! attr_exists - attribute exists status -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier -! -! Programmer: M. S. Breitenfeld -! February, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aexists_by_name_f -!DEC$endif - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, - ! absolute from the file’s root group, or '.' - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - INTEGER :: attr_exists_c - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen - - INTEGER(HID_T) :: lapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AEXISTS_BY_NAME_C'::h5aexists_by_name_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr_exists_c - END FUNCTION h5aexists_by_name_c - END INTERFACE - - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) - - attr_exists = .FALSE. - IF(attr_exists_c.GT.0) attr_exists = .TRUE. - - END SUBROUTINE h5aexists_by_name_f -!---------------------------------------------------------------------- -! Name: H5Aopen_by_name_f -! -! Purpose: Opens an attribute for an object by object name and attribute name. -! -! Inputs: -! loc_id - Location from which to find object to which attribute is attached -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name -! -! Outputs: -! attr_id - attribute identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) -! lapl_id - Link access property list identifier -! -! Programmer: M. S. Breitenfeld -! February, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5aopen_by_name_f -!DEC$endif - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, - ! absolute from the file’s root group, or '.' - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list - ! (Currently unused; should be passed in as H5P_DEFAULT_F) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5AOPEN_BY_NAME_C'::h5aopen_by_name_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(LEN=*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION h5aopen_by_name_c - END INTERFACE - - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) - - aapl_id_default = H5P_DEFAULT_F - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(aapl_id)) aapl_id_default = aapl_id - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) - - END SUBROUTINE h5aopen_by_name_f - -!---------------------------------------------------------------------- -! Name: h5arename_f -! -! Purpose: Renames an attribute -! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5arename_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ARENAME_C'::h5arename_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: old_attr_name, new_attr_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - - END FUNCTION h5arename_c - END INTERFACE - - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) - - hdferr = h5arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) - - END SUBROUTINE h5arename_f - -END MODULE H5A + INTERFACE + INTEGER FUNCTION h5aclose_c(attr_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5ACLOSE_C'::h5aclose_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: attr_id + END FUNCTION h5aclose_c + END INTERFACE + hdferr = h5aclose_c(attr_id) + END SUBROUTINE h5aclose_f + END MODULE H5A diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 49f8266..929a056 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -30,13 +30,10 @@ * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: - * - Added optional parameters introduced in version 1.8 - * February, 2008 + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, - hid_t_f *lcpl_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) +nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id) { char *c_name = NULL; hid_t c_dset_id; @@ -51,8 +48,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ /* * Call H5Dcreate2 function. */ - if((c_dset_id = H5Dcreate2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*space_id, - (hid_t)*lcpl_id, (hid_t)*dcpl_id, (hid_t)*dapl_id)) < 0) + if((c_dset_id = H5Dcreate2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*space_id, H5P_DEFAULT, (hid_t)*crt_prp, H5P_DEFAULT)) < 0) goto DONE; *dset_id = (hid_t_f)c_dset_id; @@ -70,15 +66,14 @@ DONE: * Inputs: loc_id - file or group identifier * name - name of the dataset * namelen - name length - * dapl_id - Dataset access property list * Outputs: dset_id - dataset identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: Added 1.8 parameter: dapl_id + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id) +nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id) { char *c_name = NULL; hid_t c_dset_id; @@ -93,7 +88,7 @@ nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f /* * Call H5Dopen2 function. */ - if((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, (hid_t)*dapl_id)) < 0) + if((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0) goto DONE; *dset_id = (hid_t_f)c_dset_id; @@ -1262,21 +1257,18 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) /*---------------------------------------------------------------------------- - * Name: h5dset_extent_c + * Name: h5dextend_c * Purpose: Call H5Dset_extent to extend dataset with unlimited dimensions * Inputs: dset_id - identifier of the dataset * Outputs: dims - array with the dimension sizes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, August 19, 1999 - * - * Modifications: Changed name from the now obsolete h5dextend - * to h5dset_extent in order to match new fortran interface. - * -MSB- March 14, 2008 + * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) +nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) { hid_t c_space_id; hsize_t c_dims[H5S_MAX_RANK]; @@ -1954,39 +1946,4 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dcreate_anon_c - * Purpose: Call H5Dcreate_anon - * Inputs: - * loc_id - Identifier of the file or group within which to create the dataset. - * type_id - Identifier of the datatype to use when creating the dataset. - * space_id - Identifier of the dataspace to use when creating the dataset. - * dcpl_id - Dataset creation property list identifier. - * dapl_id - Dataset access property list identifier. - * Outputs: - * dset_id - dataset identifier - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February, 2008 - *---------------------------------------------------------------------------*/ -int_f -nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, - hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) -{ - int ret_value = -1; - - /* - * Call H5Dcreate2 function. - */ - if((*dset_id = (hid_t_f)H5Dcreate_anon((hid_t)*loc_id, (hid_t)*type_id, (hid_t)*space_id, - (hid_t)*dcpl_id, (hid_t)*dapl_id)) < 0) - goto DONE; - - ret_value = 0; - - DONE: - return ret_value; -} - diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index a94339f..34bcdf4 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -16,115 +16,111 @@ ! ! This file contains Fortran90 interfaces for H5D functions. ! -MODULE H5D - USE H5GLOBAL - - INTERFACE h5dwrite_f - - MODULE PROCEDURE h5dwrite_reference_obj - MODULE PROCEDURE h5dwrite_reference_dsetreg - MODULE PROCEDURE h5dwrite_integer_scalar - MODULE PROCEDURE h5dwrite_integer_1 - MODULE PROCEDURE h5dwrite_integer_2 - MODULE PROCEDURE h5dwrite_integer_3 - MODULE PROCEDURE h5dwrite_integer_4 - MODULE PROCEDURE h5dwrite_integer_5 - MODULE PROCEDURE h5dwrite_integer_6 - MODULE PROCEDURE h5dwrite_integer_7 - MODULE PROCEDURE h5dwrite_char_scalar - MODULE PROCEDURE h5dwrite_char_1 - MODULE PROCEDURE h5dwrite_char_2 - MODULE PROCEDURE h5dwrite_char_3 - MODULE PROCEDURE h5dwrite_char_4 - MODULE PROCEDURE h5dwrite_char_5 - MODULE PROCEDURE h5dwrite_char_6 - MODULE PROCEDURE h5dwrite_char_7 - MODULE PROCEDURE h5dwrite_real_scalar - MODULE PROCEDURE h5dwrite_real_1 - MODULE PROCEDURE h5dwrite_real_2 - MODULE PROCEDURE h5dwrite_real_3 - MODULE PROCEDURE h5dwrite_real_4 - MODULE PROCEDURE h5dwrite_real_5 - MODULE PROCEDURE h5dwrite_real_6 - MODULE PROCEDURE h5dwrite_real_7 - ! Comment if on Crays - MODULE PROCEDURE h5dwrite_double_scalar - MODULE PROCEDURE h5dwrite_double_1 - MODULE PROCEDURE h5dwrite_double_2 - MODULE PROCEDURE h5dwrite_double_3 - MODULE PROCEDURE h5dwrite_double_4 - MODULE PROCEDURE h5dwrite_double_5 - MODULE PROCEDURE h5dwrite_double_6 - MODULE PROCEDURE h5dwrite_double_7 - ! End comment if on Crays - END INTERFACE - - INTERFACE h5dread_f - - MODULE PROCEDURE h5dread_reference_obj - MODULE PROCEDURE h5dread_reference_dsetreg - MODULE PROCEDURE h5dread_integer_scalar - MODULE PROCEDURE h5dread_integer_1 - MODULE PROCEDURE h5dread_integer_2 - MODULE PROCEDURE h5dread_integer_3 - MODULE PROCEDURE h5dread_integer_4 - MODULE PROCEDURE h5dread_integer_5 - MODULE PROCEDURE h5dread_integer_6 - MODULE PROCEDURE h5dread_integer_7 - MODULE PROCEDURE h5dread_char_scalar - MODULE PROCEDURE h5dread_char_1 - MODULE PROCEDURE h5dread_char_2 - MODULE PROCEDURE h5dread_char_3 - MODULE PROCEDURE h5dread_char_4 - MODULE PROCEDURE h5dread_char_5 - MODULE PROCEDURE h5dread_char_6 - MODULE PROCEDURE h5dread_char_7 - MODULE PROCEDURE h5dread_real_scalar - MODULE PROCEDURE h5dread_real_1 - MODULE PROCEDURE h5dread_real_2 - MODULE PROCEDURE h5dread_real_3 - MODULE PROCEDURE h5dread_real_4 - MODULE PROCEDURE h5dread_real_5 - MODULE PROCEDURE h5dread_real_6 - MODULE PROCEDURE h5dread_real_7 - ! Comment if on Crays - MODULE PROCEDURE h5dread_double_scalar - MODULE PROCEDURE h5dread_double_1 - MODULE PROCEDURE h5dread_double_2 - MODULE PROCEDURE h5dread_double_3 - MODULE PROCEDURE h5dread_double_4 - MODULE PROCEDURE h5dread_double_5 - MODULE PROCEDURE h5dread_double_6 - MODULE PROCEDURE h5dread_double_7 - ! End comment if on Crays - - END INTERFACE - - INTERFACE h5dwrite_vl_f - MODULE PROCEDURE h5dwrite_vl_integer - MODULE PROCEDURE h5dwrite_vl_real - MODULE PROCEDURE h5dwrite_vl_string - END INTERFACE - - INTERFACE h5dread_vl_f - MODULE PROCEDURE h5dread_vl_integer - MODULE PROCEDURE h5dread_vl_real - MODULE PROCEDURE h5dread_vl_string - END INTERFACE - - INTERFACE h5dfill_f - MODULE PROCEDURE h5dfill_integer - MODULE PROCEDURE h5dfill_real - MODULE PROCEDURE h5dfill_double - MODULE PROCEDURE h5dfill_char - END INTERFACE - - INTERFACE h5dextend_f - MODULE PROCEDURE h5dset_extent_f - END INTERFACE - - -CONTAINS + MODULE H5D + USE H5GLOBAL + + INTERFACE h5dwrite_f + + MODULE PROCEDURE h5dwrite_reference_obj + MODULE PROCEDURE h5dwrite_reference_dsetreg + MODULE PROCEDURE h5dwrite_integer_scalar + MODULE PROCEDURE h5dwrite_integer_1 + MODULE PROCEDURE h5dwrite_integer_2 + MODULE PROCEDURE h5dwrite_integer_3 + MODULE PROCEDURE h5dwrite_integer_4 + MODULE PROCEDURE h5dwrite_integer_5 + MODULE PROCEDURE h5dwrite_integer_6 + MODULE PROCEDURE h5dwrite_integer_7 + MODULE PROCEDURE h5dwrite_char_scalar + MODULE PROCEDURE h5dwrite_char_1 + MODULE PROCEDURE h5dwrite_char_2 + MODULE PROCEDURE h5dwrite_char_3 + MODULE PROCEDURE h5dwrite_char_4 + MODULE PROCEDURE h5dwrite_char_5 + MODULE PROCEDURE h5dwrite_char_6 + MODULE PROCEDURE h5dwrite_char_7 + MODULE PROCEDURE h5dwrite_real_scalar + MODULE PROCEDURE h5dwrite_real_1 + MODULE PROCEDURE h5dwrite_real_2 + MODULE PROCEDURE h5dwrite_real_3 + MODULE PROCEDURE h5dwrite_real_4 + MODULE PROCEDURE h5dwrite_real_5 + MODULE PROCEDURE h5dwrite_real_6 + MODULE PROCEDURE h5dwrite_real_7 +! Comment if on Crays + MODULE PROCEDURE h5dwrite_double_scalar + MODULE PROCEDURE h5dwrite_double_1 + MODULE PROCEDURE h5dwrite_double_2 + MODULE PROCEDURE h5dwrite_double_3 + MODULE PROCEDURE h5dwrite_double_4 + MODULE PROCEDURE h5dwrite_double_5 + MODULE PROCEDURE h5dwrite_double_6 + MODULE PROCEDURE h5dwrite_double_7 +! End comment if on Crays + END INTERFACE + + INTERFACE h5dread_f + + MODULE PROCEDURE h5dread_reference_obj + MODULE PROCEDURE h5dread_reference_dsetreg + MODULE PROCEDURE h5dread_integer_scalar + MODULE PROCEDURE h5dread_integer_1 + MODULE PROCEDURE h5dread_integer_2 + MODULE PROCEDURE h5dread_integer_3 + MODULE PROCEDURE h5dread_integer_4 + MODULE PROCEDURE h5dread_integer_5 + MODULE PROCEDURE h5dread_integer_6 + MODULE PROCEDURE h5dread_integer_7 + MODULE PROCEDURE h5dread_char_scalar + MODULE PROCEDURE h5dread_char_1 + MODULE PROCEDURE h5dread_char_2 + MODULE PROCEDURE h5dread_char_3 + MODULE PROCEDURE h5dread_char_4 + MODULE PROCEDURE h5dread_char_5 + MODULE PROCEDURE h5dread_char_6 + MODULE PROCEDURE h5dread_char_7 + MODULE PROCEDURE h5dread_real_scalar + MODULE PROCEDURE h5dread_real_1 + MODULE PROCEDURE h5dread_real_2 + MODULE PROCEDURE h5dread_real_3 + MODULE PROCEDURE h5dread_real_4 + MODULE PROCEDURE h5dread_real_5 + MODULE PROCEDURE h5dread_real_6 + MODULE PROCEDURE h5dread_real_7 +! Comment if on Crays + MODULE PROCEDURE h5dread_double_scalar + MODULE PROCEDURE h5dread_double_1 + MODULE PROCEDURE h5dread_double_2 + MODULE PROCEDURE h5dread_double_3 + MODULE PROCEDURE h5dread_double_4 + MODULE PROCEDURE h5dread_double_5 + MODULE PROCEDURE h5dread_double_6 + MODULE PROCEDURE h5dread_double_7 +! End comment if on Crays + + END INTERFACE + + INTERFACE h5dwrite_vl_f + MODULE PROCEDURE h5dwrite_vl_integer + MODULE PROCEDURE h5dwrite_vl_real + MODULE PROCEDURE h5dwrite_vl_string + END INTERFACE + + INTERFACE h5dread_vl_f + MODULE PROCEDURE h5dread_vl_integer + MODULE PROCEDURE h5dread_vl_real + MODULE PROCEDURE h5dread_vl_string + END INTERFACE + + INTERFACE h5dfill_f + MODULE PROCEDURE h5dfill_integer + MODULE PROCEDURE h5dfill_real + MODULE PROCEDURE h5dfill_double + MODULE PROCEDURE h5dfill_char + END INTERFACE + + + CONTAINS !---------------------------------------------------------------------- ! Name: h5dcreate_f @@ -142,86 +138,64 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! creation_prp - Dataset creation property list -! lcpl_id - Link creation property list -! dapl_id - Dataset access property list +! createion_prp - dataset creation property list identifier ! ! Programmer: Elena Pourmal ! August 12, 1999 ! -! Modifications: -! - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! - Added version's 1.8 new optional parameters -! February, 2008 +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & - hdferr, dcpl_id, lcpl_id, dapl_id) - + SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & + hdferr, creation_prp) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5dcreate_f !DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - - INTEGER :: namelen ! Name length + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp + ! Dataset creation propertly + ! list identifier + INTEGER(HID_T) :: creation_prp_default + INTEGER :: namelen ! Name length +! INTEGER, EXTERNAL :: h5dcreate_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & - space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_C'::h5dcreate_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - dcpl_id_default = H5P_DEFAULT_F - dapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - - namelen = LEN(name) - hdferr = h5dcreate_c(loc_id, name, namelen, type_id, space_id, & - lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) - - END SUBROUTINE h5dcreate_f + INTERFACE + INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & + space_id, creation_prp_default, dset_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_C'::h5dcreate_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T) :: creation_prp_default + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dcreate_c + END INTERFACE + + creation_prp_default = H5P_DEFAULT_F + if (present(creation_prp)) creation_prp_default = creation_prp + namelen = LEN(name) + hdferr = h5dcreate_c(loc_id, name, namelen, type_id, space_id, & + creation_prp_default, dset_id) + END SUBROUTINE h5dcreate_f !---------------------------------------------------------------------- ! Name: h5dopen_f @@ -237,22 +211,19 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! dapl_id - Dataset access property list +! NONE ! ! Programmer: Elena Pourmal ! August 12, 1999 ! -! Modifications: -Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! -Added 1.8 (optional) parameter dapl_id -! February, 2008, M.S. Breitenfeld +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id) + SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5dopen_f @@ -260,18 +231,15 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list INTEGER :: namelen ! Name length - INTEGER(HID_T) :: dapl_id_default - ! INTEGER, EXTERNAL :: h5dopen_c ! MS FORTRAN needs explicit interface for C functions called here. ! INTERFACE - INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) + INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dset_id) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DOPEN_C'::h5dopen_c @@ -280,16 +248,12 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: dapl_id_default INTEGER(HID_T), INTENT(OUT) :: dset_id END FUNCTION h5dopen_c END INTERFACE - dapl_id_default = H5P_DEFAULT_F - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - namelen = LEN(name) - hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) + hdferr = h5dopen_c(loc_id, name, namelen, dset_id) END SUBROUTINE h5dopen_f @@ -368,7 +332,7 @@ CONTAINS INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: j + INTEGER :: i,j ! INTEGER, EXTERNAL :: h5dwrite_ref_obj_c ! MS FORTRAN needs explicit interface for C functions called here. @@ -2535,7 +2499,7 @@ CONTAINS INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: j + INTEGER :: i,j ! INTEGER, EXTERNAL :: h5dread_ref_obj_c ! MS FORTRAN needs explicit interface for C functions called here. @@ -4741,7 +4705,7 @@ CONTAINS END SUBROUTINE h5dget_type_f !---------------------------------------------------------------------- -! Name: h5dset_extent (instead of obsolete name: h5dextend_f) +! Name: h5dextend_f ! ! Purpose: Extends a dataset with unlimited dimension. ! @@ -4763,18 +4727,14 @@ CONTAINS ! called C functions (it is needed for Windows ! port). February 28, 2001 ! -! Changed name from the now obsolete h5dextend_f -! to h5dset_extent_f. Provided interface to old name -! for backward compatability. -MSB- March 14, 2008 -! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE H5Dset_extent_f(dataset_id, size, hdferr) + SUBROUTINE h5dextend_f(dataset_id, size, hdferr) !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: H5Dset_extent_f +!DEC$attributes dllexport :: h5dextend_f !DEC$endif IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier @@ -4783,22 +4743,22 @@ CONTAINS ! dimensions' sizes INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: H5Dset_extent_c +! INTEGER, EXTERNAL :: h5dextend_c ! MS FORTRAN needs explicit interface for C functions called here. ! INTERFACE - INTEGER FUNCTION H5Dset_extent_c(dataset_id, size) + INTEGER FUNCTION h5dextend_c(dataset_id, size) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DSET_EXTENT_C'::H5Dset_extent_c + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DEXTEND_C'::h5dextend_c !DEC$ ENDIF INTEGER(HID_T), INTENT(IN) :: dataset_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - END FUNCTION H5Dset_extent_c + END FUNCTION h5dextend_c END INTERFACE - hdferr = H5Dset_extent_c(dataset_id, size) - END SUBROUTINE H5Dset_extent_f + hdferr = h5dextend_c(dataset_id, size) + END SUBROUTINE h5dextend_f !---------------------------------------------------------------------- @@ -5255,6 +5215,7 @@ CONTAINS INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default ! CHARACTER, DIMENSION(dims(1)*dims(2)) :: tmp_buf + integer i, j INTERFACE INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & @@ -5685,79 +5646,4 @@ CONTAINS hdferr = h5dget_space_status_c(dset_id, flag) END SUBROUTINE h5dget_space_status_f -!---------------------------------------------------------------------- -! Name: h5dcreate_anon_f -! -! Purpose: Creates a dataset in a file without linking it into the file structure -! -! Inputs: -! loc_id - Identifier of the file or group within which to create the dataset. -! type_id - Identifier of the datatype to use when creating the dataset. -! space_id - Identifier of the dataspace to use when creating the dataset. -! Outputs: -! dset_id - dataset identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! dcpl_id - Dataset creation property list identifier. -! dapl_id - Dataset access property list identifier. -! -! Programmer: M.S. Breitenfeld -! February 11, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5dcreate_anon_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier. - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier. - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier. - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier. - INTEGER, INTENT(OUT) :: hdferr ! Error code. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list identifier. - - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_ANON_C'::h5dcreate_anon_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_anon_c - END INTERFACE - - dcpl_id_default = H5P_DEFAULT_F - dapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - - hdferr = h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) - - END SUBROUTINE h5dcreate_anon_f - -END MODULE H5D - - + END MODULE H5D diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 2190d05..575d92b 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -508,7 +508,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) HGOTO_DONE(FAIL); /* - * Call H5Fget_name function + * Call H5Aget_name function */ if ((size_c = (size_t_f)H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen)) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 6cf6c05..3926656 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -58,14 +58,14 @@ !DEC$endif ! - IMPLICIT NONE + IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file INTEGER, INTENT(IN) :: access_flags ! File access flags INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp ! File creation propertly - ! list identifier + ! list identifier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp ! File access property list ! identifier diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index f2a4187..0316c03 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -16,7 +16,6 @@ /* This files contains C stubs for H5G Fortran APIs */ #include "H5f90.h" -#include "H5Eprivate.h" /*---------------------------------------------------------------------------- * Name: h5gcreate_c @@ -36,9 +35,9 @@ *---------------------------------------------------------------------------*/ int_f nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, - hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) + hid_t_f *grp_id) { - hid_t c_gcpl_id = -1; /* Group creation property list */ + hid_t gcpl_id = -1; /* Group creation property list */ char *c_name = NULL; hid_t c_grp_id; int_f ret_value = -1; @@ -52,19 +51,19 @@ nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, /* * Call H5Gcreate function. */ - if(*size_hint == OBJECT_NAMELEN_DEFAULT_F ){ - c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name,(hid_t)*lcpl_id,(hid_t)*gcpl_id,(hid_t)*gapl_id);} + if(*size_hint == OBJECT_NAMELEN_DEFAULT_F ) + c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); else { - /* Create the group creation property list */ - if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + /* Create the group creation property list */ + if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) + goto DONE; - /* Set the local heap size hint */ - if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + /* Set the local heap size hint */ + if(H5Pset_local_heap_size_hint(gcpl_id, (size_t)*size_hint) < 0) + goto DONE; - /* Create the group */ - c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); + /* Create the group */ + c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT); } if(c_grp_id < 0) goto DONE; @@ -74,8 +73,8 @@ nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, ret_value = 0; DONE: - if(c_gcpl_id > 0) - H5Pclose(c_gcpl_id); + if(gcpl_id > 0) + H5Pclose(gcpl_id); if(c_name) HDfree(c_name); return ret_value; @@ -87,7 +86,6 @@ DONE: * Inputs: loc_id - file or group identifier * name - name of the group * namelen - name length - * gapl_id - Group access property list identifier * Outputs: grp_id - group identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -95,7 +93,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id) +nh5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id) { char *c_name = NULL; hid_t c_grp_id; @@ -110,7 +108,7 @@ nh5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f /* * Call H5Gopen function. */ - if((c_grp_id = H5Gopen2((hid_t)*loc_id, c_name, (hid_t)*gapl_id)) < 0) + if((c_grp_id = H5Gopen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0) goto DONE; /* Everything OK, set values to return */ @@ -661,210 +659,3 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gcreate_anon_c - * Purpose: Call H5Gcreate_anon - * Inputs: - * loc_id - Location identifier - * gcpl_id - Group creation property list identifier - * gapl_id - Group access property list identifier - * - * Outputs: grp_id - group identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 15, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5gcreate_anon_c(hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id) -{ - - int_f ret_value=0; /* Return value */ - - if ((*grp_id = (hid_t_f)H5Gcreate_anon((hid_t)*loc_id,(hid_t)*gcpl_id,(hid_t)*gapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5gget_create_plist_c - * Purpose: Call H5Gget_create_plist - * Inputs: - * grp_id - group identifier - * - * Outputs: gcpl_id - Group creation property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 15, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ) -{ - int_f ret_value=0; /* Return value */ - - if ((*gcpl_id = (hid_t_f)H5Gget_create_plist((hid_t)*grp_id)) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - - -/*---------------------------------------------------------------------------- - * Name: h5gget_info_c - * Purpose: Call H5Gget_info - * Inputs: group_id - Group identifier - * Outputs: - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 15, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder) -{ - - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - - /* - * Call H5Gget_info function. - */ - if(H5Gget_info((hid_t)*group_id,&ginfo) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - -done: - return ret_value; -} - - -/*---------------------------------------------------------------------------- - * Name: h5gget_info_by_idx_c - * Purpose: Call H5Gget_info_by_idx - * Inputs: - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * index_type - Index type - * order - Order of the count in the index - * n - Position in the index of the group for which information is retrieved - * lapl_id - Link access property list - * Outputs: - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 18, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - hid_t_f *index_type, hid_t_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder) - -{ - char *c_group_name = NULL; /* Buffer to hold group name C string */ - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - /* - * Convert FORTRAN name to C name - */ - if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Gget_info_by_idx function. - */ - if(H5Gget_info_by_idx((hid_t)*loc_id,c_group_name, (H5_index_t)*index_type,(H5_iter_order_t)*order,(hsize_t)*n, - &ginfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - - done: - if(c_group_name) - HDfree(c_group_name); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5gget_info_by_name_c - * Purpose: Call H5Gget_info_by_name - * Inputs: - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * lapl_id - Link access property list - * Outputs: - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 18, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder) - -{ - char *c_group_name = NULL; /* Buffer to hold group name C string */ - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - /* - * Convert FORTRAN name to C name - */ - if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Gget_info_by_name function. - */ - if(H5Gget_info_by_name((hid_t)*loc_id, c_group_name, &ginfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - - done: - if(c_group_name) - HDfree(c_group_name); - return ret_value; -} - diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index 6e4dd4f..5866539 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -16,18 +16,10 @@ ! ! This file contains Fortran90 interfaces for H5F functions. ! -MODULE H5G - USE H5GLOBAL - -! PRIVATE :: h5gcreate1_f -! PRIVATE :: h5gcreate2_f - -! INTERFACE h5gcreate_f -! MODULE PROCEDURE h5gcreate1_f -! MODULE PROCEDURE h5gcreate2_f -! END INTERFACE - -CONTAINS + MODULE H5G + USE H5GLOBAL + + CONTAINS !---------------------------------------------------------------------- ! Name: h5gcreate_f @@ -43,12 +35,9 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! size_hint - a parameter indicating the number of bytes +! size_hint - a parameter indicating the number of bytes ! to reserve for the names that will appear ! in the group -! lcpl_id - Property list for link creation -! gcpl_id - Property list for group creation -! gapl_id - Property list for group access ! ! Programmer: Elena Pourmal ! August 12, 1999 @@ -57,170 +46,56 @@ CONTAINS ! called C functions (it is needed for Windows ! port). March 5, 2001 ! -! Added additional optional paramaters in 1.8 -! MSB - February 27, 2008 -! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id) + SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5gcreate_f !DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint - ! Parameter indicating - ! the number of bytes - ! to reserve for the - ! names that will appear - ! in the group. Set to OBJECT_NAMELEN_DEFAULT_F - ! if using any of the optional - ! parameters lcpl_id, gcpl_id, and/or gapl_id when not - ! using keywords in specifying the optional parameters - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - - INTEGER :: namelen ! Length of the name character string - INTEGER(SIZE_T) :: size_hint_default +! + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint + ! Parameter indicating + ! the number of bytes + ! to reserve for the + ! names that will appear + ! in the group + INTEGER :: namelen ! Length of the name character string + INTEGER(SIZE_T) :: size_hint_default +! INTEGER, EXTERNAL :: h5gcreate_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & - size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T) :: size_hint_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - END FUNCTION h5gcreate_c - END INTERFACE - - size_hint_default = OBJECT_NAMELEN_DEFAULT_F - IF (PRESENT(size_hint)) size_hint_default = size_hint - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - gcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id - gapl_id_default = H5P_DEFAULT_F - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - - namelen = LEN(name) - - hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, grp_id, & - lcpl_id_default, gcpl_id_default, gapl_id_default) - - END SUBROUTINE h5gcreate_f + INTERFACE + INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & + size_hint_default, grp_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T) :: size_hint_default + INTEGER(HID_T), INTENT(OUT) :: grp_id + END FUNCTION h5gcreate_c + END INTERFACE -!!$!---------------------------------------------------------------------- -!!$! Name: h5gcreate2_f -!!$! -!!$! Purpose: Creates a new group. -!!$! -!!$! Inputs: -!!$! loc_id - location identifier -!!$! name - group name at the specified location -!!$! Outputs: -!!$! grp_id - group identifier -!!$! hdferr: - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! Optional parameters: -!!$! -!!$! lcpl_id - Property list for link creation -!!$! gcpl_id - Property list for group creation -!!$! gapl_id - Property list for group access -!!$! -!!$! Programmer: M.S. BREITENFELD -!!$! February 27, 2008 -!!$! -!!$! Modifications: -!!$! -!!$! Comment: Needed to switch the first 2 arguments to avoid conflect -!!$! with h5gcreate1_f -!!$!---------------------------------------------------------------------- -!!$ -!!$ SUBROUTINE h5gcreate2_f(name, loc_id, grp_id, hdferr, & -!!$ lcpl_id, gcpl_id, gapl_id) -!!$! -!!$!This definition is needed for Windows DLLs -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$attributes dllexport :: h5gcreate_f -!!$!DEC$endif -!!$! -!!$ IMPLICIT NONE -!!$ CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code -!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier -!!$ -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access -!!$ -!!$ INTEGER(HID_T) :: lcpl_id_default -!!$ INTEGER(HID_T) :: gcpl_id_default -!!$ INTEGER(HID_T) :: gapl_id_default -!!$ -!!$ INTEGER(SIZE_T) :: OBJECT_NAMELEN_DEFAULT ! Dummy argument to pass to c call -!!$ INTEGER :: namelen ! Length of the name character string -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & -!!$ OBJECT_NAMELEN_DEFAULT, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_C'::h5gcreate_c -!!$ !DEC$ ENDIF -!!$ !DEC$ATTRIBUTES reference :: name -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(LEN=*), INTENT(IN) :: name -!!$ INTEGER :: namelen -!!$ INTEGER(SIZE_T) :: OBJECT_NAMELEN_DEFAULT -!!$ INTEGER(HID_T) :: lcpl_id_default -!!$ INTEGER(HID_T) :: gcpl_id_default -!!$ INTEGER(HID_T) :: gapl_id_default -!!$ INTEGER(HID_T), INTENT(OUT) :: grp_id -!!$ END FUNCTION h5gcreate_c -!!$ END INTERFACE -!!$ -!!$ namelen = LEN(name) -!!$ OBJECT_NAMELEN_DEFAULT = OBJECT_NAMELEN_DEFAULT_F -!!$ -!!$ lcpl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id -!!$ gcpl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id -!!$ gapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(gapl_id)) gapl_id_default = gapl_id -!!$ -!!$ -!!$ hdferr = h5gcreate_c(loc_id, name, namelen, OBJECT_NAMELEN_DEFAULT, grp_id, & -!!$ lcpl_id_default, gcpl_id_default, gapl_id_default) -!!$ -!!$ END SUBROUTINE h5gcreate2_f + size_hint_default = OBJECT_NAMELEN_DEFAULT_F + if (present(size_hint)) size_hint_default = size_hint + namelen = LEN(name) + hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, & + grp_id) + END SUBROUTINE h5gcreate_f !---------------------------------------------------------------------- ! Name: h5gopen_f @@ -236,62 +111,54 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! gapl_id - Group access property list identifier +! NONE ! ! Programmer: Elena Pourmal ! August 12, 1999 ! ! Modifications: Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Added 1.8 (optional) parameter gapl_id -! February, 2008 M.S. Breitenfeld +! port). March 5, 2001 ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id) + SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5gopen_f !DEC$endif ! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Group access property list identifier - - INTEGER(HID_T) :: gapl_id_default - INTEGER :: namelen ! Length of the name character string - + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: namelen ! Length of the name character string + ! INTEGER, EXTERNAL :: h5gopen_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GOPEN_C'::h5gopen_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: gapl_id_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - END FUNCTION h5gopen_c - END INTERFACE - - gapl_id_default = H5P_DEFAULT_F - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + INTERFACE + INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, grp_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GOPEN_C'::h5gopen_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(OUT) :: grp_id + END FUNCTION h5gopen_c + END INTERFACE - namelen = LEN(name) - hdferr = h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) - - END SUBROUTINE h5gopen_f + namelen = LEN(name) + hdferr = h5gopen_c(loc_id, name, namelen, grp_id) + + END SUBROUTINE h5gopen_f !---------------------------------------------------------------------- ! Name: h5gclose_f @@ -1062,362 +929,7 @@ CONTAINS namelen = LEN(name) hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) - END SUBROUTINE h5gget_comment_f - -!---------------------------------------------------------------------- -! Name: H5Gcreate_anon_f -! -! Purpose: Creates a new empty group without linking it into the file structure. -! -! Inputs: -! loc_id - Location identifier -! Outputs: -! grp_id - group identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! gcpl_id - Group creation property list identifier -! gapl_id - Group access property list identifier -! -! Programmer: M.S. Breitenfeld -! February 15, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5gcreate_anon_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access - - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - - INTERFACE - INTEGER FUNCTION h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GCREATE_ANON_C'::h5gcreate_anon_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER(HID_T), INTENT(IN) :: gcpl_id_default ! Property list for group creation - INTEGER(HID_T), INTENT(IN) :: gapl_id_default ! Property list for group access - INTEGER(HID_T), INTENT(OUT) :: grp_id ! Group identifier - END FUNCTION h5gcreate_anon_c - END INTERFACE - - gcpl_id_default = H5P_DEFAULT_F - gapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - - hdferr = h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) - - END SUBROUTINE h5Gcreate_anon_f - -!---------------------------------------------------------------------- -! Name: H5Gget_create_plist_f -! -! Purpose: Gets a group creation property list identifier. -! -! Inputs: -! grp_id - group identifier -! Outputs: -! gcpl_id - Group creation property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! Programmer: M.S. Breitenfeld -! February 15, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5gget_create_plist_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier - INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5gget_create_plist_c(grp_id, gcpl_id ) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_CREATE_PLIST_C'::h5gget_create_plist_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: grp_id - INTEGER(HID_T), INTENT(OUT) :: gcpl_id - END FUNCTION h5gget_create_plist_c - END INTERFACE - - hdferr = h5gget_create_plist_c(grp_id, gcpl_id ) - - END SUBROUTINE h5gget_create_plist_f - -!---------------------------------------------------------------------- -! Name: h5gget_info_f -! -! Purpose: Retrieves information about a group -! -! Inputs: -! group_id - Group identifier -! -! Outputs: NOTE: In C it is defined as a structure: H5G_info_t -! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M. S. Breitenfeld -! February 15, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5gget_info_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_C'::h5gget_info_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: group_id - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - END FUNCTION h5gget_info_c - END INTERFACE - - hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder) - - END SUBROUTINE h5gget_info_f - -!---------------------------------------------------------------------- -! Name: h5gget_info_by_idx_f -! -! Purpose: Retrieves information about a group, according to the group’s position within an index. -! -! Inputs: -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved -! index_type - Index type -! order - Order of the count in the index -! n - Position in the index of the group for which information is retrieved -! -! Outputs: NOTE: In C the following are defined as a structure: H5G_info_t -! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! February 18, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & - storage_type, nlinks, max_corder, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5gget_info_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved - INTEGER(HID_T), INTENT(IN) :: index_type ! Index type - INTEGER(HID_T), INTENT(IN) :: order ! Order of the count in the index - INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_IDX_C'::h5gget_info_by_idx_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(HID_T), INTENT(IN) :: index_type - INTEGER(HID_T), INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - - END FUNCTION h5gget_info_by_idx_c - END INTERFACE - - group_name_len = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(present(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5gget_info_by_idx_c(loc_id, group_name, group_name_len, & - index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder) - - END SUBROUTINE h5gget_info_by_idx_f - -!---------------------------------------------------------------------- -! Name: h5gget_info_by_name_f -! -! Purpose: Retrieves information about a group. -! -! Inputs: -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved -! -! Outputs: NOTE: In C the following are defined as a structure: H5G_info_t -! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! February 18, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & - storage_type, nlinks, max_corder, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5gget_info_by_name_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved - - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GGET_INFO_BY_NAME_C'::h5gget_info_by_name_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - - END FUNCTION h5gget_info_by_name_c - END INTERFACE - - group_name_len = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + END SUBROUTINE h5gget_comment_f - hdferr = h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder) - - END SUBROUTINE h5gget_info_by_name_f -END MODULE H5G + END MODULE H5G diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index b4c7660..d948259 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -54,11 +54,7 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) * Returns: length of the name on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - * Changed the size of c_buf_size to c_buf_size + 1, which - * fixes the problem of truncating the string by 1 if the - * exact size of the string (buf_size) is passed in. - * M.S. Breitenfeld, April 21, 2008 + * Modifications: *---------------------------------------------------------------------------*/ int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) @@ -72,8 +68,8 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz /* * Allocate buffer to hold name of an attribute */ - c_buf_size = (size_t)*buf_size +1; - c_buf = (char *)HDmalloc(c_buf_size); + c_buf_size = (size_t)*buf_size; + c_buf = (char *)HDmalloc(c_buf_size +1); if (c_buf == NULL) return ret_value; /* @@ -86,7 +82,7 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz /* * Convert C name to FORTRAN and place it in the given buffer */ - HD5packFstring(c_buf, _fcdtocp(buf), c_buf_size-1); + HD5packFstring(c_buf, _fcdtocp(buf), c_buf_size); *name_size = (size_t_f)c_size; ret_value = 0; diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c deleted file mode 100644 index 208ad19..0000000 --- a/fortran/src/H5Lf.c +++ /dev/null @@ -1,817 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5L Fortran APIs */ - -#include "H5f90.h" -#include "H5Eprivate.h" - -/*---------------------------------------------------------------------------- - * Name: h5lcopy_c - * Purpose: Call H5Lcopy - * Inputs: - * src_loc_id - Location identifier of the source link - * src_name - Name of the link to be copied - * src_namelen - length of the name - * dest_loc_id - Location identifier specifying the destination of the copy - * dest_name - Name to be assigned to the NEW copy - * dest_namelen - Length of the name - * loc_id - Identifier of the file or group containing the object - * name - Name of the link to delete - * lcpl_id - Link creation property list identifier - * lapl_id - Link access property list identifier - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, - _fcd dest_name, size_t_f *dest_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id) -{ - char *c_src_name = NULL; - char *c_dest_name = NULL; - int ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if((c_src_name = HD5f2cstring(src_name, (size_t)*src_namelen)) == NULL) - HGOTO_DONE(FAIL); - if((c_dest_name = HD5f2cstring(dest_name, (size_t)*dest_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lcopy function. - */ - if( H5Lcopy( (hid_t)*src_loc_id, c_src_name, (hid_t) *dest_loc_id, - c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id ) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_src_name) - HDfree(c_src_name); - if(c_dest_name) - HDfree(c_dest_name); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lcreate_external_c - * Purpose: Call H5Lcreate_external_c - * Inputs: - * file_name - Name of the file containing the target object. Neither the file nor the target object is - * required to exist. May be the file the link is being created in. - * obj_name - Path within the target file to the target object. - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 29, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, - hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id) - -{ - char *c_file_name = NULL; - char *c_obj_name = NULL; - char *c_link_name = NULL; - int ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if((c_file_name = HD5f2cstring(file_name, (size_t)*file_namelen)) == NULL) - HGOTO_DONE(FAIL); - if((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lcopy function. - */ - if( H5Lcreate_external( c_file_name, c_obj_name, (hid_t) *link_loc_id, c_link_name, - (hid_t) *lcpl_id, (hid_t) *lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_file_name) - HDfree(c_file_name); - if(c_obj_name) - HDfree(c_obj_name); - if(c_link_name) - HDfree(c_link_name); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5ldelete_c - * Purpose: Call H5Ldelete - * Inputs: - * - * loc_id - Identifier of the file or group containing the object - * name - Name of the link to delete - * lapl_id - Link access property list identifier - * namelen - length of name - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5ldelete_c ( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ) -{ - char *c_name = NULL; - int ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Ldelete function. - */ - if( H5Ldelete( (hid_t)*loc_id, c_name, (hid_t)*lapl_id ) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_name) - HDfree(c_name); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lcreate_soft_c - * Purpose: Call H5Lcreate_soft - * Inputs: - * - * target_path - Path to the target object, which is not required to exist. - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 20, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, - hid_t_f *link_loc_id, - _fcd link_name, size_t_f *link_name_len, - hid_t_f *lcpl_id, hid_t_f *lapl_id ) -{ - char *c_target_path = NULL; - char *c_link_name = NULL; - int ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if((c_target_path = HD5f2cstring(target_path, (size_t)*target_path_len)) == NULL) - HGOTO_DONE(FAIL); - if((c_link_name = HD5f2cstring(link_name, (size_t)*link_name_len)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Adelete function. - */ - if ( H5Lcreate_soft(c_target_path,(hid_t)*link_loc_id, c_link_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - done: - if(c_target_path) - HDfree(c_target_path); - if(c_link_name) - HDfree(c_link_name); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lcreate_hard_c - * Purpose: Call H5Lcreate_hard - * Inputs: - * obj_loc_id - The file or group identifier for the target object. - * obj_name - Name of the target object, which must already exist. - * obj_namelen - Name length - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * link_namelen- Name length - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 27, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, - hid_t_f *link_loc_id, - _fcd link_name, size_t_f *link_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id ) -{ - char *c_obj_name = NULL; - char *c_link_name = NULL; - int ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lcreate_hard function. - */ - if ( H5Lcreate_hard((hid_t)*obj_loc_id, c_obj_name, (hid_t)*link_loc_id, c_link_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - done: - if(c_obj_name) - HDfree(c_obj_name); - if(c_link_name) - HDfree(c_link_name); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5ldelete_by_idx_c - * Purpose: Calls h5ldelete_by_idx - * Inputs: - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - * group_namelen - Name length - * index_field - Type of index; Possible values are: - * H5_INDEX_UNKNOWN_F = -1 - Unknown index type - * H5_INDEX_NAME_F - Index on names - * H5_INDEX_CRT_ORDER_F - Index on creation order - * H5_INDEX_N_F - Number of indices defined - * order - Order within field or index; Possible values are: - * H5_ITER_UNKNOWN_F - Unknown order - * H5_ITER_INC_F - Increasing order - * H5_ITER_DEC_F - Decreasing order - * H5_ITER_NATIVE_F - No particular order, whatever is fastest - * H5_ITER_N_F - Number of iteration orders - * n - Link for which to retrieve information - * lapl_id - Link access property list - * - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 29, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, size_t_f *n, hid_t_f *lapl_id) -{ - char *c_group_name = NULL; /* Buffer to hold C string */ - H5_index_t c_index_field; - H5_iter_order_t c_order; - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - c_index_field = (H5_index_t)*index_field; - c_order = (H5_iter_order_t)*order; - - /* - * Call H5Ldelete_by_name function. - */ - if(H5Ldelete_by_idx((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_group_name) - HDfree(c_group_name); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lexists_c - * Purpose: Calls H5Lexists - * Inputs: - * loc_id - Identifier of the file or group to query. - * name - Link name to check - * lapl_id - Link access property list identifier. - * Outputs: - * link_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 29, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *link_exists) -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lexists function. - */ - if((*link_exists = (hid_t_f)H5Lexists((hid_t)*loc_id, c_name, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if(c_name) - HDfree(c_name); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lget_info_c - * Purpose: Call H5Lget_info - * Inputs: - * link_loc_id - File or group identifier. - * link_name - Name of the link for which information is being sought - * link_namelen - Name length - * lapl_id - Link access property list - * Outputs: - * - * cset - indicates the character set used for link’s name. - * corder - specifies the link’s creation order position. - * corder_valid - indicates whether the value in corder is valid. - * link_type - specifies the link class: - * H5L_LINK_HARD_F - Hard link - * H5L_LINK_SOFT_F - Soft link - * H5L_LINK_EXTERNAL_F - External link - * H5L_LINK_ERROR_F - Error - * address - If the link is a hard link, address specifies the file address that the link points to - * val_size - If the link is a symbolic link, val_size will be the length of the link value - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, - int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, - int_f *address, hsize_t_f *val_size, - hid_t_f *lapl_id) -{ - char *c_link_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - H5L_info_t link_buff; - - /* - * Convert FORTRAN name to C name - */ - if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) - HGOTO_DONE(FAIL); - /* - * Call H5Linfo function. - */ - if(H5Lget_info((hid_t)*link_loc_id, c_link_name, &link_buff, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *cset = (int_f)link_buff.cset; - *corder = (int_f)link_buff.corder; - *corder_valid = 0; - if(link_buff.corder_valid > 0) *corder_valid = 1; - *link_type = (int_f)link_buff.type; - *address = (int_f)link_buff.u.address; - *val_size = (hsize_t)link_buff.u.val_size; - -done: - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lget_info_by_idx_c - * Purpose: Call H5Lget_info_by_idx - * Inputs: - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - *group_namelen - Name length - * index_field - Index or field which determines the order - * order - Order within field or index - * n - Link for which to retrieve information - * lapl_id - Link access property list - * Outputs: - * corder_valid - Indicates whether the the creation order data is valid for this attribute - * corder - Is a positive integer containing the creation order of the attribute - * cset - Indicates the character set used for the attribute’s name - * data_size - indicates the size, in the number of characters, of the attribute - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, hsize_t_f *n, - int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size, hid_t_f *lapl_id) -{ - char *c_group_name = NULL; /* Buffer to hold C string */ - H5_index_t c_index_field; - H5_iter_order_t c_order; - int_f ret_value = 0; /* Return value */ - H5L_info_t link_buff; - - /* - * Convert FORTRAN name to C name - */ - if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - c_index_field = (H5_index_t)*index_field; - c_order = (H5_iter_order_t)*order; - /* - * Call H5Linfo_by_idx function. - */ - if(H5Lget_info_by_idx((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n, - &link_buff, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *corder_valid = 0; - if(link_buff.corder_valid > 0) *corder_valid = 1; - - *corder = (int_f)link_buff.corder; - *cset = (int_f)link_buff.cset; - *data_size = (hsize_t)link_buff.u.val_size; - -done: - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: H5Lis_registered_c - * Purpose: Call H5Lis_registered - * Inputs: - * link_cls_id - User-defined link class identifier - * Outputs: NONE - * - * Returns: Returns a positive value if the link class has been registered - * and zero if it is unregistered. Otherwise returns a negative value - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lis_registered_c(int_f *link_cls_id) -{ - int_f ret_value = 0; /* Return value */ - H5L_type_t c_link_cls_id; /* User-defined link class identifier */ - htri_t registered; /* registration status */ - - - c_link_cls_id = (H5L_type_t)*link_cls_id; - /* - * Call H5Lis_registered - */ - registered = H5Lis_registered(c_link_cls_id); - - ret_value = (int_f)registered; - - return ret_value; -} - - -/*---------------------------------------------------------------------------- - * Name: h5lmove_c - * Purpose: Call H5Lmove - * Inputs: - * src_loc_id - Original file or group identifier. - * src_name - Original link name. - * src_namelen - name length - * dest_loc_id - Destination file or group identifier. - * dest_name - NEW link name. - * dest_namelen - name length - * Outputs: - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, - _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) - -{ - char *c_src_name = NULL; /* Buffer to hold C string */ - char *c_dest_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_src_name = HD5f2cstring(src_name, (size_t)*src_namelen)) == NULL) - HGOTO_DONE(FAIL); - if((c_dest_name = HD5f2cstring(dest_name, (size_t)*dest_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lmove function. - */ - if(H5Lmove((hid_t)*src_loc_id, c_src_name, (hid_t)*dest_loc_id, - c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); -done: - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lget_name_by_idx_c - * Purpose: Call H5Lget_name_by_idx - * Inputs: - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - * index_field - Index or field which determines the order - * order - Order within field or index - * n - Link for which to retrieve information - * size - Maximum number of characters of link value to be returned. - * lapl_id - Link access property list - * Outputs: - * name - Buffer in which link value is returned - * size - The size of the link name on success - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 10, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, hsize_t_f *n, - size_t_f *size, _fcd name, hid_t_f *lapl_id) -{ - char *c_group_name = NULL; /* Buffer to hold C string */ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - size_t c_size; - - /* - * Convert FORTRAN name to C name - */ - if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - c_size = (size_t)*size + 1; - /* - * Allocate buffer to hold name of an attribute - */ - if ((c_name = HDmalloc(c_size)) == NULL) - HGOTO_DONE(FAIL); - - if((*size = (size_t)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, - (H5_iter_order_t)*order, (hsize_t)*n,c_name, c_size, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - if(c_name != NULL) - HD5packFstring(c_name, _fcdtocp(name), c_size-1); -done: - if(c_group_name) HDfree(c_group_name); - if(c_name) HDfree(c_name); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5lget_val_c - * Purpose: Call H5Lget_val - * Inputs: - * link_loc_id - File or group identifier. - * link_name - Name of the link for which valrmation is being sought - * link_namelen - Name length - * size - Maximum number of characters of link value to be returned. - * lapl_id - Link access property list - * Outputs: - * linkval_buff - The buffer to hold the returned link value. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -/* int_f */ -/* nh5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ -/* size_t_f *size, _fcd linkval_buff, */ -/* hid_t_f *lapl_id) */ -/* { */ -/* char *c_link_name = NULL; /\* Buffer to hold C string *\/ */ -/* int_f ret_value = 0; /\* Return value *\/ */ -/* void *c_linkval_buff = NULL; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Call H5Lval function. */ -/* *\/ */ -/* if(H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Convert C name to FORTRAN */ -/* *\/ */ -/* HD5packFstring(c_buf, _fcdtocp(buf), c_bufsize-1); */ - - -/* done: */ -/* return ret_value; */ -/* } */ - - -/*---------------------------------------------------------------------------- - * Name: H5Lregistered_c - * Purpose: Call H5Lregistered - * Inputs: - * - * Inputs: - * version - Version number of this struct - * class_id - Link class identifier - * comment - Comment for debugging - * comment_len - Comment for debugging - * create_func - Callback during link creation - * create_func_len - length - * move_func - Callback after moving link - * move_func_len - length - * copy_func - Callback after copying link - * copy_func_len - length - * trav_func - The main traversal function - * trav_func_len - length - * del_func - Callback for link deletion - * del_func_len - length - * query_func - Callback for queries - * query_func_len - length - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -/* int_f */ - -/* nh5lregistered_c(int_f *version, int_f *class_id, */ -/* _fcd comment, size_t_f *comment_len, */ -/* _fcd create_func, size_t_f *create_func_len, */ -/* _fcd move_func, size_t_f *move_func_len, */ -/* _fcd copy_func, size_t_f *copy_func_len, */ -/* _fcd trav_func, size_t_f *trav_func_len, */ -/* _fcd del_func , size_t_f *del_func_len, */ -/* _fcd query_func, size_t_f *query_func_len) */ -/* { */ -/* char *c_comment = NULL; */ -/* char *c_create_func = NULL; */ -/* char *c_move_func = NULL; */ -/* char *c_copy_func = NULL; */ -/* char *c_trav_func = NULL; */ -/* char *c_del_func = NULL; */ -/* char *c_query_func = NULL; */ - -/* H5L_class_t class_t; */ - -/* int ret_value = 0; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_comment = HD5f2cstring(c_comment, (size_t)*sc_comment_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_create_func = HD5f2cstring(c_create_func, (size_t)*c_create_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_move_func = HD5f2cstring(c_move_func, (size_t)*sc_move_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_copy_func = HD5f2cstring(c_copy_func, (size_t)*c_copy_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_trav_func = HD5f2cstring(c_trav_func, (size_t)*sc_trav_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_del_func = HD5f2cstring(c_del_func, (size_t)*c_del_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_query_func = HD5f2cstring(c_query_func, (size_t)*c_query_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Pack into C struct H5L_class_t */ -/* *\/ */ -/* int version; /\* Version number of this struct *\/ */ -/* H5L_type_t class_id; /\* Link class identifier *\/ */ -/* const char *comment; /\* Comment for debugging *\/ */ -/* H5L_create_func_t create_func; /\* Callback during link creation *\/ */ -/* H5L_move_func_t move_func; /\* Callback after moving link *\/ */ -/* H5L_copy_func_t copy_func; /\* Callback after copying link *\/ */ -/* H5L_traverse_func_t trav_func; /\* The main traversal function *\/ */ -/* H5L_delete_func_t del_func; /\* Callback for link deletion *\/ */ -/* H5L_query_func_t query_func; /\* Callback for queries *\/ */ - -/* class_t.version = (int)*version; */ -/* class_t.class_id = (H5L_type_t)*class_id; */ -/* class_t.comment = c_comment; */ -/* class_t. */ - -/* /\* */ -/* * Call H5Lcopy function. */ -/* *\/ */ -/* if( H5Lcopy( (hid_t)*src_loc_id, c_src_name, (hid_t) *dest_loc_id, */ -/* c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id ) < 0) */ -/* HGOTO_DONE(FAIL); */ - -/* done: */ -/* if(c_src_name) */ -/* HDfree(c_src_name); */ -/* if(c_dest_name) */ -/* HDfree(c_dest_name); */ - -/* return ret_value; */ -/* } */ - -/*---------------------------------------------------------------------------- - * Name: h5lget_val_c - * Purpose: Call H5Lget_val_c - * Inputs: - * link_loc_id - File or group identifier. - * link_name - Link whose value is to be returned. - * link_name_len - length of link_name - * size - Maximum number of characters of link value to be returned. - * lapl_id - List access property list identifier - * Outputs: - * linkval_buff - The buffer to hold the returned link value. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 11, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ -int_f -nh5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, - void *linkval_buff, hid_t_f *lapl_id) -{ - int_f ret_value = 0; /* Return value */ - char *c_link_name = NULL; /* Buffer to hold C string */ - - /* - * Convert FORTRAN name to C name - */ - if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lget_val - */ - - if(H5Lget_val( (hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id )< 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - - diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 deleted file mode 100644 index acb7c73..0000000 --- a/fortran/src/H5Lff.f90 +++ /dev/null @@ -1,1323 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains Fortran90 interfaces for H5L functions. -! -MODULE H5L - - USE H5GLOBAL - -CONTAINS - -!---------------------------------------------------------------------- -! Name: h5lcopy_f -! -! Purpose: Copies a link from one location to another. -! -! Inputs: -! src_loc_id - Location identifier of the source link -! src_name - Name of the link to be copied -! dest_loc_id - Location identifier specifying the destination of the copy -! dest_name - Name to be assigned to the NEW copy -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete -! -! Outputs: -! hdferr - error code: -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier -! lapl_id - Link access property list identifier -! -! Programmer: M.S. Breitenfeld -! February 27, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, & - lcpl_id, lapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lcopy -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Location identifier of the source link - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Name of the link to be copied - INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Location identifier specifying the destination of the copy - CHARACTER(LEN=*), INTENT(IN) :: dest_name ! Name to be assigned to the NEW copy - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & - lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCOPY_C'::h5lcopy_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(HID_T), INTENT(IN) :: dest_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dest_name - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - END FUNCTION h5lcopy_c - END INTERFACE - - src_namelen = LEN(src_name) - dest_namelen = LEN(dest_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & - lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcopy_f - -!---------------------------------------------------------------------- -! Name: h5ldelete_f -! -! Purpose: Removes a link from a group. -! -! Inputs: -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5ldelete_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group containing the object - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the link to delete - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_C'::h5ldelete_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - END FUNCTION h5ldelete_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5ldelete_c(loc_id, name, namelen, lapl_id_default) - - END SUBROUTINE h5ldelete_f - -!---------------------------------------------------------------------- -! Name: H5Lcreate_soft_f -! -! Purpose: Creates a soft link to an object. -! -! Inputs: -! target_path - Path to the target object, which is not required to exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! Programmer: M.S. Breitenfeld -! February 20, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lcreate_soft_f -!DEC$endif -! - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: target_path ! Path to the target object, which is not required to exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: target_path_len - INTEGER(SIZE_T) :: link_name_len - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lcreate_soft_c(target_path, target_path_len, & - link_loc_id, & - link_name,link_name_len, & - lcpl_id_default, lapl_id_default ) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_SOFT_C'::h5lcreate_soft_c - !DEC$ ENDIF - CHARACTER(LEN=*), INTENT(IN) :: target_path - INTEGER(SIZE_T) :: target_path_len - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: link_name_len - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_soft_c - END INTERFACE - - target_path_len = LEN(target_path) - link_name_len = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_soft_c(target_path, target_path_len,& - link_loc_id, & - link_name, link_name_len, & - lcpl_id_default, lapl_id_default ) - - END SUBROUTINE h5lcreate_soft_f - -!---------------------------------------------------------------------- -! Name: H5Lcreate_hard_f -! -! Purpose: Creates a hard link to an object. -! -! Inputs: -! -! obj_loc_id - The file or group identifier for the target object. -! obj_name - Name of the target object, which must already exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! Programmer: M.S. Breitenfeld -! February 27, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lcreate_hard_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_loc_id ! The file or group identifier for the target object. - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_HARD_C'::h5lcreate_hard_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_loc_id - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_hard_c - END INTERFACE - obj_namelen = LEN(obj_name) - link_namelen = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcreate_hard_f - -!---------------------------------------------------------------------- -! Name: H5Lcreate_external_f -! -! Purpose: Creates a soft link to an object in a different file. -! -! Inputs: -! -! file_name - Name of the file containing the target object. Neither the file nor the target object is -! required to exist. May be the file the link is being created in. -! obj_name - Path within the target file to the target object. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! Programmer: M.S. Breitenfeld -! February 27, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lcreate_external_f -!DEC$endif -! - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither - ! the file nor the target object is required to exist. - ! May be the file the link is being created in. - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: file_namelen - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LCREATE_EXTERNAL_C'::h5lcreate_external_c - !DEC$ ENDIF - CHARACTER(LEN=*), INTENT(IN) :: file_name - CHARACTER(LEN=*), INTENT(IN) :: obj_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: file_namelen - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_external_c - END INTERFACE - file_namelen = LEN(file_name) - obj_namelen = LEN(obj_name) - link_namelen = LEN(link_name) - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5lcreate_external_f - -!---------------------------------------------------------------------- -! Name: h5ldelete_by_idx_f -! -! Purpose: Removes the nth link in a group. -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Type of index; Possible values are: -! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order within field or index; Possible values are: -! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! n - Link for which to retrieve information -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5ldelete_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of object, relative to location, - ! from which attribute is to be removed - INTEGER, INTENT(IN) :: index_field ! Type of index; Possible values are: - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders - INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LDELETE_BY_IDX_C'::h5ldelete_by_idx_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen - END FUNCTION h5ldelete_by_idx_c - END INTERFACE - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - group_namelen = LEN(group_name) - hdferr = h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) - - END SUBROUTINE h5ldelete_by_idx_f - -!---------------------------------------------------------------------- -! Name: H5Lexists_f -! -! Purpose: Check if a link with a particular name exists in a group. -! -! Inputs: -! loc_id - Identifier of the file or group to query. -! name - Link name to check -! -! Outputs: -! link_exists - link exists status (.TRUE.,.FALSE.) -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier. -! -! Programmer: M. S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id) - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lexists_f -!DEC$endif - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group to query. - CHARACTER(LEN=*), INTENT(IN) :: name ! Link name to check. - LOGICAL, INTENT(OUT) :: link_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - ! Link access property list identifier. - INTEGER :: link_exists_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LEXISTS_C'::h5lexists_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - INTEGER(HID_T), INTENT(OUT) :: link_exists_c - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION h5lexists_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) - - link_exists = .FALSE. - IF(link_exists_c.GT.0) link_exists = .TRUE. - - END SUBROUTINE h5lexists_f - -!---------------------------------------------------------------------- -! Name: h5lget_info_f -! -! Purpose: Returns information about a link. -! -! Inputs: -! link_loc_id - File or group identifier. -! link_name - Name of the link for which information is being sought -! -! Outputs: NOTE: In C these are contained in the structure H5L_info_t -! -! cset - indicates the character set used for link’s name. -! corder - specifies the link’s creation order position. -!corder_valid - indicates whether the value in corder is valid. -! link_type - specifies the link class: -! H5L_LINK_HARD_F - Hard link -! H5L_LINK_SOFT_F - Soft link -! H5L_LINK_EXTERNAL_F - External link -! H5L_LINK_ERROR_ F - Error -! address - If the link is a hard link, address specifies the file address that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5lget_info_f(link_loc_id, link_name, & - cset, corder, f_corder_valid, link_type, address, val_size, & - hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lget_info_f -!DEC$endif - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought - -! Outputs: NOTE: In C these are contained in the structure H5L_info_t - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the link’s name. - INTEGER, INTENT(OUT) :: corder ! Specifies the link’s creation order position. - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER, INTENT(OUT) :: link_type ! Specifies the link class: - ! H5L_LINK_HARD_F - Hard link - ! H5L_LINK_SOFT_F - Soft link - ! H5L_LINK_EXTERNAL_F - External link - ! H5L_LINK_ERROR _F - Error - INTEGER, INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(HSIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER :: corder_valid - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lget_info_c(link_loc_id, link_name, link_namelen, & - cset, corder, corder_valid, link_type, address, val_size, & - lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_C'::h5lget_info_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER, INTENT(OUT) :: cset - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: link_type - INTEGER, INTENT(OUT) :: address - INTEGER(HSIZE_T), INTENT(OUT) :: val_size - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: link_namelen - INTEGER :: corder_valid - END FUNCTION h5lget_info_c - END INTERFACE - - link_namelen = LEN(link_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lget_info_c(link_loc_id, link_name, link_namelen, & - cset, corder, corder_valid, link_type, & - address, val_size, & - lapl_id_default) - - f_corder_valid =.FALSE. - IF(corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5lget_info_f - -!---------------------------------------------------------------------- -! Name: h5lget_info_by_idx_f -! -! Purpose: Retrieves metadata for a link in a group, according to the order within a field or index. -! -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information -! -! Outputs: NOTE: In C these are defined as a structure: H5L_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & - f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lget_info_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group - INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER :: corder_valid - INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - corder_valid, corder, cset, data_size, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_INFO_BY_IDX_C'::h5lget_info_by_idx_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(SIZE_T) :: group_namelen - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER :: corder_valid - INTEGER, INTENT(OUT) :: corder - INTEGER, INTENT(OUT) :: cset - INTEGER(HSIZE_T), INTENT(OUT) :: data_size - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lget_info_by_idx_c - END INTERFACE - - group_namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - corder_valid, corder, cset, data_size, lapl_id_default) - - f_corder_valid =.FALSE. - IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - - END SUBROUTINE h5lget_info_by_idx_f - -!---------------------------------------------------------------------- -! Name: H5Lis_registered_f -! -! Purpose: Determines whether a class of user-defined links is registered. -! -! Inputs: -! link_cls_id - User-defined link class identifier -! -! Outputs: -! registered - .TRUE. - if the link class has been registered -! .FALSE. - if it is unregistered -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! None -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE H5Lis_registered_f(link_cls_id, registered, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: H5Lis_registered_f -!DEC$endif - IMPLICIT NONE - INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier - LOGICAL, INTENT(OUT) :: registered ! .TRUE. - if the link class has been registered and - ! .FALSE. - if it is unregistered - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Lis_registered_c(link_cls_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LIS_REGISTERED_C'::h5lis_registered_c - !DEC$ ENDIF - INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier - END FUNCTION H5Lis_registered_c - END INTERFACE - - hdferr = H5Lis_registered_c(link_cls_id) - - IF(hdferr.GT.0)THEN - registered = .TRUE. - ELSE IF(hdferr.EQ.0)THEN - registered = .FALSE. - ENDIF - - END SUBROUTINE H5Lis_registered_f - -!---------------------------------------------------------------------- -! Name: H5Lmove_f -! -! Purpose: Renames a link within an HDF5 file. -! -! Inputs: -! src_loc_id - Original file or group identifier. -! src_name - Original link name. -! dest_loc_id - Destination file or group identifier. -! dest_name - NEW link name. -! -! Outputs: -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier to be associated WITH the NEW link. -! lapl_id - Link access property list identifier to be associated WITH the NEW link. -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: H5Lmove_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Original file or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original link name. - INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Destination file or group identifier. - CHARACTER(LEN=*), INTENT(IN) :: dest_name ! NEW link name. - INTEGER(HID_T), INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier - ! to be associated WITH the NEW link. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - ! to be associated WITH the NEW link. - - INTEGER(SIZE_T) :: src_namelen - INTEGER(SIZE_T) :: dest_namelen - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & - dest_name, dest_namelen, lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LMOVE_C'::h5lmove_c - !DEC$ ENDIF - - INTEGER(HID_T), INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(SIZE_T) :: src_namelen - INTEGER(HID_T), INTENT(IN) :: dest_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dest_name - INTEGER(SIZE_T) :: dest_namelen - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - - END FUNCTION H5Lmove_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - src_namelen = LEN(src_name) - dest_namelen = LEN(dest_name) - - hdferr = H5Lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & - dest_name, dest_namelen, lcpl_id_default, lapl_id_default) - - END SUBROUTINE H5Lmove_f - -!---------------------------------------------------------------------- -! Name: h5lget_name_by_idx_f -! -! Purpose: Retrieves name of the nth link in a group, according to the order within a specified field or index. -! -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information -! -! Outputs: -! name - Buffer in which link value is returned -! size - Maximum number of characters of link value to be returned. -! hdferr - error code -! Success: 0 -! Failure: -1 -! -! Optional parameters: -! lapl_id - List access property list identifier. -! -! Programmer: M. S. Breitenfeld -! March 10, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, & - size, name, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5lget_name_by_idx_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group - CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group - INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order - ! H5_INDEX_UNKNOWN_F - Unknown index type - ! H5_INDEX_NAME_F - Index on names - ! H5_INDEX_CRT_ORDER_F - Index on creation order - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: - ! H5_ITER_UNKNOWN_F - Unknown order - ! H5_ITER_INC_F - Increasing order - ! H5_ITER_DEC_F - Decreasing order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - INTEGER(SIZE_T), INTENT(INOUT) :: size ! Indicates the size, in the number of characters, of the attribute - ! returns correct size - CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned - INTEGER, INTENT(OUT) :: hdferr ! Error code: - - INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - size, name, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_NAME_BY_IDX_C'::h5lget_name_by_idx_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER(SIZE_T) :: group_namelen - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(SIZE_T), INTENT(INOUT) :: size - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lget_name_by_idx_c - END INTERFACE - - group_namelen = LEN(group_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & - size, name, lapl_id_default) - - END SUBROUTINE h5lget_name_by_idx_f - - -! HAS PROBLEM WITH void pointer in C - -!!$!---------------------------------------------------------------------- -!!$! Name: h5lget_val_by_idx_f -!!$! -!!$! Purpose: Returns the link value of a link, according to the order of -!!$! an index. For symbolic links, this is the path to which the -!!$! link points, including the null terminator. For user-defined -!!$! links, it is the link buffer. -!!$! Inputs: -!!$! loc_id - File or group identifier specifying location of subject group -!!$! group_name - Name of subject group -!!$! index_field - Index or field which determines the order -!!$! order - Order within field or index -!!$! n - Link for which to retrieve information -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! Outputs: NOTE: In C these are defined as a structure: H5L_info_t -!!$! corder_valid - indicates whether the creation order data is valid for this attribute -!!$! corder - is a positive integer containing the creation order of the attribute -!!$! cset - indicates the character set used for the attribute’s name -!!$! data_size - indicates the size, in the number of characters, of the attribute -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! Optional parameters: -!!$! lapl_id - List access property list identifier. -!!$! -!!$! Programmer: M. S. Breitenfeld -!!$! March 3, 2008 -!!$! -!!$! Modifications: N/A -!!$! -!!$!---------------------------------------------------------------------- -!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & -!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!!$!This definition is needed for Windows DLLs -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$attributes dllexport :: h5lget_val_by_idx_f -!!$!DEC$endif -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group -!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order -!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type -!!$ ! H5_INDEX_NAME_F - Index on names -!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order -!!$ ! H5_INDEX_N_F - Number of indices defined -!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: -!!$ ! H5_ITER_UNKNOWN_F - Unknown order -!!$ ! H5_ITER_INC_F - Increasing order -!!$ ! H5_ITER_DEC_F - Decreasing order -!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index -!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute -!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute -!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: corder_valid -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c -!!$ !DEC$ ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER, INTENT(IN) :: index_field -!!$ INTEGER, INTENT(IN) :: order -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n -!!$ INTEGER :: corder_valid -!!$ INTEGER, INTENT(OUT) :: corder -!!$ INTEGER, INTENT(OUT) :: cset -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ END FUNCTION h5lget_val_by_idx_c -!!$ END INTERFACE -!!$ -!!$ group_namelen = LEN(group_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ -!!$ f_corder_valid =.FALSE. -!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. -!!$ -!!$ END SUBROUTINE h5lget_val_by_idx_f - - - -!---------------------------------------------------------------------- -! Name: h5lget_val_f -! -! Purpose: Returns the value of a symbolic link. -! -! Inputs: -! link_loc_id - File or group identifier. -! link_name - Link whose value is to be returned. -! size - Maximum number of characters of link value to be returned. -! -! Outputs: -! linkval_buff - The buffer to hold the returned link value. -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - List access property list identifier. -! -! Programmer: M. S. Breitenfeld -! March 3, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - -!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & -!!$ hdferr, lapl_id) -!!$!This definition is needed for Windows DLLs -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$attributes dllexport :: h5lget_val_f -!!$!DEC$endif -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ INTEGER :: corder_valid -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c -!!$ !DEC$ ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER :: link_namelen -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ END FUNCTION h5lget_val_c -!!$ END INTERFACE -!!$ -!!$ link_namelen = LEN(link_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ -!!$ END SUBROUTINE h5lget_val_f - - - -!---------------------------------------------------------------------- -! Name: H5Lregistered_f -! -! Purpose: Registers user-defined link class or changes behavior of existing class. -! -! Inputs: NOTE: In C the following represents struct H5L_class_t: -! version - Version number of this struct -! class_id - Link class identifier -! comment - Comment for debugging -! create_func - Callback during link creation -! move_func - Callback after moving link -! copy_func - Callback after copying link -! trav_func - The main traversal function -! del_func - Callback for link deletion -! query_func - Callback for queries -! -! Outputs: -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! None -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- -!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & -!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) -!!$!This definition is needed for Windows DLLs -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$attributes dllexport :: H5Lregistered_f -!!$!DEC$endif -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$! -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func,query_func_len) -!!$ USE H5GLOBAL -!!$ !DEC$ IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c -!!$ !DEC$ ENDIF -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ END FUNCTION H5Lregistered_c -!!$ END INTERFACE -!!$ -!!$ comment_len = LEN(comment) -!!$ create_func_len = LEN(create_func) -!!$ move_func_len = LEN(move_func) -!!$ copy_func_len = LEN(copy_func) -!!$ trav_func_len = LEN(trav_func) -!!$ del_func_len = LEN(del_func) -!!$ query_func_len = LEN(query_func) -!!$ -!!$ hdferr = H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func, query_func_len) -!!$ -!!$ END SUBROUTINE H5Lregistered_f - -END MODULE H5L diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c deleted file mode 100644 index 9a708da..0000000 --- a/fortran/src/H5Of.c +++ /dev/null @@ -1,99 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5O Fortran APIs */ - -#include "H5f90.h" -#include "H5Eprivate.h" - -/*---------------------------------------------------------------------------- - * Name: h5olink_c - * Purpose: Calls H5Olink - * Inputs: - * object_id - Object to be linked. - * new_loc_id - File or group identifier specifying location at which object is to be linked. - * name - Name of link to be created, relative to new_loc_id. - * namelen - Length of buffer for link to be created. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id) -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if( (c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Olink function. - */ - if((hid_t_f)H5Olink((hid_t)*object_id, (hid_t)*new_loc_id, c_name, - (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - done: - if(c_name) - HDfree(c_name); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5oopen_c - * Purpose: Calls H5Oopen - * Inputs: loc_id - File or group identifier - * name - Attribute access property list - * namelen - Size of name - * lapl_id - Link access property list - * Outputs: obj_id - Dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id) -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Oopen function. - */ - if((*obj_id = (hid_t_f)H5Oopen((hid_t)*loc_id, c_name, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - - done: - if(c_name) - HDfree(c_name); - return ret_value; -} - diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 deleted file mode 100644 index c64b82d..0000000 --- a/fortran/src/H5Off.f90 +++ /dev/null @@ -1,163 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains Fortran90 interfaces for H5O functions. -! -MODULE H5O - - USE H5GLOBAL - -CONTAINS - -!---------------------------------------------------------------------- -! Name: h5olink_f -! -! Purpose: Creates a hard link to an object in an HDF5 file. -! -! Inputs: -! object_id - Object to be linked. -! new_loc_id - File or group identifier specifying location at which object is to be linked. -! new_link_name - Name of link to be created, relative to new_loc_id. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! Programmer: M.S. Breitenfeld -! April 21, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5olink_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id ! Object to be linked - INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier specifying - ! location at which object is to be linked. - CHARACTER(LEN=*), INTENT(IN) :: new_link_name ! Name of link to be created, relative to new_loc_id. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link creation property list identifier. - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T) :: lcpl_id_default - - INTEGER(SIZE_T) :: new_link_namelen - - INTERFACE - INTEGER FUNCTION h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & - lcpl_id_default, lapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OLINK_C'::h5olink_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER(HID_T), INTENT(IN) :: new_loc_id - CHARACTER(LEN=*), INTENT(IN) :: new_link_name - INTEGER(SIZE_T) :: new_link_namelen - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T) :: lcpl_id_default - END FUNCTION h5olink_c - END INTERFACE - - new_link_namelen = LEN(new_link_name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - - hdferr = h5olink_c(object_id, new_loc_id, new_link_name, new_link_namelen, & - lcpl_id_default, lapl_id_default) - - END SUBROUTINE h5olink_f - -!---------------------------------------------------------------------- -! Name: h5oopen_f -! -! Purpose: Opens an object in an HDF5 file by location identifier and path name.O -! -! Inputs: -! loc_id - File or group identifier -! name - Path to the object, relative to loc_id. -! Outputs: -! obj_id - Object identifier for the opened object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Access property list identifier for the link pointing to the object -! -! Programmer: M.S. Breitenfeld -! April 18, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5oopen_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Path to the object, relative to loc_id - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Attribute access property list - INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OOPEN_C'::h5oopen_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5oopen_c - END INTERFACE - - namelen = LEN(name) - - lapl_id_default = H5P_DEFAULT_F - IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - - hdferr = h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) - - END SUBROUTINE h5oopen_f - - -END MODULE H5O diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index ea7a4bb..f674530 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1,4 +1,3 @@ - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -18,6 +17,7 @@ #include "H5f90.h" + /*---------------------------------------------------------------------------- * Name: h5pcreate_c * Purpose: Call H5Pcreate to create a property list @@ -2710,20 +2710,16 @@ int_f nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len) { int_f ret_value = -1; - char *c_name = NULL; /* Buffer to hold C string */ - size_t c_size; + hid_t c_class; + char* c_name; - c_size = (size_t)*name_len + 1; - /* - * Allocate buffer to hold name - */ - if ((c_name = HDmalloc(c_size)) == NULL) - goto DONE; + + c_class = (hid_t)*class; /* * Call H5Pget_class_name function. */ - c_name = H5Pget_class_name((hid_t)*class); - if(c_name == NULL) goto DONE; + c_name = H5Pget_class_name(c_class); + if( c_name == NULL) goto DONE; HD5packFstring(c_name, _fcdtocp(name), (size_t)*name_len); ret_value = (int_f)HDstrlen(c_name); @@ -3135,7 +3131,7 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) */ status = H5Pset_fapl_multi(c_prp_id, NULL, NULL, NULL, NULL, relax); - if ( status < 0 ) return ret_value; /* error occurred */ + if ( status < 0 ) return ret_value; ret_value = 0; return ret_value; } @@ -3418,1017 +3414,3 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_attr_phase_change_c - * Purpose: Calls H5Pget_attr_phase_change - * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) -{ - int ret_value = -1; - hid_t c_ocpl_id; - unsigned c_max_compact; - unsigned c_min_dense; - herr_t ret; - /* - * Call H5Pget_attr_phase_change function. - */ - c_ocpl_id = (hid_t)*ocpl_id; - ret = H5Pget_attr_phase_change(c_ocpl_id, &c_max_compact,&c_min_dense); - if (ret < 0) return ret_value; - - *max_compact = (int_f)c_max_compact; - *min_dense = (int_f)c_min_dense; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_attr_creation_order_c - * Purpose: Calls H5Ppset_attr_creation_order - * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier - * Outputs crt_order_flags - Flags specifying whether to track and index attribute creation order - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) -{ - int ret_value = -1; - unsigned c_crt_order_flags; - herr_t ret; - /* - * Call h5pset_attr_creation_order function. - */ - c_crt_order_flags = (unsigned)*crt_order_flags; - ret = H5Pset_attr_creation_order((hid_t)*ocpl_id, c_crt_order_flags); - if (ret < 0) return ret_value; - - *crt_order_flags = (int_f)c_crt_order_flags; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_shared_mesg_nindexes_c - * Purpose: Calls h5pset_shared_mesg_nindexes - * - * Inputs: - * plist_id - file creation property list - * nindexes - Number of shared object header message indexes - * available in files created WITH this property list - * - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) -{ - int ret_value = -1; - hid_t c_plist_id; - unsigned c_nindexes; - herr_t ret; - /* - * Call h5pset_shared_mesg_nindexes function. - */ - c_plist_id = (hid_t)*plist_id; - c_nindexes = (unsigned)*nindexes; - ret = H5Pset_shared_mesg_nindexes(c_plist_id, c_nindexes ); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_shared_mesg_index_c - * Purpose: Calls H5Pset_shared_mesg_index - * - * Inputs: - * fcpl_id - File creation property list identifier. - * index_num - Index being configured. - * mesg_type_flags - Types of messages that should be stored in this index. - * min_mesg_size - Minimum message size. - * - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size) -{ - int ret_value = -1; - herr_t ret; - /* - * Call h5pset_shared_mesg_index function. - */ - ret = H5Pset_shared_mesg_index((hid_t)*fcpl_id,(unsigned)*index_num, (unsigned)*mesg_type_flags, (unsigned)*min_mesg_size); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_attr_creation_order_c - * Purpose: Calls H5Pget_attr_creation_order - * - * Inputs: - * ocpl_id - Object (group or dataset) creation property list identifier - * Outputs: - * crt_order_flags - Flags specifying whether to track and index attribute creation order - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) -{ - int ret_value = -1; - herr_t ret; - - unsigned c_crt_order_flags; - /* - * Call h5pget_attr_creation_order function. - */ - - ret = H5Pget_attr_creation_order((hid_t)*ocpl_id, &c_crt_order_flags); - if (ret < 0) return ret_value; - - *crt_order_flags = (int_f)c_crt_order_flags; - - ret_value = 0; - return ret_value; -} -/*---------------------------------------------------------------------------- - * Name: h5pset_libver_bounds_c - * Purpose: Calls H5Pset_libver_bounds - * - * Inputs: - * fapl_id - File access property list identifier - * low - The earliest version of the library that will be used for writing objects. - * high - The latest version of the library that will be used for writing objects. - * Outputs: - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pset_libver_bounds function. - */ - ret = H5Pset_libver_bounds( (hid_t)*fapl_id, (H5F_libver_t)*low, (H5F_libver_t)*high ); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_link_creation_order_c - * Purpose: Calls H5Pset_link_creation_order - * - * Inputs: gcpl_id - Group creation property list identifier - * crt_order_flags - Creation order flag(s) - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) -{ - int ret_value = -1; - herr_t ret; - /* - * Call H5Pset_link_creation_order function. - */ - ret = H5Pset_link_creation_order((hid_t)*gcpl_id, (unsigned)*crt_order_flags); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_link_phase_change_c - * Purpose: Calls H5Pget_link_phase_change - * - * Inputs: gcpl_id - Group creation property list identifier - * Outputs max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 20, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) -{ - int ret_value = -1; - unsigned c_max_compact; - unsigned c_min_dense; - herr_t ret; - - /* - * Call H5Pget_link_phase_change function. - */ - ret = H5Pget_link_phase_change((hid_t)*gcpl_id, &c_max_compact,&c_min_dense); - if (ret < 0) return ret_value; - - *max_compact = (int_f)c_max_compact; - *min_dense = (int_f)c_min_dense; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_obj_track_times_c - * Purpose: Call H5Pget_obj_track_times - * - * Inputs: plist_id - property list id - * Outputs: - * flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) -{ - int ret_value = -1; - hbool_t c_track_times=0; - herr_t ret; - - /* - * Call H5Pget_obj_track_times function. - */ - ret = H5Pget_obj_track_times((hid_t)*plist_id, &c_track_times); - - if (ret < 0) return ret_value; /* error occurred */ - - *flag = 0; - if(c_track_times > 0) *flag = 1; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_obj_track_times_c - * Purpose: Call H5Pset_obj_track_times - * - * Inputs: plist_id - property list id - * flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) -{ - int ret_value = -1; - hbool_t c_track_times; - herr_t ret; - - - c_track_times = (hbool_t)*flag; - - /* - * Call H5Pset_obj_track_times function. - */ - ret = H5Pset_obj_track_times((hid_t)*plist_id, c_track_times); - - if (ret < 0) return ret_value; /* error occurred */ - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_create_inter_group_c - * Purpose: Calls H5Pset_create_intermediate_group - * - * Inputs: - * lcpl_id - Link creation property list identifier - * crt_intermed_group - crt_intermed_group specifying whether - * to create intermediate groups upon the - * creation of an object - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pset_create_intermediate_group function. - */ - ret = H5Pset_create_intermediate_group((hid_t)*lcpl_id, (unsigned)*crt_intermed_group); - - if (ret < 0) return ret_value; /* error occurred */ - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_link_creation_order_c - * Purpose: Calls H5Pget_link_creation_order - * - * Inputs: - * gcpl_id - Group creation property list identifier - * Outputs: - * crt_order_flags - Creation order flag(s) - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) -{ - int ret_value = -1; - herr_t ret; - - unsigned c_crt_order_flags; - /* - * Call h5pget_link_creation_order function. - */ - - ret = H5Pget_link_creation_order((hid_t)*gcpl_id, &c_crt_order_flags); - if (ret < 0) return ret_value; - - *crt_order_flags = (int_f)c_crt_order_flags; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_char_encoding_c - * Purpose: Calls H5Pset_char_encoding - * - * Inputs: - * plist_id - Property list identifier - * encoding - String encoding character set: - * H5T_CSET_ASCII_F -> US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - * Outputs: NONE - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pset_char_encoding function. - */ - ret = H5Pset_char_encoding((hid_t)*plist_id, (H5T_cset_t)*encoding); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - - -/*---------------------------------------------------------------------------- - * Name: h5pget_char_encoding_c - * Purpose: Calls H5Pget_char_encoding - * - * Inputs: - * plist_id - Property list identifier - * Outputs: - * encoding - Encoding character set: - * H5T_CSET_ASCII_F -> US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) -{ - int ret_value = -1; - H5T_cset_t c_encoding; - herr_t ret; - /* - * Call H5Pget_char_encoding function. - */ - ret = H5Pget_char_encoding((hid_t)*plist_id, &c_encoding); - if (ret < 0) return ret_value; - - *encoding = (int_f)c_encoding; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_copy_object_c - * Purpose: Calls H5Pset_copy_object - * - * Inputs: - * ocp_plist_id - Object copy property list identifier - * copy_options - Copy option(s) to be set - * - * Outputs: - * NONE - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) -{ - int ret_value = -1; - herr_t ret; - /* - * Call H5Pset_copy_object function. - */ - ret = H5Pset_copy_object((hid_t)*ocp_plist_id, (unsigned)*copy_options); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_copy_object_c - * Purpose: Calls H5Pget_copy_object - * - * Inputs: - * ocp_plist_id - Object copy property list identifier - * - * Outputs: - * copy_options - Copy option(s) to be get - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) -{ - int ret_value = -1; - unsigned c_copy_options; - herr_t ret; - /* - * Call H5Pget_copy_object function. - */ - ret = H5Pget_copy_object((hid_t)*ocp_plist_id, &c_copy_options); - if (ret < 0) return ret_value; - - *copy_options = (int_f)c_copy_options; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_data_transform_c - * Purpose: Calls H5Pget_data_transform - * Inputs: - * prp_id - property list identifier to query - * expression_len - buffer size transorm expression - * - * Output: - * expression - buffer to hold transform expression - * - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 19, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size) -{ - int_f ret_value = -1; - char *c_expression = NULL; /* Buffer to hold C string */ - size_t c_expression_len; - ssize_t ret; - - - c_expression_len = (size_t)*expression_len + 1; - - /* should expression_len be size_t_f? */ - /* - * Allocate memory to store the expression. - */ - if( c_expression_len) c_expression = (char*) HDmalloc(c_expression_len); - if (c_expression == NULL) return ret_value; - - /* - * Call h5pget_data_transform function. - */ - ret = H5Pget_data_transform((hid_t)*plist_id, c_expression, c_expression_len); - if(ret < 0) return ret_value; - /* or strlen ? */ - HD5packFstring(c_expression, _fcdtocp(expression), c_expression_len-1); - - *size = (size_t_f)ret; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_data_transform_c - * Purpose: Calls H5Pset_data_transform - * Inputs: - * prp_id - property list identifier to query - * expression - buffer to hold transform expression - * expression_len - buffer size transorm expression - * - * Output: - * - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 19, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len) -{ - int_f ret_value = -1; /* Return value */ - char* c_expression = NULL; /* Buffer to hold C string */ - herr_t ret; - /* - * Convert FORTRAN name to C name - */ - if(NULL == (c_expression = HD5f2cstring(expression, (size_t)*expression_len))) - return ret_value; - /* - * Call h5pset_data_transform function. - */ - ret = H5Pset_data_transform((hid_t)*plist_id, c_expression); - if(ret<0) return ret_value; - - ret_value = 0; - if(c_expression) - HDfree(c_expression); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_local_heap_size_hint_c - * Purpose: Calls H5Pget_local_heap_size_hint - * Inputs: - * gcpl_id - Group creation property list identifier - * - * Output: - * size_hint - Hint for size of local heap - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) -{ - int_f ret_value = -1; /* Return value */ - size_t c_size_hint; - herr_t ret; - /* - * Call H5Pget_local_heap_size_hint function. - */ - ret = H5Pget_local_heap_size_hint((hid_t)*gcpl_id, &c_size_hint); - if(ret<0) return ret_value; - - *size_hint = (size_t_f)c_size_hint; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_est_link_info_c - * Purpose: Calls H5Pget_est_link_info - * Inputs: - * gcpl_id - Group creation property list identifier - * - * Output: - * est_num_entries - Estimated number of links to be inserted into group - * est_name_len - Estimated average length of link names - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) -{ - int_f ret_value = -1; /* Return value */ - unsigned c_est_num_entries; - unsigned c_est_name_len; - herr_t ret; - /* - * Call h5pget_est_link_info function. - */ - ret = H5Pget_est_link_info((hid_t)*gcpl_id, &c_est_num_entries, &c_est_name_len); - if(ret<0) return ret_value; - - *est_num_entries = (int_f)c_est_num_entries; - *est_name_len = (int_f)c_est_name_len; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_local_heap_size_hint_c - * Purpose: Calls H5Pset_local_heap_size_hint - * Inputs: - * gcpl_id - Group creation property list identifier - * size_hint - Hint for size of local heap - * - * Output: - * - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) -{ - int_f ret_value = -1; /* Return value */ - herr_t ret; - /* - * Call H5Pget_local_heap_size_hint function. - */ - ret = H5Pset_local_heap_size_hint((hid_t)*gcpl_id, (size_t)*size_hint); - if(ret<0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_est_link_info_c - * Purpose: Calls H5Pset_est_link_info - * Inputs: - * gcpl_id - Group creation property list identifier - * est_num_entries - Estimated number of links to be inserted into group - * est_name_len - Estimated average length of link names - * - * Output: - * Returns: - * Success: 0 - * Failure: -1 - * - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) -{ - int_f ret_value = -1; /* Return value */ - herr_t ret; - /* - * Call h5pset_est_link_info function. - */ - ret = H5Pset_est_link_info((hid_t)*gcpl_id, (unsigned)*est_num_entries, (unsigned)*est_name_len); - if(ret<0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_link_phase_change_c - * Purpose: Calls H5Pset_link_phase_change - * - * Inputs: gcpl_id - Group creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage - * Outputs - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pset_link_phase_change function. - */ - ret = H5Pset_link_phase_change((hid_t)*gcpl_id, (unsigned)*max_compact,(unsigned)*min_dense); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_direct_c - * Purpose: Calls H5Pset_fapl_direct - * - * Inputs: - * fapl_id - File access property list identifier - * alignment - Required memory alignment boundary - * block_size - File system block size - * cbuf_size - Copy buffer size - * Outputs - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pset_link_phase_change function. - */ -#ifdef H5_HAVE_DIRECT - ret = H5Pset_fapl_direct((hid_t)*fapl_id, (size_t)*alignment, (size_t)*block_size, (size_t)*cbuf_size ); - if (ret < 0) return ret_value; - - ret_value = 0; - -#endif - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_direct_c - * Purpose: Calls H5Pget_fapl_direct - * - * Inputs: - * fapl_id - File access property list identifier - * Outputs: - * alignment - Required memory alignment boundary - * block_size - File system block size - * cbuf_size - Copy buffer size - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ) -{ - int ret_value = -1; - herr_t ret; - size_t c_alignment; - size_t c_block_size; - size_t c_cbuf_size; - - /* - * Call H5Pget_link_phase_change function. - */ -#ifdef H5_HAVE_DIRECT - ret = H5Pget_fapl_direct((hid_t)*fapl_id, &c_alignment, &c_block_size, &c_cbuf_size ); - if (ret < 0) return ret_value; - - *alignment = (size_t_f)c_alignment; - *block_size = (size_t_f)c_block_size; - *cbuf_size = (size_t_f)c_cbuf_size; - - ret_value = 0; -#endif - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_attr_phase_change_c - * Purpose: Calls H5Pset_attr_phase_change - * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) -{ - int ret_value = -1; - herr_t ret; - /* - * Call H5Pset_attr_phase_change function. - */ - ret = H5Pset_attr_phase_change((hid_t)*ocpl_id, (unsigned)*max_compact,(unsigned)*min_dense); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_nbit_c - * Purpose: Calls H5Pset_nbit - * - * Inputs: plist_id - Dataset creation property list identifier - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_nbit_c(hid_t_f *plist_id ) -{ - int ret_value = -1; - herr_t ret; - /* - * Call H5Pset_nbit_change function. - */ - ret = H5Pset_nbit((hid_t)*plist_id); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} -/*---------------------------------------------------------------------------- - * Name: h5pset_scaleoffset_c - * Purpose: Calls H5Pset_scaleoffset - * - * Inputs: - * plist_id - Dataset creation property list identifier - * scale_type - Flag indicating compression method. - * scale_factor - Parameter related to scale. - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ) -{ - int ret_value = -1; - H5Z_SO_scale_type_t c_scale_type; - herr_t ret; - /* - * Call H5Pset_scaleoffset_change function. - */ - c_scale_type = (H5Z_SO_scale_type_t)*scale_type; - - ret = H5Pset_scaleoffset((hid_t)*plist_id, c_scale_type, (int)*scale_factor); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pset_nlinks - * Purpose: Calls H5Pset_nlinks - * - * Inputs: - * lapl_id - File access property list identifier - * nlinks - Maximum number of links to traverse - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 24, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) -{ - int ret_value = -1; - herr_t ret; - /* - * Call H5Pset_nlinks function. - */ - ret = H5Pset_nlinks((hid_t)*lapl_id, (size_t)*nlinks); - if (ret < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_nlinks - * Purpose: Calls H5Pget_nlinks - * - * Inputs: - * lapl_id - File access property list identifier - * - * Outputs: - * nlinks - Maximum number of links to traverse - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 24, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) -{ - int ret_value = -1; - herr_t ret; - size_t c_nlinks; - /* - * Call H5Pget_nlinks function. - */ - ret = H5Pget_nlinks((hid_t)*lapl_id, &c_nlinks); - if (ret < 0) return ret_value; - - *nlinks = (size_t_f)c_nlinks; - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5pget_create_inter_group_c - * Purpose: Calls H5Pget_create_intermediate_group - * - * Inputs: - * lcpl_id - Link creation property list identifier - * crt_intermed_group - Specifying whether to create intermediate groups upon - * the creation of an object - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 4, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) -{ - int ret_value = -1; - herr_t ret; - - /* - * Call H5Pget_create_intermediate_group function. - */ - ret = H5Pget_create_intermediate_group((hid_t)*lcpl_id, (unsigned)*crt_intermed_group); - - if (ret < 0) return ret_value; /* error occurred */ - ret_value = 0; - return ret_value; -} diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index ed935e9..1c1fb90 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -1943,7 +1943,7 @@ hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) backing_store =.FALSE. - IF (backing_store_flag .EQ. 1) backing_store =.TRUE. + if (backing_store_flag .eq. 1) backing_store =.TRUE. END SUBROUTINE h5pget_fapl_core_f !---------------------------------------------------------------------- @@ -4665,18 +4665,19 @@ !---------------------------------------------------------------------- ! Name: h5pget_class_name_f ! -! Purpose: Queries the name of a class. +! Purpose: Queries the ithe name of a class. ! ! Inputs: ! prp_id - property list identifier to query ! Outputs: ! name - name of a class -! size - Actual length of the class name -! If provided buffer "name" is smaller, -! than name will be truncated to fit into -! provided user buffer -! hdferr: - error code -! Success: 0 +! hdferr: - error code +! +! Success: Actual lenght of the class name +! If provided buffer "name" is +! smaller, than name will be +! truncated to fit into +! provided user buffer ! Failure: -1 ! Optional parameters: ! NONE @@ -4684,12 +4685,12 @@ ! Programmer: Elena Pourmal ! October 9, 2002 ! -! Modifications: Returned the size of name as an argument +! Modifications: ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) + SUBROUTINE h5pget_class_name_f(prp_id, name, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) @@ -4698,9 +4699,7 @@ ! IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name - - INTEGER, INTENT(OUT) :: size ! Actual length of the class name + CHARACTER(LEN=*), INTENT(INOUT) :: name ! Buffer to retireve class name INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: name_len @@ -4716,13 +4715,8 @@ INTEGER, INTENT(IN) :: name_len END FUNCTION h5pget_class_name_c END INTERFACE - name_len = LEN(name) - size = h5pget_class_name_c(prp_id, name, name_len) - - hdferr = 0 - IF(size.LT.0) hdferr = -1 - + hdferr = h5pget_class_name_c(prp_id, name , name_len) END SUBROUTINE h5pget_class_name_f !---------------------------------------------------------------------- @@ -6393,1764 +6387,4 @@ hdferr = h5premove_filter_c(prp_id, filter) END SUBROUTINE h5premove_filter_f -!---------------------------------------------------------------------- -! Name: H5Pget_attr_phase_change_f -! -! Purpose: Retrieves attribute storage phase change thresholds -! -! Inputs: -! ocpl_id - Object (dataset or group) creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_attr_phase_change_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - !(Default: 8) - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_PHASE_CHANGE_C'::h5pget_attr_phase_change_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(OUT) :: max_compact - INTEGER, INTENT(OUT) :: min_dense - - END FUNCTION h5pget_attr_phase_change_c - END INTERFACE - - hdferr = h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) - END SUBROUTINE h5pget_attr_phase_change_f - -!---------------------------------------------------------------------- -! Name: H5Pset_attr_creation_order_f -! -! Purpose: Sets tracking and indexing of attribute creation order -! -! Inputs: -! ocpl_id - Object creation property list identifier -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_attr_creation_order_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(IN) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order - - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_CREATION_ORDER_C'::h5pset_attr_creation_order_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(IN) :: crt_order_flags - - END FUNCTION H5Pset_attr_creation_order_c - END INTERFACE - - hdferr = H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) - END SUBROUTINE h5pset_attr_creation_order_f - - -!---------------------------------------------------------------------- -! Name: H5Pset_shared_mesg_nindexes_f -! -! Purpose: Sets number of shared object header message indexes -! -! Inputs: -! plist_id - file creation property list -! nindexes - Number of shared object header message indexes to be available in files created with this property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_shared_mesg_nindexes_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! file creation property list - INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes - ! available in files created WITH this property list - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_shared_mesg_nindexes_c(plist_id, nindexes) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_NINDEXES_C'::h5pset_shared_mesg_nindexes_c - !DEC$ ENDIF - - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: nindexes - - END FUNCTION H5pset_shared_mesg_nindexes_c - END INTERFACE - - hdferr = h5pset_shared_mesg_nindexes_c(plist_id, nindexes) - - END SUBROUTINE h5pset_shared_mesg_nindexes_f - -!---------------------------------------------------------------------- -! Name: H5Pset_shared_mesg_index_f -! -! Purpose: Configures the specified shared object header message index -! -! Inputs: -! fcpl_id - File creation property list identifier. -! index_num - Index being configured. -! mesg_type_flags - Types of messages that should be stored in this index. -! min_mesg_size - Minimum message size. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_shared_mesg_index_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list - INTEGER, INTENT(IN) :: index_num ! Index being configured. - INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index. - INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SHARED_MESG_INDEX_C'::h5pset_shared_mesg_index_c - !DEC$ ENDIF - - INTEGER(HID_T), INTENT(IN) :: fcpl_id - INTEGER, INTENT(IN) :: index_num - INTEGER, INTENT(IN) :: mesg_type_flags - INTEGER, INTENT(IN) :: min_mesg_size - - END FUNCTION H5pset_shared_mesg_index_c - END INTERFACE - - hdferr = h5pset_shared_mesg_index_c(fcpl_id, index_num, mesg_type_flags, min_mesg_size) - - END SUBROUTINE h5pset_shared_mesg_index_f - -!---------------------------------------------------------------------- -! Name: H5Pget_attr_creation_order_f -! -! Purpose: Retrieves tracking and indexing settings for attribute creation order -! -! Inputs: -! ocpl_id - Object (group or dataset) creation property list identifier -! -! Outputs: -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_attr_creation_order_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_ATTR_CREATION_ORDER_C'::h5pget_attr_creation_order_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(OUT) :: crt_order_flags - - END FUNCTION H5pget_attr_creation_order_c - END INTERFACE - - hdferr = h5pget_attr_creation_order_c(ocpl_id, crt_order_flags) - - END SUBROUTINE h5pget_attr_creation_order_f - -!---------------------------------------------------------------------- -! Name: H5Pset_libver_bounds_f -! -! Purpose: Sets bounds on library versions, and indirectly format versions, to be used when creating objects. -! -! Inputs: -! fapl_id - File access property list identifier -! low - The earliest version of the library that will be used for writing objects. -! high - The latest version of the library that will be used for writing objects. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 18, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_libver_bounds_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(HID_T), INTENT(IN) :: low ! The earliest version of the library that will be used for writing objects. - ! Currently, low must be one of two pre-defined values: - ! HDF_LIBVER_EARLIEST_F - ! HDF_LIBVER_LATEST_F - INTEGER(HID_T), INTENT(IN) :: high ! The latest version of the library that will be used for writing objects. - ! Currently, low must set to the pre-defined value: - ! HDF_LIBVER_LATEST_F - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_libver_bounds_c(fapl_id, low, high) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LIBVER_BOUNDS_C'::h5pset_libver_bounds_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER(HID_T), INTENT(IN) :: low - INTEGER(HID_T), INTENT(IN) :: high - - END FUNCTION H5pset_libver_bounds_c - END INTERFACE - - hdferr = h5pset_libver_bounds_c(fapl_id, low, high) - - END SUBROUTINE h5pset_libver_bounds_f - -!---------------------------------------------------------------------- -! Name: H5Pset_link_creation_order_f -! -! Purpose: Sets creation order tracking and indexing for links in a group. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! crt_order_flags - Creation order flag(s) -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 18, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_libver_bounds_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier - INTEGER(HID_T), INTENT(IN) :: crt_order_flags ! Creation order flag(s) - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_link_creation_order_c(gcpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_CREATION_ORDER_C'::h5pset_link_creation_order_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER(HID_T), INTENT(IN) :: crt_order_flags - - END FUNCTION H5pset_link_creation_order_c - END INTERFACE - - hdferr = h5pset_link_creation_order_c(gcpl_id, crt_order_flags) - - END SUBROUTINE h5pset_link_creation_order_f - -!---------------------------------------------------------------------- -! Name: H5Pget_link_phase_change_f -! -! Purpose: Queries the settings for conversion between compact and dense groups. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 20, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_link_phase_change_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_PHASE_CHANGE_C'::h5pget_link_phase_change_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: max_compact - INTEGER, INTENT(OUT) :: min_dense - - END FUNCTION h5pget_link_phase_change_c - END INTERFACE - - hdferr = h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) - END SUBROUTINE h5pget_link_phase_change_f - -!---------------------------------------------------------------------- -! Name: H5Pget_obj_track_times_f -! -! Purpose: Returns whether times are tracked for an object. -! -! Inputs: -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 22, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_obj_track_times_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(OUT) :: flag ! Object timestamp setting - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: status -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_obj_track_times_c(plist_id, status) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_OBJ_TRACK_TIMES_C'::h5pget_obj_track_times_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier - INTEGER, INTENT(OUT) :: status - END FUNCTION h5pget_obj_track_times_c - END INTERFACE - flag = .TRUE. - hdferr = h5pget_obj_track_times_c(plist_id, status) - IF(status.EQ.0) flag = .FALSE. - - END SUBROUTINE h5pget_obj_track_times_f - -!---------------------------------------------------------------------- -! Name: H5Pset_obj_track_times_f -! -! Purpose: Set whether the birth, access, modification & change times for -! an object are stored. -! -! Birth time is the time the object was created. Access time is -! the last time that metadata or raw data was read from this -! object. Modification time is the last time the data for -! this object was changed (either writing raw data to a dataset -! or inserting/modifying/deleting a link in a group). Change -! time is the last time the metadata for this object was written -! (adding/modifying/deleting an attribute on an object, extending -! the size of a dataset, etc). -! -! If these times are not tracked, they will be reported as -! 12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX -! epoch) when queried. -! -! Inputs: -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 22, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_obj_track_times_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(IN) :: flag ! Object timestamp setting - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: status -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_obj_track_times_c(plist_id, status) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_OBJ_TRACK_TIMES_C'::h5pset_obj_track_times_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier - INTEGER, INTENT(IN) :: status - END FUNCTION h5pset_obj_track_times_c - END INTERFACE - - status = 0 - IF(flag) status = 1 - - hdferr = h5pset_obj_track_times_c(plist_id, status) - - END SUBROUTINE h5pset_obj_track_times_f - -!---------------------------------------------------------------------- -! Name: H5Pset_create_inter_group_f -! -! Purpose: Specifies in property list whether to create missing intermediate groups. -! -! Inputs: -! lcpl_id - Link creation property list identifier -! crt_intermed_group - crt_intermed_group specifying whether -! to create intermediate groups upon the creation -! of an object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 22, 2008 -! -! Modifications: -! -! Comment: The long subroutine name (>31) on older f90 compilers causes problems -! so had to shorten the name -!-------------------------------------------------------------------------------------- - - SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_create_inter_group_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER, INTENT(IN) :: crt_intermed_group ! specifying whether to create intermediate groups - ! upon the creation of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CREATE_INTER_GROUP_C'::h5pset_create_inter_group_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: lcpl_id - INTEGER(HID_T), INTENT(IN) :: crt_intermed_group - END FUNCTION h5pset_create_inter_group_c - END INTERFACE - - hdferr = h5pset_create_inter_group_c(lcpl_id, crt_intermed_group) - - END SUBROUTINE h5pset_create_inter_group_f - -!---------------------------------------------------------------------- -! Name: H5Pget_link_creation_order_f -! -! Purpose: Queries whether link creation order is tracked and/or indexed in a group. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! -! Outputs: -! crt_order_flags - Creation order flag(s) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_link_creation_order_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s) - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_link_creation_order_c(gcpl_id, crt_order_flags) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LINK_CREATION_ORDER_C'::h5pget_link_creation_order_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: crt_order_flags - - END FUNCTION H5pget_link_creation_order_c - END INTERFACE - - hdferr = h5pget_link_creation_order_c(gcpl_id, crt_order_flags) - - END SUBROUTINE h5pget_link_creation_order_f - -!---------------------------------------------------------------------- -! Name: H5Pset_char_encoding -! -! Purpose: Sets the character encoding used to encode a string. -! -! Inputs: -! plist_id - Property list identifier -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_attr_creation_order_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - - INTEGER, INTENT(IN) :: encoding ! String encoding character set: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_char_encoding_c(plist_id, encoding) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_CHAR_ENCODING_C'::h5pset_char_encoding_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: encoding - - END FUNCTION H5pset_char_encoding_c - END INTERFACE - - hdferr = h5pset_char_encoding_c(plist_id, encoding) - - END SUBROUTINE h5pset_char_encoding_f - -!---------------------------------------------------------------------- -! Name: H5Pget_char_encoding -! -! Purpose: Retrieves the character encoding used to create a string -! -! Inputs: -! plist_id - Property list identifier -! -! Outputs: -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_char_encoding_f(plist_id, encoding, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_char_encoding_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - - INTEGER, INTENT(OUT) :: encoding ! Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_char_encoding_c(plist_id, encoding) - - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CHAR_ENCODING_C'::h5pget_char_encoding_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: encoding - - END FUNCTION H5pget_char_encoding_c - END INTERFACE - - hdferr = h5pget_char_encoding_c(plist_id, encoding) - - END SUBROUTINE h5pget_char_encoding_f - -!---------------------------------------------------------------------- -! Name: h5pset_copy_object_f -! -! Purpose: Sets properties to be used when an object is copied. -! -! Inputs: -! ocp_plist_id - Object copy property list identifier -! copy_options - Copy option(s) to be set -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_copy_object_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier - INTEGER, INTENT(IN) :: copy_options ! Copy option(s) to be set, valid options are: - ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F - ! H5O_COPY_EXPAND_EXT_LINK_F - ! H5O_COPY_EXPAND_REFERENCE_F - ! H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_copy_object_c(ocp_plist_id, copy_options) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_COPY_OBJECT_C'::h5pset_copy_object_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id - INTEGER, INTENT(IN) :: copy_options - END FUNCTION h5pset_copy_object_c - END INTERFACE - hdferr = h5pset_copy_object_c(ocp_plist_id, copy_options) - END SUBROUTINE h5pset_copy_object_f - -!---------------------------------------------------------------------- -! Name: h5pget_copy_object_f -! -! Purpose: Retrieves the properties to be used when an object is copied. -! -! Inputs: -! ocp_plist_id - Object copy property list identifier -! Outputs: -! copy_options - Copy option(s) to be get -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 3, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_copy_object_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier - INTEGER, INTENT(OUT) :: copy_options ! valid copy options returned are: - ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F - ! H5O_COPY_EXPAND_EXT_LINK_F - ! H5O_COPY_EXPAND_REFERENCE_F - ! H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_copy_object_c(ocp_plist_id, copy_options) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_COPY_OBJECT_C'::h5pget_copy_object_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocp_plist_id - INTEGER, INTENT(OUT) :: copy_options - END FUNCTION h5pget_copy_object_c - END INTERFACE - hdferr = h5pget_copy_object_c(ocp_plist_id, copy_options) - END SUBROUTINE h5pget_copy_object_f - -!---------------------------------------------------------------------- -! Name: h5pget_data_transform_f -! -! Purpose: Retrieves a data transform expression. -! -! Inputs: -! plist_id - Identifier of the property list or class -! Outputs: -! expression - buffer to hold transform expression -! hdferr - error code -! Success: Actual lenght of the expression -! If provided buffer "expression" is -! smaller, than expression will be -! truncated to fit into -! provided user buffer -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 19, 2008 -! -! Modifications: -! -! Comment: Should hdferr return just 0 or 1 and add another arguement for the size? -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_data_transform_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(OUT) :: expression ! Buffer to hold transform expression - - INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! registered size of the transform expression - - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: expression_len - INTEGER(SIZE_T) :: size_default - - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_data_transform_c(plist_id, expression, expression_len, size_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_DATA_TRANSFORM_C'::h5pget_data_transform_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - CHARACTER(LEN=*), INTENT(OUT) :: expression - INTEGER(SIZE_T) :: size_default - INTEGER :: expression_len - END FUNCTION h5pget_data_transform_c - END INTERFACE - - size_default = 0 - expression_len = LEN(expression) - - hdferr = h5pget_data_transform_c(plist_id, expression, expression_len, size_default) - - IF(present(size)) size = size_default - - END SUBROUTINE h5pget_data_transform_f - -!---------------------------------------------------------------------- -! Name: h5pset_data_transform_f -! -! Purpose: Sets a data transform expression. -! -! Inputs: -! plist_id - Identifier of the property list or class -! expression - buffer to hold transform expression -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 19, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_data_transform_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: expression_len - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_data_transform_c(plist_id, expression, expression_len) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_DATA_TRANSFORM_C'::h5pset_data_transform_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - CHARACTER(LEN=*), INTENT(IN) :: expression - INTEGER :: expression_len - END FUNCTION h5pset_data_transform_c - END INTERFACE - - expression_len = LEN(expression) - hdferr = h5pset_data_transform_c(plist_id, expression, expression_len) - - END SUBROUTINE h5pset_data_transform_f - -!---------------------------------------------------------------------- -! Name: H5Pget_local_heap_size_hint_f -! -! Purpose: Queries the local heap size hint for original-style groups. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! size_hint - Hint for size of local heap -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_local_heap_size_hint_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pget_local_heap_size_hint_c(gcpl_id, size_hint) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_LOCAL_HEAP_SIZE_HINT_C'::h5pget_local_heap_size_hint_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER(SIZE_T), INTENT(OUT) :: size_hint - END FUNCTION H5Pget_local_heap_size_hint_c - END INTERFACE - - hdferr = H5Pget_local_heap_size_hint_c(gcpl_id, size_hint) - - END SUBROUTINE H5Pget_local_heap_size_hint_f - -!---------------------------------------------------------------------- -! Name: H5Pget_est_link_info_f -! -! Purpose: Queries data required to estimate required local heap or object header size. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_est_link_info_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group - INTEGER, INTENT(OUT) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_EST_LINK_INFO_C'::h5pget_est_link_info_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(OUT) :: est_num_entries - INTEGER, INTENT(OUT) :: est_name_len - END FUNCTION H5Pget_est_link_info_c - END INTERFACE - - hdferr = H5Pget_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - - END SUBROUTINE H5Pget_est_link_info_f - -!---------------------------------------------------------------------- -! Name: H5Pset_local_heap_size_hint_f -! -! Purpose: Sets the local heap size hint for original-style groups. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! size_hint - Hint for size of local heap -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_local_heap_size_hint_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_local_heap_size_hint_c(gcpl_id, size_hint) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LOCAL_HEAP_SIZE_HINT_C'::h5pset_local_heap_size_hint_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER(SIZE_T), INTENT(IN) :: size_hint - END FUNCTION H5Pset_local_heap_size_hint_c - END INTERFACE - - hdferr = H5Pset_local_heap_size_hint_c(gcpl_id, size_hint) - - END SUBROUTINE H5Pset_local_heap_size_hint_f - -!---------------------------------------------------------------------- -! Name: H5Pset_est_link_info_f -! -! Purpose: Sets estimated number of links and length of link names in a group. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_est_link_info_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group - INTEGER, INTENT(IN) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_EST_LINK_INFO_C'::h5pset_est_link_info_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(IN) :: est_num_entries - INTEGER, INTENT(IN) :: est_name_len - END FUNCTION H5Pset_est_link_info_c - END INTERFACE - - hdferr = H5Pset_est_link_info_c(gcpl_id, est_num_entries, est_name_len) - - END SUBROUTINE H5Pset_est_link_info_f - -!---------------------------------------------------------------------- -! Name: H5Pset_link_phase_change_f -! -! Purpose: Sets the parameters for conversion between compact and dense groups. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_link_phase_change_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_LINK_PHASE_CHANGE_C'::h5pset_link_phase_change_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: gcpl_id - INTEGER, INTENT(IN) :: max_compact - INTEGER, INTENT(IN) :: min_dense - - END FUNCTION h5pset_link_phase_change_c - END INTERFACE - - hdferr = h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) - END SUBROUTINE h5pset_link_phase_change_f - -!---------------------------------------------------------------------- -! Name: H5Pset_fapl_direct_f -! -! Purpose: Sets up use of the direct I/O driver. -! -! Inputs: -! fapl_id - File access property list identifier -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_fapl_direct_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(IN) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_DIRECT_C'::h5pset_fapl_direct_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER(SIZE_T), INTENT(IN) :: alignment - INTEGER(SIZE_T), INTENT(IN) :: block_size - INTEGER(SIZE_T), INTENT(IN) :: cbuf_size - END FUNCTION H5Pset_fapl_direct_c - END INTERFACE - - hdferr = H5Pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - END SUBROUTINE H5Pset_fapl_direct_f - -!---------------------------------------------------------------------- -! Name: H5Pget_fapl_direct_f -! -! Purpose: Gets up use of the direct I/O driver. -! -! Inputs: -! fapl_id - File access property list identifier -! Outputs: -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_fapl_direct_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_DIRECT_C'::h5pget_fapl_direct_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER(SIZE_T), INTENT(OUT) :: alignment - INTEGER(SIZE_T), INTENT(OUT) :: block_size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size - END FUNCTION H5Pget_fapl_direct_c - END INTERFACE - - hdferr = H5Pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) - END SUBROUTINE H5Pget_fapl_direct_f - -!---------------------------------------------------------------------- -! Name: H5Pset_attr_phase_change_f -! -! Purpose: Sets attribute storage phase change thresholds. -! -! Inputs: -! ocpl_id - Object (dataset or group) creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_attr_phase_change_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - !(Default: 8) - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_ATTR_PHASE_CHANGE_C'::h5pset_attr_phase_change_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: ocpl_id - INTEGER, INTENT(IN) :: max_compact - INTEGER, INTENT(IN) :: min_dense - - END FUNCTION h5pset_attr_phase_change_c - END INTERFACE - - hdferr = h5pset_attr_phase_change_c(ocpl_id, max_compact, min_dense) - - - END SUBROUTINE h5pset_attr_phase_change_f - -!---------------------------------------------------------------------- -! Name: H5Pset_nbit_f -! -! Purpose: Sets up the use of the N-Bit filter. -! -! Inputs: -! plist_id - Dataset creation property list identifier. -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pset_nbit_f(plist_id, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_nbit_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_nbit_c(plist_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_NBIT_C'::h5pset_nbit_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - END FUNCTION H5Pset_nbit_c - END INTERFACE - - hdferr = H5Pset_nbit_c(plist_id) - - END SUBROUTINE H5Pset_nbit_f - -!---------------------------------------------------------------------- -! Name: H5Pset_scaleoffset_f -! -! Purpose: Sets up the use of the Scale-Offset filter. -! -! Inputs: -! plist_id - Dataset creation property list identifier. -! scale_type - Flag indicating compression method. -! scale_factor - Parameter related to scale. -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE H5Pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_scaleoffset_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(IN) :: scale_type ! Flag indicating compression method. - INTEGER, INTENT(IN) :: scale_factor ! parameter related to scale. - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION H5Pset_scaleoffset_c(plist_id, scale_type, scale_factor) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_SCALEOFFSET_C'::h5pset_scaleoffset_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: scale_type - INTEGER, INTENT(IN) :: scale_factor - END FUNCTION H5Pset_scaleoffset_c - END INTERFACE - - hdferr = H5Pset_scaleoffset_c(plist_id, scale_type, scale_factor) - - END SUBROUTINE H5Pset_scaleoffset_f - -!---------------------------------------------------------------------- -! Name: h5pset_nlinks_f -! -! Purpose: Sets maximum number of soft or user-defined link traversals. -! -! Inputs: -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse -! -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 24, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pset_nlinks_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pset_nlinks_c(lapl_id, nlinks) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PSET_NLINKS_C'::h5pset_nlinks_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: lapl_id - INTEGER(SIZE_T), INTENT(IN) :: nlinks - END FUNCTION h5pset_nlinks_c - END INTERFACE - - hdferr = h5pset_nlinks_c(lapl_id, nlinks) - - END SUBROUTINE h5pset_nlinks_f - -!---------------------------------------------------------------------- -! Name: h5pget_nlinks_f -! -! Purpose: Gets maximum number of soft or user-defined link traversals. -! -! Inputs: -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse -! -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 24, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_nlinks_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5pget_nlinks_c(lapl_id, nlinks) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_NLINKS_C'::h5pget_nlinks_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: lapl_id - INTEGER(SIZE_T), INTENT(OUT) :: nlinks - END FUNCTION h5pget_nlinks_c - END INTERFACE - - hdferr = h5pget_nlinks_c(lapl_id, nlinks) - - END SUBROUTINE h5pget_nlinks_f - -!---------------------------------------------------------------------- -! Name: H5Pget_create_inter_group_f -! -! Purpose: Determines whether property is set to enable creating missing intermediate groups. -! -! Inputs: -! lcpl_id - Link creation property list identifier -! crt_intermed_group - Specifying whether to create intermediate groups upon -! the creation of an object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 4, 2008 -! -! Modifications: -! -! Comment: The long subroutine name (>31) on older f90 compilers causes problems -! so had to shorten the name -!-------------------------------------------------------------------------------------- - - SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5pget_create_inter_group_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier - INTEGER, INTENT(IN) :: crt_intermed_group ! Flag specifying whether to create intermediate groups - ! upon creation of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5PGET_CREATE_INTER_GROUP_C'::h5pget_create_inter_group_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: lcpl_id - INTEGER(HID_T), INTENT(IN) :: crt_intermed_group - END FUNCTION h5pget_create_inter_group_c - END INTERFACE - - hdferr = h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) - - END SUBROUTINE h5pget_create_inter_group_f - - -END MODULE H5P - + END MODULE H5P diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 299f6bd..4430e1a 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -239,102 +239,3 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5rget_name_object_c - * Purpose: Call H5Rget_name for an object - * Inputs: - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * Outputs: name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 31, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -{ - hobj_ref_t ref_c; - int_f ret_value = -1; - ssize_t c_size; - size_t c_bufsize; - char *c_buf= NULL; /* Buffer to hold C string */ - - ref_c = *ref; - - c_bufsize = (size_t)*name_len+1; - /* - * Allocate buffer to hold name of an attribute - */ - if ((c_buf = HDmalloc(c_bufsize)) == NULL) - return ret_value; - - /* - * Call H5Rget_name function. - */ - if((c_size=H5Rget_name((hid_t)*loc_id, H5R_OBJECT, &ref_c, c_buf, c_bufsize)) < 0) - return ret_value; - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1); - - *size_default = (size_t_f)c_size; - ret_value = 0; - if(c_buf) HDfree(c_buf); - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5rget_name_region_c - * Purpose: Call H5Rget_name for a dataset region - * Inputs: - * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. - * ref - An object or dataset region reference. - * - * Outputs: name - A name associated with the referenced object or dataset region. - * size - The size of the name buffer. - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 31, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) -{ - hdset_reg_ref_t ref_c; - int_f ret_value = -1; - ssize_t c_size; - size_t c_bufsize; - char *c_buf= NULL; /* Buffer to hold C string */ - - HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); - - c_bufsize = (size_t)*name_len+1; - /* - * Allocate buffer to hold name of an attribute - */ - if ((c_buf = HDmalloc(c_bufsize)) == NULL) - return ret_value; - - /* - * Call H5Rget_name function. - */ - if((c_size=H5Rget_name((hid_t)*loc_id, H5R_DATASET_REGION, &ref_c, c_buf, c_bufsize)) < 0) - return ret_value; - /* - * Convert C name to FORTRAN and place it in the given buffer - */ - HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1); - - *size_default = (size_t_f)c_size; - ret_value = 0; - if(c_buf) HDfree(c_buf); - - return ret_value; -} diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index a4f4a65..6400f43 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -58,12 +58,6 @@ END INTERFACE - INTERFACE h5rget_name_f - - MODULE PROCEDURE h5rget_name_object_f - MODULE PROCEDURE h5rget_name_region_f - - END INTERFACE CONTAINS @@ -249,6 +243,7 @@ INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: ref_type ! Reference type INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference ! INTEGER, EXTERNAL :: h5h5rdereference_object_c @@ -314,6 +309,7 @@ INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: ref_type ! Reference type INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference ! INTEGER, EXTERNAL :: h5rdereference_region_c @@ -332,6 +328,7 @@ END FUNCTION h5rdereference_region_c END INTERFACE + ref_type = H5R_DATASET_REGION_F ref_f = ref%ref hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) @@ -478,146 +475,4 @@ END SUBROUTINE h5rget_object_type_obj_f -!---------------------------------------------------------------------- -! Name: h5rget_name_object_f -! -! Purpose: Retrieves a name of a referenced object. -! -! Inputs: -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! size - The size of the name buffer. -! -! Programmer: M.S. Breitenfeld -! March 28, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5rget_name_object_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - - INTERFACE - INTEGER FUNCTION h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_OBJECT_C':: h5rget_name_object_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(HADDR_T) :: ref_f - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_object_c - END INTERFACE - - name_len=LEN(name) - - ref_f = ref%ref - hdferr = h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_object_f - -!---------------------------------------------------------------------- -! Name: h5rget_name_region_f -! -! Purpose: Retrieves a name of a dataset region. -! -! Inputs: -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! size - The size of the name buffer. -! -! Programmer: M.S. Breitenfeld -! March 28, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5rget_name_region_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len - - INTERFACE - INTEGER FUNCTION h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_REGION_C':: h5rget_name_region_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER :: ref_f(REF_REG_BUF_LEN) - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_region_c - END INTERFACE - - name_len=LEN(name) - - ref_f = ref%ref - hdferr = h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_region_f - -END MODULE H5R + END MODULE H5R diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index c33e7e6..0a4bd40 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -1027,127 +1027,3 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sdecode_c - * Purpose: Call H5Sdecode - * Inputs: - * buf - Buffer for the data space object to be decoded. - * Outputs: - * obj_id - Object_id (non-negative) - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 26, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5sdecode_c ( _fcd buf, int_f *obj_id ) -{ - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - hid_t c_obj_id; - - /* - * Call H5Sdecode function. - */ - - c_buf = (unsigned char*)buf; - - c_obj_id = H5Sdecode(c_buf); - if(c_obj_id < 0) - return ret_value; - - *obj_id = (int_f)c_obj_id; - ret_value = 0; - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5sencode_c - * Purpose: Call H5Sencode - * Inputs: - * obj_id - Identifier of the object to be encoded. - * buf - Buffer for the object to be encoded into. - * nalloc - The size of the allocated buffer. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 26, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) -{ - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - size_t c_size; - - /* return just the size of the allocated buffer; - * equivalent to C routine for which 'name' is set equal to NULL - */ - - if (*nalloc == 0) { - - if(H5Sencode((hid_t)*obj_id, c_buf, &c_size) < 0) - return ret_value; - - *nalloc = (size_t_f)c_size; - - ret_value = 0; - return ret_value; - } - - c_size = (size_t)*nalloc; - /* - * Allocate buffer - */ - if ((c_buf = HDmalloc(c_size)) == NULL) - return ret_value; - /* - * Call H5Sencode function. - */ - if(H5Sencode((hid_t)*obj_id, c_buf, &c_size) < 0){ - return ret_value; - } - - /* copy the C buffer to the FORTRAN buffer. - * Can not use HD5packFstring because we don't want to - * eliminate the NUL terminator or pad remaining space - * with blanks. - */ - - HDmemcpy(_fcdtocp(buf),(char *)c_buf,c_size); - - ret_value = 0; - if(c_buf) HDfree(c_buf); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5sextent_equal_c - * Purpose: Call H5Sextent_equal - * Inputs: - * space1_id - First dataspace identifier. - * space2_id - Second dataspace identifier. - * Outputs: - * equal - TRUE if equal, FALSE if unequal. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 4, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) -{ - int ret_value = -1; - - if( (*c_equal = (hid_t_f)H5Sextent_equal((hid_t)*space1_id, (hid_t)*space2_id)) < 0) - return ret_value; - - ret_value = 0; - return ret_value; -} - diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index 9e1367d..a4780c1 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -1942,170 +1942,4 @@ END SUBROUTINE h5sget_select_type_f -!---------------------------------------------------------------------- -! Name: H5Sdecode_f -! -! Purpose: Decode a binary object description of data space and return a new object handle. -! -! Inputs: -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Optional parameters: - NONE -! -! Programmer: M.S. Breitenfeld -! March 26, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5sdecode_f(buf, obj_id, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5sdecode_f -!DEC$endif -! - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. - INTEGER, INTENT(OUT) :: obj_id ! Object ID - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5sdecode_c(buf, obj_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SDECODE_C'::h5sdecode_c - !DEC$ ENDIF - CHARACTER(LEN=*), INTENT(IN) :: buf - INTEGER, INTENT(OUT) :: obj_id ! Object ID - END FUNCTION h5sdecode_c - END INTERFACE - - hdferr = h5sdecode_c(buf, obj_id) - - END SUBROUTINE h5sdecode_f - -!---------------------------------------------------------------------- -! Name: H5Sencode_f -! -! Purpose: Encode a data space object description into a binary buffer. -! -! Inputs: -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! Outputs: -! nalloc - The size of the buffer needed. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Optional parameters: - NONE -! -! Programmer: M.S. Breitenfeld -! March 26, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5sencode_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - - INTERFACE - INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SENCODE_C'::h5sencode_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc - END FUNCTION h5sencode_c - END INTERFACE - - hdferr = h5sencode_c(buf, obj_id, nalloc) - - END SUBROUTINE h5sencode_f - - -!---------------------------------------------------------------------- -! Name: h5sextent_equal_f -! -! Purpose: Determines whether two dataspace extents are equal. -! -! Inputs: -! space1_id - First dataspace identifier. -! space2_id - Second dataspace identifier. -! Outputs: -! Equal - .TRUE. if equal, .FALSE. if unequal. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 2, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5sextent_equal_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier. - INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier. - LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: c_equal - - INTERFACE - INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_EQUAL_C'::h5sextent_equal_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: space1_id - INTEGER(HID_T), INTENT(IN) :: space2_id - INTEGER(HID_T) :: c_equal - END FUNCTION h5sextent_equal_c - END INTERFACE - - hdferr = h5sextent_equal_c(space1_id, space2_id, c_equal) - - - equal = .FALSE. - IF(c_equal.GT.0) equal = .TRUE. - - - END SUBROUTINE h5sextent_equal_f - -END MODULE H5S + END MODULE H5S diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 0ad0bc9..7c3befc 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -24,7 +24,6 @@ * Inputs: loc_id - file or group identifier * name - name of the datatype within file or group * namelen - name length - * tapl_id - datatype access property list identifier * Outputs: type_id - dataset identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -32,7 +31,7 @@ * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) +nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) { char *c_name = NULL; hid_t c_type_id; @@ -47,7 +46,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_ /* * Call H5Topen2 function. */ - if((c_type_id = H5Topen2((hid_t)*loc_id, c_name, (hid_t)*tapl_id)) < 0) + if((c_type_id = H5Topen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0) goto done; *type_id = (hid_t_f)c_type_id; @@ -68,19 +67,13 @@ done: * name - name of the datatype within file or group * namelen - name length * type_id - dataset identifier - * lcpl_id - Link creation property list - * tcpl_id - Datatype creation property list - * tapl_id - Datatype access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: - * - Added passing optional parameters for version 1.8 - * M.S. Breitenfeld *---------------------------------------------------------------------------*/ int_f -nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, - hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) +nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) { char *c_name = NULL; int ret_value = -1; @@ -90,7 +83,7 @@ nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, goto done; /* Call H5Tcommit2 function */ - if(H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*lcpl_id, (hid_t)*tcpl_id, (hid_t)*tapl_id) < 0) + if(H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) goto done; ret_value = 0; @@ -1641,202 +1634,3 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ) *class = (int_f)c_class; return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5tcommit_anon_c - * Purpose: Call H5Tcommit_anon - * Inputs: loc_id - file or group identifier - * dtype_id - dataset identifier - * tcpl_id - Datatype creation property list - * tapl_id - Datatype access property list - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 25, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, - hid_t_f *tcpl_id, hid_t_f *tapl_id) -{ - int ret_value = -1; - - /* Call H5Tcommit_anon function */ - if(H5Tcommit_anon((hid_t)*loc_id, (hid_t)*dtype_id, (hid_t)*tcpl_id, (hid_t)*tapl_id) < 0) - goto done; - - ret_value = 0; - - done: - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5tcommitted_c - * Purpose: Call H5Tcommitted - * dtype_id - dataset identifier - * Returns: a positive value, for TRUE, if the datatype has been committed, - * or 0 (zero), for FALSE, if the datatype has not been committed. - * Otherwise returns a negative value. - * Programmer: M.S. Breitenfeld - * February 25, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5tcommitted_c(hid_t_f *dtype_id) -{ - int_f ret_value; - - /* Call H5Tcommitted function */ - - ret_value=(int_f)H5Tcommitted((hid_t)*dtype_id); - - return ret_value; - -} - -/*---------------------------------------------------------------------------- - * Name: h5tdecode_c - * Purpose: Call H5Tdecode - * Inputs: - * buf - Buffer for the data space object to be decoded. - * Outputs: - * obj_id - Object_id (non-negative) - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5tdecode_c ( _fcd buf, int_f *obj_id ) -{ - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - hid_t c_obj_id; - - /* - * Call H5Tdecode function. - */ - - c_buf = (unsigned char*)buf; - - c_obj_id = H5Tdecode(c_buf); - if(c_obj_id < 0) - return ret_value; - - *obj_id = (int_f)c_obj_id; - ret_value = 0; - - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5tencode_c - * Purpose: Call H5Tencode - * Inputs: - * obj_id - Identifier of the object to be encoded. - * buf - Buffer for the object to be encoded into. - * nalloc - The size of the allocated buffer. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) -{ - int ret_value = -1; - unsigned char *c_buf = NULL; /* Buffer to hold C string */ - size_t c_size; - - /* return just the size of the allocated buffer; - * equivalent to C routine for which 'name' is set equal to NULL - */ - - if (*nalloc == 0) { - - if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0) - return ret_value; - - *nalloc = (size_t_f)c_size; - - ret_value = 0; - return ret_value; - } - - c_size = (size_t)*nalloc; - /* - * Allocate buffer - */ - if ((c_buf = HDmalloc(c_size)) == NULL) - return ret_value; - /* - * Call H5Tencode function. - */ - if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0){ - return ret_value; - } - - /* copy the C buffer to the FORTRAN buffer. - * Can not use HD5packFstring because we don't want to - * eliminate the NUL terminator or pad remaining space - * with blanks. - */ - - HDmemcpy(_fcdtocp(buf),(char *)c_buf,c_size); - - ret_value = 0; - if(c_buf) HDfree(c_buf); - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5tget_create_plist_c - * Purpose: Call H5Tget_create_plist - * Inputs: dtype_id - Datatype identifier - * Outputs: dtpl_id - Datatype property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ - -int_f -nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) -{ - int_f ret_value=-1; /* Return value */ - - if ((*dtpl_id = (hid_t_f)H5Tget_create_plist((hid_t)*dtype_id)) < 0) - return ret_value; - - ret_value = 0; - return ret_value; -} - -/*---------------------------------------------------------------------------- - * Name: h5tcompiler_conv_c - * Purpose: Call H5Tcompiler_conv - * Inputs: - * src_id - Identifier for the source datatype. - * dst_id - Identifier for the destination datatype. - * Outputs: c_flag - flag; TRUE for compiler conversion, FALSE for library conversion - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - -int_f -nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) -{ - int ret_value = -1; - htri_t status; - - status = H5Tcompiler_conv( (hid_t)*src_id , (hid_t)*dst_id); - if ( status < 0 ) return ret_value; - *c_flag = (int_f)status; - ret_value = 0; - return ret_value; -} diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index dee6990..ee5bb77 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -16,11 +16,11 @@ ! ! This file contains FORTRAN90 interfaces for H5T functions ! -MODULE H5T + MODULE H5T - USE H5GLOBAL + USE H5GLOBAL -CONTAINS + CONTAINS !---------------------------------------------------------------------- ! Name: h5topen_f @@ -36,62 +36,53 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! tapl_id - datatype access property list identifier. +! NONE ! ! Programmer: Elena Pourmal ! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Added optional parameter 'tapl_id' for compatability -! with H5Topen2. April 9, 2009. +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id) + SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5topen_f !DEC$endif ! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Datatype name within file or group - INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! datatype access property list identifier + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name + ! Datatype name within file or group + INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: namelen ! Name length - INTEGER :: namelen ! Name length - INTEGER(HID_T) :: tapl_id_default -! +! INTEGER, EXTERNAL :: h5topen_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TOPEN_C'::h5topen_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(OUT) :: type_id - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5topen_c - END INTERFACE - - namelen = LEN(name) - - tapl_id_default = H5P_DEFAULT_F - IF(PRESENT(tapl_id)) tapl_id_default = tapl_id - - hdferr = h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) - END SUBROUTINE h5topen_f + INTERFACE + INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TOPEN_C'::h5topen_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference ::name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(OUT) :: type_id + END FUNCTION h5topen_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5topen_c(loc_id, name, namelen, type_id) + END SUBROUTINE h5topen_f !---------------------------------------------------------------------- ! Name: h5tcommit_f @@ -109,84 +100,53 @@ CONTAINS ! Success: 0 ! Failure: -1 ! Optional parameters: -! lcpl_id - Link creation property list -! tcpl_id - Datatype creation property list -! tapl_id - Datatype access property list +! NONE ! ! Programmer: Elena Pourmal ! August 12, 1999 ! -! Modifications: - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! - Added optional parameters introduced in version 1.8 -! M.S. Breitenfeld -! -! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, & - lcpl_id, tcpl_id, tapl_id ) + SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5tcommit_f !DEC$endif ! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Datatype name within file or group - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list - - - INTEGER :: namelen ! Name length - - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: namelen ! Name length +! INTEGER, EXTERNAL :: h5tcommit_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id, & - lcpl_id_default, tcpl_id_default, tapl_id_default ) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_C'::h5tcommit_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5tcommit_c - END INTERFACE - - lcpl_id_default = H5P_DEFAULT_F - tcpl_id_default = H5P_DEFAULT_F - tapl_id_default = H5P_DEFAULT_F - - IF (PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - IF (PRESENT(tcpl_id)) tcpl_id_default = tcpl_id - IF (PRESENT(tapl_id)) tapl_id_default = tapl_id - - namelen = LEN(name) - - hdferr = h5tcommit_c(loc_id, name, namelen, type_id, & - lcpl_id_default, tcpl_id_default, tapl_id_default ) - - END SUBROUTINE h5tcommit_f + INTERFACE + INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_C'::h5tcommit_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference ::name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: type_id + END FUNCTION h5tcommit_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5tcommit_c(loc_id, name, namelen, type_id) + END SUBROUTINE h5tcommit_f !---------------------------------------------------------------------- ! Name: h5tcopy_f @@ -3289,357 +3249,4 @@ CONTAINS END SUBROUTINE h5tget_member_class_f !---------------------------------------------------------------------- -! Name: h5tcommit_anon_f -! -! Purpose: Commits a transient datatype to a file, -! creating a new named datatype, -! but does not link it into the file structure. -! -! Inputs: -! loc_id - A file or group identifier specifying the file -! in which the new named datatype is to be created. -! dtype_id - A datatype identifier. -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! tcpl_id - A datatype creation property list identifier. -! (H5P_DEFAULT_F for the default property list.) -! tapl_id - A datatype access property list identifier. -! should always be passed as the value H5P_DEFAULT_F. -! -! Programmer: M.S. Breitenfeld -! February 25, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tcommit_anon_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! A file or group identifier specifying - ! the file in which the new named datatype - ! is to be created. - INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! A datatype creation property - ! list identifier. - ! (H5P_DEFAULT_F for the default property list.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! A datatype access property list identifier. - ! should always be passed as the value H5P_DEFAULT_F. - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5tcommit_anon_c(loc_id, dtype_id, & - tcpl_id_default, tapl_id_default) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMIT_ANON_C'::h5tcommit_anon_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER(HID_T) :: tcpl_id_default - INTEGER(HID_T) :: tapl_id_default - END FUNCTION h5tcommit_anon_c - END INTERFACE - - tcpl_id_default = H5P_DEFAULT_F - tapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(tcpl_id)) tcpl_id_default = tcpl_id - IF(PRESENT(tapl_id)) tapl_id_default = tapl_id - - hdferr = h5tcommit_anon_c(loc_id, dtype_id, & - tcpl_id_default, tapl_id_default ) - - END SUBROUTINE h5tcommit_anon_f - -!---------------------------------------------------------------------- -! Name: h5tcommitted_f -! -! Purpose: Determines whether a datatype is a named type or a transient type. -! -! Inputs: -! dtype_id - A datatype identifier. -! -! Outputs: -! committed - .TRUE., if the datatype has been committed -! .FALSE., if the datatype has not been committed. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: None -! -! Programmer: M.S. Breitenfeld -! February 25, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tcommitted_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id ! A datatype identifier - LOGICAL, INTENT(OUT) :: committed ! .TRUE., if the datatype has been committed - !.FALSE., if the datatype has not been committed. - INTEGER, INTENT(OUT) :: hdferr ! Error code: -! Success: 0 -! Failure: -1 - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5tcommitted_c(dtype_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMMITTED_C'::h5tcommitted_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference ::name - INTEGER(HID_T), INTENT(IN) :: dtype_id - END FUNCTION h5tcommitted_c - END INTERFACE - - hdferr = h5tcommitted_c(dtype_id) - - IF(hdferr.GT.0)THEN - committed = .TRUE. - hdferr = 0 - ELSE IF(hdferr.EQ.0)THEN - committed = .FALSE. - hdferr = 0 - ELSE - hdferr = -1 - ENDIF - - - END SUBROUTINE h5tcommitted_f - -!---------------------------------------------------------------------- -! Name: H5Tdecode_f -! -! Purpose: Decode a binary object description of data type and return a new object handle. -! Inputs: -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Optional parameters: - NONE -! -! Programmer: M.S. Breitenfeld -! April 9, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tdecode_f(buf, obj_id, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tdecode_f -!DEC$endif -! - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. - INTEGER, INTENT(OUT) :: obj_id ! Object ID - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTERFACE - INTEGER FUNCTION h5tdecode_c(buf, obj_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TDECODE_C'::h5tdecode_c - !DEC$ ENDIF - CHARACTER(LEN=*), INTENT(IN) :: buf - INTEGER, INTENT(OUT) :: obj_id ! Object ID - END FUNCTION h5tdecode_c - END INTERFACE - - hdferr = h5tdecode_c(buf, obj_id) - - END SUBROUTINE h5tdecode_f - -!---------------------------------------------------------------------- -! Name: H5Tencode_f -! -! Purpose: Encode a data type object description into a binary buffer. -! -! Inputs: -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! Outputs: -! nalloc - The size of the buffer needed. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Optional parameters: - NONE -! -! Programmer: M.S. Breitenfeld -! April 9, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr) -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tencode_f -!DEC$endif -! - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - - INTERFACE - INTEGER FUNCTION h5tencode_c(buf, obj_id, nalloc) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TENCODE_C'::h5tencode_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc - END FUNCTION h5tencode_c - END INTERFACE - - hdferr = h5tencode_c(buf, obj_id, nalloc) - - END SUBROUTINE h5tencode_f - -!---------------------------------------------------------------------- -! Name: h5tget_create_plist_f -! -! Purpose: Returns a copy of a datatype creation property list. -! -! Inputs: -! dtype_id - Datatype identifier -! Outputs: -! dtpl_id - Datatype property list identifier -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 9, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tget_create_plist_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier - INTEGER(HID_T), INTENT(OUT) :: dtpl_id ! Datatype property list identifier. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5tget_create_plist_c(dtype_id, dtpl_id) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TGET_CREATE_PLIST_C'::h5tget_create_plist_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: dtype_id - INTEGER(HID_T), INTENT(OUT) :: dtpl_id - END FUNCTION h5tget_create_plist_c - END INTERFACE - - hdferr = h5tget_create_plist_c(dtype_id, dtpl_id) - END SUBROUTINE h5tget_create_plist_f - -!---------------------------------------------------------------------- -! Name: h5tcompiler_conv_f -! -! Purpose: Check whether the library’s default conversion is hard conversion.R -! -! Inputs: -! src_id - Identifier for the source datatype. -! dst_id - Identifier for the destination datatype. -! Outputs: -! flag - TRUE for compiler conversion, FALSE for library conversion -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 9, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - - SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr) -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: h5tcompiler_conv_f -!DEC$endif - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_id ! Identifier for the source datatype. - INTEGER(HID_T), INTENT(IN) :: dst_id ! Identifier for the destination datatype. - LOGICAL, INTENT(OUT) :: flag ! .TRUE. for compiler conversion, .FALSE. for library conversion - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER :: c_flag - - INTERFACE - INTEGER FUNCTION h5tcompiler_conv_c(src_id, dst_id, c_flag) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5TCOMPILER_CONV_C'::h5tcompiler_conv_c - !DEC$ ENDIF - INTEGER(HID_T), INTENT(IN) :: src_id - INTEGER(HID_T), INTENT(IN) :: dst_id - INTEGER :: c_flag - END FUNCTION h5tcompiler_conv_c - END INTERFACE - - hdferr = h5tcompiler_conv_c(src_id, dst_id, c_flag) - - flag = .FALSE. - IF(c_flag .GT. 0) flag = .TRUE. - - END SUBROUTINE h5tcompiler_conv_f - -END MODULE H5T + END MODULE H5T diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 77240b2..a9ac279 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -215,310 +215,213 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * Added more FD flags and new H5LIB flags * Added more FD flags for HDF5 file driver * EIP, April 9, 2005 - * Added Generic flags introduced in version 1.8 - * MSB, January, 2008 - * Added types in lines h5*_flags = ( )variable to match input *---------------------------------------------------------------------------*/ int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, - int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, + int_f *h5g_flags, int_f *h5i_flags, hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, - int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags) + int_f *h5t_flags, int_f *h5z_flags) { int ret_value = -1; /* * H5D flags */ - h5d_flags[0] = (int_f)H5D_COMPACT; - h5d_flags[1] = (int_f)H5D_CONTIGUOUS; - h5d_flags[2] = (int_f)H5D_CHUNKED; - h5d_flags[3] = (int_f)H5D_ALLOC_TIME_ERROR; - h5d_flags[4] = (int_f)H5D_ALLOC_TIME_DEFAULT; - h5d_flags[5] = (int_f)H5D_ALLOC_TIME_EARLY; - h5d_flags[6] = (int_f)H5D_ALLOC_TIME_LATE; - h5d_flags[7] = (int_f)H5D_ALLOC_TIME_INCR; - h5d_flags[8] = (int_f)H5D_SPACE_STATUS_ERROR; - h5d_flags[9] = (int_f)H5D_SPACE_STATUS_NOT_ALLOCATED; - h5d_flags[10] = (int_f)H5D_SPACE_STATUS_PART_ALLOCATED; - h5d_flags[11] = (int_f)H5D_SPACE_STATUS_ALLOCATED; - h5d_flags[12] = (int_f)H5D_FILL_TIME_ERROR; - h5d_flags[13] = (int_f)H5D_FILL_TIME_ALLOC; - h5d_flags[14] = (int_f)H5D_FILL_TIME_NEVER; - h5d_flags[15] = (int_f)H5D_FILL_VALUE_ERROR; - h5d_flags[16] = (int_f)H5D_FILL_VALUE_UNDEFINED; - h5d_flags[17] = (int_f)H5D_FILL_VALUE_DEFAULT; - h5d_flags[18] = (int_f)H5D_FILL_VALUE_USER_DEFINED; + h5d_flags[0] = H5D_COMPACT; + h5d_flags[1] = H5D_CONTIGUOUS; + h5d_flags[2] = H5D_CHUNKED; + h5d_flags[3] = H5D_ALLOC_TIME_ERROR; + h5d_flags[4] = H5D_ALLOC_TIME_DEFAULT; + h5d_flags[5] = H5D_ALLOC_TIME_EARLY; + h5d_flags[6] = H5D_ALLOC_TIME_LATE; + h5d_flags[7] = H5D_ALLOC_TIME_INCR; + h5d_flags[8] = H5D_SPACE_STATUS_ERROR; + h5d_flags[9] = H5D_SPACE_STATUS_NOT_ALLOCATED; + h5d_flags[10] = H5D_SPACE_STATUS_PART_ALLOCATED; + h5d_flags[11] = H5D_SPACE_STATUS_ALLOCATED; + h5d_flags[12] = H5D_FILL_TIME_ERROR; + h5d_flags[13] = H5D_FILL_TIME_ALLOC; + h5d_flags[14] = H5D_FILL_TIME_NEVER; + h5d_flags[15] = H5D_FILL_VALUE_ERROR; + h5d_flags[16] = H5D_FILL_VALUE_UNDEFINED; + h5d_flags[17] = H5D_FILL_VALUE_DEFAULT; + h5d_flags[18] = H5D_FILL_VALUE_USER_DEFINED; /* * H5F flags */ - h5f_flags[0] = (int_f)H5F_ACC_RDWR; - h5f_flags[1] = (int_f)H5F_ACC_RDONLY; - h5f_flags[2] = (int_f)H5F_ACC_TRUNC; - h5f_flags[3] = (int_f)H5F_ACC_EXCL; - h5f_flags[4] = (int_f)H5F_ACC_DEBUG; - h5f_flags[5] = (int_f)H5F_SCOPE_LOCAL; - h5f_flags[6] = (int_f)H5F_SCOPE_GLOBAL; - h5f_flags[7] = (int_f)H5F_CLOSE_DEFAULT; - h5f_flags[8] = (int_f)H5F_CLOSE_WEAK; - h5f_flags[9] = (int_f)H5F_CLOSE_SEMI; - h5f_flags[10] = (int_f)H5F_CLOSE_STRONG; - h5f_flags[11] = (int_f)H5F_OBJ_FILE; - h5f_flags[12] = (int_f)H5F_OBJ_DATASET; - h5f_flags[13] = (int_f)H5F_OBJ_GROUP; - h5f_flags[14] = (int_f)H5F_OBJ_DATATYPE; - h5f_flags[15] = (int_f)H5F_OBJ_ALL; - h5f_flags[16] = (int_f)H5F_LIBVER_EARLIEST; - h5f_flags[17] = (int_f)H5F_LIBVER_LATEST; - + h5f_flags[0] = (int_f)H5F_ACC_RDWR; + h5f_flags[1] = (int_f)H5F_ACC_RDONLY; + h5f_flags[2] = (int_f)H5F_ACC_TRUNC; + h5f_flags[3] = (int_f)H5F_ACC_EXCL; + h5f_flags[4] = (int_f)H5F_ACC_DEBUG; + h5f_flags[5] = (int_f)H5F_SCOPE_LOCAL; + h5f_flags[6] = (int_f)H5F_SCOPE_GLOBAL; + h5f_flags[7] = (int_f)H5F_CLOSE_DEFAULT; + h5f_flags[8] = (int_f)H5F_CLOSE_WEAK; + h5f_flags[9] = (int_f)H5F_CLOSE_SEMI; + h5f_flags[10] = (int_f)H5F_CLOSE_STRONG; + h5f_flags[11] = (int_f)H5F_OBJ_FILE; + h5f_flags[12] = (int_f)H5F_OBJ_DATASET; + h5f_flags[13] = (int_f)H5F_OBJ_GROUP; + h5f_flags[14] = (int_f)H5F_OBJ_DATATYPE; + h5f_flags[15] = (int_f)H5F_OBJ_ALL; + /* * H5FD flags */ - h5fd_flags[0] = (int_f)H5FD_MPIO_INDEPENDENT; - h5fd_flags[1] = (int_f)H5FD_MPIO_COLLECTIVE; - h5fd_flags[2] = (int_f)H5FD_MEM_NOLIST; - h5fd_flags[3] = (int_f)H5FD_MEM_DEFAULT; - h5fd_flags[4] = (int_f)H5FD_MEM_SUPER; - h5fd_flags[5] = (int_f)H5FD_MEM_BTREE; - h5fd_flags[6] = (int_f)H5FD_MEM_DRAW; - h5fd_flags[7] = (int_f)H5FD_MEM_GHEAP; - h5fd_flags[8] = (int_f)H5FD_MEM_LHEAP; - h5fd_flags[9] = (int_f)H5FD_MEM_OHDR; - h5fd_flags[10] = (int_f)H5FD_MEM_NTYPES; + h5fd_flags[0] = H5FD_MPIO_INDEPENDENT; + h5fd_flags[1] = H5FD_MPIO_COLLECTIVE; + h5fd_flags[2] = H5FD_MEM_NOLIST; + h5fd_flags[3] = H5FD_MEM_DEFAULT; + h5fd_flags[4] = H5FD_MEM_SUPER; + h5fd_flags[5] = H5FD_MEM_BTREE; + h5fd_flags[6] = H5FD_MEM_DRAW; + h5fd_flags[7] = H5FD_MEM_GHEAP; + h5fd_flags[8] = H5FD_MEM_LHEAP; + h5fd_flags[9] = H5FD_MEM_OHDR; + h5fd_flags[10] = H5FD_MEM_NTYPES; /* * H5FD flags of type hid_t */ - h5fd_hid_flags[0] = (int_f)H5FD_CORE; - h5fd_hid_flags[1] = (int_f)H5FD_FAMILY; - h5fd_hid_flags[2] = (int_f)H5FD_LOG; - h5fd_hid_flags[3] = (int_f)H5FD_MPIO; - h5fd_hid_flags[4] = (int_f)H5FD_MULTI; - h5fd_hid_flags[5] = (int_f)H5FD_SEC2; - h5fd_hid_flags[6] = (int_f)H5FD_STDIO; + h5fd_hid_flags[0] = H5FD_CORE; + h5fd_hid_flags[1] = H5FD_FAMILY; + h5fd_hid_flags[2] = H5FD_LOG; + h5fd_hid_flags[3] = H5FD_MPIO; + h5fd_hid_flags[4] = H5FD_MULTI; + h5fd_hid_flags[5] = H5FD_SEC2; + h5fd_hid_flags[6] = H5FD_STDIO; /* * H5G flags */ - h5g_flags[0] = (int_f)H5O_TYPE_UNKNOWN; - h5g_flags[1] = (int_f)H5O_TYPE_GROUP; - h5g_flags[2] = (int_f)H5O_TYPE_DATASET; - h5g_flags[3] = (int_f)H5O_TYPE_NAMED_DATATYPE; + h5g_flags[0] = H5O_TYPE_UNKNOWN; + h5g_flags[1] = H5O_TYPE_GROUP; + h5g_flags[2] = H5O_TYPE_DATASET; + h5g_flags[3] = H5O_TYPE_NAMED_DATATYPE; /* This value can no longer be returned and all these flags should be updated * to reflect the refinements between links and objects. -QAK */ -/* h5g_flags[4] = H5G_LINK; */ - h5g_flags[5] = (int_f)H5L_TYPE_ERROR; - h5g_flags[6] = (int_f)H5L_TYPE_HARD; - h5g_flags[7] = (int_f)H5L_TYPE_SOFT; - - h5g_flags[8] = (int_f)H5G_STORAGE_TYPE_UNKNOWN; - h5g_flags[9] = (int_f)H5G_STORAGE_TYPE_SYMBOL_TABLE; - h5g_flags[10] = (int_f)H5G_STORAGE_TYPE_COMPACT; - h5g_flags[11] = (int_f)H5G_STORAGE_TYPE_DENSE; +/* h5g_flags[4] = H5G_LINK; */ + h5g_flags[5] = H5L_TYPE_ERROR; + h5g_flags[6] = H5L_TYPE_HARD; + h5g_flags[7] = H5L_TYPE_SOFT; /* * H5I flags */ - h5i_flags[0] = (int_f)H5I_FILE; - h5i_flags[1] = (int_f)H5I_GROUP; - h5i_flags[2] = (int_f)H5I_DATATYPE; - h5i_flags[3] = (int_f)H5I_DATASPACE; - h5i_flags[4] = (int_f)H5I_DATASET; - h5i_flags[5] = (int_f)H5I_ATTR; - h5i_flags[6] = (int_f)H5I_BADID; -/* - * H5L flags - */ - h5l_flags[0] = (int_f)H5L_TYPE_ERROR; - h5l_flags[1] = (int_f)H5L_TYPE_HARD; - h5l_flags[2] = (int_f)H5L_TYPE_SOFT; - h5l_flags[3] = (int_f)H5L_TYPE_EXTERNAL; - h5l_flags[4] = (int_f)H5L_SAME_LOC; /* Macro to indicate operation occurs on same location */ - h5l_flags[5] = (int_f)H5L_LINK_CLASS_T_VERS; /* Current version of the H5L_class_t struct */ - -/* - * H5O flags - */ - -/* Flags for object copy (H5Ocopy) */ - h5o_flags[0] = (int_f)H5O_COPY_SHALLOW_HIERARCHY_FLAG; /* Copy only immediate members */ - h5o_flags[1] = (int_f)H5O_COPY_EXPAND_SOFT_LINK_FLAG; /* Expand soft links into new objects */ - h5o_flags[2] = (int_f)H5O_COPY_EXPAND_EXT_LINK_FLAG; /* Expand external links into new objects */ - h5o_flags[3] = (int_f)H5O_COPY_EXPAND_REFERENCE_FLAG; /* Copy objects that are pointed by references */ - h5o_flags[4] = (int_f)H5O_COPY_WITHOUT_ATTR_FLAG; /* Copy object without copying attributes */ - h5o_flags[5] = (int_f)H5O_COPY_PRESERVE_NULL_FLAG; /* Copy NULL messages (empty space) */ - h5o_flags[6] = (int_f)H5O_COPY_ALL; /* All object copying flags (for internal checking) */ - -/* Flags for shared message indexes. - * Pass these flags in using the mesg_type_flags parameter in - * H5P_set_shared_mesg_index. - * (Developers: These flags correspond to object header message type IDs, - * but we need to assign each kind of message to a different bit so that - * one index can hold multiple types.) - */ - h5o_flags[7] = (int_f)H5O_SHMESG_NONE_FLAG; /* No shared messages */ - h5o_flags[8] = (int_f)H5O_SHMESG_SDSPACE_FLAG; /* Simple Dataspace Message. */ - h5o_flags[9] = (int_f)H5O_SHMESG_DTYPE_FLAG; /* Datatype Message. */ - h5o_flags[10] = (int_f)H5O_SHMESG_FILL_FLAG; /* Fill Value Message. */ - h5o_flags[11] = (int_f)H5O_SHMESG_PLINE_FLAG; /* Filter pipeline message. */ - h5o_flags[12] = (int_f)H5O_SHMESG_ATTR_FLAG; /* Attribute Message. */ - h5o_flags[13] = (int_f)H5O_SHMESG_ALL_FLAG; - -/* Object header status flag definitions */ - h5o_flags[14] = (int_f)H5O_HDR_CHUNK0_SIZE; /* 2-bit field indicating # of bytes to store the size of chunk 0's data */ - h5o_flags[15] = (int_f)H5O_HDR_ATTR_CRT_ORDER_TRACKED; /* Attribute creation order is tracked */ - h5o_flags[16] = (int_f)H5O_HDR_ATTR_CRT_ORDER_INDEXED; /* Attribute creation order has index */ - h5o_flags[17] = (int_f)H5O_HDR_ATTR_STORE_PHASE_CHANGE; /* Non-default attribute storage phase change values stored */ - h5o_flags[18] = (int_f)H5O_HDR_STORE_TIMES; /* Store access, modification, change & birth times for object */ - h5o_flags[19] = (int_f)H5O_HDR_ALL_FLAGS; - -/* Maximum shared message values. Number of indexes is 8 to allow room to add - * new types of messages. - */ - h5o_flags[20] = (int_f)H5O_SHMESG_MAX_NINDEXES; - h5o_flags[21] = (int_f)H5O_SHMESG_MAX_LIST_SIZE; + h5i_flags[0] = H5I_FILE; + h5i_flags[1] = H5I_GROUP; + h5i_flags[2] = H5I_DATATYPE; + h5i_flags[3] = H5I_DATASPACE; + h5i_flags[4] = H5I_DATASET; + h5i_flags[5] = H5I_ATTR; + h5i_flags[6] = H5I_BADID; /* * H5P flags */ - h5p_flags[0] = (hid_t_f)H5P_FILE_CREATE; - h5p_flags[1] = (hid_t_f)H5P_FILE_ACCESS; - h5p_flags[2] = (hid_t_f)H5P_DATASET_CREATE; - h5p_flags[3] = (hid_t_f)H5P_DATASET_XFER; - h5p_flags[4] = (hid_t_f)H5P_FILE_MOUNT; - h5p_flags[5] = (hid_t_f)H5P_DEFAULT; - h5p_flags[6] = (hid_t_f)H5P_ROOT; - h5p_flags[7] = (hid_t_f)H5P_CRT_ORDER_INDEXED; - h5p_flags[8] = (hid_t_f)H5P_CRT_ORDER_TRACKED; - h5p_flags[9] = (hid_t_f)H5P_OBJECT_CREATE; - h5p_flags[10] = (hid_t_f)H5P_DATASET_ACCESS; - h5p_flags[11] = (hid_t_f)H5P_GROUP_CREATE; - h5p_flags[12] = (hid_t_f)H5P_GROUP_ACCESS; - h5p_flags[13] = (hid_t_f)H5P_DATATYPE_CREATE; - h5p_flags[14] = (hid_t_f)H5P_DATATYPE_ACCESS; - h5p_flags[15] = (hid_t_f)H5P_STRING_CREATE; - h5p_flags[16] = (hid_t_f)H5P_ATTRIBUTE_CREATE; - h5p_flags[17] = (hid_t_f)H5P_OBJECT_COPY; - h5p_flags[18] = (hid_t_f)H5P_LINK_CREATE; - h5p_flags[19] = (hid_t_f)H5P_LINK_ACCESS; + h5p_flags[0] = H5P_FILE_CREATE; + h5p_flags[1] = H5P_FILE_ACCESS; + h5p_flags[2] = H5P_DATASET_CREATE; + h5p_flags[3] = H5P_DATASET_XFER; + h5p_flags[4] = H5P_FILE_MOUNT; + h5p_flags[5] = H5P_DEFAULT; + h5p_flags[6] = H5P_ROOT; + /* * H5R flags */ - h5r_flags[0] = (int_f)H5R_OBJECT; - h5r_flags[1] = (int_f)H5R_DATASET_REGION; + h5r_flags[0] = H5R_OBJECT; + h5r_flags[1] = H5R_DATASET_REGION; /* * H5S flags */ - h5s_flags[0] = (int_f)H5S_SCALAR; - h5s_flags[1] = (int_f)H5S_SIMPLE; - h5s_flags[2] = (int_f)H5S_NULL; - h5s_flags[3] = (int_f)H5S_SELECT_SET; - h5s_flags[4] = (int_f)H5S_SELECT_OR; + h5s_flags[0] = H5S_SCALAR; + h5s_flags[1] = H5S_SIMPLE; + h5s_flags[2] = H5S_NULL; + h5s_flags[3] = H5S_SELECT_SET; + h5s_flags[4] = H5S_SELECT_OR; h5s_flags[5] = (int_f)H5S_UNLIMITED; h5s_flags[6] = (int_f)H5S_ALL; - h5s_flags[7] = (int_f)H5S_SELECT_NOOP; - h5s_flags[8] = (int_f)H5S_SELECT_AND; - h5s_flags[9] = (int_f)H5S_SELECT_XOR; - h5s_flags[10] = (int_f)H5S_SELECT_NOTB; - h5s_flags[11] = (int_f)H5S_SELECT_NOTA; - h5s_flags[12] = (int_f)H5S_SELECT_APPEND; - h5s_flags[13] = (int_f)H5S_SELECT_PREPEND; - h5s_flags[14] = (int_f)H5S_SELECT_INVALID; + h5s_flags[7] = H5S_SELECT_NOOP; + h5s_flags[8] = H5S_SELECT_AND; + h5s_flags[9] = H5S_SELECT_XOR; + h5s_flags[10] = H5S_SELECT_NOTB; + h5s_flags[11] = H5S_SELECT_NOTA; + h5s_flags[12] = H5S_SELECT_APPEND; + h5s_flags[13] = H5S_SELECT_PREPEND; + h5s_flags[14] = H5S_SELECT_INVALID; - h5s_flags[15] = (int_f)H5S_SEL_ERROR; - h5s_flags[16] = (int_f)H5S_SEL_NONE; - h5s_flags[17] = (int_f)H5S_SEL_POINTS; - h5s_flags[18] = (int_f)H5S_SEL_HYPERSLABS; - h5s_flags[19] = (int_f)H5S_SEL_ALL; + h5s_flags[15] = H5S_SEL_ERROR; + h5s_flags[16] = H5S_SEL_NONE; + h5s_flags[17] = H5S_SEL_POINTS; + h5s_flags[18] = H5S_SEL_HYPERSLABS; + h5s_flags[19] = H5S_SEL_ALL; /* * H5T flags */ - h5t_flags[0] = (int_f)H5T_NO_CLASS; - h5t_flags[1] = (int_f)H5T_INTEGER; - h5t_flags[2] = (int_f)H5T_FLOAT; - h5t_flags[3] = (int_f)H5T_TIME; - h5t_flags[4] = (int_f)H5T_STRING; - h5t_flags[5] = (int_f)H5T_BITFIELD; - h5t_flags[6] = (int_f)H5T_OPAQUE; - h5t_flags[7] = (int_f)H5T_COMPOUND; - h5t_flags[8] = (int_f)H5T_REFERENCE; - h5t_flags[9] = (int_f)H5T_ENUM; - h5t_flags[10] = (int_f)H5T_ORDER_LE; - h5t_flags[11] = (int_f)H5T_ORDER_BE; - h5t_flags[12] = (int_f)H5T_ORDER_VAX; - h5t_flags[13] = (int_f)H5T_PAD_ZERO; - h5t_flags[14] = (int_f)H5T_PAD_ONE; - h5t_flags[15] = (int_f)H5T_PAD_BACKGROUND; - h5t_flags[16] = (int_f)H5T_PAD_ERROR; - h5t_flags[17] = (int_f)H5T_SGN_NONE; - h5t_flags[18] = (int_f)H5T_SGN_2; - h5t_flags[19] = (int_f)H5T_SGN_ERROR; - h5t_flags[20] = (int_f)H5T_NORM_IMPLIED; - h5t_flags[21] = (int_f)H5T_NORM_MSBSET; - h5t_flags[22] = (int_f)H5T_NORM_NONE; - h5t_flags[23] = (int_f)H5T_CSET_ASCII; - h5t_flags[24] = (int_f)H5T_CSET_UTF8; - h5t_flags[25] = (int_f)H5T_STR_NULLTERM; - h5t_flags[26] = (int_f)H5T_STR_NULLPAD; - h5t_flags[27] = (int_f)H5T_STR_SPACEPAD; - h5t_flags[28] = (int_f)H5T_STR_ERROR; - h5t_flags[29] = (int_f)H5T_VLEN; - h5t_flags[30] = (int_f)H5T_ARRAY; + h5t_flags[0] = H5T_NO_CLASS; + h5t_flags[1] = H5T_INTEGER; + h5t_flags[2] = H5T_FLOAT; + h5t_flags[3] = H5T_TIME; + h5t_flags[4] = H5T_STRING; + h5t_flags[5] = H5T_BITFIELD; + h5t_flags[6] = H5T_OPAQUE; + h5t_flags[7] = H5T_COMPOUND; + h5t_flags[8] = H5T_REFERENCE; + h5t_flags[9] = H5T_ENUM; + h5t_flags[10] = H5T_ORDER_LE; + h5t_flags[11] = H5T_ORDER_BE; + h5t_flags[12] = H5T_ORDER_VAX; + h5t_flags[13] = H5T_PAD_ZERO; + h5t_flags[14] = H5T_PAD_ONE; + h5t_flags[15] = H5T_PAD_BACKGROUND; + h5t_flags[16] = H5T_PAD_ERROR; + h5t_flags[17] = H5T_SGN_NONE; + h5t_flags[18] = H5T_SGN_2; + h5t_flags[19] = H5T_SGN_ERROR; + h5t_flags[20] = H5T_NORM_IMPLIED; + h5t_flags[21] = H5T_NORM_MSBSET; + h5t_flags[22] = H5T_NORM_NONE; + h5t_flags[23] = H5T_CSET_ASCII; + h5t_flags[24] = H5T_CSET_UTF8; + h5t_flags[25] = H5T_STR_NULLTERM; + h5t_flags[26] = H5T_STR_NULLPAD; + h5t_flags[27] = H5T_STR_SPACEPAD; + h5t_flags[28] = H5T_STR_ERROR; + h5t_flags[29] = H5T_VLEN; + h5t_flags[30] = H5T_ARRAY; /* * H5Z flags */ - h5z_flags[0] = (int_f)H5Z_FILTER_ERROR; - h5z_flags[1] = (int_f)H5Z_FILTER_NONE; - h5z_flags[2] = (int_f)H5Z_FILTER_DEFLATE; - h5z_flags[3] = (int_f)H5Z_FILTER_SHUFFLE; - h5z_flags[4] = (int_f)H5Z_FILTER_FLETCHER32; - h5z_flags[5] = (int_f)H5Z_ERROR_EDC; - h5z_flags[6] = (int_f)H5Z_DISABLE_EDC; - h5z_flags[7] = (int_f)H5Z_ENABLE_EDC; - h5z_flags[8] = (int_f)H5Z_NO_EDC; - h5z_flags[9] = (int_f)H5Z_FILTER_SZIP; - h5z_flags[10] = (int_f)H5Z_FLAG_OPTIONAL; - h5z_flags[11] = (int_f)H5Z_FILTER_CONFIG_ENCODE_ENABLED; - h5z_flags[12] = (int_f)H5Z_FILTER_CONFIG_DECODE_ENABLED; - h5z_flags[13] = (int_f)H5Z_FILTER_ALL; -/* - * H5A flags - */ - - -/* - * H5 Generic flags introduced in version 1.8 -MSB- - */ - - /* H5_index_t enum struct */ - - h5_generic_flags[0] = (int_f)H5_INDEX_UNKNOWN; /* Unknown index type */ - h5_generic_flags[1] = (int_f)H5_INDEX_NAME; /* Index on names */ - h5_generic_flags[2] = (int_f)H5_INDEX_CRT_ORDER; /* Index on creation order */ - h5_generic_flags[3] = (int_f)H5_INDEX_N; /* Index on creation order */ - - - /* H5_iter_order_t enum struct */ - - h5_generic_flags[4] = (int_f)H5_ITER_UNKNOWN; /* Unknown order */ - h5_generic_flags[5] = (int_f)H5_ITER_INC; /* Increasing order */ - h5_generic_flags[6] = (int_f)H5_ITER_DEC; /* Decreasing order */ - h5_generic_flags[7] = (int_f)H5_ITER_NATIVE; /* No particular order, whatever is fastest */ - h5_generic_flags[8] = (int_f)H5_ITER_N; /* Number of iteration orders */ + h5z_flags[0] = H5Z_FILTER_ERROR; + h5z_flags[1] = H5Z_FILTER_NONE; + h5z_flags[2] = H5Z_FILTER_DEFLATE; + h5z_flags[3] = H5Z_FILTER_SHUFFLE; + h5z_flags[4] = H5Z_FILTER_FLETCHER32; + h5z_flags[5] = H5Z_ERROR_EDC; + h5z_flags[6] = H5Z_DISABLE_EDC; + h5z_flags[7] = H5Z_ENABLE_EDC; + h5z_flags[8] = H5Z_NO_EDC; + h5z_flags[9] = H5Z_FILTER_SZIP; + h5z_flags[10] = H5Z_FLAG_OPTIONAL; + h5z_flags[11] = H5Z_FILTER_CONFIG_ENCODE_ENABLED; + h5z_flags[12] = H5Z_FILTER_CONFIG_DECODE_ENABLED; + h5z_flags[13] = H5Z_FILTER_ALL; ret_value = 0; return ret_value; diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index 899ce00..eeffa34 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -13,9 +13,8 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -MODULE H5LIB - -CONTAINS + MODULE H5LIB + CONTAINS !---------------------------------------------------------------------- ! Name: h5open_f ! @@ -38,18 +37,18 @@ CONTAINS ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5open_f(error) + SUBROUTINE h5open_f(error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5open_f !DEC$endif ! - USE H5GLOBAL + USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error - INTEGER :: error_0, error_1, error_2, error_3 + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error + INTEGER :: error_0, error_1, error_2, error_3 ! INTEGER, EXTERNAL :: h5init_types_c ! INTEGER, EXTERNAL :: h5init_flags_c ! INTEGER, EXTERNAL :: h5init1_flags_c @@ -58,87 +57,78 @@ CONTAINS ! ! MS FORTRAN needs explicit interfaces for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5open_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OPEN_C'::h5open_c - !DEC$ ENDIF - END FUNCTION h5open_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) - USE H5GLOBAL - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT_TYPES_C'::h5init_types_c - !DEC$ ENDIF - END FUNCTION h5init_types_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & - i_H5F_flags, & - i_H5FD_flags, & - i_H5FD_hid_flags, & - i_H5G_flags, & - i_H5I_flags, & - i_H5L_flags, & - i_H5O_flags, & - i_H5P_flags, & - i_H5R_flags, & - i_H5S_flags, & - i_H5T_flags, & - i_H5Z_flags, & - i_H5generic_flags) - USE H5GLOBAL - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) + INTERFACE + INTEGER FUNCTION h5open_c() + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5OPEN_C'::h5open_c + !DEC$ ENDIF + END FUNCTION h5open_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) + USE H5GLOBAL + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT_TYPES_C'::h5init_types_c + !DEC$ ENDIF + END FUNCTION h5init_types_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & + i_H5F_flags, & + i_H5FD_flags, & + i_H5FD_hid_flags, & + i_H5G_flags, & + i_H5I_flags, & + i_H5P_flags, & + i_H5R_flags, & + i_H5S_flags, & + i_H5T_flags, & + i_H5Z_flags) + USE H5GLOBAL + INTEGER i_H5F_flags(H5F_FLAGS_LEN) + INTEGER i_H5G_flags(H5G_FLAGS_LEN) + INTEGER i_H5D_flags(H5D_FLAGS_LEN) + INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) + INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER i_H5I_flags(H5I_FLAGS_LEN) + INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) + INTEGER i_H5R_flags(H5R_FLAGS_LEN) + INTEGER i_H5S_flags(H5S_FLAGS_LEN) + INTEGER i_H5T_flags(H5T_FLAGS_LEN) + INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT_FLAGS_C'::h5init_flags_c !DEC$ ENDIF - END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) - USE H5GLOBAL - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT1_FLAGS_C'::h5init1_flags_c - !DEC$ ENDIF - END FUNCTION h5init1_flags_c - END INTERFACE - error_0 = h5open_c() - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & - H5F_flags, & - H5FD_flags, & - H5FD_hid_flags, & - H5G_flags, & - H5I_flags, & - H5L_flags, & - H5O_flags, & - H5P_flags, & - H5R_flags, & - H5S_flags, & - H5T_flags, & - H5Z_flags, & - H5generic_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_0 + error_1 + error_2 + error_3 - END SUBROUTINE h5open_f + END FUNCTION h5init_flags_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) + USE H5GLOBAL + INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5INIT1_FLAGS_C'::h5init1_flags_c + !DEC$ ENDIF + END FUNCTION h5init1_flags_c + END INTERFACE + error_0 = h5open_c() + error_1 = h5init_types_c(predef_types, floating_types, integer_types) + error_2 = h5init_flags_c(H5D_flags, & + H5F_flags, & + H5FD_flags, & + H5FD_hid_flags, & + H5G_flags, & + H5I_flags, & + H5P_flags, & + H5R_flags, & + H5S_flags, & + H5T_flags, & + H5Z_flags) + error_3 = h5init1_flags_c(H5LIB_flags ) + error = error_0 + error_1 + error_2 + error_3 + END SUBROUTINE h5open_f !---------------------------------------------------------------------- ! Name: h5close_f @@ -163,49 +153,49 @@ CONTAINS ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5close_f(error) + SUBROUTINE h5close_f(error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5close_f !DEC$endif ! - USE H5GLOBAL + USE H5GLOBAL - IMPLICIT NONE - INTEGER :: error_1, error_2 - INTEGER, INTENT(OUT) :: error - ! INTEGER, EXTERNAL :: h5close_types_c, h5close_c - INTERFACE - INTEGER FUNCTION h5close_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_C'::h5close_c - !DEC$ ENDIF - END FUNCTION h5close_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & - f_types, F_TYPES_LEN, & - i_types, I_TYPES_LEN ) - USE H5GLOBAL - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_TYPES_C'::h5close_types_c - !DEC$ ENDIF - END FUNCTION h5close_types_c - END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & - floating_types, FLOATING_TYPES_LEN, & - integer_types, INTEGER_TYPES_LEN ) - error_2 = h5close_c() - error = error_1 + error_2 + IMPLICIT NONE + INTEGER :: error_1, error_2 + INTEGER, INTENT(OUT) :: error +! INTEGER, EXTERNAL :: h5close_types_c, h5close_c + INTERFACE + INTEGER FUNCTION h5close_c() + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_C'::h5close_c + !DEC$ ENDIF + END FUNCTION h5close_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & + f_types, F_TYPES_LEN, & + i_types, I_TYPES_LEN ) + USE H5GLOBAL + INTEGER P_TYPES_LEN + INTEGER F_TYPES_LEN + INTEGER I_TYPES_LEN + INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CLOSE_TYPES_C'::h5close_types_c + !DEC$ ENDIF + END FUNCTION h5close_types_c + END INTERFACE + error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + floating_types, FLOATING_TYPES_LEN, & + integer_types, INTEGER_TYPES_LEN ) + error_2 = h5close_c() + error = error_1 + error_2 - END SUBROUTINE h5close_f + END SUBROUTINE h5close_f !---------------------------------------------------------------------- ! Name: h5get_libversion_f @@ -229,29 +219,29 @@ CONTAINS ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error) + SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5get_libversion_f !DEC$endif ! - USE H5GLOBAL - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error - INTERFACE - INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GET_LIBVERSION_C'::h5get_libversion_c - !DEC$ ENDIF - INTEGER, INTENT(OUT) :: majnum, minnum, relnum - END FUNCTION h5get_libversion_c - END INTERFACE - - error = h5get_libversion_c(majnum, minnum, relnum) - - END SUBROUTINE h5get_libversion_f + USE H5GLOBAL + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error + INTERFACE + INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GET_LIBVERSION_C'::h5get_libversion_c + !DEC$ ENDIF + INTEGER, INTENT(OUT) :: majnum, minnum, relnum + END FUNCTION h5get_libversion_c + END INTERFACE + + error = h5get_libversion_c(majnum, minnum, relnum) + + END SUBROUTINE h5get_libversion_f !---------------------------------------------------------------------- ! Name: h5check_version_f @@ -275,30 +265,30 @@ CONTAINS ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5check_version_f(majnum, minnum, relnum, error) + SUBROUTINE h5check_version_f(majnum, minnum, relnum, error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5check_version_f !DEC$endif ! - USE H5GLOBAL - - IMPLICIT NONE - INTEGER, INTENT(IN) :: majnum, minnum, relnum - INTEGER, INTENT(OUT) :: error - INTERFACE - INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CHECK_VERSION_C'::h5check_version_c - !DEC$ ENDIF - INTEGER, INTENT(IN) :: majnum, minnum, relnum - END FUNCTION h5check_version_c - END INTERFACE - - error = h5check_version_c(majnum, minnum, relnum) - - END SUBROUTINE h5check_version_f + USE H5GLOBAL + + IMPLICIT NONE + INTEGER, INTENT(IN) :: majnum, minnum, relnum + INTEGER, INTENT(OUT) :: error + INTERFACE + INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5CHECK_VERSION_C'::h5check_version_c + !DEC$ ENDIF + INTEGER, INTENT(IN) :: majnum, minnum, relnum + END FUNCTION h5check_version_c + END INTERFACE + + error = h5check_version_c(majnum, minnum, relnum) + + END SUBROUTINE h5check_version_f !---------------------------------------------------------------------- ! Name: h5garbage_collect_f @@ -320,28 +310,28 @@ CONTAINS ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5garbage_collect_f(error) + SUBROUTINE h5garbage_collect_f(error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5garbage_collect_f !DEC$endif ! - USE H5GLOBAL - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error - INTERFACE - INTEGER FUNCTION h5garbage_collect_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GARBAGE_COLLECT_C'::h5garbage_collect_c - !DEC$ ENDIF - END FUNCTION h5garbage_collect_c - END INTERFACE - - error = h5garbage_collect_c() + USE H5GLOBAL - END SUBROUTINE h5garbage_collect_f + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error + INTERFACE + INTEGER FUNCTION h5garbage_collect_c() + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5GARBAGE_COLLECT_C'::h5garbage_collect_c + !DEC$ ENDIF + END FUNCTION h5garbage_collect_c + END INTERFACE + + error = h5garbage_collect_c() + + END SUBROUTINE h5garbage_collect_f !---------------------------------------------------------------------- ! Name: h5dont_atexit_f @@ -363,26 +353,26 @@ CONTAINS ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5dont_atexit_f(error) + SUBROUTINE h5dont_atexit_f(error) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5dont_atexit_f !DEC$endif ! - USE H5GLOBAL - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error - INTERFACE - INTEGER FUNCTION h5dont_atexit_c() - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DONT_ATEXIT_C'::h5dont_atexit_c - !DEC$ ENDIF - END FUNCTION h5dont_atexit_c - END INTERFACE - - error = h5dont_atexit_c() - - END SUBROUTINE h5dont_atexit_f -END MODULE H5LIB + USE H5GLOBAL + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error + INTERFACE + INTEGER FUNCTION h5dont_atexit_c() + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5DONT_ATEXIT_C'::h5dont_atexit_c + !DEC$ ENDIF + END FUNCTION h5dont_atexit_c + END INTERFACE + + error = h5dont_atexit_c() + + END SUBROUTINE h5dont_atexit_f + END MODULE H5LIB diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 8a8ca8e..a13d732 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -15,20 +15,19 @@ ! MODULE H5GLOBAL USE H5FORTRAN_TYPES -! ! ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. - INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - TYPE hobj_ref_t_f - INTEGER(HADDR_T) ref - END TYPE hobj_ref_t_f + TYPE hobj_ref_t_f + INTEGER(HADDR_T) ref + END TYPE - TYPE hdset_reg_ref_t_f - INTEGER ref(REF_REG_BUF_LEN) - END TYPE hdset_reg_ref_t_f + TYPE hdset_reg_ref_t_f + INTEGER ref(REF_REG_BUF_LEN) + END TYPE INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 6 ! Do not forget to change this ! value when new predefined @@ -42,32 +41,32 @@ INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 17 INTEGER(HID_T) H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE, & - H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING + H5T_NATIVE_REAL, & + H5T_NATIVE_DOUBLE, & + H5T_NATIVE_CHARACTER , & + H5T_STD_REF_OBJ, & + H5T_STD_REF_DSETREG, & + H5T_IEEE_F32BE, & + H5T_IEEE_F32LE, & + H5T_IEEE_F64BE, & + H5T_IEEE_F64LE, & + H5T_STD_I8BE, & + H5T_STD_I8LE, & + H5T_STD_I16BE, & + H5T_STD_I16LE, & + H5T_STD_I32BE, & + H5T_STD_I32LE, & + H5T_STD_I64BE, & + H5T_STD_I64LE, & + H5T_STD_U8BE, & + H5T_STD_U8LE, & + H5T_STD_U16BE, & + H5T_STD_U16LE, & + H5T_STD_U32BE, & + H5T_STD_U32LE, & + H5T_STD_U64BE, & + H5T_STD_U64LE, & + H5T_STRING INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types @@ -77,13 +76,13 @@ EQUIVALENCE (predef_types(4), H5T_NATIVE_CHARACTER) EQUIVALENCE (predef_types(5), H5T_STD_REF_OBJ) EQUIVALENCE (predef_types(6), H5T_STD_REF_DSETREG) - + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) EQUIVALENCE (integer_types(2), H5T_STD_I8LE) @@ -152,7 +151,7 @@ ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 16 INTEGER H5F_flags(H5F_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ @@ -175,8 +174,6 @@ INTEGER :: H5F_OBJ_GROUP_F INTEGER :: H5F_OBJ_DATATYPE_F INTEGER :: H5F_OBJ_ALL_F - INTEGER :: H5F_LIBVER_EARLIEST_F - INTEGER :: H5F_LIBVER_LATEST_F EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) @@ -194,43 +191,10 @@ EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) -! -! H5generic flags declaration -! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER H5generic_flags(H5generic_FLAGS_LEN) -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$ ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ -!DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 8 INTEGER H5G_flags(H5G_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ @@ -246,26 +210,16 @@ INTEGER :: H5G_LINK_ERROR_F INTEGER :: H5G_LINK_HARD_F INTEGER :: H5G_LINK_SOFT_F - INTEGER :: H5G_STORAGE_TYPE_UNKNOWN_F - INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F - INTEGER :: H5G_STORAGE_TYPE_COMPACT_F - INTEGER :: H5G_STORAGE_TYPE_DENSE_F EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) -! XXX: Fix problems with H5G_LINK_F! - QAK ! these are really H5L values -MSB- +! XXX: Fix problems with H5G_LINK_F! - QAK EQUIVALENCE(H5G_flags(5), H5G_LINK_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) -! XXX - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) + EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) + EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) + EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) ! ! H5D flags declaration ! @@ -384,6 +338,8 @@ EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) + + ! ! H5I flags declaration ! @@ -409,108 +365,24 @@ EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) EQUIVALENCE(H5I_flags(7), H5I_BADID_F) -! -! H5L flags declaration -! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$ ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ -!DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_LINK_F) - EQUIVALENCE(H5L_flags(2), H5L_LINK_ERROR_F) - EQUIVALENCE(H5L_flags(3), H5L_LINK_HARD_F) - EQUIVALENCE(H5L_flags(4), H5L_LINK_SOFT_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) -! -! H5O flags declaration -! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 22 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$ ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ -!DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! * THESE VARIABLES DO - INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE - INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER - INTEGER :: H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE - INTEGER :: H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER :: H5O_COPY_PRESERVE_NULL_FLAG_F - INTEGER :: H5O_COPY_ALL_F - INTEGER :: H5O_SHMESG_NONE_FLAG_F - INTEGER :: H5O_SHMESG_SDSPACE_FLAG_F - INTEGER :: H5O_SHMESG_DTYPE_FLAG_F - INTEGER :: H5O_SHMESG_FILL_FLAG_F - INTEGER :: H5O_SHMESG_PLINE_FLAG_F - INTEGER :: H5O_SHMESG_ATTR_FLAG_F - INTEGER :: H5O_SHMESG_ALL_FLAG_F - INTEGER :: H5O_HDR_CHUNK0_SIZE_F - INTEGER :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER - INTEGER :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE - INTEGER :: H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH * - INTEGER :: H5O_HDR_STORE_TIMES_F - INTEGER :: H5O_HDR_ALL_FLAGS_F - INTEGER :: H5O_SHMESG_MAX_NINDEXES_F - INTEGER :: H5O_SHMESG_MAX_LIST_SIZE_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORD_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDE_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 20 + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 7 INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ !DEC$endif COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F - INTEGER(HID_T) :: H5P_FILE_ACCESS_F - INTEGER(HID_T) :: H5P_DATASET_CREATE_F - INTEGER(HID_T) :: H5P_DATASET_XFER_F - INTEGER(HID_T) :: H5P_FILE_MOUNT_F - INTEGER(HID_T) :: H5P_DEFAULT_F - INTEGER(HID_T) :: H5P_ROOT_F - INTEGER(HID_T) :: H5P_CRT_ORDER_INDEXED_F - INTEGER(HID_T) :: H5P_CRT_ORDER_TRACKED_F - INTEGER(HID_T) :: H5P_OBJECT_CREATE_F - INTEGER(HID_T) :: H5P_DATASET_ACCESS_F - INTEGER(HID_T) :: H5P_GROUP_CREATE_F - INTEGER(HID_T) :: H5P_GROUP_ACCESS_F - INTEGER(HID_T) :: H5P_DATATYPE_CREATE_F - INTEGER(HID_T) :: H5P_DATATYPE_ACCESS_F - INTEGER(HID_T) :: H5P_STRING_CREATE_F - INTEGER(HID_T) :: H5P_ATTRIBUTE_CREATE_F - INTEGER(HID_T) :: H5P_OBJECT_COPY_F - INTEGER(HID_T) :: H5P_LINK_CREATE_F - INTEGER(HID_T) :: H5P_LINK_ACCESS_F + INTEGER(HID_T) :: H5P_FILE_CREATE_F + INTEGER(HID_T) :: H5P_FILE_ACCESS_F + INTEGER(HID_T) :: H5P_DATASET_CREATE_F + INTEGER(HID_T) :: H5P_DATASET_XFER_F + INTEGER(HID_T) :: H5P_FILE_MOUNT_F + INTEGER(HID_T) :: H5P_DEFAULT_F + INTEGER(HID_T) :: H5P_ROOT_F EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) @@ -519,21 +391,9 @@ EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags(9), H5P_CRT_ORDER_TRACKED_F) - EQUIVALENCE(H5P_flags(10), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(16), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(17), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(19), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(20), H5P_LINK_ACCESS_F) + ! -! H5R flags declaration +! H5P flags declaration ! INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 INTEGER H5R_flags(H5R_FLAGS_LEN) @@ -732,27 +592,11 @@ !DEC$ ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ !DEC$endif COMMON /H5LIB_FLAGS/ H5LIB_flags - INTEGER :: H5_SZIP_EC_OM_F - INTEGER :: H5_SZIP_NN_OM_F + INTEGER :: H5_SZIP_EC_OM_F + INTEGER :: H5_SZIP_NN_OM_F ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - + EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) + EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) -! General H5 flags declarations -! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) - - END MODULE H5GLOBAL + END MODULE H5GLOBAL diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 071b74a..8099ecc 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -93,9 +93,6 @@ H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); # define nh5sselect_select_c H5_FC_FUNC_(h5sselect_select_c, H5SSELECT_SELECT_C) # define nh5sget_select_type_c H5_FC_FUNC_(h5sget_select_type_c, H5SGET_SELECT_TYPE_C) # define nh5sselect_elements_c H5_FC_FUNC_(h5sselect_elements_c, H5SSELECT_ELEMENTS_C) -# define nh5sdecode_c H5_FC_FUNC_(h5sdecode_c, H5SDECODE_C) -# define nh5sencode_c H5_FC_FUNC_(h5sencode_c, H5SENCODE_C) -# define nh5sextent_equal_c H5_FC_FUNC_(h5sextent_equal_c, H5SEXTENT_EQUAL_C) H5_FCDLL int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ); H5_FCDLL int_f nh5sclose_c ( hid_t_f *space_id ); @@ -126,9 +123,6 @@ H5_FCDLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f * H5_FCDLL int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); H5_FCDLL int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); H5_FCDLL int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); -H5_FCDLL int_f nh5sdecode_c ( _fcd buf, int_f *obj_id ); -H5_FCDLL int_f nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); -H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal); /* * Functions from H5Df.c @@ -213,7 +207,7 @@ H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid # define nh5dget_space_c H5_FC_FUNC_(h5dget_space_c, H5DGET_SPACE_C) # define nh5dget_type_c H5_FC_FUNC_(h5dget_type_c, H5DGET_TYPE_C) # define nh5dget_create_plist_c H5_FC_FUNC_(h5dget_create_plist_c, H5DGET_CREATE_PLIST_C) -# define nh5dset_extent_c H5_FC_FUNC_(h5dset_extent_c, H5DSET_EXTENT_C) +# define nh5dextend_c H5_FC_FUNC_(h5dextend_c, H5DEXTEND_C) # define nh5dget_storage_size_c H5_FC_FUNC_(h5dget_storage_size_c, H5DGET_STORAGE_SIZE_C) # define nh5dvlen_get_max_len_c H5_FC_FUNC_(h5dvlen_get_max_len_c, H5DVLEN_GET_MAX_LEN_C) # define nh5dwrite_vl_integer_c H5_FC_FUNC_(h5dwrite_vl_integer_c, H5DWRITE_VL_INTEGER_C) @@ -228,13 +222,12 @@ H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid # define nh5dfill_real_c H5_FC_FUNC_(h5dfill_real_c, H5DFILL_REAL_C) # define nh5dfill_double_c H5_FC_FUNC_(h5dfill_double_c, H5DFILL_DOUBLE_C) # define nh5dget_space_status_c H5_FC_FUNC_(h5dget_space_status_c, H5DGET_SPACE_STATUS_C) -# define nh5dcreate_anon_c H5_FC_FUNC_(h5dcreate_anon_c, H5DCREATE_ANON_C) -H5_FCDLL int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, - hid_t_f *lcpl_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); -H5_FCDLL int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id); +H5_FCDLL int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id); +H5_FCDLL int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id); H5_FCDLL int_f nh5dclose_c ( hid_t_f *dset_id ); + H5_FCDLL int_f nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); H5_FCDLL int_f nh5dwrite_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); H5_FCDLL int_f nh5dwrite_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f *dims); @@ -329,7 +322,7 @@ H5_FCDLL int_f nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *m H5_FCDLL int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id); H5_FCDLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id); H5_FCDLL int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id); -H5_FCDLL int_f nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims); +H5_FCDLL int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims); H5_FCDLL int_f nh5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len); H5_FCDLL int_f nh5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size); H5_FCDLL int_f nh5dfillc_c(_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id); @@ -338,8 +331,6 @@ H5_FCDLL int_f nh5dfill_integer_c(void * fill_value, hid_t_f *fill_type_id, hid_ H5_FCDLL int_f nh5dfill_real_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); H5_FCDLL int_f nh5dfill_double_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id); H5_FCDLL int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag); -H5_FCDLL int_f nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, - hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id); /*MSB*/ /* * Functions from H5Gf.c @@ -357,16 +348,10 @@ H5_FCDLL int_f nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *sp # define nh5gget_linkval_c H5_FC_FUNC_(h5gget_linkval_c, H5GGET_LINKVAL_C) # define nh5gset_comment_c H5_FC_FUNC_(h5gset_comment_c, H5GSET_COMMENT_C) # define nh5gget_comment_c H5_FC_FUNC_(h5gget_comment_c, H5GGET_COMMENT_C) -# define nh5gcreate_anon_c H5_FC_FUNC_(h5gcreate_anon_c, H5GCREATE_ANON_C) -# define nh5gget_create_plist_c H5_FC_FUNC_(h5gget_create_plist_c, H5GGET_CREATE_PLIST_C) -# define nh5gget_info_c H5_FC_FUNC_(h5gget_info_c, H5GGET_INFO_C) -# define nh5gget_info_by_idx_c H5_FC_FUNC_(h5gget_info_by_idx_c, H5GGET_INFO_BY_IDX_C) -# define nh5gget_info_by_name_c H5_FC_FUNC_(h5gget_info_by_name_c, H5GGET_INFO_BY_NAME_C) -H5_FCDLL int_f nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, - hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id); -H5_FCDLL int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id); +H5_FCDLL int_f nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id); +H5_FCDLL int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id); H5_FCDLL int_f nh5gclose_c ( hid_t_f *grp_id ); H5_FCDLL int_f nh5gget_obj_info_idx_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type); H5_FCDLL int_f nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers); @@ -378,14 +363,6 @@ H5_FCDLL int_f nh5gmove2_c (hid_t_f *src_loc_id, _fcd src_name, int_f *src_namel H5_FCDLL int_f nh5gget_linkval_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value ); H5_FCDLL int_f nh5gset_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen); H5_FCDLL int_f nh5gget_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment); -H5_FCDLL int_f nh5gcreate_anon_c (hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id); /*MSB*/ -H5_FCDLL int_f nh5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ); /*MSB*/ -H5_FCDLL int_f nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder); /*MSB*/ -H5_FCDLL int_f nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - hid_t_f *index_type, hid_t_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder); /*MSB*/ -H5_FCDLL int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder); /*MSB*/ /* * Functions from H5Af.c @@ -467,25 +444,9 @@ H5_FCDLL int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f # define nh5aget_type_c H5_FC_FUNC_(h5aget_type_c, H5AGET_TYPE_C) # define nh5aget_num_attrs_c H5_FC_FUNC_(h5aget_num_attrs_c, H5AGET_NUM_ATTRS_C) # define nh5adelete_c H5_FC_FUNC_(h5adelete_c, H5ADELETE_C) -# define nh5aget_storage_size_c H5_FC_FUNC_(h5aget_storage_size_c, H5AGET_STORAGE_SIZE_C) /* MSB */ -# define nh5arename_by_name_c H5_FC_FUNC_(h5arename_by_name_c, H5ARENAME_BY_NAME_C) /* MSB */ -# define nh5aopen_c H5_FC_FUNC_(h5aopen_c, H5AOPEN_C) /* MSB */ -# define nh5adelete_by_name_c H5_FC_FUNC_(h5adelete_by_name_c,H5ADELETE_BY_NAME_C) /* MSB */ -# define nh5adelete_by_idx_c H5_FC_FUNC_(h5adelete_by_idx_c,H5ADELETE_BY_IDX_C) /* MSB */ -# define nh5aget_name_by_idx_c H5_FC_FUNC_(h5aget_name_by_idx_c,H5AGET_NAME_BY_IDX_C) /* MSB */ -# define nh5aget_create_plist_c H5_FC_FUNC_(h5aget_create_plist_c,H5AGET_CREATE_PLIST_C) /* MSB */ -# define nh5aopen_by_idx_c H5_FC_FUNC_(h5aopen_by_idx_c,H5AOPEN_BY_IDX_C) /* MSB */ -# define nh5aget_info_c H5_FC_FUNC_(h5aget_info_c,H5AGET_INFO_C) /* MSB */ -# define nh5aget_info_by_idx_c H5_FC_FUNC_(h5aget_info_by_idx_c,H5AGET_INFO_BY_IDX_C) /* MSB */ -# define nh5aget_info_by_name_c H5_FC_FUNC_(h5aget_info_by_name_c,H5AGET_INFO_BY_NAME_C) /* MSB */ -# define nh5aget_info_by_name_c H5_FC_FUNC_(h5aget_info_by_name_c,H5AGET_INFO_BY_NAME_C) /* MSB */ -# define nh5acreate_by_name_c H5_FC_FUNC_(h5acreate_by_name_c,H5ACREATE_BY_NAME_C) /* MSB */ -# define nh5aexists_c H5_FC_FUNC_(h5aexists_c,H5AEXISTS_C) /* MSB */ -# define nh5aexists_by_name_c H5_FC_FUNC_(h5aexists_by_name_c,H5AEXISTS_BY_NAME_C) /* MSB */ -# define nh5aopen_by_name_c H5_FC_FUNC_(h5aopen_by_name_c,H5AOPEN_BY_NAME_C) /* MSB */ -# define nh5arename_c H5_FC_FUNC_(h5arename_c,H5ARENAME_C) /* MSB */ -H5_FCDLL int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id); + +H5_FCDLL int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id); H5_FCDLL int_f nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id); H5_FCDLL int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); H5_FCDLL int_f nh5awritec_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); @@ -562,45 +523,6 @@ H5_FCDLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id); H5_FCDLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id); H5_FCDLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num); H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); -H5_FCDLL int_f nh5aget_storage_size_c ( hid_t_f *attr_id, hsize_t_f *size ); /* MSB */ -H5_FCDLL int_f nh5arename_by_name_c ( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - _fcd old_attr_name, size_t_f *old_attr_namelen, - _fcd new_attr_name, size_t_f *new_attr_namelen, - hid_t_f *lapl_id ); /* MSB */ -H5_FCDLL int_f nh5aopen_c ( hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, - hid_t_f *aapl_id, hid_t_f *attr_id); /* MSB */ -H5_FCDLL int_f nh5adelete_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id); /* MSB */ -H5_FCDLL int_f nh5adelete_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - int_f *idx_type, int_f *order, size_t_f *n, hid_t_f *lapl_id); /* MSB */ -H5_FCDLL int_f nh5aget_name_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - int_f *idx_type, int_f *order, size_t_f *n, _fcd name, - size_t_f *size, hid_t_f *lapl_id); /* MSB */ -H5_FCDLL int_f nh5aget_create_plist_c ( hid_t_f *attr_id, hid_t_f *creation_prop_id ); /* MSB */ -H5_FCDLL int_f nh5aopen_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - int_f *idx_type, int_f *order, size_t_f *n, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id); /* MSB */ -H5_FCDLL int_f nh5aget_info_c (hid_t_f *loc_id, int_f *corder_valid, int_f *corder, - int_f *cset, hsize_t_f *data_size ); /* MSB */ -H5_FCDLL int_f nh5aget_info_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - int_f *idx_type, int_f *order, size_t_f *n, hid_t_f *lapl_id, - int_f *corder_valid, int_f *corder, - int_f *cset, hsize_t_f *data_size ); /* MSB */ -H5_FCDLL int_f nh5aget_info_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, - int_f *corder_valid, int_f *corder, - int_f *cset, hsize_t_f *data_size ); /* MSB */ -H5_FCDLL int_f nh5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, - _fcd attr_name, size_t_f *attr_namelen, hid_t_f *type_id, - hid_t_f *space_id, hid_t_f *acpl_id, hid_t_f *aapl_id, - hid_t_f *lapl_id, hid_t_f *attr_id ); /* MSB */ -H5_FCDLL int_f nh5aexists_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists); /* MSB */ -H5_FCDLL int_f nh5aexists_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, - hid_t_f *lapl_id, hid_t_f *attr_exists); /* MSB */ -H5_FCDLL int_f nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, - hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id); /* MSB */ -H5_FCDLL int_f nh5arename_c( hid_t_f *loc_id, - _fcd old_attr_name, size_t_f *old_attr_namelen, - _fcd new_attr_name, size_t_f *new_attr_namelen); /* MSB */ /* * Functions form H5Tf.c file @@ -661,15 +583,11 @@ H5_FCDLL int_f nh5arename_c( hid_t_f *loc_id, # define nh5tvlen_create_c H5_FC_FUNC_(h5tvlen_create_c, H5TVLEN_CREATE_C) # define nh5tis_variable_str_c H5_FC_FUNC_(h5tis_variable_str_c, H5TIS_VARIABLE_STR_C) # define nh5tget_member_class_c H5_FC_FUNC_(h5tget_member_class_c, H5TGET_MEMBER_CLASS_C) -# define nh5tcommit_anon_c H5_FC_FUNC_(h5tcommit_anon_c, H5TCOMMIT_ANON_C) -# define nh5tdecode_c H5_FC_FUNC_(h5tdecode_c, H5TDECODE_C) -# define nh5tencode_c H5_FC_FUNC_(h5tencode_c, H5TENCODE_C) -# define nh5tget_create_plist_c H5_FC_FUNC_(h5tget_create_plist_c, H5TGET_CREATE_PLIST_C) -# define nh5tcompiler_conv_c H5_FC_FUNC_(h5tcompiler_conv_c, H5TCOMPILER_CONV_C) + H5_FCDLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id); -H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id ); -H5_FCDLL int_f nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); +H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id); +H5_FCDLL int_f nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id); H5_FCDLL int_f nh5tclose_c ( hid_t_f *type_id ); H5_FCDLL int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag); H5_FCDLL int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id); @@ -678,7 +596,7 @@ H5_FCDLL int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order); H5_FCDLL int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order); H5_FCDLL int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size); H5_FCDLL int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size); -H5_FCDLL int_f nh5tcommitted_c (hid_t_f *dtype_id); +H5_FCDLL int_f nh5tcommitted_c (hid_t_f *type_id); H5_FCDLL int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision); H5_FCDLL int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision); H5_FCDLL int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset); @@ -723,24 +641,7 @@ H5_FCDLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id); H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id); H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ); H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ); -H5_FCDLL int_f nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id); -H5_FCDLL int_f nh5tdecode_c ( _fcd buf, int_f *obj_id ); -H5_FCDLL int_f nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); -H5_FCDLL int_f nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id); -H5_FCDLL int_f nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag); - - -/* - * Functions from H5Of.c - */ - -# define nh5olink_c H5_FC_FUNC_(h5olink_c, H5OLINK_C) -# define nh5oopen_c H5_FC_FUNC_(h5oopen_c, H5OOPEN_C) - -H5_FCDLL int_f nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id); -H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id); /* * Functions from H5Pf.c */ @@ -867,37 +768,7 @@ H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, s # define nh5pset_fapl_multi_sc H5_FC_FUNC_(h5pset_fapl_multi_sc, H5PSET_FAPL_MULTI_SC) # define nh5pset_szip_c H5_FC_FUNC_(h5pset_szip_c, H5PSET_SZIP_C) # define nh5pall_filters_avail_c H5_FC_FUNC_(h5pall_filters_avail_c, H5PALL_FILTERS_AVAIL_C) -# define nh5pget_attr_phase_change_c H5_FC_FUNC_(h5pget_attr_phase_change_c, H5PGET_ATTR_PHASE_CHANGE_C) /* MSB */ -# define nh5pset_attr_creation_order_c H5_FC_FUNC_(h5pset_attr_creation_order_c, H5PSET_ATTR_CREATION_ORDER_C) /* MSB */ -# define nh5pset_shared_mesg_nindexes_c H5_FC_FUNC_(h5pset_shared_mesg_nindexes_c, H5PSET_SHARED_MESG_NINDEXES_C) /* MSB */ -# define nh5pset_shared_mesg_index_c H5_FC_FUNC_(h5pset_shared_mesg_index_c,H5PSET_SHARED_MESG_INDEX_C) /* MSB */ -# define nh5pget_attr_creation_order_c H5_FC_FUNC_(h5pget_attr_creation_order_c,H5PGET_ATTR_CREATION_ORDER_C) /* MSB */ -# define nh5pset_libver_bounds_c H5_FC_FUNC_(h5pset_libver_bounds_c,H5PSET_LIBVER_BOUNDS_C) /* MSB */ -# define nh5pset_link_creation_order_c H5_FC_FUNC_(h5pset_link_creation_order_c, H5PSET_LINK_CREATION_ORDER_C) /* MSB */ -# define nh5pget_link_phase_change_c H5_FC_FUNC_(h5pget_link_phase_change_c, H5PGET_LINK_PHASE_CHANGE_C) /* MSB */ -# define nh5pget_obj_track_times_c H5_FC_FUNC_(h5pget_obj_track_times_c, H5PGET_OBJ_TRACK_TIMES_C) /* MSB */ -# define nh5pset_obj_track_times_c H5_FC_FUNC_(h5pset_obj_track_times_c, H5PSET_OBJ_TRACK_TIMES_C) /* MSB */ -# define nh5pset_create_inter_group_c H5_FC_FUNC_(h5pset_create_inter_group_c,H5PSET_CREATE_INTER_GROUP_C) /* MSB */ -# define nh5pget_create_inter_group_c H5_FC_FUNC_(h5pget_create_inter_group_c,H5PGET_CREATE_INTER_GROUP_C) /* MSB */ -# define nh5pget_link_creation_order_c H5_FC_FUNC_(h5pget_link_creation_order_c,H5PGET_LINK_CREATION_ORDER_C) /* MSB */ -# define nh5pset_char_encoding_c H5_FC_FUNC_(h5pset_char_encoding_c, H5PSET_CHAR_ENCODING_C) /* MSB */ -# define nh5pget_char_encoding_c H5_FC_FUNC_(h5pget_char_encoding_c, H5PGET_CHAR_ENCODING_C) /* MSB */ -# define nh5pset_copy_object_c H5_FC_FUNC_(h5pset_copy_object_c, H5PSET_COPY_OBJECT_C) /* MSB */ -# define nh5pget_copy_object_c H5_FC_FUNC_(h5pget_copy_object_c, H5PGET_COPY_OBJECT_C) /* MSB */ -# define nh5pget_data_transform_c H5_FC_FUNC_(h5pget_data_transform_c, H5PGET_DATA_TRANSFORM_C) /* MSB */ -# define nh5pset_data_transform_c H5_FC_FUNC_(h5pset_data_transform_c, H5PSET_DATA_TRANSFORM_C) /* MSB */ -# define nh5pget_local_heap_size_hint_c H5_FC_FUNC_(h5pget_local_heap_size_hint_c, H5PGET_LOCAL_HEAP_SIZE_HINT_C) /* MSB */ -# define nh5pget_est_link_info_c H5_FC_FUNC_(h5pget_est_link_info_c,H5PGET_EST_LINK_INFO_C) /* MSB */ -# define nh5pset_est_link_info_c H5_FC_FUNC_(h5pset_est_link_info_c,H5PSET_EST_LINK_INFO_C) /* MSB */ -# define nh5pset_local_heap_size_hint_c H5_FC_FUNC_(h5pset_local_heap_size_hint_c, H5PSET_LOCAL_HEAP_SIZE_HINT_C) /* MSB */ -# define nh5pset_link_phase_change_c H5_FC_FUNC_(h5pset_link_phase_change_c, H5PSET_LINK_PHASE_CHANGE_C) /* MSB */ -# define nh5pset_fapl_direct_c H5_FC_FUNC_(h5pset_fapl_direct_c, H5PSET_FAPL_DIRECT_C) /* MSB */ -# define nh5pget_fapl_direct_c H5_FC_FUNC_(h5pget_fapl_direct_c, H5PGET_FAPL_DIRECT_C) /* MSB */ -# define nh5pset_attr_phase_change_c H5_FC_FUNC_(h5pset_attr_phase_change_c, H5PSET_ATTR_PHASE_CHANGE_C) /* MSB */ -# define nh5pset_nbit_c H5_FC_FUNC_(h5pset_nbit_c, H5PSET_NBIT_C) /* MSB */ -# define nh5pset_scaleoffset_c H5_FC_FUNC_(h5pset_scaleoffset_c, H5PSET_SCALEOFFSET_C) /* MSB */ -# define nh5pset_nlinks_c H5_FC_FUNC_(h5pset_nlinks_c, H5PSET_NLINKS_C) /* MSB */ -# define nh5pget_nlinks_c H5_FC_FUNC_(h5pget_nlinks_c, H5PGET_NLINKS_C) /* MSB */ + H5_FCDLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ); H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id ); @@ -1023,37 +894,7 @@ H5_FCDLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag); H5_FCDLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block); H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); H5_FCDLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag); -H5_FCDLL int_f nh5pget_attr_phase_change_c (hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); /* MSB */ -H5_FCDLL int_f nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ); /* MSB */ -H5_FCDLL int_f nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ); /* MSB */ -H5_FCDLL int_f nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size); /* MSB */ -H5_FCDLL int_f nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags); /* MSB */ -H5_FCDLL int_f nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high); /* MSB */ -H5_FCDLL int_f nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); /* MSB */ -H5_FCDLL int_f nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); /* MSB */ -H5_FCDLL int_f nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag); /* MSB */ -H5_FCDLL int_f nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag); /* MSB */ -H5_FCDLL int_f nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); /* MSB */ -H5_FCDLL int_f nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group); /* MSB */ -H5_FCDLL int_f nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags); /* MSB */ -H5_FCDLL int_f nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding); /* MSB */ -H5_FCDLL int_f nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding); /* MSB */ -H5_FCDLL int_f nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); /* MSB */ -H5_FCDLL int_f nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options); /* MSB */ -H5_FCDLL int_f nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size); /* MSB */ -H5_FCDLL int_f nh5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len); /* MSB */ -H5_FCDLL int_f nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); /* MSB */ -H5_FCDLL int_f nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); /* MSB */ -H5_FCDLL int_f nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint); /* MSB */ -H5_FCDLL int_f nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len); /* MSB */ -H5_FCDLL int_f nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ); /* MSB */ -H5_FCDLL int_f nh5pset_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); /* MSB */ -H5_FCDLL int_f nh5pget_fapl_direct_c(hid_t_f *fapl_id, size_t_f *alignment, size_t_f *block_size, size_t_f *cbuf_size ); /* MSB */ -H5_FCDLL int_f nh5pset_attr_phase_change_c (hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ); /* MSB */ -H5_FCDLL int_f nh5pset_nbit_c(hid_t_f *plist_id ); /* MSB */ -H5_FCDLL int_f nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ); /* MSB */ -H5_FCDLL int_f nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); /* MSB */ -H5_FCDLL int_f nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); /* MSB */ + /* * Functions frome H5Rf.c */ @@ -1063,8 +904,6 @@ H5_FCDLL int_f nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); /* MSB */ # define nh5rdereference_object_c H5_FC_FUNC_(h5rdereference_object_c, H5RDEREFERENCE_OBJECT_C) # define nh5rget_region_region_c H5_FC_FUNC_(h5rget_region_region_c, H5RGET_REGION_REGION_C) # define nh5rget_object_type_obj_c H5_FC_FUNC_(h5rget_object_type_obj_c, H5RGET_OBJECT_TYPE_OBJ_C) -# define nh5rget_name_object_c H5_FC_FUNC_(h5rget_name_object_c, H5RGET_NAME_OBJECT_C) -# define nh5rget_name_region_c H5_FC_FUNC_(h5rget_name_region_c, H5RGET_NAME_REGION_C) H5_FCDLL int_f nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen); @@ -1073,8 +912,7 @@ H5_FCDLL int_f nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f * H5_FCDLL int_f nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id); H5_FCDLL int_f nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id); H5_FCDLL int_f nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type); -H5_FCDLL int_f nh5rget_name_object_c (hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); -H5_FCDLL int_f nh5rget_name_region_c (hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default); + /* * Functions from H5If.c */ @@ -1130,10 +968,10 @@ H5_FCDLL int_f nh5close_c(void); H5_FCDLL int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes); H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * floatingtypes, int_f * floatinglen, hid_t_f * integertypes, int_f * integerlen); H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, - int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, - int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, - hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, - int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags); + int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, + int_f *h5g_flags, int_f *h5i_flags, + hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, + int_f *h5t_flags, int_f *h5z_flags); H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); @@ -1153,55 +991,4 @@ H5_FCDLL int_f nh5zfilter_avail_c (int_f *filter, int_f *flag); H5_FCDLL int_f nh5zget_filter_info_c (int_f *filter, int_f *flag); -/* - * Functions from H5Lf.c - */ -# define nh5lcopy_c H5_FC_FUNC_(h5lcopy_c, H5LCOPY_C) /*MSB*/ -# define nh5lcreate_external_c H5_FC_FUNC_(h5lcreate_external_c, H5LCREATE_EXTERNAL_C) /*MSB*/ -# define nh5lcreate_hard_c H5_FC_FUNC_(h5lcreate_hard_c, H5LCREATE_HARD_C) /*MSB*/ -# define nh5lcreate_soft_c H5_FC_FUNC_(h5lcreate_soft_c, H5LCREATE_SOFT_C) /*MSB*/ -# define nh5ldelete_c H5_FC_FUNC_(h5ldelete_c, H5LDELETE_C) /*MSB*/ -# define nh5ldelete_by_idx_c H5_FC_FUNC_(h5ldelete_by_idx_c, H5LDELETE_BY_IDX_C) /*MSB*/ -# define nh5lexists_c H5_FC_FUNC_(h5lexists_c, H5LEXISTS_C) /*MSB*/ -# define nh5lget_info_c H5_FC_FUNC_(h5lget_info_c, H5LGET_INFO_C) /*MSB*/ -# define nh5lget_info_by_idx_c H5_FC_FUNC_(h5lget_info_by_idx_c, H5LGET_INFO_BY_IDX_C) /*MSB*/ -# define nh5lis_registered_c H5_FC_FUNC_(h5lis_registered_c, H5LIS_REGISTERED_C) /*MSB*/ -# define nh5lmove_c H5_FC_FUNC_(h5lmove_c, H5LMOVE_C) /* MSB */ -# define nh5lget_name_by_idx_c H5_FC_FUNC_(h5lget_name_by_idx_c, H5LGET_NAME_BY_IDX_C) /* MSB */ -# define nh5lget_val_c H5_FC_FUNC_(h5lget_val_c, H5LGET_VAL_C) /* MSB */ - -H5_FCDLL int_f nh5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, - _fcd dest_name, size_t_f *dest_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, - hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, - hid_t_f *link_loc_id, - _fcd link_name, size_t_f *link_namelen, - hid_t_f *lcpl_id, hid_t_f *lapl_id ); /*MSB*/ -H5_FCDLL int_f nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, - hid_t_f *link_loc_id, - _fcd link_name, size_t_f *link_name_len, - hid_t_f *lcpl_id, hid_t_f *lapl_id ); /*MSB*/ -H5_FCDLL int_f nh5ldelete_c( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ); /*MSB*/ -H5_FCDLL int_f nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, size_t_f *n, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *link_exists); /*MSB*/ -H5_FCDLL int_f nh5lget_info_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, - int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, - int_f *address, hsize_t_f *link_len, - hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, hsize_t_f *n, - int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lis_registered_c(int_f *link_cls_id); /*MSB*/ -H5_FCDLL int_f nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, - _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_field, int_f *order, hsize_t_f *n, - size_t_f *size, _fcd name, hid_t_f *lapl_id); /*MSB*/ -H5_FCDLL int_f nh5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, - void *linkval_buff, hid_t_f *lapl_id) ; - #endif /* _H5f90proto_H */ diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 index 04ad33d..b24d295 100644 --- a/fortran/src/HDF5.f90 +++ b/fortran/src/HDF5.f90 @@ -13,21 +13,18 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -MODULE HDF5 - USE H5GLOBAL - USE H5F - USE H5G - USE H5E - USE H5I - USE H5L - USE H5S - USE H5D - USE H5A - USE H5T - USE H5O - USE H5P - USE H5R - USE H5Z - USE H5LIB - -END MODULE HDF5 + MODULE HDF5 + USE H5GLOBAL + USE H5F + USE H5G + USE H5E + USE H5I + USE H5S + USE H5D + USE H5A + USE H5T + USE H5P + USE H5R + USE H5Z + USE H5LIB + END MODULE HDF5 diff --git a/fortran/src/HDF5mpio.f90 b/fortran/src/HDF5mpio.f90 index 59ec309..95c6273 100644 --- a/fortran/src/HDF5mpio.f90 +++ b/fortran/src/HDF5mpio.f90 @@ -19,12 +19,10 @@ USE H5E USE H5G USE H5I - USE H5L USE H5S USE H5D USE H5A USE H5T - USE H5O USE H5P USE H5FDMPIO USE H5R diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 4216f34..a4f9025 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -48,10 +48,10 @@ endif # Source files for the library. libhdf5_fortran_la_SOURCES=H5fortran_flags.f90 H5f90global.f90 \ H5fortran_types.f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ + H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ H5Tff.f90 H5Zff.f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ + H5If.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ $(PARALLEL_COND_SRC) # h5fc and libhdf5_fortran.settings are generated during configure. @@ -167,19 +167,17 @@ H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo H5Iff.lo: $(srcdir)/H5Iff.f90 H5f90global.lo -H5Lff.lo: $(srcdir)/H5Lff.f90 H5f90global.lo -H5Off.lo: $(srcdir)/H5Off.f90 H5f90global.lo H5Pff.lo: $(srcdir)/H5Pff.f90 H5f90global.lo H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5FDmpioff.lo include $(top_srcdir)/config/conclude.am diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index a51254a..31baee2 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -78,20 +78,19 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_fortran_la_LIBADD = am__libhdf5_fortran_la_SOURCES_DIST = H5fortran_flags.f90 \ H5f90global.f90 H5fortran_types.f90 H5_ff.f90 H5Aff.f90 \ - H5Dff.f90 H5Eff.f90 H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 \ - H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 H5Tff.f90 H5Zff.f90 \ - H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c H5If.c \ - H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c HDF5.f90 \ - H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 + H5Dff.f90 H5Eff.f90 H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Pff.f90 \ + H5Rff.f90 H5Sff.f90 H5Tff.f90 H5Zff.f90 H5f90kit.c H5_f.c \ + H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c H5If.c H5Pf.c H5Rf.c H5Sf.c \ + H5Tf.c H5Zf.c HDF5.f90 H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 @BUILD_PARALLEL_CONDITIONAL_FALSE@am__objects_1 = HDF5.lo @BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5FDmpiof.lo \ @BUILD_PARALLEL_CONDITIONAL_TRUE@ HDF5mpio.lo H5FDmpioff.lo am_libhdf5_fortran_la_OBJECTS = H5fortran_flags.lo H5f90global.lo \ H5fortran_types.lo H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo \ - H5Sff.lo H5Tff.lo H5Zff.lo H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo \ - H5Ef.lo H5Ff.lo H5Gf.lo H5If.lo H5Lf.lo H5Of.lo H5Pf.lo \ - H5Rf.lo H5Sf.lo H5Tf.lo H5Zf.lo $(am__objects_1) + H5Fff.lo H5Gff.lo H5Iff.lo H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo \ + H5Zff.lo H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo \ + H5Gf.lo H5If.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo H5Zf.lo \ + $(am__objects_1) libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am_H5fortran_detect_OBJECTS = H5fortran_detect.$(OBJEXT) @@ -382,10 +381,10 @@ lib_LTLIBRARIES = libhdf5_fortran.la # Source files for the library. libhdf5_fortran_la_SOURCES = H5fortran_flags.f90 H5f90global.f90 \ H5fortran_types.f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ + H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ H5Tff.f90 H5Zff.f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ + H5If.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ $(PARALLEL_COND_SRC) @@ -537,8 +536,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Gf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5If.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Lf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Of.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Rf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Sf.Plo@am__quote@ @@ -872,19 +869,17 @@ H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo H5Iff.lo: $(srcdir)/H5Iff.f90 H5f90global.lo -H5Lff.lo: $(srcdir)/H5Lff.f90 H5f90global.lo -H5Off.lo: $(srcdir)/H5Off.f90 H5f90global.lo H5Pff.lo: $(srcdir)/H5Pff.f90 H5f90global.lo H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ + H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5FDmpioff.lo # lib/progs/tests targets recurse into subdirectories. build-* targets diff --git a/fortran/src/README_DEVELOPEMENT b/fortran/src/README_DEVELOPEMENT deleted file mode 100644 index dc65f47..0000000 --- a/fortran/src/README_DEVELOPEMENT +++ /dev/null @@ -1,36 +0,0 @@ -Procedure to add a new function: - -(1) Edit the fortran/src/H5*ff.f90 file -(2) Edit the fortran/sr/H5*f.c file -(3) Edit the fortran/src/H5f90proto.h file - - - -Procedure: -(1) Find the struct name you are interested in: - (a) src/H5public.h if it is a generic type, i.e. H5_* - or - (b) src/H5*public.h if is a specific type, i.e. H5*_ - -(2) Put that structure into an array that will be passed to fortran in: - (a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine) - (b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call - -(3) Edit the function call in fortran/src/H5_ff.f90 - (a) edit the call FUNCTION h5init_flags_c - (b) edit h5init_flags_c call in h5open_f to match the number of arguments passing - -(4) add the size of the array and array to fortran/src/H5f90global.f90 - - must match the size found it H5_f.c - -NOTE: To just add a default C value argument, do steps (2a) and (4) - -Adding a new file to the repository -------------------------------------- - -Add the name of the file to: - (1) Makefile.am located in the same directory as the newfile - (2) MANIFEST located in the top level directory - - -If you add a new file, be sure to add it to the MANIFEST located in the top directory diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 042cfab..ed4b9fd 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -36,10 +36,12 @@ else endif # Our main targets, the tests themselves -TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 +TEST_PROG=fortranlib_test fflush1 fflush2 check_PROGRAMS=$(TEST_PROG) -libh5test_fortran_la_SOURCES= tf.f90 t.c +libh5test_fortran_la_SOURCES=fortranlib_test.f90 tH5F.f90 tH5D.f90 \ + tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 tH5Sselect.f90 \ + tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tf.f90 t.c # Source files are used for both the library and fortranlib_test. # Automake will complain about this without the following workaround. @@ -48,12 +50,8 @@ fortranlib_test_CFLAGS=$(AM_CFLAGS) fortranlib_test_SOURCES = fortranlib_test.f90 \ tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 - -fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ - tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5O.f90 tH5P.f90 tH5A_1_8.f90 tH5I.f90 tH5G_1_8.f90 tH5E.f90 - + tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tf.f90 \ + t.c fflush1_SOURCES=fflush1.f90 fflush2_SOURCES=fflush2.f90 diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 3c748e9..5e0b92f 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -64,10 +64,12 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libh5test_fortran_la_LIBADD = -am_libh5test_fortran_la_OBJECTS = tf.lo t.lo +am_libh5test_fortran_la_OBJECTS = fortranlib_test.lo tH5F.lo tH5D.lo \ + tH5R.lo tH5S.lo tH5T.lo tH5VL.lo tH5Z.lo tH5Sselect.lo tH5P.lo \ + tH5A.lo tH5I.lo tH5G.lo tH5E.lo tf.lo t.lo libh5test_fortran_la_OBJECTS = $(am_libh5test_fortran_la_OBJECTS) am__EXEEXT_1 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \ - fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) + fflush2$(EXEEXT) am_fflush1_OBJECTS = fflush1.$(OBJEXT) fflush1_OBJECTS = $(am_fflush1_OBJECTS) fflush1_LDADD = $(LDADD) @@ -87,7 +89,8 @@ am_fortranlib_test_OBJECTS = \ fortranlib_test-tH5Sselect.$(OBJEXT) \ fortranlib_test-tH5P.$(OBJEXT) fortranlib_test-tH5A.$(OBJEXT) \ fortranlib_test-tH5I.$(OBJEXT) fortranlib_test-tH5G.$(OBJEXT) \ - fortranlib_test-tH5E.$(OBJEXT) + fortranlib_test-tH5E.$(OBJEXT) fortranlib_test-tf.$(OBJEXT) \ + fortranlib_test-t.$(OBJEXT) fortranlib_test_OBJECTS = $(am_fortranlib_test_OBJECTS) fortranlib_test_LDADD = $(LDADD) fortranlib_test_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ @@ -95,16 +98,6 @@ fortranlib_test_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ fortranlib_test_LINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(FCLD) $(fortranlib_test_FCFLAGS) $(FCFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_fortranlib_test_1_8_OBJECTS = fortranlib_test_1_8.$(OBJEXT) \ - tH5F.$(OBJEXT) tH5D.$(OBJEXT) tH5R.$(OBJEXT) tH5S.$(OBJEXT) \ - tH5T.$(OBJEXT) tH5VL.$(OBJEXT) tH5Z.$(OBJEXT) \ - tH5Sselect.$(OBJEXT) tH5O.$(OBJEXT) tH5P.$(OBJEXT) \ - tH5A_1_8.$(OBJEXT) tH5I.$(OBJEXT) tH5G_1_8.$(OBJEXT) \ - tH5E.$(OBJEXT) -fortranlib_test_1_8_OBJECTS = $(am_fortranlib_test_1_8_OBJECTS) -fortranlib_test_1_8_LDADD = $(LDADD) -fortranlib_test_1_8_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ - $(LIBH5F) $(LIBHDF5) DEFAULT_INCLUDES = -I. -I$(top_builddir)/src@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -125,11 +118,9 @@ FCLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \ - $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ - $(fortranlib_test_1_8_SOURCES) + $(fflush2_SOURCES) $(fortranlib_test_SOURCES) DIST_SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \ - $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ - $(fortranlib_test_1_8_SOURCES) + $(fflush2_SOURCES) $(fortranlib_test_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -377,8 +368,11 @@ noinst_LTLIBRARIES = libh5test_fortran.la @FORTRAN_SHARED_CONDITIONAL_FALSE@AM_LDFLAGS = -static # Our main targets, the tests themselves -TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 -libh5test_fortran_la_SOURCES = tf.f90 t.c +TEST_PROG = fortranlib_test fflush1 fflush2 +libh5test_fortran_la_SOURCES = fortranlib_test.f90 tH5F.f90 tH5D.f90 \ + tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 tH5Sselect.f90 \ + tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tf.f90 t.c + # Source files are used for both the library and fortranlib_test. # Automake will complain about this without the following workaround. @@ -386,11 +380,8 @@ fortranlib_test_FCFLAGS = $(AM_FCFLAGS) fortranlib_test_CFLAGS = $(AM_CFLAGS) fortranlib_test_SOURCES = fortranlib_test.f90 \ tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 - -fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ - tH5F.f90 tH5D.f90 tH5R.f90 tH5S.f90 tH5T.f90 tH5VL.f90 tH5Z.f90 \ - tH5Sselect.f90 tH5O.f90 tH5P.f90 tH5A_1_8.f90 tH5I.f90 tH5G_1_8.f90 tH5E.f90 + tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 tf.f90 \ + t.c fflush1_SOURCES = fflush1.f90 fflush2_SOURCES = fflush2.f90 @@ -478,9 +469,6 @@ fflush2$(EXEEXT): $(fflush2_OBJECTS) $(fflush2_DEPENDENCIES) fortranlib_test$(EXEEXT): $(fortranlib_test_OBJECTS) $(fortranlib_test_DEPENDENCIES) @rm -f fortranlib_test$(EXEEXT) $(fortranlib_test_LINK) $(fortranlib_test_OBJECTS) $(fortranlib_test_LDADD) $(LIBS) -fortranlib_test_1_8$(EXEEXT): $(fortranlib_test_1_8_OBJECTS) $(fortranlib_test_1_8_DEPENDENCIES) - @rm -f fortranlib_test_1_8$(EXEEXT) - $(FCLINK) $(fortranlib_test_1_8_OBJECTS) $(fortranlib_test_1_8_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -488,6 +476,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortranlib_test-t.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t.Plo@am__quote@ .c.o: @@ -511,6 +500,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +fortranlib_test-t.o: t.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_CFLAGS) $(CFLAGS) -MT fortranlib_test-t.o -MD -MP -MF $(DEPDIR)/fortranlib_test-t.Tpo -c -o fortranlib_test-t.o `test -f 't.c' || echo '$(srcdir)/'`t.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fortranlib_test-t.Tpo $(DEPDIR)/fortranlib_test-t.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='t.c' object='fortranlib_test-t.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_CFLAGS) $(CFLAGS) -c -o fortranlib_test-t.o `test -f 't.c' || echo '$(srcdir)/'`t.c + +fortranlib_test-t.obj: t.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_CFLAGS) $(CFLAGS) -MT fortranlib_test-t.obj -MD -MP -MF $(DEPDIR)/fortranlib_test-t.Tpo -c -o fortranlib_test-t.obj `if test -f 't.c'; then $(CYGPATH_W) 't.c'; else $(CYGPATH_W) '$(srcdir)/t.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fortranlib_test-t.Tpo $(DEPDIR)/fortranlib_test-t.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='t.c' object='fortranlib_test-t.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fortranlib_test_CFLAGS) $(CFLAGS) -c -o fortranlib_test-t.obj `if test -f 't.c'; then $(CYGPATH_W) 't.c'; else $(CYGPATH_W) '$(srcdir)/t.c'; fi` + .f90.o: $(FCCOMPILE) -c -o $@ $< @@ -604,6 +607,12 @@ fortranlib_test-tH5E.o: tH5E.f90 fortranlib_test-tH5E.obj: tH5E.f90 $(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tH5E.obj `if test -f 'tH5E.f90'; then $(CYGPATH_W) 'tH5E.f90'; else $(CYGPATH_W) '$(srcdir)/tH5E.f90'; fi` +fortranlib_test-tf.o: tf.f90 + $(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tf.o `test -f 'tf.f90' || echo '$(srcdir)/'`tf.f90 + +fortranlib_test-tf.obj: tf.f90 + $(FC) $(fortranlib_test_FCFLAGS) $(FCFLAGS) -c -o fortranlib_test-tf.obj `if test -f 'tf.f90'; then $(CYGPATH_W) 'tf.f90'; else $(CYGPATH_W) '$(srcdir)/tf.f90'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/fortran/test/fflush1.f90 b/fortran/test/fflush1.f90 index f42ae6e..44c4195 100644 --- a/fortran/test/fflush1.f90 +++ b/fortran/test/fflush1.f90 @@ -58,6 +58,12 @@ ! data space identifier ! INTEGER(HID_T) :: dataspace + + ! + ! data type identifier + ! + INTEGER(HID_T) :: dtype_id + ! !The dimensions for the dataset. ! @@ -76,7 +82,7 @@ ! !data buffers ! - INTEGER, DIMENSION(NX,NY) :: data_in + INTEGER, DIMENSION(NX,NY) :: data_in, data_out INTEGER(HSIZE_T), DIMENSION(2) :: data_dims data_dims(1) = NX data_dims(2) = NY diff --git a/fortran/test/fflush2.f90 b/fortran/test/fflush2.f90 index 38a2bd7..0414d37 100644 --- a/fortran/test/fflush2.f90 +++ b/fortran/test/fflush2.f90 @@ -50,13 +50,22 @@ ! dataset identifier ! INTEGER(HID_T) :: dset_id - + + ! + ! data space identifier + ! + INTEGER(HID_T) :: dataspace ! ! data type identifier ! INTEGER(HID_T) :: dtype_id + ! + !The dimensions for the dataset. + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/NX,NY/) + ! !flag to check operation success ! diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90 deleted file mode 100644 index 970f570..0000000 --- a/fortran/test/fortranlib_test_1_8.f90 +++ /dev/null @@ -1,966 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! -! Testing Fortran wrappers introduced in 1.8 release. -! -PROGRAM fortranlibtest - - USE HDF5 - - IMPLICIT NONE - INTEGER :: total_error = 0 - INTEGER :: error - INTEGER :: mounting_total_error = 0 - INTEGER :: reopen_total_error = 0 - INTEGER :: fclose_total_error = 0 - INTEGER :: fspace_total_error = 0 - INTEGER :: dataset_total_error = 0 - INTEGER :: extend_dataset_total_error = 0 - INTEGER :: refobj_total_error = 0 - INTEGER :: refreg_total_error = 0 - INTEGER :: dataspace_total_error = 0 - INTEGER :: hyperslab_total_error = 0 - INTEGER :: element_total_error = 0 - INTEGER :: basic_select_total_error = 0 - INTEGER :: total_error_compoundtest = 0 - INTEGER :: basic_datatype_total_error = 0 - INTEGER :: enum_total_error = 0 - INTEGER :: external_total_error = 0 - INTEGER :: multi_file_total_error = 0 - INTEGER :: attribute_total_error = 0 - INTEGER :: group_total_error = 0 - INTEGER :: majnum, minnum, relnum - CHARACTER(LEN=8) error_string - CHARACTER(LEN=8) :: success = ' PASSED ' - CHARACTER(LEN=8) :: failure = '*FAILED*' - CHARACTER(LEN=4) :: e_format ='(8a)' - LOGICAL :: cleanup = .TRUE. - ! LOGICAL :: cleanup = .FALSE. - - CALL h5open_f(error) - WRITE(*,*) ' ========================== ' - WRITE(*,*) ' FORTRAN 1.8 tests ' - WRITE(*,*) ' ========================== ' - CALL h5get_libversion_f(majnum, minnum, relnum, total_error) - IF(total_error .EQ. 0) THEN - WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") - WRITE(*, '(I1)', advance="NO") majnum - WRITE(*, '(".")', advance="NO") - WRITE(*, '(I1)', advance="NO") minnum - WRITE(*, '(" release ")', advance="NO") - WRITE(*, '(I3)') relnum - ELSE - total_error = total_error + 1 - ENDIF - WRITE(*,*) - - error_string = failure - CALL file_space(cleanup, fspace_total_error) - IF (fspace_total_error == 0) error_string = success - WRITE(*, fmt = '(21a)', advance = 'no') ' File free space test' - WRITE(*, fmt = '(49x,a)', advance = 'no') ' ' - WRITE(*, fmt = e_format) error_string - total_error = total_error + fspace_total_error - - ! write(*,*) - ! write(*,*) '=========================================' - ! write(*,*) 'Testing ATTRIBUTE interface ' - ! write(*,*) '=========================================' - - error_string = failure - CALL attribute_test_1_8(cleanup, attribute_total_error) - WRITE(*, fmt = '(15a)', advance = 'no') ' ATTRIBUTE TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (attribute_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + attribute_total_error - - CALL group_test(cleanup, group_total_error) - WRITE(*, fmt = '(15a)', advance = 'no') ' GROUP TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (group_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + group_total_error - - CALL test_h5o(cleanup, group_total_error ) - WRITE(*, fmt = '(15a)', advance = 'no') ' H5O TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (group_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + group_total_error - - CALL dtransform(cleanup, group_total_error) - WRITE(*, fmt = '(15a)', advance = 'no') ' Dtransform TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (group_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + group_total_error - - CALL test_genprop_basic_class(cleanup, group_total_error) - WRITE(*, fmt = '(30a)', advance = 'no') ' test_genprop_basic_class TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (group_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + group_total_error - CALL test_h5s_encode(cleanup, group_total_error) - WRITE(*, fmt = '(15a)', advance = 'no') ' test_h5s_encode TEST' - WRITE(*, fmt = '(55x,a)', advance = 'no') ' ' - IF (group_total_error == 0) error_string = success - WRITE(*, fmt = e_format) error_string - total_error = total_error + group_total_error - -! CALL test_hard_query(group_total_error) - - total_error = total_error + group_total_error - - WRITE(*,*) - - WRITE(*,*) ' ============================================ ' - WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' - WRITE(*, fmt = '(i4)', advance='NO') total_error - WRITE(*, fmt = '(12a)' ) ' error(s) ! ' - WRITE(*,*) ' ============================================ ' - - CALL h5close_f(error) - - ! if errors detected, exit with non-zero code. - IF (total_error .NE. 0) CALL h5_exit_f (1) - -END PROGRAM fortranlibtest - -SUBROUTINE dtransform(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: dxpl_id_c_to_f, dxpl_id_c_to_f_copy - INTEGER(HID_T) :: dxpl_id_simple, dxpl_id_polynomial, dxpl_id_polynomial_copy, dxpl_id_utrans_inv, file_id - - CHARACTER(LEN=15), PARAMETER :: c_to_f = "(9/5.0)*x + 123" - INTEGER :: error - CHARACTER(LEN=15) :: ptrgetTest - CHARACTER(LEN=7) :: ptrgetTest_small - CHARACTER(LEN=30) :: ptrgetTest_big - - INTEGER(SIZE_T) :: size - - - CALL H5Fcreate_f("dtransform.h5", H5F_ACC_TRUNC_F, file_id, error) - CALL check("dtransform.H5Fcreate_f", error, total_error) - - CALL H5Pcreate_f(H5P_DATASET_XFER_F, dxpl_id_c_to_f, error) - CALL check("dtransform.H5Pcreate_f", error, total_error) - - CALL H5Pset_data_transform_f(dxpl_id_c_to_f, c_to_f, error) - CALL check("dtransform.H5Pset_data_transform_f", error, total_error) - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f, ptrgetTest, total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) - -! check case when receiving buffer to small - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_small, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f(1:7), ptrgetTest_small, total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size),15, total_error) - -! check case when receiving buffer to big - - CALL H5Pget_data_transform_f(dxpl_id_c_to_f, ptrgetTest_big, error, size=size) - CALL check("dtransform.H5Pget_data_transform_f", error, total_error) - CALL VerifyString("dtransform.H5Pget_data_transform_f", c_to_f(1:15), ptrgetTest_big(1:15), total_error) - CALL VERIFY("dtransform.H5Pget_data_transform_f", INT(size), 15, total_error) - - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("dtransform", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - -END SUBROUTINE dtransform - - -!/**************************************************************** -!** -!** test_genprop_basic_class(): Test basic generic property list code. -!** Tests creating new generic classes. -!** -!****************************************************************/ - -SUBROUTINE test_genprop_basic_class(cleanup, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(HID_T) :: cid1 !/* Generic Property class ID */ - INTEGER(HID_T) :: cid2 !/* Generic Property class ID */ - INTEGER(HID_T) :: cid3 !/* Generic Property class ID */ - - CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1" - CHARACTER(LEN=7) :: name ! /* Name of class */ - CHARACTER(LEN=10) :: name_big ! /* Name of class bigger buffer */ - CHARACTER(LEN=4) :: name_small ! /* Name of class smaller buffer*/ - INTEGER :: error - INTEGER :: size - LOGICAL :: flag - - !/* Output message about test being performed */ - - WRITE(*,*) "Testing Basic Generic Property List Class Creation Functionality" - - ! /* Create a new generic class, derived from the root of the class hierarchy */ - CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) - CALL check("H5Pcreate_class", error, total_error) - - ! /* Check class name */ - CALL H5Pget_class_name_f(cid1, name, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", name, CLASS1_NAME, error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',name, 'CLASS1_NAME=',CLASS1_NAME - total_error = total_error + 1 - ENDIF - - ! /* Check class name smaller buffer*/ - CALL H5Pget_class_name_f(cid1, name_small, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", name_small(1:4), CLASS1_NAME(1:4), error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',name_small(1:4), 'CLASS1_NAME=',CLASS1_NAME(1:4) - total_error = total_error + 1 - ENDIF - - ! /* Check class name bigger buffer*/ - CALL H5Pget_class_name_f(cid1, name_big, size, error) - CALL check("H5Pget_class_name", error, total_error) - CALL VERIFY("H5Pget_class_name", size,7,error) - CALL verifystring("H5Pget_class_name", TRIM(name_big), TRIM(CLASS1_NAME), error) - IF(error.NE.0)THEN - WRITE(*,*) 'Class names do not match! name=',TRIM(name_small), 'CLASS1_NAME=',TRIM(CLASS1_NAME) - total_error = total_error + 1 - ENDIF - - ! /* Check class parent */ - CALL H5Pget_class_parent_f(cid1, cid2, error) - CALL check("H5Pget_class_parent_f", error, total_error) - - ! /* Verify class parent correct */ - CALL H5Pequal_f(cid2, H5P_ROOT_F, flag, error) - CALL check("H5Pequal_f", error, total_error) - CALL verifylogical("H5Pequal_f", flag, .TRUE., total_error) - - - ! /* Make certain false postives aren't being returned */ - CALL H5Pequal_f(cid2, H5P_FILE_CREATE_F, flag, error) - CALL check("H5Pequal_f", error, total_error) - CALL verifylogical("H5Pequal_f", flag, .FALSE., total_error) - - !/* Close parent class */ - CALL H5Pclose_class_f(cid2, error) - CALL check("H5Pclose_class_f", error, total_error) - - - !/* Close class */ - CALL H5Pclose_class_f(cid1, error) - CALL check("H5Pclose_class_f", error, total_error) - -END SUBROUTINE test_genprop_basic_class - -SUBROUTINE test_h5s_encode(cleanup, total_error) - -!/**************************************************************** -!** -!** test_h5s_encode(): Test H5S (dataspace) encoding and decoding. -!** -!****************************************************************/ - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(hid_t) :: sid1, sid2, sid3! /* Dataspace ID */ - INTEGER(hid_t) :: decoded_sid1, decoded_sid2, decoded_sid3 - INTEGER :: rank !/* LOGICAL rank of dataspace */ - INTEGER(size_t) :: sbuf_size=0, null_size=0, scalar_size=0 - -! Make sure the size is large, need variable length in fortran 2003 - CHARACTER(LEN=288) :: sbuf - CHARACTER(LEN=288) :: scalar_buf -! F2003 CHARACTER(LEN=:), ALLOCATABLE :: sbuf - -! unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; -! hsize_t tdims[4]; /* Dimension array to test with */ - INTEGER(hsize_t) :: n ! /* Number of dataspace elements */ - - INTEGER(hsize_t), DIMENSION(1:3) :: start = (/0, 0, 0/) - INTEGER(hsize_t), DIMENSION(1:3) :: stride = (/2, 5, 3/) - INTEGER(hsize_t), DIMENSION(1:3) :: count = (/2, 2, 2/) - INTEGER(hsize_t), DIMENSION(1:3) :: BLOCK = (/1, 3, 1/) - - INTEGER :: space_type - -! H5S_sel_type sel_type; -! hssize_t nblocks; - ! - !Dataset dimensions - ! - INTEGER, PARAMETER :: SPACE1_DIM1= 3, SPACE1_DIM2=15, SPACE1_DIM3=13 - - INTEGER(HSIZE_T), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) - INTEGER :: SPACE1_RANK = 3 - INTEGER :: error - - !/* Output message about test being performed */ - WRITE(*,*) "Testing Dataspace Encoding and Decoding" - - !/*------------------------------------------------------------------------- - ! * Test encoding and decoding of simple dataspace and hyperslab selection. - ! *------------------------------------------------------------------------- - ! */ - - CALL H5Screate_simple_f(SPACE1_RANK, dims1, sid1, error) - CALL check("H5Screate_simple", error, total_error) - - CALL h5sselect_hyperslab_f(sid1, H5S_SELECT_SET_F, & - start, count, error, stride=stride, BLOCK=BLOCK) - CALL check("h5sselect_hyperslab_f", error, total_error) - - - !/* Encode simple data space in a buffer */ - - ! First find the buffer size - CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) - CALL check("H5Sencode", error, total_error) - - ! In fortran 2003 we can allocate the needed character size here - - ! /* Try decoding bogus buffer */ - - CALL H5Sdecode_f(sbuf, decoded_sid1, error) - CALL VERIFY("H5Sdecode", error, -1, total_error) - - CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) - CALL check("H5Sencode", error, total_error) - - ! /* Decode from the dataspace buffer and return an object handle */ - CALL H5Sdecode_f(sbuf, decoded_sid1, error) - CALL check("H5Sdecode", error, total_error) - - - ! /* Verify the decoded dataspace */ - CALL h5sget_simple_extent_npoints_f(decoded_sid1, n, error) - CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL VERIFY("h5sget_simple_extent_npoints_f", INT(n), SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, & - total_error) - -!!$ -!!$ rank = H5Sget_simple_extent_ndims(decoded_sid1); -!!$ CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); -!!$ VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims"); -!!$ -!!$ rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL); -!!$ CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); -!!$ VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, -!!$ "H5Sget_simple_extent_dims"); -!!$ -!!$ /* Verify hyperslabe selection */ -!!$ sel_type = H5Sget_select_type(decoded_sid1); -!!$ VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type"); -!!$ -!!$ nblocks = H5Sget_select_hyper_nblocks(decoded_sid1); -!!$ VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks"); -!!$ - ! - !Close the dataspace for the dataset. - ! - CALL h5sclose_f(sid1, error) - CALL check("h5sclose_f", error, total_error) - - CALL h5sclose_f(decoded_sid1, error) - CALL check("h5sclose_f", error, total_error) - -!!$ -!!$ ret = H5Sclose(decoded_sid1); -!!$ CHECK(ret, FAIL, "H5Sclose"); -!!$ -!!$ /*------------------------------------------------------------------------- -!!$ * Test encoding and decoding of null dataspace. -!!$ *------------------------------------------------------------------------- -!!$ */ -!!$ sid2 = H5Screate(H5S_NULL); -!!$ CHECK(sid2, FAIL, "H5Screate"); -!!$ -!!$ /* Encode null data space in a buffer */ -!!$ ret = H5Sencode(sid2, NULL, &null_size); -!!$ CHECK(ret, FAIL, "H5Sencode"); -!!$ -!!$ if(null_size>0) -!!$ null_sbuf = (unsigned char*)HDcalloc((size_t)1, null_size); -!!$ -!!$ ret = H5Sencode(sid2, null_sbuf, &null_size); -!!$ CHECK(ret, FAIL, "H5Sencode"); -!!$ -!!$ /* Decode from the dataspace buffer and return an object handle */ -!!$ decoded_sid2=H5Sdecode(null_sbuf); -!!$ CHECK(decoded_sid2, FAIL, "H5Sdecode"); -!!$ -!!$ /* Verify decoded dataspace */ -!!$ space_type = H5Sget_simple_extent_type(decoded_sid2); -!!$ VERIFY(space_type, H5S_NULL, "H5Sget_simple_extent_type"); -!!$ -!!$ ret = H5Sclose(sid2); -!!$ CHECK(ret, FAIL, "H5Sclose"); -!!$ -!!$ ret = H5Sclose(decoded_sid2); -!!$ CHECK(ret, FAIL, "H5Sclose"); -!!$ - ! /*------------------------------------------------------------------------- - ! * Test encoding and decoding of scalar dataspace. - ! *------------------------------------------------------------------------- - ! */ - ! /* Create scalar dataspace */ - - CALL H5Screate_f(H5S_SCALAR_F, sid3, error) - CALL check("H5Screate_f",error, total_error) - - ! /* Encode scalar data space in a buffer */ - - ! First find the buffer size - CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) - CALL check("H5Sencode_f", error, total_error) - - ! encode - - CALL H5Sencode_f(sid3, scalar_buf, scalar_size, error) - CALL check("H5Sencode_f", error, total_error) - - - ! /* Decode from the dataspace buffer and return an object handle */ - - CALL H5Sdecode_f(scalar_buf, decoded_sid3, error) - CALL check("H5Sdecode_f", error, total_error) - - - ! /* Verify extent type */ - - CALL H5Sget_simple_extent_type_f(decoded_sid3, space_type, error) - CALL check("H5Sget_simple_extent_type_f", error, total_error) - CALL VERIFY("H5Sget_simple_extent_type_f", space_type, H5S_SCALAR_F, total_error) - - ! /* Verify decoded dataspace */ - CALL h5sget_simple_extent_npoints_f(decoded_sid3, n, error) - CALL check("h5sget_simple_extent_npoints_f", error, total_error) - CALL VERIFY("h5sget_simple_extent_npoints_f", INT(n), 1, total_error) - - CALL H5Sget_simple_extent_ndims_f(decoded_sid3, rank, error) - CALL CHECK("H5Sget_simple_extent_ndims_f", error, total_error) - CALL VERIFY("H5Sget_simple_extent_ndims_f", rank, 0, total_error ) - - CALL h5sclose_f(sid3, error) - CALL check("h5sclose_f", error, total_error) - - CALL h5sclose_f(decoded_sid3, error) - CALL check("h5sclose_f", error, total_error) - -END SUBROUTINE test_h5s_encode - -!/*------------------------------------------------------------------------- -! * Function: test_hard_query -! * -! * Purpose: Tests H5Tcompiler_conv() for querying whether a conversion is -! * a hard one. -! * -! * Return: Success: 0 -! * -! * Failure: number of errors -! * -! * Programmer: Raymond Lu -! * Friday, Sept 2, 2005 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - -!!$SUBROUTINE test_hard_query(total_error) -!!$ -!!$ USE HDF5 ! This module contains all necessary modules -!!$ -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(INOUT) :: total_error -!!$ -!!$ INTEGER :: error -!!$ LOGICAL :: flag -!!$ -!!$ WRITE(*,*) "query functions of compiler conversion" -!!$ -!!$ ! /* Verify the conversion from int to float is a hard conversion. */ -!!$ -!!$ CALL H5Tcompiler_conv_f(H5T_INTEGER_F, H5T_FLOAT_F, flag, error) -!!$ CALL check("H5Tcompiler_conv", error, total_error) -!!$ CALL VerifyLogical("H5Tcompiler_conv", flag, .TRUE.,total_error) - -!!$ if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) { -!!$ H5_FAILED(); -!!$ printf("Can't query conversion function\n"); -!!$ goto error; -!!$ } - -!!$ /* Unregister the hard conversion from int to float. Verify the conversion -!!$ * is a soft conversion. */ -!!$ H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); -!!$ if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=FALSE) { -!!$ H5_FAILED(); -!!$ printf("Can't query conversion function\n"); -!!$ goto error; -!!$ } -!!$ -!!$ /* Register the hard conversion from int to float. Verify the conversion -!!$ * is a hard conversion. */ -!!$ H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); -!!$ if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) { -!!$ H5_FAILED(); -!!$ printf("Can't query conversion function\n"); -!!$ goto error; -!!$ } -!!$ -!!$ PASSED(); -!!$ reset_hdf5(); -!!$ -!!$ return 0; -!!$ -!!$END SUBROUTINE test_hard_query - - -!/*------------------------------------------------------------------------- -! * Function: test_encode -! * -! * Purpose: Tests functions of encoding and decoding datatype. -! * -! * Return: Success: 0 -! * -! * Failure: number of errors -! * -! * Programmer: Raymond Lu -! * July 14, 2004 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - -!!$SUBROUTINE test_encode(total_error) -!!$ -!!$ USE HDF5 ! This module contains all necessary modules -!!$ struct s1 { -!!$ int a; -!!$ float b; -!!$ long c; -!!$ double d; -!!$ }; -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(INOUT) :: total_error -!!$ INTEGER(SIZE_T), PARAMETER :: sizechar = 1024 -!!$ INTEGER :: error -!!$ INTEGER(hid_t) :: file=-1, tid1=-1, tid2=-1 -!!$ INTEGER(hid_t) :: decoded_tid1=-1, decoded_tid2=-1 -!!$ CHARACTER(LEN=1024) :: filename = 'encode.h5' -!!$ char compnd_type[]="Compound_type", enum_type[]="Enum_type"; -!!$ short enum_val; -!!$ size_t cmpd_buf_size = 0; -!!$ size_t enum_buf_size = 0; -!!$ unsigned char *cmpd_buf=NULL, *enum_buf=NULL; -!!$ herr_t ret; -!!$ INTEGER(HID_T) :: dt5_id ! Memory datatype identifier -!!$ -!!$ INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype -!!$ -!!$ WRITE(*,*) "functions of encoding and decoding datatypes" -!!$ -!!$ !/* Create File */ -!!$ -!!$ CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file, error) -!!$ CALL check("H5Fcreate_f", error, total_error) -!!$ -!!$ !/*----------------------------------------------------------------------- -!!$ ! * Create compound and enumerate datatypes -!!$ ! *----------------------------------------------------------------------- -!!$ ! */ -!!$ -!!$ ! /* Create a compound datatype */ -!!$ CALL h5tcopy_f(H5T_NATIVE_CHARACTER, dt5_id, error) -!!$ CALL check("h5tcopy_f", error, total_error) -!!$ sizechar = 2 -!!$ CALL h5tset_size_f(dt5_id, sizechar, error) -!!$ CALL check("h5tset_size_f", error, total_error) -!!$ CALL h5tget_size_f(dt5_id, type_sizec, error) -!!$ CALL check("h5tget_size_f", error, total_error) -!!$ -!!$ CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizec, error) -!!$ CALL check("h5tget_size_f", error, total_error) -!!$ CALL h5tcreate_f(H5T_COMPOUND_F, type_sizec, dtype_id, error) -!!$ -!!$ -!!$ if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't create datatype!\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tinsert(tid1, "a", HOFFSET(struct s1, a), H5T_NATIVE_INT) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field 'a'\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tinsert(tid1, "b", HOFFSET(struct s1, b), H5T_NATIVE_FLOAT) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field 'b'\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tinsert(tid1, "c", HOFFSET(struct s1, c), H5T_NATIVE_LONG) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field 'c'\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tinsert(tid1, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field 'd'\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Create a enumerate datatype */ -!!$ if((tid2=H5Tcreate(H5T_ENUM, sizeof(short))) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't create enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tenum_insert(tid2, "RED", (enum_val=0,&enum_val)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field into enumeration type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tenum_insert(tid2, "GREEN", (enum_val=1,&enum_val)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field into enumeration type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tenum_insert(tid2, "BLUE", (enum_val=2,&enum_val)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field into enumeration type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tenum_insert(tid2, "ORANGE", (enum_val=3,&enum_val)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field into enumeration type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tenum_insert(tid2, "YELLOW", (enum_val=4,&enum_val)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't insert field into enumeration type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /*----------------------------------------------------------------------- -!!$ * Test encoding and decoding compound and enumerate datatypes -!!$ *----------------------------------------------------------------------- -!!$ */ -!!$ /* Encode compound type in a buffer */ -!!$ if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode compound type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(cmpd_buf_size>0) -!!$ cmpd_buf = (unsigned char*)calloc(1, cmpd_buf_size); -!!$ -!!$ /* Try decoding bogus buffer */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Tdecode(cmpd_buf); -!!$ } H5E_END_TRY; -!!$ if(ret!=FAIL) { -!!$ H5_FAILED(); -!!$ printf("Decoded bogus buffer!\n"); -!!$ goto error; -!!$ } -!!$ -!!$ if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode compound type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Decode from the compound buffer and return an object handle */ -!!$ if((decoded_tid1 = H5Tdecode(cmpd_buf)) < 0) -!!$ FAIL_PUTS_ERROR("Can't decode compound type\n") -!!$ -!!$ /* Verify that the datatype was copied exactly */ -!!$ if(H5Tequal(decoded_tid1, tid1)<=0) { -!!$ H5_FAILED(); -!!$ printf("Datatype wasn't encoded & decoded identically\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Query member number and member index by name, for compound type. */ -!!$ if(H5Tget_nmembers(decoded_tid1)!=4) { -!!$ H5_FAILED(); -!!$ printf("Can't get member number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tget_member_index(decoded_tid1, "c")!=2) { -!!$ H5_FAILED(); -!!$ printf("Can't get correct index number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ -!!$ /* Encode enumerate type in a buffer */ -!!$ if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(enum_buf_size>0) -!!$ enum_buf = (unsigned char*)calloc(1, enum_buf_size); -!!$ -!!$ if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Decode from the enumerate buffer and return an object handle */ -!!$ if((decoded_tid2=H5Tdecode(enum_buf)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't decode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Verify that the datatype was copied exactly */ -!!$ if(H5Tequal(decoded_tid2, tid2)<=0) { -!!$ H5_FAILED(); -!!$ printf("Datatype wasn't encoded & decoded identically\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Query member number and member index by name, for enumeration type. */ -!!$ if(H5Tget_nmembers(decoded_tid2)!=5) { -!!$ H5_FAILED(); -!!$ printf("Can't get member number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tget_member_index(decoded_tid2, "ORANGE") != 3) { -!!$ H5_FAILED(); -!!$ printf("Can't get correct index number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /*----------------------------------------------------------------------- -!!$ * Commit and reopen the compound and enumerate datatypes -!!$ *----------------------------------------------------------------------- -!!$ */ -!!$ /* Commit compound datatype and close it */ -!!$ if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't commit compound datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(tid1) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(decoded_tid1) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ free(cmpd_buf); -!!$ cmpd_buf_size = 0; -!!$ -!!$ /* Commit enumeration datatype and close it */ -!!$ if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't commit compound datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(tid2) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(decoded_tid2) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ free(enum_buf); -!!$ enum_buf_size = 0; -!!$ -!!$ /* Open the dataytpe for query */ -!!$ if((tid1 = H5Topen2(file, compnd_type, H5P_DEFAULT)) < 0) -!!$ FAIL_STACK_ERROR -!!$ if((tid2 = H5Topen2(file, enum_type, H5P_DEFAULT)) < 0) -!!$ FAIL_STACK_ERROR -!!$ -!!$ -!!$ /* Encode compound type in a buffer */ -!!$ if(H5Tencode(tid1, NULL, &cmpd_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode compound type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(cmpd_buf_size>0) -!!$ cmpd_buf = (unsigned char*)calloc(1, cmpd_buf_size); -!!$ -!!$ if(H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode compound type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Decode from the compound buffer and return an object handle */ -!!$ if((decoded_tid1 = H5Tdecode(cmpd_buf)) < 0) -!!$ FAIL_PUTS_ERROR("Can't decode compound type\n") -!!$ -!!$ /* Verify that the datatype was copied exactly */ -!!$ if(H5Tequal(decoded_tid1, tid1)<=0) { -!!$ H5_FAILED(); -!!$ printf("Datatype wasn't encoded & decoded identically\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Query member number and member index by name, for compound type. */ -!!$ if(H5Tget_nmembers(decoded_tid1)!=4) { -!!$ H5_FAILED(); -!!$ printf("Can't get member number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tget_member_index(decoded_tid1, "c")!=2) { -!!$ H5_FAILED(); -!!$ printf("Can't get correct index number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /*----------------------------------------------------------------------- -!!$ * Test encoding and decoding compound and enumerate datatypes -!!$ *----------------------------------------------------------------------- -!!$ */ -!!$ /* Encode enumerate type in a buffer */ -!!$ if(H5Tencode(tid2, NULL, &enum_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(enum_buf_size>0) -!!$ enum_buf = (unsigned char*)calloc(1, enum_buf_size); -!!$ -!!$ if(H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't encode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Decode from the enumerate buffer and return an object handle */ -!!$ if((decoded_tid2=H5Tdecode(enum_buf)) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't decode enumerate type\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Verify that the datatype was copied exactly */ -!!$ if(H5Tequal(decoded_tid2, tid2)<=0) { -!!$ H5_FAILED(); -!!$ printf("Datatype wasn't encoded & decoded identically\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Query member number and member index by name, for enumeration type. */ -!!$ if(H5Tget_nmembers(decoded_tid2)!=5) { -!!$ H5_FAILED(); -!!$ printf("Can't get member number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tget_member_index(decoded_tid2, "ORANGE")!=3) { -!!$ H5_FAILED(); -!!$ printf("Can't get correct index number\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /*----------------------------------------------------------------------- -!!$ * Close and release -!!$ *----------------------------------------------------------------------- -!!$ */ -!!$ /* Close datatype and file */ -!!$ if(H5Tclose(tid1) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(tid2) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(H5Tclose(decoded_tid1) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ if(H5Tclose(decoded_tid2) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close datatype\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ if(H5Fclose(file) < 0) { -!!$ H5_FAILED(); -!!$ printf("Can't close file\n"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ free(cmpd_buf); -!!$ free(enum_buf); -!!$ -!!$ PASSED(); -!!$ return 0; -!!$ -!!$ error: -!!$ H5E_BEGIN_TRY { -!!$ H5Tclose (tid1); -!!$ H5Tclose (tid2); -!!$ H5Tclose (decoded_tid1); -!!$ H5Tclose (decoded_tid2); -!!$ H5Fclose (file); -!!$ } H5E_END_TRY; -!!$ return 1; -!!$} diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90 index b73dd8a..44c7964 100644 --- a/fortran/test/tH5A.f90 +++ b/fortran/test/tH5A.f90 @@ -56,7 +56,10 @@ INTEGER(HID_T) :: attr5_id !Integer Attribute identifier INTEGER(HID_T) :: attr6_id !Null Attribute identifier INTEGER(HID_T) :: aspace_id !String Attribute Dataspace identifier - INTEGER(HID_T) :: aspace2_id !Character Attribute Dataspace identifier + INTEGER(HID_T) :: aspace2_id !Character Attribute Dataspace identifier + INTEGER(HID_T) :: aspace3_id !Double Attribute Dataspace identifier + INTEGER(HID_T) :: aspace4_id !Real Attribute Dataspace identifier + INTEGER(HID_T) :: aspace5_id !Integer Attribute Dataspace identifier INTEGER(HID_T) :: aspace6_id !Null Attribute Dataspace identifier INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier INTEGER(HID_T) :: atype2_id !Character Attribute Datatype identifier @@ -76,8 +79,7 @@ INTEGER(HID_T) :: attr4_type !Returned REAL Attribute Datatype identifier INTEGER(HID_T) :: attr5_type !Returned INTEGER Attribute Datatype identifier INTEGER(HID_T) :: attr6_type !Returned NULL Attribute Datatype identifier - INTEGER :: num_attrs !number of attributes - INTEGER(HSIZE_T) :: attr_storage ! attributes storage requirements .MSB. + INTEGER :: num_attrs !number of attributes CHARACTER(LEN=256) :: attr_name !buffer to put attr_name INTEGER(SIZE_T) :: name_size = 80 !attribute name length @@ -111,32 +113,32 @@ ! !data buffers ! - INTEGER, DIMENSION(NX,NY) :: data_in + INTEGER, DIMENSION(NX,NY) :: data_in, data_out ! !Initialize data_in buffer ! - DO i = 1, NX - DO j = 1, NY + do i = 1, NX + do j = 1, NY data_in(i,j) = (i-1) + (j-1) - END DO - END DO + end do + end do ! ! Initialize attribute's data ! attr_data(1) = 'Dataset character attribute' attr_data(2) = 'Some other string here ' - attrlen = LEN(attr_data(1)) + attrlen = len(attr_data(1)) ! ! Create the file. ! CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify file name" - STOP - ENDIF + if (error .ne. 0) then + write(*,*) "Cannot modify file name" + stop + endif CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) CALL check("h5fcreate_f",error,total_error) @@ -245,10 +247,8 @@ ! ! Create dataset NULL attribute of INTEGER. ! - CALL h5acreate_f(dset_id, aname6, atype5_id, aspace6_id, & attr6_id, error) - CALL check("h5acreate_f",error,total_error) ! @@ -287,29 +287,6 @@ ! CALL h5awrite_f(attr6_id, atype5_id, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - - ! - ! check the amount of storage that is required for the specified attribute .MSB. - ! - CALL h5aget_storage_size_f(attr_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL VERIFY("h5aget_storage_size_f",attr_storage,*SizeOf(attr_storage),total_error) - CALL h5aget_storage_size_f(attr2_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,1,total_error) - CALL h5aget_storage_size_f(attr3_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,8,total_error) - CALL h5aget_storage_size_f(attr4_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) - CALL h5aget_storage_size_f(attr5_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,4,total_error) - CALL h5aget_storage_size_f(attr6_id, attr_storage, error) - CALL check("h5aget_storage_size_f",error,total_error) -! CALL verify("h5aget_storage_size_f",attr_storage,0,total_error) - ! ! Close the attribute. @@ -406,12 +383,12 @@ ! CALL h5aget_name_f(attr5_id, name_size, attr_name, error) CALL check("h5aget_name_f",error,total_error) - IF (attr_name(1:12) .NE. aname5) THEN + if (attr_name(1:12) .ne. aname5) then total_error = total_error + 1 - END IF - IF (error .NE. 12) THEN + end if + if (error .ne. 12) then total_error = total_error + 1 - END IF + end if ! !get the STRING attrbute space @@ -461,10 +438,10 @@ ! CALL h5aget_num_attrs_f(dset_id, num_attrs, error) CALL check("h5aget_num_attrs_f",error,total_error) - IF (num_attrs .NE. 6) THEN - WRITE(*,*) "got number of attributes wrong", num_attrs + if (num_attrs .ne. 6) then + write(*,*) "got number of attributes wrong", num_attrs total_error = total_error +1 - END IF + end if ! !set the read back data type's size @@ -481,60 +458,60 @@ CALL h5aread_f(attr_id, atype_id, aread_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF ( (aread_data(1) .NE. attr_data(1)) .OR. (aread_data(2) .NE. attr_data(2)) ) THEN - WRITE(*,*) "Read back string attrbute is wrong", aread_data(1), aread_data(2) + if ( (aread_data(1) .ne. attr_data(1)) .or. (aread_data(2) .ne. attr_data(2)) ) then + write(*,*) "Read back string attrbute is wrong", aread_data(1), aread_data(2) total_error = total_error + 1 - END IF + end if ! !read the CHARACTER attribute data back to memory ! CALL h5aread_f(attr2_id, H5T_NATIVE_CHARACTER, aread_character_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF (aread_character_data .NE. 'A' ) THEN - WRITE(*,*) "Read back character attrbute is wrong ",aread_character_data + if (aread_character_data .ne. 'A' ) then + write(*,*) "Read back character attrbute is wrong ",aread_character_data total_error = total_error + 1 - END IF + end if ! !read the double attribute data back to memory ! data_dims(1) = 1 CALL h5aread_f(attr3_id, H5T_NATIVE_DOUBLE, aread_double_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF (aread_double_data(1) .NE. 3.459 ) THEN - WRITE(*,*) "Read back double attrbute is wrong", aread_double_data(1) + if (aread_double_data(1) .ne. 3.459 ) then + write(*,*) "Read back double attrbute is wrong", aread_double_data(1) total_error = total_error + 1 - END IF + end if ! !read the real attribute data back to memory ! data_dims(1) = 1 CALL h5aread_f(attr4_id, H5T_NATIVE_REAL, aread_real_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF (aread_real_data(1) .NE. 4.0 ) THEN - WRITE(*,*) "Read back real attrbute is wrong ", aread_real_data + if (aread_real_data(1) .ne. 4.0 ) then + write(*,*) "Read back real attrbute is wrong ", aread_real_data total_error = total_error + 1 - END IF + end if ! !read the Integer attribute data back to memory ! data_dims(1) = 1 CALL h5aread_f(attr5_id, H5T_NATIVE_INTEGER, aread_integer_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF (aread_integer_data(1) .NE. 5 ) THEN - WRITE(*,*) "Read back integer attrbute is wrong ", aread_integer_data + if (aread_integer_data(1) .ne. 5 ) then + write(*,*) "Read back integer attrbute is wrong ", aread_integer_data total_error = total_error + 1 - END IF + end if ! !read the null attribute data. nothing can be read. ! data_dims(1) = 1 CALL h5aread_f(attr6_id, H5T_NATIVE_INTEGER, aread_null_data, data_dims, error) CALL check("h5aread_f",error,total_error) - IF (aread_null_data(1) .NE. 7 ) THEN - WRITE(*,*) "Read back null attrbute is wrong ", aread_null_data + if (aread_null_data(1) .ne. 7 ) then + write(*,*) "Read back null attrbute is wrong ", aread_null_data total_error = total_error + 1 - END IF + end if ! ! Close the attribute. @@ -563,10 +540,10 @@ ! CALL h5aget_num_attrs_f(dset_id, num_attrs, error) CALL check("h5aget_num_attrs_f",error,total_error) - IF (num_attrs .NE. 5) THEN - WRITE(*,*) "got number of attributes wrong", num_attrs + if (num_attrs .ne. 5) then + write(*,*) "got number of attributes wrong", num_attrs total_error = total_error +1 - END IF + end if @@ -605,7 +582,7 @@ ! ! Remove the file ! - IF (cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + if (cleanup) call h5_cleanup_f(filename, H5P_DEFAULT_F, error) RETURN END SUBROUTINE attribute_test diff --git a/fortran/test/tH5A_1_8.f90 b/fortran/test/tH5A_1_8.f90 deleted file mode 100644 index bba0340..0000000 --- a/fortran/test/tH5A_1_8.f90 +++ /dev/null @@ -1,3777 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -SUBROUTINE attribute_test_1_8(cleanup, total_error) - -! This subroutine tests following 1.8 functionalities: -! h5acreate_f, h5awrite_f, h5aclose_f,h5aread_f, h5aopen_name_f, -! h5aget_name_f,h5aget_space_f, h5aget_type_f, H5Pset_shared_mesg_nindexes_f, -! H5Pset_shared_mesg_index_f -! - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=5), PARAMETER :: filename = "atest" !File name - CHARACTER(LEN=9), PARAMETER :: dsetname = "atestdset" !Dataset name - CHARACTER(LEN=11), PARAMETER :: aname = "attr_string" !String Attribute name - CHARACTER(LEN=14), PARAMETER :: aname2 = "attr_character"!Character Attribute name - CHARACTER(LEN=11), PARAMETER :: aname3 = "attr_double" !DOuble Attribute name - CHARACTER(LEN=9), PARAMETER :: aname4 = "attr_real" !Real Attribute name - CHARACTER(LEN=12), PARAMETER :: aname5 = "attr_integer" !Integer Attribute name - CHARACTER(LEN=9), PARAMETER :: aname6 = "attr_null" !Null Attribute name - - ! - !data space rank and dimensions - ! - INTEGER, PARAMETER :: RANK = 2 - INTEGER, PARAMETER :: NX = 4 - INTEGER, PARAMETER :: NY = 5 - - ! - !general purpose integer - ! - INTEGER :: i, j - INTEGER :: error ! Error flag - - ! NEW STARTS HERE - INTEGER(HID_T) :: fapl = -1, fapl2 = -1 - INTEGER(HID_T) :: fcpl = -1, fcpl2 = -1 - INTEGER(HID_T) :: my_fapl, my_fcpl - LOGICAL, DIMENSION(1:2) :: new_format = (/.TRUE.,.FALSE./) - LOGICAL, DIMENSION(1:2) :: use_shared = (/.TRUE.,.FALSE./) - - -! ******************** -! test_attr equivelent -! ******************** - - WRITE(*,*) "TESTING ATTRIBUTES" - - CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL h5pcopy_f(fapl, fapl2, error) - CALL check("h5pcopy_f",error,total_error) - - CALL H5Pcreate_f(H5P_FILE_CREATE_F,fcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - CALL h5pcopy_f(fcpl, fcpl2, error) - CALL check("h5pcopy_f",error,total_error) - - CALL H5Pset_shared_mesg_nindexes_f(fcpl2,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) - - CALL H5Pset_shared_mesg_index_f(fcpl2, 0, H5O_SHMESG_ATTR_FLAG_F, 1, error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - - DO i = 1, 2 - IF (new_format(i)) THEN - WRITE(*,*) " - Testing with new file format" - my_fapl = fapl2 - ELSE - WRITE(*,*) " - Testing with old file format" - my_fapl = fapl - END IF - CALL test_attr_basic_write(my_fapl, total_error) -!!$ CALL test_attr_basic_read(my_fapl) -!!$ CALL test_attr_flush(my_fapl) -!!$ CALL test_attr_plist(my_fapl) ! this is next -!!$ CALL test_attr_compound_write(my_fapl) -!!$ CALL test_attr_compound_read(my_fapl) -!!$ CALL test_attr_scalar_write(my_fapl) -!!$ CALL test_attr_scalar_read(my_fapl) -!!$ CALL test_attr_mult_write(my_fapl) -!!$ CALL test_attr_mult_read(my_fapl) -!!$ CALL test_attr_iterate(my_fapl) -!!$ CALL test_attr_delete(my_fapl) -!!$ CALL test_attr_dtype_shared(my_fapl) - IF(new_format(i)) THEN - DO j = 1, 2 - IF (use_shared(j)) THEN - WRITE(*,*) " - Testing with shared attributes" - my_fcpl = fcpl2 - ELSE - WRITE(*,*) " - Testing without shared attributes" - my_fcpl = fcpl - END IF -!!$ CALL test_attr_dense_create(my_fcpl, my_fapl) - CALL test_attr_dense_open(my_fcpl, my_fapl, total_error) -!!$ CALL test_attr_dense_delete(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_rename(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_unlink(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_limits(my_fcpl, my_fapl) -!!$ CALL test_attr_big(my_fcpl, my_fapl) - CALL test_attr_null_space(my_fcpl, my_fapl, total_error) -!!$ CALL test_attr_deprec(fcpl, my_fapl) - CALL test_attr_many(new_format(i), my_fcpl, my_fapl, total_error) - CALL test_attr_corder_create_basic(my_fcpl, my_fapl, total_error) - CALL test_attr_corder_create_compact(my_fcpl, my_fapl, total_error) -!!$ CALL test_attr_corder_create_dense(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_create_reopen(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_transition(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_delete(my_fcpl, my_fapl) - CALL test_attr_info_by_idx(new_format, my_fcpl, my_fapl, total_error) - CALL test_attr_delete_by_idx(new_format, my_fcpl, my_fapl, total_error) -!!$ CALL test_attr_iterate2(new_format, my_fcpl, my_fapl) -!!$ CALL test_attr_open_by_idx(new_format, my_fcpl, my_fapl) -!!$ CALL test_attr_open_by_name(new_format, my_fcpl, my_fapl) - CALL test_attr_create_by_name(new_format(i), my_fcpl, my_fapl, total_error) - ! /* More complex tests with both "new format" and "shared" attributes */ - IF( use_shared(j) ) THEN -!!$ CALL test_attr_shared_write(my_fcpl, my_fapl) - CALL test_attr_shared_rename(my_fcpl, my_fapl, total_error) - CALL test_attr_shared_delete(my_fcpl, my_fapl, total_error) -!!$ CALL test_attr_shared_unlink(my_fcpl, my_fapl) - END IF -!!$ CALL test_attr_bug1(my_fcpl, my_fapl) - END DO -!!$ ELSE -!!$ CALL test_attr_big(fcpl, my_fapl) -!!$ CALL test_attr_null_space(fcpl, my_fapl) -!!$ CALL test_attr_deprec(fcpl, my_fapl) -!!$ CALL test_attr_many(new_format, fcpl, my_fapl) -!!$ CALL test_attr_info_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_delete_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_iterate2(new_format, fcpl, my_fapl) -!!$ CALL test_attr_open_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_open_by_name(new_format, fcpl, my_fapl) -!!$ CALL test_attr_create_by_name(new_format, fcpl, my_fapl) -!!$ CALL test_attr_bug1(fcpl, my_fapl) - - END IF - END DO - - CALL H5Pclose_f(fcpl, error) - CALL CHECK("H5Pclose", error,total_error) - CALL H5Pclose_f(fcpl2, error) - CALL CHECK("H5Pclose", error,total_error) - - IF(cleanup) CALL h5_cleanup_f("tattr", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - - RETURN -END SUBROUTINE attribute_test_1_8 - -SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) - -! Needed for get_info_by_name - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE -! - - - arg types - - - - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - INTEGER :: error - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset -!!$ -!!$! - - - local declarations - - - -!!$ -!!$ INTEGER :: max_compact,min_dense,curr_dset,u -!!$ CHARACTER (LEN=NAME_BUF_SIZE) :: attrname -!!$ - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - - INTEGER :: u - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=7) :: attrname - CHARACTER(LEN=2) :: chr2 - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - data_dims = 0 - -!!$ INTEGER :: sid -!!$ INTEGER :: attr -!!$ INTEGER :: dcpl -!!$ INTEGER ::is_empty -!!$ INTEGER ::is_dense -!!$ - WRITE(*,*) " - Testing Compact Storage of Attributes with Creation Order Info" - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - ! /* Create dataset creation property list */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) - CALL check("H5Pset_attr_creation_order",error,total_error) -! ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED)); - - ! /* Query the attribute creation properties */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - -! FIX: need to check optional parameters i.e. h5dcreate1/2_f - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - -!!$ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT) -!!$ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT) -!!$ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT) - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 -! CASE DEFAULT -! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") - DO u = 0, max_compact - 1 - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); - ! check with the optional information create2 specs. - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - -!!$ ret = H5O_num_attrs_test(my_dataset, nattrs) -!!$ CALL CHECK(ret, FAIL, "H5O_num_attrs_test") -!!$ CALL VERIFY(nattrs, (u + 1)) -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") - END DO - END DO - - ! /* Close Datasets */ - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - ! /* Close property list */ - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - -!!$ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl) -!!$ CALL CHECK(fid, FAIL, "H5Fopen") - - CALL h5dopen_f(fid, DSET1_NAME, dset1, error) - CALL check("h5dopen_f",error,total_error) - CALL h5dopen_f(fid, DSET2_NAME, dset2, error) - CALL check("h5dopen_f",error,total_error) - CALL h5dopen_f(fid, DSET3_NAME, dset3, error) - CALL check("h5dopen_f",error,total_error) - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - CASE DEFAULT - WRITE(*,*) " WARNING: To many data sets! " - END SELECT -!!$ ret = H5O_num_attrs_test(my_dataset, nattrs) -!!$ CALL CHECK(ret, FAIL, "H5O_num_attrs_test") -!!$ CALL VERIFY(nattrs, max_compact, "H5O_num_attrs_test") -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") - - DO u = 0,max_compact-1 - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - ! /* Retrieve information for attribute */ - - CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & - f_corder_valid, corder, cset, data_size, error, lapl_id = H5P_DEFAULT_F ) !with optional - - CALL check("H5Aget_info_by_name_f", error, total_error) - - ! /* Verify creation order of attribute */ - - CALL verifyLogical("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) - CALL verify("H5Aget_info_by_name_f", corder, u, total_error) - - - ! /* Retrieve information for attribute */ - - CALL H5Aget_info_by_name_f(my_dataset, ".", attrname, & - f_corder_valid, corder, cset, data_size, error) ! without optional - - CALL check("H5Aget_info_by_name_f", error, total_error) - - ! /* Verify creation order of attribute */ - - CALL verifyLogical("H5Aget_info_by_name_f", f_corder_valid, .TRUE., total_error) - CALL verify("H5Aget_info_by_name_f", corder, u, total_error) - - END DO - END DO - ! /* Close Datasets */ - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - -END SUBROUTINE test_attr_corder_create_compact - -SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) -! -------------------------------------------------- - USE HDF5 - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: sid, null_sid - INTEGER(HID_T) :: dataset - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - - INTEGER :: error - - INTEGER :: value_scalar - INTEGER, DIMENSION(1) :: value - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_sid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - INTEGER(HSIZE_T) :: storage_size ! attributes storage requirements .MSB. - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - LOGICAL :: equal - - ! test: H5Sextent_equal_f - - - data_dims = 0 - -! CHARACTER (LEN=NAME_BUF_SIZE) :: attrname - -! /* Output message about test being performed */ - WRITE(*,*) " - Testing Storing Attributes with 'null' dataspace" - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) -! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - -!!$ empty_filesize = h5_get_file_size(FILENAME) -!!$ IF (empty_filesize < 0) CALL TestErrPrintf("Line %d: file size wrong!\n"C, __LINE__) - ! /* Re-open file */ - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error) - CALL check("h5open_f",error,total_error) - ! /* Create dataspace for dataset attributes */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - ! /* Create "null" dataspace for attribute */ - CALL h5screate_f(H5S_NULL_F, null_sid, error) - CALL check("h5screate_f",error,total_error) - ! /* Create a dataset */ - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error) - CALL check("h5dcreate_f",error,total_error) -!!$ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) -!!$ CALL CHECK(dataset, FAIL, "H5Dcreate2") - ! /* Add attribute with 'null' dataspace */ - - ! /* Create attribute */ - CALL h5acreate_f(dataset, "null attr", H5T_NATIVE_INTEGER, null_sid, attr, error) - CALL check("h5acreate_f",error,total_error) - -!!$ CALL HDstrcpy(attrname, "null attr") -!!$ attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT) - ! /* Try to read data from the attribute */ - ! /* (shouldn't fail, but should leave buffer alone) */ - value(1) = 103 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL verify("h5aread_f",value(1),103,total_error) - -! /* Try to read data from the attribute again but*/ -! /* for a scalar */ - - value_scalar = 104 - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value_scalar, data_dims, error) - CALL check("h5aread_f",error,total_error) - CALL verify("h5aread_f",value_scalar,104,total_error) - - CALL h5aget_space_f(attr, attr_sid, error) - CALL check("h5aget_space_f",error,total_error) - - CALL H5Sextent_equal_f(attr_sid, null_sid, equal, error) - CALL check("H5Sextent_equal_f",error,total_error) - CALL Verifylogical("H5Sextent_equal_f",equal,.TRUE.,total_error) - - -!!$ ret = H5Sclose(attr_sid) -!!$ CALL CHECK(ret, FAIL, "H5Sclose") - - CALL h5aget_storage_size_f(attr, storage_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_storage_size_f",INT(storage_size),0,total_error) - - CALL h5aget_info_f(attr, f_corder_valid, corder, cset, data_size, error) - CALL VERIFY("h5aget_info_f",INT(data_size),INT(storage_size),total_error) - - - CALL h5aclose_f(attr,error) - CALL check("h5aclose_f",error,total_error) - - -!!$ CALL HDstrcpy(attrname, "null attr #2") -!!$ attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, null_sid, H5P_DEFAULT, H5P_DEFAULT) -!!$ CALL CHECK(attr, FAIL, "H5Acreate2") -!!$ value = 23 -!!$ ret = H5Awrite(attr, H5T_NATIVE_UINT, value) -!!$ CALL CHECK(ret, FAIL, "H5Awrite") -!!$ CALL VERIFY(value, 23, "H5Awrite") -!!$ ret = H5Aclose(attr) -!!$ CALL CHECK(ret, FAIL, "H5Aclose") -!!$ ret = H5Dclose(dataset) -!!$ CALL CHECK(ret, FAIL, "H5Dclose") -!!$ ret = H5Fclose(fid) -!!$ CALL CHECK(ret, FAIL, "H5Fclose") -!!$ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl) -!!$ CALL CHECK(fid, FAIL, "H5Fopen") -!!$ dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT) -!!$ CALL CHECK(dataset, FAIL, "H5Dopen2") -!!$ CALL HDstrcpy(attrname, "null attr #2") -!!$ attr = H5Aopen(dataset, attrname, H5P_DEFAULT) -!!$ CALL CHECK(attr, FAIL, "H5Aopen") -!!$ value = 23 -!!$ ret = H5Aread(attr, H5T_NATIVE_UINT, value) -!!$ CALL CHECK(ret, FAIL, "H5Aread") -!!$ CALL VERIFY(value, 23, "H5Aread") -!!$ attr_sid = H5Aget_space(attr) -!!$ CALL CHECK(attr_sid, FAIL, "H5Aget_space") -!!$ cmp = H5Sextent_equal(attr_sid, null_sid) -!!$ CALL CHECK(cmp, FAIL, "H5Sextent_equal") -!!$ CALL VERIFY(cmp, TRUE, "H5Sextent_equal") - - - CALL H5Sclose_f(attr_sid, error) - CALL check("H5Sclose_f",error,total_error) - - -!!$ ret = H5Sclose(attr_sid) -!!$ CALL CHECK(ret, FAIL, "H5Sclose") -!!$ storage_size = H5Aget_storage_size(attr) -!!$ CALL VERIFY(storage_size, 0, "H5Aget_storage_size") -!!$ ret = H5Aget_info(attr, ainfo) -!!$ CALL CHECK(ret, FAIL, "H5Aget_info") -!!$ CALL VERIFY(ainfo%data_size, storage_size, "H5Aget_info") -!!$ ret = H5Aclose(attr) -!!$ CALL CHECK(ret, FAIL, "H5Aclose") -!!$ CALL HDstrcpy(attrname, "null attr") -!!$ attr = H5Aopen(dataset, attrname, H5P_DEFAULT) -!!$ CALL CHECK(attr, FAIL, "H5Aopen") -!!$ value = 23 -!!$ ret = H5Awrite(attr, H5T_NATIVE_UINT, value) -!!$ CALL CHECK(ret, FAIL, "H5Awrite") -!!$ CALL VERIFY(value, 23, "H5Awrite") - - -!!$ CALL H5Aclose_f(attr, error) -!!$ CALL check("H5Aclose_f", error,total_error) -!!$ CALL H5Ddelete_f(fid, DSET1_NAME, H5P_DEFAULT_F, error) -!!$ CALL check("H5Aclose_f", error,total_error) - - CALL H5Dclose_f(dataset, error) - CALL check("H5Dclose_f", error,total_error) - -!!$ ret = H5delete(fid, DSET1_NAME, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Ldelete") - -! TESTING1 - - CALL H5Fclose_f(fid, error) - CALL check("H5Fclose_f", error,total_error) - - CALL H5Sclose_f(sid, error) - CALL check("H5Sclose_f", error,total_error) - - CALL H5Sclose_f(null_sid, error) - CALL check("H5Sclose_f", error,total_error) - -!!$ filesize = h5_get_file_size(FILENAME) -!!$ CALL VERIFY(filesize, empty_filesize, "h5_get_file_size") - -END SUBROUTINE test_attr_null_space - - -SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) - - USE HDF5 - - IMPLICIT NONE - - INTEGER(SIZE_T), PARAMETER :: NAME_BUF_SIZE = 7 - LOGICAL :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - INTEGER :: max_compact,min_dense,u - CHARACTER (LEN=NAME_BUF_SIZE) :: attrname - CHARACTER(LEN=8) :: dsetname - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - CHARACTER(LEN=2) :: chr2 - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - INTEGER :: Input1 - INTEGER :: i - - data_dims = 0 - - - ! /* Create dataspace for dataset & attributes */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! /* Create dataset creation property list */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Query the attribute creation properties */ - - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! /* Loop over using index for creation order value */ - DO i = 1, 2 - ! /* Print appropriate test message */ - IF(use_index(i))THEN - WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" - ELSE - WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" - ENDIF - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Set attribute creation order tracking & indexing for object */ - IF(new_format)THEN - - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ENDIF - - ! /* Create datasets */ - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f2",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f3",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f4",error,total_error) - - - ! /* Work on all the datasets */ - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - dsetname = DSET1_NAME - CASE (1) - my_dataset = dset2 - dsetname = DSET2_NAME - CASE (2) - my_dataset = dset3 - dsetname = DSET3_NAME - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - !/* Create attributes, up to limit of compact form */ - - DO u = 0, max_compact - 1 - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & - attr, error, lapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) - CALL check("H5Acreate_by_name_f",error,total_error) - - ! /* Write data into the attribute */ - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify information for NEW attribute */ - CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index, total_error) - ! CALL check("FAILED IN attr_info_by_idx_check",total_error) - ENDDO - - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Test opening attributes stored compactly */ - - CALL attr_open_check(fid, dsetname, my_dataset, u, total_error) - - ! CHECK(ret, FAIL, "attr_open_check"); - ENDDO - - - ! /* Work on all the datasets */ - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - dsetname = DSET1_NAME - CASE (1) - my_dataset = dset2 - dsetname = DSET2_NAME - CASE (2) - my_dataset = dset3 - dsetname = DSET3_NAME -! CASE DEFAULT -! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Create more attributes, to push into dense form */ - DO u = max_compact, max_compact* 2 - 1 - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL H5Acreate_by_name_f(fid, dsetname, attrname, H5T_NATIVE_INTEGER, sid, & - attr, error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Acreate_by_name",error,total_error) - - ! /* Write data into the attribute */ - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify state of object */ -!!$ if(u >= max_compact) { -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ } /* end if */ -!!$ -!!$ /* Verify information for new attribute */ -!!$ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); -!!$ CHECK(ret, FAIL, "attr_info_by_idx_check"); - ENDDO - - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); - -!!$ if(new_format) { -!!$ /* Retrieve & verify # of records in the name & creation order indices */ -!!$ ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); -!!$ CHECK(ret, FAIL, "H5O_attr_dense_info_test"); -!!$ if(use_index) -!!$ VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); -!!$ VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); -!!$ } /* end if */ - -!!$ /* Test opening attributes stored compactly */ -!!$ ret = attr_open_check(fid, dsetname, my_dataset, u); -!!$ CHECK(ret, FAIL, "attr_open_check"); - - ENDDO - - ! /* Close Datasets */ - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - ENDDO - - ! /* Close property list */ - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_create_by_name - - -SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) - - USE HDF5 - - IMPLICIT NONE - - LOGICAL :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - INTEGER(HSIZE_T) :: n - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER :: i, j - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - INTEGER(SIZE_T) :: size - CHARACTER(LEN=80) :: tmpname - - INTEGER :: Input1 - - data_dims = 0 -!!$ htri_t is_empty; /* Are there any attributes? */ -!!$ htri_t is_dense; /* Are attributes stored densely? */ -!!$ hsize_t nattrs; /* Number of attributes on object */ -!!$ hsize_t name_count; /* # of records in name index */ -!!$ hsize_t corder_count; /* # of records in creation order index */ -!!$ hbool_t use_index; /* Use index on creation order values */ -!!$ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ -!!$ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ -!!$ unsigned curr_dset; /* Current dataset to work on */ -!!$ unsigned u; /* Local index variable */ -!!$ herr_t ret; /* Generic return value */ - - ! /* Create dataspace for dataset & attributes */ - - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - - ! /* Create dataset creation property list */ - - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - - ! /* Query the attribute creation properties */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! /* Loop over using index for creation order value */ - - DO i = 1, 2 - - ! /* Output message about test being performed */ - IF(use_index(i))THEN - WRITE(*,'(A72)') " - Testing Querying Attribute Info By Index w/Creation Order Index" - ELSE - WRITE(*,'(A74)') " - Testing Querying Attribute Info By Index w/o Creation Order Index" - ENDIF - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Set attribute creation order tracking & indexing for object */ - IF(new_format)THEN - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - ENDIF - - ! /* Create datasets */ - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error ) - CALL check("h5dcreate_f",error,total_error) - - ! /* Work on all the datasets */ - - DO curr_dset = 0,NUM_DSETS-1 - - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - !/* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Check for query on non-existant attribute */ - - n = 0 - CALL h5aget_info_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_info_by_idx_f",error,-1,total_error) - - size = 0 - CALL h5aget_name_by_idx_f(my_dataset, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & - 0_HSIZE_T, tmpname, size, error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("h5aget_name_by_idx_f",error,-1,total_error) - - - ! /* Create attributes, up to limit of compact form */ - - DO j = 0, max_compact-1 - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') j - attrname = 'attr '//chr2 - - ! attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); - ! check with the optional information create2 specs. - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Write data into the attribute */ - - attr_integer_data(1) = j - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify information for new attribute */ - - CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error ) - - CALL check("attr_info_by_idx_check",error,total_error) - - !CHECK(ret, FAIL, "attr_info_by_idx_check"); - ENDDO - - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Check for out of bound offset queries */ -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_info_by_idx"); -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_info_by_idx"); -!!$ ret = H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_name_by_idx"); -!!$ -!!$ /* Create more attributes, to push into dense form */ -!!$ for(; u < (max_compact * 2); u++) { -!!$ /* Create attribute */ -!!$ sprintf(attrname, "attr %02u", u); -!!$ attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); -!!$ CHECK(attr, FAIL, "H5Acreate2"); -!!$ -!!$ /* Write data into the attribute */ -!!$ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); -!!$ CHECK(ret, FAIL, "H5Awrite"); -!!$ -!!$ /* Close attribute */ -!!$ ret = H5Aclose(attr); -!!$ CHECK(ret, FAIL, "H5Aclose"); -!!$ -!!$ /* Verify state of object */ -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ -!!$ /* Verify information for new attribute */ -!!$ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); -!!$ CHECK(ret, FAIL, "attr_info_by_idx_check"); -!!$ } /* end for */ -!!$ -!!$ /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ -!!$ if(new_format) { -!!$ /* Retrieve & verify # of records in the name & creation order indices */ -!!$ ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); -!!$ CHECK(ret, FAIL, "H5O_attr_dense_info_test"); -!!$ if(use_index) -!!$ VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); -!!$ VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); -!!$ } /* end if */ -!!$ -!!$ /* Check for out of bound offset queries */ -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_info_by_idx"); -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_info_by_idx"); -!!$ ret = H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Aget_name_by_idx"); -!!$ } /* end for */ -!!$ - -!!$ } /* end for */ -!!$ - - ENDDO - - - ! /* Close Datasets */ - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - END DO - - ! /* Close property list */ - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_info_by_idx - - -SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) - - USE HDF5 - - IMPLICIT NONE - - INTEGER :: error, total_error - - INTEGER :: obj_id - CHARACTER(LEN=*) :: attrname - INTEGER(HSIZE_T) :: n - LOGICAL :: use_index - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - - INTEGER(SIZE_T) :: NAME_BUF_SIZE = 7 - CHARACTER(LEN=7) :: tmpname - -!!$ -!!$ INTEGER :: const -!!$ INTEGER :: har -!!$ INTEGER :: attrname -!!$ INTEGER :: hsize_t -!!$ INTEGER :: hbool_t -!!$ INTEGER :: se_index -!!$ INTEGER :: old_nerrs -!!$ CHARACTER (LEN=NAME_BUF_SIZE) :: tmpname -!!$ ainfo -!!$ ret -!!$ old_nerrs = GetTestNumErrs() - - ! /* Verify the information for first attribute, in increasing creation order */ - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL verify("h5aget_info_by_idx_f",corder,0,total_error) - - ! /* Verify the information for new attribute, in increasing creation order */ - - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, & - f_corder_valid, corder, cset, data_size, error) - - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! /* Verify the name for new link, in increasing creation order */ - -!!$ CALL HDmemset(tmpname, 0, (size_t)) - - CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & - n, tmpname, NAME_BUF_SIZE, error) - CALL check("h5aget_name_by_idx_f",error,total_error) - - IF(TRIM(attrname).NE.TRIM(tmpname))THEN - error = -1 - ENDIF - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) - - ! /* Don't test "native" order if there is no creation order index, since - ! * there's not a good way to easily predict the attribute's order in the name - ! * index. - ! */ - IF (use_index) THEN - ! CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - ! /* Verify the information for first attribute, in native creation order */ - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) - - ! CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - - ! /* Verify the information for new attribute, in native creation order */ - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) - - ! /* Verify the name for new link, in increasing native order */ - ! CALL HDmemset(tmpname, 0, (size_t)) - CALL h5aget_name_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_NATIVE_F, & - n, tmpname, NAME_BUF_SIZE, error) - CALL check("h5aget_name_by_idx_f",error,total_error) - IF(TRIM(attrname).NE.TRIM(tmpname))THEN - WRITE(*,*) "ERROR: attribute name size wrong!" - error = -1 - ENDIF - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) - END IF - - - ! CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) - - ! CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) -!!$ CALL HDmemset(tmpname, 0, (size_t)) -!!$ ret = H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Aget_name_by_idx") -!!$ IF (HDstrcmp(attrname, tmpname)) CALL TestErrPrintf("Line %d: attribute name size wrong!\n"C, __LINE__) -!!$ CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) -!!$ CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_INC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) -!!$ CALL HDmemset(tmpname, 0, (size_t)) -!!$ ret = H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Aget_name_by_idx") -!!$ IF (HDstrcmp(attrname, tmpname)) CALL TestErrPrintf("Line %d: attribute name size wrong!\n"C, __LINE__) -!!$ CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, n, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,0,total_error) -!!$ CALL HDmemset(ainfo, 0, SIZEOF(ainfo) - CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error) - CALL check("h5aget_info_by_idx_f",error,total_error) - CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) -!!$ CALL HDmemset(tmpname, 0, (size_t)) -!!$ ret = H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Aget_name_by_idx") -!!$ IF (HDstrcmp(attrname, tmpname)) CALL TestErrPrintf("Line %d: attribute name size wrong!\n"C, __LINE__) - -END SUBROUTINE attr_info_by_idx_check - - -SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) - -!/**************************************************************** -!** -!** test_attr_shared_rename(): Test basic H5A (attribute) code. -!** Tests renaming shared attributes in "compact" & "dense" storage -!** -!****************************************************************/ - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid, big_sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - - INTEGER(HID_T) :: dataset, dataset2 - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_tid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - CHARACTER(LEN=11) :: attrname2 - - CHARACTER(LEN=1), PARAMETER :: chr1 = '.' - - INTEGER :: u - INTEGER, PARAMETER :: SPACE1_RANK = 3 - INTEGER, PARAMETER :: NX = 20 - INTEGER, PARAMETER :: NY = 5 - INTEGER, PARAMETER :: NZ = 10 - INTEGER(HID_T) :: my_fcpl - - CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" - - INTEGER, PARAMETER :: SPACE1_DIM1 = 4 - INTEGER, PARAMETER :: SPACE1_DIM2 = 8 - INTEGER, PARAMETER :: SPACE1_DIM3 = 10 - - - INTEGER :: test_shared - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - - ! /* Output message about test being performed */ - WRITE(*,*) " - Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage" -!!$ /* Initialize "big" attribute data */ -!!$ CALL HDmemset(big_value, 1, SIZEOF(big_value) - - ! /* Create dataspace for dataset */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! /* Create "big" dataspace for "large" attributes */ - - CALL h5screate_simple_f(arank, adims2, big_sid, error) - CALL check("h5screate_simple_f",error,total_error) - - ! /* Loop over type of shared components */ - DO test_shared = 0, 2 - ! /* Make copy of file creation property list */ - CALL H5Pcopy_f(fcpl, my_fcpl, error) - CALL check("H5Pcopy",error,total_error) - - ! /* Set up datatype for attributes */ - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) - CALL check("H5Tcopy",error,total_error) - - ! /* Special setup for each type of shared components */ - - IF( test_shared .EQ. 0) THEN - ! /* Make attributes > 500 bytes shared */ - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_nindexes"); - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - ELSE - ! /* Set up copy of file creation property list */ - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) -!!$ -!!$ CHECK_I(ret, "H5Pset_shared_mesg_nindexes"); -!!$ - ! /* Make attributes > 500 bytes shared */ - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); -!!$ - ! /* Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) */ - CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - ENDIF - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Close FCPL copy */ - CALL h5pclose_f(my_fcpl, error) - CALL check("h5pclose_f", error, total_error) - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - -!!$ -!!$ /* Get size of file */ -!!$ empty_filesize = h5_get_file_size(FILENAME); -!!$ if(empty_filesize < 0) -!!$ TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - - ! /* Re-open file */ - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) - CALL check("h5open_f",error,total_error) - - ! /* Commit datatype to file */ - IF(test_shared.EQ.2) THEN - CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F,error) - CALL check("H5Tcommit",error,total_error) - ENDIF - - ! /* Set up to query the object creation properties */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Create datasets */ - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - ! /* Check on dataset's message storage status */ -!!$ if(test_shared != 0) { -!!$ /* Datasets' datatypes can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Datasets' dataspace can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ - - ! /* Retrieve limits for compact/dense attribute storage */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! /* Close property list */ - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) -!!$ -!!$ -!!$ /* Check on datasets' attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - ! /* Add attributes to each dataset, until after converting to dense storage */ - - - DO u = 0, (max_compact * 2) - 1 - - ! /* Create attribute name */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! /* Alternate between creating "small" & "big" attributes */ - - IF(MOD(u+1,2).EQ.0)THEN - ! /* Create "small" attribute on first dataset */ - - CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); - - ! /* Write data into the attribute */ - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - ! Create "big" attribute on first dataset */ - - CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) -!!$ - ! Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ - ! Write data into the attribute */ - - data_dims(1) = 1 - attr_integer_data(1) = u + 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); - ENDIF - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); -!!$ -!!$ - ! /* Alternate between creating "small" & "big" attributes */ - IF(MOD(u+1,2).EQ.0)THEN - - ! /* Create "small" attribute on second dataset */ - - CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ - ! /* Write data into the attribute */ - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - - ! /* Create "big" attribute on second dataset */ - - CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ -! /* Write data into the attribute */ - - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 -! CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) -! CALL check("h5awrite_f",error,total_error) - - -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); - - ENDIF - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - - - ! /* Create new attribute name */ - - WRITE(chr2,'(I2.2)') u - attrname2 = 'new attr '//chr2 - - - ! /* Change second dataset's attribute's name */ - - CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname, attrname2, error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Arename_by_name_f",error,total_error) - - ! /* Check refcount on attributes now */ - - ! /* Check refcount on renamed attribute */ - - CALL H5Aopen_f(dataset2, attrname2, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("H5Aopen_f",error,total_error) - -!!$ -!!$ IF(MOD(u+1,2).EQ.0)THEN -!!$ ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ CALL VERIFY("H5A_is_shared_test", error, -1) -!!$ ELSE -!!$ ! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test") -!!$ ENDIF - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check refcount on original attribute */ - CALL H5Aopen_f(dataset, attrname, attr, error) - CALL check("H5Aopen",error,total_error) - -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - - ! /* Change second dataset's attribute's name back to original */ - - CALL H5Arename_by_name_f(fid, DSET2_NAME, attrname2, attrname, error) - CALL check("H5Arename_by_name_f",error,total_error) - - ! /* Check refcount on attributes now */ - - ! /* Check refcount on renamed attribute */ - CALL H5Aopen_f(dataset2, attrname, attr, error) - CALL check("H5Aopen",error,total_error) -!!$ -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check refcount on original attribute */ - - ! /* Check refcount on renamed attribute */ - CALL H5Aopen_f(dataset, attrname, attr, error) - CALL check("H5Aopen",error,total_error) - -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ENDDO - - ! /* Close attribute's datatype */ - CALL h5tclose_f(attr_tid, error) - CALL check("h5tclose_f",error,total_error) - - ! /* Close attribute's datatype */ - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dataset2, error) - CALL check("h5dclose_f",error,total_error) - -!!$ /* Check on shared message status now */ -!!$ if(test_shared != 0) { -!!$ if(test_shared == 1) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ - - ! /* Unlink datasets with attributes */ - CALL H5Ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("HLdelete",error,total_error) - CALL H5Ldelete_f(fid, DSET2_NAME, error) - CALL check("HLdelete",error,total_error) - - !/* Unlink committed datatype */ - IF(test_shared == 2)THEN - CALL H5Ldelete_f(fid, TYPE1_NAME, error) - CALL check("HLdelete_f",error,total_error) - ENDIF - - ! /* Check on attribute storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ if(test_shared != 0) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! /* Check size of file */ - !filesize = h5_get_file_size(FILENAME); - !VERIFY(filesize, empty_filesize, "h5_get_file_size"); - ENDDO - - ! /* Close dataspaces */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(big_sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_shared_rename - - -SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) - - USE HDF5 - - IMPLICIT NONE - - LOGICAL, INTENT(IN) :: new_format - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - CHARACTER(LEN=8) :: DSET3_NAME = "Dataset3" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - INTEGER :: curr_dset - - INTEGER(HID_T) :: dset1, dset2, dset3 - INTEGER(HID_T) :: my_dataset - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - LOGICAL :: f_corder_valid ! Indicates whether the the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! indicates the size, in the number of characters - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER :: i - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - INTEGER(SIZE_T) :: size - CHARACTER(LEN=8) :: tmpname - CHARACTER(LEN=1), PARAMETER :: chr1 = '.' - - INTEGER :: idx_type - INTEGER :: order - INTEGER :: u - INTEGER :: Input1 - - data_dims = 0 - -!!$test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) -!!${ -!!$ hid_t fid; /* HDF5 File ID */ -!!$ hid_t dset1, dset2, dset3; /* Dataset IDs */ -!!$ hid_t my_dataset; /* Current dataset ID */ -!!$ hid_t sid; /* Dataspace ID */ -!!$ hid_t attr; /* Attribute ID */ -!!$ hid_t dcpl; /* Dataset creation property list ID */ -!!$ H5A_info_t ainfo; /* Attribute information */ -!!$ unsigned max_compact; /* Maximum # of links to store in group compactly */ -!!$ unsigned min_dense; /* Minimum # of links to store in group "densely" */ -!!$ htri_t is_empty; /* Are there any attributes? */ -!!$ htri_t is_dense; /* Are attributes stored densely? */ -!!$ hsize_t nattrs; /* Number of attributes on object */ -!!$ hsize_t name_count; /* # of records in name index */ -!!$ hsize_t corder_count; /* # of records in creation order index */ -!!$ H5_index_t idx_type; /* Type of index to operate on */ -!!$ H5_iter_order_t order; /* Order within in the index */ -!!$ hbool_t use_index; /* Use index on creation order values */ -!!$ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ -!!$ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ -!!$ unsigned curr_dset; /* Current dataset to work on */ -!!$ unsigned u; /* Local index variable */ -!!$ herr_t ret; /* Generic return value */ -!!$ - - ! /* Create dataspace for dataset & attributes */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! /* Create dataset creation property list */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Query the attribute creation properties */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - - !/* Loop over operating on different indices on link fields */ - DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - - ! /* Loop over operating in different orders */ - DO order = H5_ITER_INC_F, H5_ITER_DEC_F - - ! /* Loop over using index for creation order value */ - DO i = 1, 2 - - ! /* Print appropriate test message */ - IF(idx_type .EQ. H5_INDEX_CRT_ORDER_F)THEN - IF(order .EQ. H5_ITER_INC_F) THEN - IF(use_index(i))THEN - WRITE(*,'(A102)') & - " - Testing Deleting Attribute By Creation Order Index in Increasing Order w/Creation Order Index" - ELSE - WRITE(*,'(A104)') & - " - Testing Deleting Attribute By Creation Order Index in Increasing Order w/o Creation Order Index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(A102)') & - " - Testing Deleting Attribute By Creation Order Index in Decreasing Order w/Creation Order Index" - ELSE - WRITE(*,'(A104)') & - " - Testing Deleting Attribute By Creation Order Index in Decreasing Order w/o Creation Order Index" - ENDIF - ENDIF - ELSE - IF(order .EQ. H5_ITER_INC_F)THEN - IF(use_index(i))THEN - WRITE(*,'(7X,A86)')"- Testing Deleting Attribute By Name Index in Increasing Order w/Creation Order Index" - ELSE - WRITE(*,'(7X,A88)')"- Testing Deleting Attribute By Name Index in Increasing Order w/o Creation Order Index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(7X,A86)') "- Testing Deleting Attribute By Name Index in Decreasing Order w/Creation Order Index" - ELSE - WRITE(*,'(7X,A88)') "- Testing Deleting Attribute By Name Index in Decreasing Order w/o Creation Order Index" - ENDIF - ENDIF - ENDIF - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Set attribute creation order tracking & indexing for object */ - IF(new_format)THEN - - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ENDIF - - ! /* Create datasets */ - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dset1, error, dcpl ) - CALL check("h5dcreate_f2",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dset2, error, dcpl ) - CALL check("h5dcreate_f3",error,total_error) - - CALL h5dcreate_f(fid, DSET3_NAME, H5T_NATIVE_CHARACTER, sid, dset3, error, dcpl ) - CALL check("h5dcreate_f4",error,total_error) - - ! /* Work on all the datasets */ - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Check for deleting non-existant attribute */ - CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("H5Adelete_by_idx_f",error,-1,total_error) - - ! /* Create attributes, up to limit of compact form */ - DO u = 0, max_compact - 1 - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Write data into the attribute */ - attr_integer_data(1) = u - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify information for new attribute */ - CALL attr_info_by_idx_check(my_dataset, attrname, INT(u,HSIZE_T), use_index(i), total_error ) - - ENDDO - - - - ! /* Verify state of object */ - -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - !/* Check for out of bound deletions */ - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) - CALL VERIFY("H5Adelete_by_idx_f",error,-1,total_error) - - ENDDO - - - DO curr_dset = 0, NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Delete attributes from compact storage */ - - DO u = 0, max_compact - 2 - - ! /* Delete first attribute in appropriate order */ - - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) - CALL check("H5Adelete_by_idx_f",error,total_error) - - - ! /* Verify the attribute information for first attribute in appropriate order */ - ! HDmemset(&ainfo, 0, sizeof(ainfo)); - - CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, & - f_corder_valid, corder, cset, data_size, error) - - IF(new_format)THEN - IF(order.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("H5Aget_info_by_idx_f",corder,u + 1,total_error) - ENDIF - ELSE - CALL VERIFY("H5Aget_info_by_idx_f",corder, max_compact-(u + 2),total_error) - ENDIF - - ! /* Verify the name for first attribute in appropriate order */ - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); - - size = 7 ! *CHECK* IF NOT THE SAME SIZE - CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & - tmpname, size, error, lapl_id=H5P_DEFAULT_F) - CALL check('h5aget_name_by_idx_f',error,total_error) - IF(order .EQ. H5_ITER_INC_F)THEN - WRITE(chr2,'(I2.2)') u + 1 - attrname = 'attr '//chr2 - ELSE - WRITE(chr2,'(I2.2)') max_compact - (u + 2) - attrname = 'attr '//chr2 - ENDIF - IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) - ENDDO - - ! /* Delete last attribute */ - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, 0_HSIZE_T, error) - CALL check("H5Adelete_by_idx_f",error,total_error) - - - ! /* Verify state of attribute storage (empty) */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); - ENDDO - -! /* Work on all the datasets */ - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Create more attributes, to push into dense form */ - - DO u = 0, (max_compact * 2) - 1 - - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - - ! /* Write data into the attribute */ - attr_integer_data(1) = u - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify state of object */ - IF(u .GE. max_compact)THEN -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); - ENDIF - - ! /* Verify information for new attribute */ -!!$ CALL check("attr_info_by_idx_check",error,total_error) - ENDDO - - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ - IF(new_format)THEN -!!$ ! /* Retrieve & verify # of records in the name & creation order indices */ -!!$ ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); -!!$ CHECK(ret, FAIL, "H5O_attr_dense_info_test"); -!!$ IF(use_index) -!!$ VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); -!!$ VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); - ENDIF - - ! /* Check for out of bound deletion */ - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) - CALL VERIFY("H5Adelete_by_idx_f",error,-1,total_error) - ENDDO - - ! /* Work on all the datasets */ - - DO curr_dset = 0,NUM_DSETS-1 - SELECT CASE (curr_dset) - CASE (0) - my_dataset = dset1 - CASE (1) - my_dataset = dset2 - CASE (2) - my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") - END SELECT - - ! /* Delete attributes from dense storage */ - - DO u = 0, (max_compact * 2) - 1 - 1 - - ! /* Delete first attribute in appropriate order */ - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) - CALL check("H5Adelete_by_idx_f",error,total_error) - - - ! /* Verify the attribute information for first attribute in appropriate order */ -!!$ HDmemset(&ainfo, 0, sizeof(ainfo)); - - - CALL h5aget_info_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - - - IF(new_format)THEN - IF(order.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("H5Aget_info_by_idx_f",corder,u + 1,total_error) - ENDIF - ELSE - CALL VERIFY("H5Aget_info_by_idx_f",corder, ((max_compact * 2) - (u + 2)), total_error) - ENDIF - - - ! /* Verify the name for first attribute in appropriate order */ - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); - - size = 7 ! *CHECK* if not the correct size - CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & - tmpname, size, error) - - IF(order .EQ. H5_ITER_INC_F)THEN - WRITE(chr2,'(I2.2)') u + 1 - attrname = 'attr '//chr2 - ELSE - WRITE(chr2,'(I2.2)') max_compact * 2 - (u + 2) - attrname = 'attr '//chr2 - ENDIF - IF(TRIM(attrname).NE.TRIM(tmpname)) error = -1 - CALL VERIFY("h5aget_name_by_idx_f",error,0,total_error) - - - ENDDO - ! /* Delete last attribute */ - - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) - CALL check("H5Adelete_by_idx_f",error,total_error) - ! /* Verify state of attribute storage (empty) */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); - - !/* Check for deletion on empty attribute storage again */ - CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) - CALL VERIFY("H5Adelete_by_idx_f",error,-1,total_error) - ENDDO - - -!!$ -!!$ -!!$ /* Delete attributes in middle */ -!!$ -!!$ -!!$ /* Work on all the datasets */ -!!$ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { -!!$ switch(curr_dset) { -!!$ case 0: -!!$ my_dataset = dset1; -!!$ break; -!!$ -!!$ case 1: -!!$ my_dataset = dset2; -!!$ break; -!!$ -!!$ case 2: -!!$ my_dataset = dset3; -!!$ break; -!!$ -!!$ default: -!!$ HDassert(0 && "Too many datasets!"); -!!$ } /* end switch */ -!!$ -!!$ /* Create attributes, to push into dense form */ -!!$ for(u = 0; u < (max_compact * 2); u++) { -!!$ /* Create attribute */ -!!$ sprintf(attrname, "attr %02u", u); -!!$ attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); -!!$ CHECK(attr, FAIL, "H5Acreate2"); -!!$ -!!$ /* Write data into the attribute */ -!!$ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u); -!!$ CHECK(ret, FAIL, "H5Awrite"); -!!$ -!!$ /* Close attribute */ -!!$ ret = H5Aclose(attr); -!!$ CHECK(ret, FAIL, "H5Aclose"); -!!$ -!!$ /* Verify state of object */ -!!$ if(u >= max_compact) { -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ } /* end if */ -!!$ -!!$ /* Verify information for new attribute */ -!!$ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); -!!$ CHECK(ret, FAIL, "attr_info_by_idx_check"); -!!$ } /* end for */ -!!$ } /* end for */ -!!$ -!!$ /* Work on all the datasets */ -!!$ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { -!!$ switch(curr_dset) { -!!$ case 0: -!!$ my_dataset = dset1; -!!$ break; -!!$ -!!$ case 1: -!!$ my_dataset = dset2; -!!$ break; -!!$ -!!$ case 2: -!!$ my_dataset = dset3; -!!$ break; -!!$ -!!$ default: -!!$ HDassert(0 && "Too many datasets!"); -!!$ } /* end switch */ -!!$ -!!$ /* Delete every other attribute from dense storage, in appropriate order */ -!!$ for(u = 0; u < max_compact; u++) { -!!$ /* Delete attribute */ -!!$ ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); -!!$ CHECK(ret, FAIL, "H5Adelete_by_idx"); -!!$ -!!$ /* Verify the attribute information for first attribute in appropriate order */ -!!$ HDmemset(&ainfo, 0, sizeof(ainfo)); -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, &ainfo, H5P_DEFAULT); -!!$ if(new_format) { -!!$ if(order == H5_ITER_INC) { -!!$ VERIFY(ainfo.corder, ((u * 2) + 1), "H5Aget_info_by_idx"); -!!$ } /* end if */ -!!$ else { -!!$ VERIFY(ainfo.corder, ((max_compact * 2) - ((u * 2) + 2)), "H5Aget_info_by_idx"); -!!$ } /* end else */ -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for first attribute in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ ret = H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); -!!$ if(order == H5_ITER_INC) -!!$ sprintf(attrname, "attr %02u", ((u * 2) + 1)); -!!$ else -!!$ sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 2))); -!!$ ret = HDstrcmp(attrname, tmpname); -!!$ VERIFY(ret, 0, "H5Aget_name_by_idx"); -!!$ } /* end for */ -!!$ } /* end for */ -!!$ -!!$ /* Work on all the datasets */ -!!$ for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) { -!!$ switch(curr_dset) { -!!$ case 0: -!!$ my_dataset = dset1; -!!$ break; -!!$ -!!$ case 1: -!!$ my_dataset = dset2; -!!$ break; -!!$ -!!$ case 2: -!!$ my_dataset = dset3; -!!$ break; -!!$ -!!$ default: -!!$ HDassert(0 && "Too many datasets!"); -!!$ } /* end switch */ -!!$ -!!$ /* Delete remaining attributes from dense storage, in appropriate order */ -!!$ for(u = 0; u < (max_compact - 1); u++) { -!!$ /* Delete attribute */ -!!$ ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); -!!$ CHECK(ret, FAIL, "H5Adelete_by_idx"); -!!$ -!!$ /* Verify the attribute information for first attribute in appropriate order */ -!!$ HDmemset(&ainfo, 0, sizeof(ainfo)); -!!$ ret = H5Aget_info_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, &ainfo, H5P_DEFAULT); -!!$ if(new_format) { -!!$ if(order == H5_ITER_INC) { -!!$ VERIFY(ainfo.corder, ((u * 2) + 3), "H5Aget_info_by_idx"); -!!$ } /* end if */ -!!$ else { -!!$ VERIFY(ainfo.corder, ((max_compact * 2) - ((u * 2) + 4)), "H5Aget_info_by_idx"); -!!$ } /* end else */ -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for first attribute in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ ret = H5Aget_name_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); -!!$ if(order == H5_ITER_INC) -!!$ sprintf(attrname, "attr %02u", ((u * 2) + 3)); -!!$ else -!!$ sprintf(attrname, "attr %02u", ((max_compact * 2) - ((u * 2) + 4))); -!!$ ret = HDstrcmp(attrname, tmpname); -!!$ VERIFY(ret, 0, "H5Aget_name_by_idx"); -!!$ } /* end for */ -!!$ -!!$ /* Delete last attribute */ -!!$ ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); -!!$ CHECK(ret, FAIL, "H5Adelete_by_idx"); -!!$ -!!$ /* Verify state of attribute storage (empty) */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ -!!$ /* Check for deletion on empty attribute storage again */ -!!$ ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); -!!$ VERIFY(ret, FAIL, "H5Adelete_by_idx"); -!!$ } /* end for */ - - ! /* Close Datasets */ - CALL h5dclose_f(dset1, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset2, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dset3, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - ENDDO - ENDDO - ENDDO - - ! /* Close property list */ - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_delete_by_idx - -SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) - -!/**************************************************************** -!** -!** test_attr_shared_delete(): Test basic H5A (attribute) code. -!** Tests deleting shared attributes in "compact" & "dense" storage -!** -!****************************************************************/ - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid, big_sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - CHARACTER(LEN=8) :: DSET2_NAME = "Dataset2" - INTEGER, PARAMETER :: NUM_DSETS = 3 - - - INTEGER(HID_T) :: dataset, dataset2 - - INTEGER :: error - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HID_T) :: attr_tid - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - INTEGER, DIMENSION(1) :: attr_integer_data - CHARACTER(LEN=7) :: attrname - - CHARACTER(LEN=1), PARAMETER :: chr1 = '.' - - INTEGER :: u - INTEGER, PARAMETER :: SPACE1_RANK = 3 - INTEGER, PARAMETER :: NX = 20 - INTEGER, PARAMETER :: NY = 5 - INTEGER, PARAMETER :: NZ = 10 - INTEGER(HID_T) :: my_fcpl - - CHARACTER(LEN=5), PARAMETER :: TYPE1_NAME = "/Type" - - INTEGER :: test_shared - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - - ! /* Output message about test being performed */ - WRITE(*,*) " - Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage" - - ! /* Initialize "big" attribute DATA */ -!!$ HDmemset(big_value, 1, sizeof(big_value)); -!!$ - ! /* Create dataspace for dataset */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - !/* Create "big" dataspace for "large" attributes */ - - CALL h5screate_simple_f(arank, adims2, big_sid, error) - CALL check("h5screate_simple_f",error,total_error) - - ! /* Loop over type of shared components */ - - DO test_shared = 0, 2 - - ! /* Make copy of file creation property list */ - - CALL H5Pcopy_f(fcpl, my_fcpl, error) - CALL check("H5Pcopy",error,total_error) - - ! /* Set up datatype for attributes */ - - CALL H5Tcopy_f(H5T_NATIVE_INTEGER, attr_tid, error) - CALL check("H5Tcopy",error,total_error) - - ! /* Special setup for each type of shared components */ - IF( test_shared .EQ. 0) THEN - ! /* Make attributes > 500 bytes shared */ - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) - CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_nindexes"); - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) - CALL check(" H5Pset_shared_mesg_index_f",error, total_error) - -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - ELSE - ! /* Set up copy of file creation property list */ - CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) -!!$ -!!$ CHECK_I(ret, "H5Pset_shared_mesg_nindexes"); -!!$ - ! /* Make attributes > 500 bytes shared */ - CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); -!!$ - ! /* Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) */ - CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); - ENDIF - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, my_fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Close FCPL copy */ - CALL h5pclose_f(my_fcpl, error) - CALL check("h5pclose_f", error, total_error) - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) -!!$ -!!$ /* Get size of file */ -!!$ empty_filesize = h5_get_file_size(FILENAME); -!!$ if(empty_filesize < 0) -!!$ TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - - ! /* Re-open file */ - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error,fapl) - CALL check("h5open_f",error,total_error) - - ! /* Commit datatype to file */ - - IF(test_shared.EQ.2) THEN - CALL H5Tcommit_f(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F,error) - CALL check("H5Tcommit",error,total_error) - ENDIF - - ! /* Set up to query the object creation properties */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Create datasets */ - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) - CALL check("h5dcreate_f",error,total_error) - - ! /* Check on dataset's message storage status */ -!!$ if(test_shared != 0) { -!!$ /* Datasets' datatypes can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Datasets' dataspace can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ - ! /* Retrieve limits for compact/dense attribute storage */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! /* Close property list */ - CALL h5pclose_f(dcpl,error) - CALL check("h5pclose_f", error, total_error) -!!$ -!!$ /* Check on datasets' attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ - ! /* Add attributes to each dataset, until after converting to dense storage */ - - DO u = 0, (max_compact * 2) - 1 - - ! /* Create attribute name */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! /* Alternate between creating "small" & "big" attributes */ - - IF(MOD(u+1,2).EQ.0)THEN - ! /* Create "small" attribute on first dataset */ - - CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); - - ! /* Write data into the attribute */ - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - ! Create "big" attribute on first dataset */ - - CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error) - CALL check("h5acreate_f",error,total_error) -!!$ - ! Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ - ! Write data into the attribute */ - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); - ENDIF - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); -!!$ -!!$ - ! /* Alternate between creating "small" & "big" attributes */ - IF(MOD(u+1,2).EQ.0)THEN - - ! /* Create "small" attribute on second dataset */ - - CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error) - CALL check("h5acreate_f",error,total_error) - - ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ - ! /* Write data into the attribute */ - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - ELSE - - ! /* Create "big" attribute on second dataset */ - - CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - -! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ -! /* Write data into the attribute */ - - - attr_integer_data(1) = u + 1 - data_dims(1) = 1 - CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); - - ENDIF - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - ENDDO - - ! /* Delete attributes from second dataset */ - - DO u = 0, max_compact*2-1 - - ! /* Create attribute name */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - ! /* Delete second dataset's attribute */ - CALL H5Adelete_by_name_f(fid, DSET2_NAME, attrname,error,lapl_id=H5P_DEFAULT_F) - CALL check("H5Adelete_by_name", error, total_error) - -!!$ /* Check refcount on attributes now */ -!!$ -!!$ /* Check refcount on first dataset's attribute */ - - CALL h5aopen_f(dataset, attrname, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5aopen_f",error,total_error) - -!!$ -!!$ if(u % 2) { -! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!/* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!/* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - - ! /* Close attribute's datatype */ - - CALL h5tclose_f(attr_tid, error) - CALL check("h5tclose_f",error,total_error) - - ! /* Close Datasets */ - - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - CALL h5dclose_f(dataset2, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Check on shared message status now */ -!!$ if(test_shared != 0) { -!!$ if(test_shared == 1) { - ! /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ - ! /* Unlink datasets WITH attributes */ - - CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("H5Ldelete_f", error, total_error) - CALL h5ldelete_f(fid, DSET2_NAME, error) - CALL check("H5Ldelete_f", error, total_error) - - ! /* Unlink committed datatype */ - - IF( test_shared == 2) THEN - CALL h5ldelete_f(fid, TYPE1_NAME, error) - CALL check("H5Ldelete_f", error, total_error) - ENDIF - - ! /* Check on attribute storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ if(test_shared != 0) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) -!!$ -!!$ /* Check size of file */ -!!$ filesize = h5_get_file_size(FILENAME); -!!$ VERIFY(filesize, empty_filesize, "h5_get_file_size"); - ENDDO - - ! /* Close dataspaces */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(big_sid, error) - CALL check("h5sclose_f",error,total_error) - -END SUBROUTINE test_attr_shared_delete - - - -SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) - -!/**************************************************************** -!** -!** test_attr_dense_open(): Test basic H5A (attribute) code. -!** Tests opening attributes in "dense" storage -!** -!****************************************************************/ - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(IN) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER :: error - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - - INTEGER :: max_compact ! Maximum # of links to store in group compactly - INTEGER :: min_dense ! Minimum # of links to store in group "densely" - - CHARACTER(LEN=2) :: chr2 - - - CHARACTER(LEN=7) :: attrname - - INTEGER(HID_T) :: dataset - INTEGER :: u - - data_dims = 0 - - ! /* Output message about test being performed */ - WRITE(*,*) " - Testing Opening Attributes in Dense Storage" - - ! /* Create file */ - - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - - ! /* Get size of file */ -!!$ empty_filesize = h5_get_file_size(FILENAME); -!!$ if(empty_filesize < 0) -!!$ TestErrPrintf("Line %d: file size wrong!\n", __LINE__); - - ! /* Re-open file */ - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - ! /* Create dataspace for dataset */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! /* Query the group creation properties */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Enable creation order tracking on attributes, so creation order tests work */ - CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_TRACKED_F, error) - CALL check("H5Pset_attr_creation_order",error,total_error) - - ! /* Create a dataset */ - - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & - lcpl_id=H5P_DEFAULT_F, dcpl_id=dcpl, dapl_id=H5P_DEFAULT_F) - CALL check("h5dcreate_f",error,total_error) - - ! /* Retrieve limits for compact/dense attribute storage */ - CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) - CALL check("H5Pget_attr_phase_change_f",error,total_error) - - ! /* Close property list */ - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ - ! is_dense = H5O_is_attr_dense_test(dataset); - ! VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Add attributes, until just before converting to dense storage */ - - DO u = 0, max_compact - 1 - ! /* Create attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Write data into the attribute */ - - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Verify attributes written so far */ - CALL test_attr_dense_verify(dataset, u, total_error) -!!$ CHECK(ret, FAIL, "test_attr_dense_verify"); - ENDDO - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - -! /* Add one more attribute, to push into "dense" storage */ -! /* Create attribute */ - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - - - ! /* Write data into the attribute */ - data_dims(1) = 1 - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - ! /* Verify all the attributes written */ - ! ret = test_attr_dense_verify(dataset, (u + 1)); - ! CHECK(ret, FAIL, "test_attr_dense_verify"); - - ! /* CLOSE Dataset */ - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Unlink dataset with attributes */ - CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) - CALL check("H5Ldelete_f", error, total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! /* Check size of file */ - ! filesize = h5_get_file_size(FILENAME); - ! VERIFY(filesize, empty_filesize, "h5_get_file_size") - -END SUBROUTINE test_attr_dense_open - -!/**************************************************************** -!** -!** test_attr_dense_verify(): Test basic H5A (attribute) code. -!** Verify attributes on object -!** -!****************************************************************/ - -SUBROUTINE test_attr_dense_verify(loc_id, max_attr, total_error) - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER, INTENT(IN) :: max_attr - INTEGER, INTENT(INOUT) :: total_error - - INTEGER(SIZE_T), PARAMETER :: ATTR_NAME_LEN = 8 ! FIX, why if 7 does not work? - - INTEGER :: u - CHARACTER(LEN=2) :: chr2 - CHARACTER(LEN=ATTR_NAME_LEN) :: attrname - CHARACTER(LEN=ATTR_NAME_LEN) :: check_name - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - INTEGER(HID_T) :: attr !String Attribute identifier - INTEGER :: error - INTEGER :: value - - data_dims = 0 - - - ! /* Retrieve the current # of reported errors */ - ! old_nerrs = GetTestNumErrs(); - - ! /* Re-open all the attributes by name and verify the data */ - - DO u = 0, max_attr -1 - - ! /* Open attribute */ - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL h5aopen_f(loc_id, attrname, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! /* Read data from the attribute */ - -! value = 103 - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - - CALL CHECK("H5Aread_F", error, total_error) - CALL VERIFY("H5Aread_F", value, u, total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - - ! /* Re-open all the attributes by index and verify the data */ - - DO u=0, max_attr-1 - -! size_t name_len; /* Length of attribute name */ -! char check_name[ATTR_NAME_LEN]; /* Buffer for checking attribute names */ - - ! /* Open attribute */ - - CALL H5Aopen_by_idx_f(loc_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(u,HSIZE_T), & - attr, error, aapl_id=H5P_DEFAULT_F) - - ! /* Verify Name */ - - WRITE(chr2,'(I2.2)') u - attrname = 'attr '//chr2 - - CALL H5Aget_name_f(attr, ATTR_NAME_LEN, check_name, error) - CALL check('H5Aget_name',error,total_error) - IF(check_name.NE.attrname) THEN - WRITE(*,*) 'ERROR: attribute name different: attr_name = ',check_name, ', should be ', attrname - total_error = total_error + 1 - ENDIF - ! /* Read data from the attribute */ - data_dims(1) = 1 - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) - CALL CHECK("H5Aread_f", error, total_error) - CALL VERIFY("H5Aread_f", value, u, total_error) - - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - ENDDO - -END SUBROUTINE test_attr_dense_verify - -!/**************************************************************** -!** -!** test_attr_corder_create_empty(): Test basic H5A (attribute) code. -!** Tests basic code to create objects with attribute creation order info -!** -!****************************************************************/ - -SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error ) - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fcpl - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(IN) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid - INTEGER(HID_T) :: dcpl - INTEGER(HID_T) :: sid - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER(HID_T) :: dataset - - INTEGER :: error - - INTEGER :: crt_order_flags - - ! /* Output message about test being performed */ - WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info" - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Create dataset creation property list */ - CALL H5Pcreate_f(H5P_DATASET_CREATE_F,dcpl,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Get creation order indexing on object */ - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - - ! /* Setting invalid combination of a attribute order creation order indexing on should fail */ - CALL H5Pset_attr_creation_order_f(dcpl, H5P_CRT_ORDER_INDEXED_F, error) - CALL VERIFY("H5Pset_attr_creation_order_f",error , -1, total_error) - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , 0, total_error) - - ! /* Set attribute creation order tracking & indexing for object */ - CALL h5pset_attr_creation_order_f(dcpl, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), error) - CALL check("H5Pset_attr_creation_order_f",error,total_error) - - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , & - IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error) - - ! /* Create dataspace for dataset */ - CALL h5screate_f(H5S_SCALAR_F, sid, error) - CALL check("h5screate_f",error,total_error) - - ! /* Create a dataset */ - CALL h5dcreate_f(fid, DSET1_NAME, H5T_NATIVE_CHARACTER, sid, dataset, error, & - lcpl_id=H5P_DEFAULT_F, dapl_id=H5P_DEFAULT_F, dcpl_id=dcpl) - CALL check("h5dcreate_f",error,total_error) - - ! /* Close dataspace */ - CALL h5sclose_f(sid, error) - CALL check("h5sclose_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Close Dataset */ - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close property list */ - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - ! /* Re-open file */ - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - ! /* Open dataset created */ - CALL h5dopen_f(fid, DSET1_NAME, dataset, error, H5P_DEFAULT_F ) - CALL check("h5dopen_f",error,total_error) - - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - - ! /* Retrieve dataset creation property list for group */ - CALL H5Dget_create_plist_f(dataset, dcpl, error) - CALL check("H5Dget_create_plist_f",error,total_error) - - ! /* Query the attribute creation properties */ - CALL H5Pget_attr_creation_order_f(dcpl, crt_order_flags, error) - CALL check("H5Pget_attr_creation_order_f",error,total_error) - CALL VERIFY("H5Pget_attr_creation_order_f",crt_order_flags , & - IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), total_error ) - - ! /* Close property list */ - CALL h5pclose_f(dcpl, error) - CALL check("h5pclose_f",error,total_error) - - ! /* Close Dataset */ - CALL h5dclose_f(dataset, error) - CALL check("h5dclose_f",error,total_error) - - ! /* Close file */ - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - -END SUBROUTINE test_attr_corder_create_basic - -!/**************************************************************** -!** -!** test_attr_basic_write(): Test basic H5A (attribute) code. -!** Tests integer attributes on both datasets and groups -!** -!****************************************************************/ - -SUBROUTINE test_attr_basic_write(fapl, total_error) - - USE HDF5 - - IMPLICIT NONE - - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - CHARACTER(LEN=8) :: FileName = "tattr.h5" - INTEGER(HID_T) :: fid1 - INTEGER(HID_T) :: sid1, sid2 - - CHARACTER(LEN=8) :: DSET1_NAME = "Dataset1" - - INTEGER(HID_T) :: dataset - INTEGER :: i - INTEGER :: error - - INTEGER(HID_T) :: attr,attr2 !String Attribute identifier - INTEGER(HID_T) :: group - INTEGER(HSIZE_T), DIMENSION(7) :: data_dims - - CHARACTER(LEN=25) :: check_name - CHARACTER(LEN=18) :: chr_exact_size - - INTEGER, PARAMETER :: SPACE1_RANK = 3 - INTEGER, PARAMETER :: NX = 20 - INTEGER, PARAMETER :: NY = 5 - INTEGER, PARAMETER :: NZ = 10 -! INTEGER(HSIZE_T), DIMENSION(3) :: dims1 = (/NX,NY,NZ/) - - CHARACTER(LEN=5), PARAMETER :: ATTR1_NAME="Attr1" - INTEGER, PARAMETER :: ATTR1_RANK = 1 - INTEGER, PARAMETER :: ATTR1_DIM1 = 3 - CHARACTER(LEN=7), PARAMETER :: ATTR1A_NAME ="Attr1_a" - CHARACTER(LEN=18), PARAMETER :: ATTR_TMP_NAME = "Attr1_a-1234567890" -! int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; - INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1 - INTEGER, DIMENSION(ATTR1_DIM1) :: attr_data1a - INTEGER, DIMENSION(ATTR1_DIM1) :: read_data1 - INTEGER(HSIZE_T) :: attr_size ! attributes storage requirements .MSB. -! INTEGER :: attr_data1 - INTEGER(HSIZE_T), DIMENSION(2) :: dims2 = (/4,6/) ! Dataset dimensions - -!!!! start - INTEGER :: rank1 = 2 ! Dataspace1 rank - INTEGER(HSIZE_T), DIMENSION(2) :: dims1 = (/4,6/) ! Dataset dimensions - INTEGER(HSIZE_T), DIMENSION(2) :: maxdims1 = (/4,6/) ! maximum dimensions - - INTEGER(SIZE_T) :: size - - attr_data1(1) = 258 - attr_data1(2) = 9987 - attr_data1(3) = -99890 - attr_data1a(1) = 258 - attr_data1a(2) = 1087 - attr_data1a(3) = -99890 - - ! /* Output message about test being performed */ - WRITE(*,*) " - Testing Basic Scalar Attribute Writing Functions" - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid1, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Create dataspace for dataset */ - CALL h5screate_simple_f(rank1, dims1, sid1, error, maxdims1) -! CALL h5screate_simple_f(SPACE1_RANK, dims1, sid1, error) - CALL check("h5screate_simple_f",error,total_error) - - ! /* Create a dataset */ -! sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - CALL h5dcreate_f(fid1, DSET1_NAME, H5T_NATIVE_CHARACTER, sid1, dataset, error, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F ) - CALL check("h5dcreate_f",error,total_error) - - ! /* Create dataspace for attribute */ - CALL h5screate_simple_f(ATTR1_RANK, dims2, sid2, error) - CALL check("h5screate_simple_f",error,total_error) - - ! /* Try to create an attribute on the file (should create an attribute on root group) */ - CALL h5acreate_f(fid1, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, aapl_id=H5P_DEFAULT_F, acpl_id=H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Open the root group */ - CALL H5Gopen_f(fid1, "/", group, error, H5P_DEFAULT_F) - CALL check("H5Gopen_f",error,total_error) - - ! /* Open attribute again */ - CALL h5aopen_f(group, ATTR1_NAME, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Close root group */ - CALL H5Gclose_f(group, error) - CALL check("h5gclose_f",error,total_error) - - ! /* Create an attribute for the dataset */ - CALL h5acreate_f(dataset, ATTR1_NAME, H5T_NATIVE_INTEGER, sid2, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Write attribute information */ - data_dims(1) = 3 - - CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, attr_data1, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Create an another attribute for the dataset */ - CALL h5acreate_f(dataset, ATTR1A_NAME, H5T_NATIVE_INTEGER, sid2, attr2, error, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5acreate_f",error,total_error) - - ! /* Write attribute information */ - CALL h5awrite_f(attr2, H5T_NATIVE_INTEGER, attr_data1a, data_dims, error) - CALL check("h5awrite_f",error,total_error) - - ! /* Check storage size for attribute */ - - CALL h5aget_storage_size_f(attr, attr_size, error) - CALL check("h5aget_storage_size_f",error,total_error) - CALL VERIFY("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) - -! attr_size = H5Aget_storage_size(attr); -! VERIFY(attr_size, (ATTR1_DIM1 * sizeof(int)), "H5A_get_storage_size"); - - ! /* Read attribute information immediately, without closing attribute */ - CALL h5aread_f(attr, H5T_NATIVE_INTEGER, read_data1, data_dims, error) - CALL check("h5aread_f",error,total_error) - - - - ! /* Verify values read in */ - DO i = 1, ATTR1_DIM1 - CALL VERIFY('h5aread_f',attr_data1(i),read_data1(i), total_error) - ENDDO - - ! /* CLOSE attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr2, error) - CALL check("h5aclose_f",error,total_error) - - ! /* change attribute name */ - CALL H5Arename_f(dataset, ATTR1_NAME, ATTR_TMP_NAME, error) - CALL check("H5Arename_f", error, total_error) - - ! /* Open attribute again */ - - CALL h5aopen_f(dataset, ATTR_TMP_NAME, attr, error) - CALL check("h5aopen_f",error,total_error) - - ! /* Verify new attribute name */ - ! Set a deliberately small size - - check_name = ' ' ! need to initialize or does not pass test - - size = 1 - CALL H5Aget_name_f(attr, size, check_name, error) - CALL check('H5Aget_name',error,total_error) - - ! Now enter with the corrected size - IF(error.NE.size)THEN - size = error - CALL H5Aget_name_f(attr, size, check_name, error) - CALL check('H5Aget_name',error,total_error) - ENDIF - - IF(TRIM(ADJUSTL(check_name)).NE.TRIM(ADJUSTL(ATTR_TMP_NAME))) THEN - PRINT*,'.'//TRIM(check_name)//'.',LEN_TRIM(check_name) - PRINT*,'.'//TRIM(ATTR_TMP_NAME)//'.',LEN_TRIM(ATTR_TMP_NAME) - WRITE(*,*) 'ERROR: attribute name different: attr_name ='//TRIM(check_name)//'.' - WRITE(*,*) ' should be ='//TRIM(ATTR_TMP_NAME)//'.' - total_error = total_error + 1 - stop - ENDIF - - ! Try with a string buffer that is exactly the correct size - size = 18 - CALL H5Aget_name_f(attr, size, chr_exact_size, error) - CALL check('H5Aget_name_f',error,total_error) - CALL VerifyString('H5Aget_name_f',chr_exact_size,ATTR_TMP_NAME, total_error) - - ! /* Close attribute */ - CALL h5aclose_f(attr, error) - CALL check("h5aclose_f",error,total_error) -!!$ -!!$ /* Open the second attribute again */ -!!$ attr2=H5Aopen(dataset, ATTR1A_NAME, H5P_DEFAULT); -!!$ CHECK(attr, FAIL, "H5Aopen"); -!!$ -!!$ /* Verify new attribute name */ -!!$ attr_name_size = H5Aget_name(attr2, (size_t)0, NULL); -!!$ CHECK(attr_name_size, FAIL, "H5Aget_name"); -!!$ -!!$ if(attr_name_size>0) -!!$ attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); -!!$ -!!$ ret=(herr_t)H5Aget_name(attr2, (size_t)(attr_name_size+1), attr_name); -!!$ CHECK(ret, FAIL, "H5Aget_name"); -!!$ ret=HDstrcmp(attr_name, ATTR1A_NAME); -!!$ VERIFY(ret, 0, "HDstrcmp"); -!!$ -!!$ if(attr_name) -!!$ HDfree(attr_name); -!!$ -!!$ /* Read attribute information immediately, without closing attribute */ -!!$ ret=H5Aread(attr2,H5T_NATIVE_INT,read_data1); -!!$ CHECK(ret, FAIL, "H5Aread"); -!!$ -!!$ /* Verify values read in */ -!!$ for(i=0; i= 0) TEST_ERROR - - ! /* Create more links, to push group into dense form */ -!!$ for(; u < (max_compact * 2); u++) { -!!$ hid_t group_id2, group_id3; /* Group IDs */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new/empty) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR -!!$ if(grp_info.max_corder != 0) TEST_ERROR -!!$ if(grp_info.nlinks != 0) TEST_ERROR -!!$ -!!$ -!!$ /* Create objects in new group created */ -!!$ for(v = 0; v <= u; v++) { -!!$ /* Make name for link */ -!!$ sprintf(objname2, "filler %02u", v); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Close group created */ -!!$ if(H5Gclose(group_id3) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve group's information */ -!!$ if(order != H5_ITER_NATIVE) { -!!$ if(order == H5_ITER_INC) { -!!$ if(H5Gget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(H5Gget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Check (new) group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Close group created */ -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Retrieve main group's information */ -!!$ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve main group's information, by name */ -!!$ if(H5Gget_info_by_name(file_id, CORDER_GROUP_NAME, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ /* Retrieve main group's information, by name */ -!!$ if(H5Gget_info_by_name(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Check main group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ -!!$ -!!$ /* Create soft link in another group, to objects in main group */ -!!$ sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname); -!!$ if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Retrieve soft link group's information, by name */ -!!$ if(H5Gget_info(soft_group_id, &grp_info) < 0) TEST_ERROR -!!$ -!!$ /* Check soft link group's information */ -!!$ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR -!!$ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR -!!$ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Check for out of bound query by index */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Gget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &grp_info, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR - - - ! /* Close the groups */ - - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(soft_group_id, error) - CALL check("H5Gclose_f", error, total_error) - - ! /* Close the file */ - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - ENDDO - ENDDO - ENDDO - - ! /* Free resources */ - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - - END SUBROUTINE group_info - -!/*------------------------------------------------------------------------- -! * Function: timestamps -! * -! * Purpose: Verify that disabling tracking timestamps for an object -! * works correctly -! * -! * -! * Programmer: M.S. Breitenfeld -! * February 20, 2008 -! * -! *------------------------------------------------------------------------- -! */ - - SUBROUTINE timestamps(cleanup, fapl, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file_id !/* File ID */ - INTEGER(HID_T) :: group_id !/* Group ID */ - INTEGER(HID_T) :: group_id2 !/* Group ID */ - INTEGER(HID_T) :: gcpl_id !/* Group creation property list ID */ - INTEGER(HID_T) :: gcpl_id2 !/* Group creation property list ID */ - - CHARACTER(LEN=6), PARAMETER :: prefix = 'links9' - CHARACTER(LEN=9), PARAMETER :: filename = prefix//'.h5' ! /* File name */ - ! /* Timestamp macros */ - CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_1="timestamp1" - CHARACTER(LEN=10), PARAMETER :: TIMESTAMP_GROUP_2="timestamp2" - LOGICAL :: track_times - LOGICAL :: cleanup - - INTEGER :: error - - ! /* Print test message */ - WRITE(*,*) "timestamps on objects" - - ! /* Create group creation property list */ - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) - CALL check("H5Pcreate_f", error, total_error) - - ! /* Query the object timestamp setting */ - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - - !/* Check default timestamp information */ - CALL VerifyLogical("H5Pget_obj_track_times",track_times,.TRUE.,total_error) - - ! /* Set a non-default object timestamp setting */ - CALL H5Pset_obj_track_times_f(gcpl_id, .FALSE., error) - CALL check("H5Pset_obj_track_times_f", error, total_error) - - ! /* Query the object timestamp setting */ - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - - ! /* Check default timestamp information */ - CALL VerifyLogical("H5Pget_obj_track_times",track_times,.FALSE.,total_error) - - ! /* Create file */ - !h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("h5fcreate_f",error,total_error) - - ! /* Create group with non-default object timestamp setting */ - CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_1, group_id, error, & - OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, gcpl_id, H5P_DEFAULT_F) - CALL check("h5fcreate_f",error,total_error) - - ! /* Close the group creation property list */ - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - ! /* Create group with default object timestamp setting */ - CALL h5gcreate_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, & - OBJECT_NAMELEN_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F, H5P_DEFAULT_F) - CALL check("h5fcreate_f",error,total_error) - - ! /* Retrieve the new groups' creation properties */ - CALL H5Gget_create_plist_f(group_id, gcpl_id, error) - CALL check("H5Gget_create_plist", error, total_error) - CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) - CALL check("H5Gget_create_plist", error, total_error) - - ! /* Query & verify the object timestamp settings */ - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) - CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) - -! /* Query the object information for each group */ -! if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR -! if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR - -!!$ /* Sanity check object information for each group */ -!!$ if(oinfo.atime != 0) TEST_ERROR -!!$ if(oinfo.mtime != 0) TEST_ERROR -!!$ if(oinfo.ctime != 0) TEST_ERROR -!!$ if(oinfo.btime != 0) TEST_ERROR -!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR -!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR -!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR -!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR -!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR -!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR -!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - - ! /* Close the property lists */ - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(gcpl_id2, error) - CALL check("H5Pclose_f", error, total_error) - - ! /* Close the groups */ - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("H5Gclose_f", error, total_error) - - !/* Close the file */ - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - !/* Re-open the file */ - - CALL h5fopen_f(FileName, H5F_ACC_RDONLY_F, file_id, error, H5P_DEFAULT_F) - CALL check("h5fopen_f",error,total_error) - - !/* Open groups */ - CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_1, group_id, error) ! with no optional param. - CALL check("H5Gopen_f", error, total_error) - CALL H5Gopen_f(file_id, TIMESTAMP_GROUP_2, group_id2, error, H5P_DEFAULT_F) ! with optional param. - CALL check("H5Gopen_f", error, total_error) - - ! /* Retrieve the new groups' creation properties */ - CALL H5Gget_create_plist_f(group_id, gcpl_id, error) - CALL check("H5Gget_create_plist", error, total_error) - CALL H5Gget_create_plist_f(group_id2, gcpl_id2, error) - CALL check("H5Gget_create_plist", error, total_error) - - ! /* Query & verify the object timestamp settings */ - - CALL H5Pget_obj_track_times_f(gcpl_id, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times1",track_times,.FALSE.,total_error) - CALL H5Pget_obj_track_times_f(gcpl_id2, track_times, error) - CALL check("H5Pget_obj_track_times_f", error, total_error) - CALL VerifyLogical("H5Pget_obj_track_times2",track_times,.TRUE.,total_error) -!!$ -!!$ /* Query the object information for each group */ -!!$ if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR -!!$ if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR -!!$ -!!$ /* Sanity check object information for each group */ -!!$ if(oinfo.atime != 0) TEST_ERROR -!!$ if(oinfo.mtime != 0) TEST_ERROR -!!$ if(oinfo.ctime != 0) TEST_ERROR -!!$ if(oinfo.btime != 0) TEST_ERROR -!!$ if(oinfo.atime == oinfo2.atime) TEST_ERROR -!!$ if(oinfo.mtime == oinfo2.mtime) TEST_ERROR -!!$ if(oinfo.ctime == oinfo2.ctime) TEST_ERROR -!!$ if(oinfo.btime == oinfo2.btime) TEST_ERROR -!!$ if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR -!!$ if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR -!!$ if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR - - ! /* Close the property lists */ - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(gcpl_id2, error) - CALL check("H5Pclose_f", error, total_error) - - ! /* Close the groups */ - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("H5Gclose_f", error, total_error) - - !/* Close the file */ - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - - END SUBROUTINE timestamps - -!/*------------------------------------------------------------------------- -! * Function: mklinks -! * -! * Purpose: Build a file with assorted links. -! * -! * -! * Programmer: Adapted from C test by: -! * M.S. Breitenfeld -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - - SUBROUTINE mklinks(fapl, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file, scalar, grp, d1 - CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' - INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension - INTEGER :: arank = 1 ! Attribure rank - INTEGER :: error - - WRITE(*,*) "link creation (w/new group format)" - - ! /* Create a file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) - CALL check("mklinks.h5fcreate_f",error,total_error) - CALL h5screate_simple_f(arank, adims2, scalar, error) - CALL check("mklinks.h5screate_simple_f",error,total_error) - - !/* Create a group */ - CALL H5Gcreate_f(file, "grp1", grp, error) - CALL check("H5Gcreate_f", error, total_error) - CALL H5Gclose_f(grp, error) - CALL check("h5gclose_f",error,total_error) - - !/* Create a dataset */ - CALL h5dcreate_f(file, "d1", H5T_NATIVE_INTEGER, scalar, d1, error) - CALL check("h5dcreate_f",error,total_error) - CALL h5dclose_f(d1, error) - CALL check("h5dclose_f",error,total_error) - - !/* Create a hard link */ - CALL H5Lcreate_hard_f(file, "d1", INT(H5L_SAME_LOC_F,HID_T), "grp1/hard", error) - CALL check("H5Lcreate_hard_f", error, total_error) - - !/* Create a symbolic link */ - CALL H5Lcreate_soft_f("/d1", file, "grp1/soft",error) - CALL check("H5Lcreate_soft_f", error, total_error) - - !/* Create a symbolic link to something that doesn't exist */ - - CALL H5Lcreate_soft_f("foobar", file, "grp1/dangle",error) - - !/* Create a recursive symbolic link */ - CALL H5Lcreate_soft_f("/grp1/recursive", file, "/grp1/recursive",error) - - !/* Close */ - CALL h5sclose_f(scalar, error) - CALL check("h5sclose_f",error,total_error) - CALL h5fclose_f(file, error) - CALL check("h5fclose_f",error,total_error) - - END SUBROUTINE mklinks - -!/*------------------------------------------------------------------------- -! * Function: test_move_preserves -! * -! * Purpose: Tests that moving and renaming links preserves their -! * properties. -! * -! * Programmer: M.S. Breitenfeld -! * March 3, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - - SUBROUTINE test_move_preserves(fapl_id, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl_id - - INTEGER(HID_T):: file_id - INTEGER(HID_T):: group_id - INTEGER(HID_T):: fcpl_id ! /* Group creation property list ID */ - INTEGER(HID_T):: lcpl_id - INTEGER(HID_T):: lcpl2_id - !H5O_info_t oinfo; - !H5L_info_t linfo; - INTEGER :: old_cset - INTEGER :: old_corder - !H5T_cset_t old_cset; - !int64_t old_corder; /* Creation order value of link */ - !time_t old_modification_time; - !time_t curr_time; - !unsigned crt_order_flags; /* Status of creation order info for GCPL */ - !char filename[1024]; - - INTEGER :: crt_order_flags ! /* Status of creation order info for GCPL */ - CHARACTER(LEN=12), PARAMETER :: filename = 'TestLinks.h5' - - INTEGER :: cset ! Indicates the character set used for the link’s name. - INTEGER :: corder ! Specifies the link’s creation order position. - LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER :: link_type ! Specifies the link class: - ! H5L_LINK_HARD_F - Hard link - ! H5L_LINK_SOFT_F - Soft link - ! H5L_LINK_EXTERNAL_F - External link - ! H5L_LINK_ERROR _F - Error - INTEGER :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(HSIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - - INTEGER :: error - - WRITE(*,*) "moving and copying links preserves their properties (w/new group format)" - - !/* Create a file creation property list with creation order stored for links - ! * in the root group - ! */ - - CALL H5Pcreate_f(H5P_FILE_CREATE_F, fcpl_id, error) - CALL check("H5Pcreate_f",error, total_error) - - CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) - CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL VERIFY("H5Pget_link_creation_order_f",crt_order_flags,0, total_error) - - CALL H5Pset_link_creation_order_f(fcpl_id, H5P_CRT_ORDER_TRACKED_F, error) - CALL check("H5Pset_link_creation_order_f", error, total_error) - - CALL H5Pget_link_creation_order_f(fcpl_id, crt_order_flags, error) - CALL check("H5Pget_link_creation_order_f",error, total_error) - CALL VERIFY("H5Pget_link_creation_order_f",crt_order_flags, H5P_CRT_ORDER_TRACKED_F, total_error) - - !/* Create file */ - !/* (with creation order tracking for the root group) */ - - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file_id, error, fcpl_id, fapl_id) - CALL check("h5fcreate_f",error,total_error) - - !/* Create a link creation property list with the UTF-8 character encoding */ - CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) - CALL check("H5Pcreate_f",error, total_error) - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("H5Pset_char_encoding_f",error, total_error) - - !/* Create a group with that lcpl */ - CALL H5Gcreate_f(file_id, "group", group_id, error,lcpl_id=lcpl_id, gcpl_id=H5P_DEFAULT_F, gapl_id=H5P_DEFAULT_F) - CALL check("H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - - ! /* Get the group's link's information */ - CALL H5Lget_info_f(file_id, "group", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error, H5P_DEFAULT_F) - CALL check("H5Lget_info_f",error,total_error) - -! if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR - - old_cset = cset - CALL VERIFY("H5Lget_info_f",old_cset,H5T_CSET_UTF8_F,total_error) - CALL VerifyLogical("H5Lget_info_f",f_corder_valid,.TRUE.,total_error) - old_corder = corder; - CALL VERIFY("H5Lget_info_f",old_corder,0,total_error) - -! old_modification_time = oinfo.mtime; - -! /* If this test happens too quickly, the times will all be the same. Make sure the time changes. */ -! curr_time = HDtime(NULL); -! while(HDtime(NULL) <= curr_time) -! ; - -! /* Close the file and reopen it */ - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - -!!$ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR -!!$ -!!$ /* Get the link's character set & modification time . They should be unchanged */ -!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(old_cset != linfo.cset) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(old_corder != linfo.corder) TEST_ERROR -!!$ -!!$ /* Create a new link to the group. It should have a different creation order value but the same modification time */ -!!$ if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_corder == linfo.corder) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 1) TEST_ERROR -!!$ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR -!!$ -!!$ /* Copy the first link to a UTF-8 name. -!!$ * Its creation order value should be different, but modification time -!!$ * should not change. -!!$ */ -!!$ if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 2) TEST_ERROR -!!$ -!!$ /* Check that its character encoding is UTF-8 */ -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ /* Move the link with the default property list. */ -!!$ if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 3) TEST_ERROR -!!$ -!!$ /* Check that its character encoding is not UTF-8 */ -!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ /* Check that the original link is unchanged */ -!!$ if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(old_corder != linfo.corder) TEST_ERROR -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ /* Move the first link to a UTF-8 name. -!!$ * Its creation order value will change, but modification time should not -!!$ * change. */ -!!$ if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 4) TEST_ERROR -!!$ -!!$ /* Check that its character encoding is UTF-8 */ -!!$ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR -!!$ -!!$ /* Move the link again using the default property list. */ -!!$ if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(old_modification_time != oinfo.mtime) TEST_ERROR -!!$ if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder_valid != TRUE) TEST_ERROR -!!$ if(linfo.corder != 5) TEST_ERROR -!!$ -!!$ /* Check that its character encoding is not UTF-8 */ -!!$ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR - - ! /* Close open IDs */ - CALL H5Pclose_f(fcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(lcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - ! if(H5Fclose(file_id) < 0) TEST_ERROR - - END SUBROUTINE test_move_preserves - -!!$!/*------------------------------------------------------------------------- -!!$! * Function: ud_hard_links -!!$! * -!!$! * Purpose: Check that the functionality of hard links can be duplicated -!!$! * with user-defined links. -!!$! * -!!$! * -!!$! * Programmer: M.S. Breitenfeld -!!$! * February, 2008 -!!$! * -!!$! *------------------------------------------------------------------------- -!!$! */ -!!$! -!!$!/* Callback functions for UD hard links. */ -!!$!/* UD_hard_create increments the object's reference count */ -!!$ -!!$ SUBROUTINE ud_hard_links(fapl, total_error) -!!$ -!!$ USE HDF5 ! This module contains all necessary modules -!!$ -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(OUT) :: total_error -!!$ INTEGER(HID_T), INTENT(IN) :: fapl -!!$ -!!$ INTEGER(HID_T) :: fid ! /* File ID */ -!!$ INTEGER(HID_T) :: gid ! /* Group IDs */ -!!$ -!!$ CHARACTER(LEN=10) :: objname = 'objname.h5' ! /* Object name */ -!!$ CHARACTER(LEN=10), PARAMETER :: filename = 'filname.h5' -!!$ -!!$ INTEGER(HSIZE_T) :: name_len ! /* Size of an empty file */ -!!$ -!!$ INTEGER, PARAMETER :: UD_HARD_TYPE=201 -!!$ LOGICAL :: registered -!!$ -!!$!/* Link information */ -!!$ -!!$! ssize_t name_len; /* Length of object name */ -!!$! h5_stat_size_t empty_size; /* Size of an empty file */ -!!$ -!!$ -!!$ WRITE(*,*) "user-defined hard link (w/new group format)" -!!$ -!!$ ! /* Set up filename and create file*/ -!!$ -!!$ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl) -!!$ CALL check("h5fcreate_f",error,total_error) -!!$ -!!$ ! /* Close file */ -!!$ CALL h5fclose_f(fid, error) -!!$ CALL check("h5fclose_f",error,total_error) -!!$ -!!$ ! if((empty_size = h5_get_file_size(filename))<0) TEST_ERROR -!!$ -!!$ ! /* Create file */ -!!$ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl) -!!$ CALL check("h5fcreate_f",error,total_error) -!!$ -!!$ ! /* Check that external links are registered and UD hard links are not */ -!!$ -!!$ CALL H5Lis_registered(H5L_TYPE_EXTERNAL, registered, error) -!!$ CALL VerifyLogical("H5Lis_registered", registered, .TRUE., total_error) -!!$ -!!$ CALL H5Lis_registered(UD_HARD_TYPE, registered, error) -!!$ CALL VerifyLogical("H5Lis_registered", registered, .FALSE., total_error) -!!$ -!!$ !/* Register "user-defined hard links" with the library */ -!!$! if(H5Lregister(UD_hard_class) < 0) TEST_ERROR -!!$ -!!$ /* Check that UD hard links are now registered */ -!!$ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR -!!$ if(H5Lis_registered(UD_HARD_TYPE) != TRUE) TEST_ERROR -!!$ -!!$ /* Create a group for the UD hard link to point to */ -!!$ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Get address for the group to give to the hard link */ -!!$ if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ if(H5Gclose(gid) < 0) TEST_ERROR -!!$ -!!$ -!!$ /* Create a user-defined "hard link" to the group using the address we got -!!$ * from H5Lget_info */ -!!$ if(H5Lcreate_ud(fid, "ud_link", UD_HARD_TYPE, &(li.u.address), sizeof(haddr_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Close and re-open file to ensure that data is written to disk */ -!!$ if(H5Fclose(fid) < 0) TEST_ERROR -!!$ if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Open group through UD link */ -!!$ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check name */ -!!$ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR -!!$ if(HDstrcmp(objname, "/group")) TEST_ERROR -!!$ -!!$ /* Create object in group */ -!!$ if((gid2 = H5Gcreate2(gid, "new_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Close groups*/ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ if(H5Gclose(gid) < 0) TEST_ERROR -!!$ -!!$ /* Re-open group without using ud link to check that it was created properly */ -!!$ if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check name */ -!!$ if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR -!!$ if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR -!!$ -!!$ /* Close opened object */ -!!$ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check that H5Lget_objinfo works on the hard link */ -!!$ if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ /* UD hard links have no query function, thus return a "link length" of 0 */ -!!$ if(li.u.val_size != 0) TEST_ERROR -!!$ if(UD_HARD_TYPE != li.type) { -!!$ H5_FAILED(); -!!$ puts(" Unexpected link class - should have been a UD hard link"); -!!$ goto error; -!!$ } /* end if */ -!!$ -!!$ /* Unlink the group pointed to by the UD link. It shouldn't be -!!$ * deleted because of the UD link. */ -!!$ if(H5Ldelete(fid, "/group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Ensure we can open the group through the UD link */ -!!$ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Unlink the group contained within it. */ -!!$ if(H5Ldelete(gid, "new_group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Now delete the UD link. This should cause the group to be -!!$ * deleted, too. */ -!!$ if(H5Ldelete(fid, "ud_link", H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Close file */ -!!$ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* The file should be empty again. */ -!!$ if(empty_size != h5_get_file_size(filename)) TEST_ERROR -!!$ -!!$ if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR -!!$ -!!$ PASSED(); -!!$ return 0; -!!$ -!!$ error: -!!$ H5E_BEGIN_TRY { -!!$ H5Gclose(gid2); -!!$ H5Gclose(gid); -!!$ H5Fclose(fid); -!!$ } H5E_END_TRY; -!!$ return -1; -!!$} /* end ud_hard_links() */ - -!/*------------------------------------------------------------------------- -! * Function: lifecycle -! * -! * Purpose: Test that adding links to a group follow proper "lifecycle" -! * of empty->compact->symbol table->compact->empty. (As group -! * is created, links are added, then links removed) -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: Quincey Koziol -! * Monday, October 17, 2005 -! * -! *------------------------------------------------------------------------- -! */ -SUBROUTINE lifecycle(cleanup, fapl2, total_error) - - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl2 - INTEGER :: error - - INTEGER, PARAMETER :: NAME_BUF_SIZE =7 - - INTEGER(HID_T) :: fid !/* File ID */ - INTEGER(HID_T) :: gid !/* Group ID */ - INTEGER(HID_T) :: gid2 !/* Datatype ID */ - INTEGER(HID_T) :: gcpl !/* Group creation property list ID */ - INTEGER(size_t) :: lheap_size_hint !/* Local heap size hint */ - INTEGER :: max_compact !/* Maximum # of links to store in group compactly */ - INTEGER :: min_dense !/* Minimum # of links to store in group "densely" */ - INTEGER :: est_num_entries !/* Estimated # of entries in group */ - INTEGER :: est_name_len !/* Estimated length of entry name */ - INTEGER :: nmsgs !/* Number of messages in group's header */ - CHARACTER(LEN=NAME_BUF_SIZE) :: objname ! /* Object name */ - CHARACTER(LEN=NAME_BUF_SIZE) :: filename = 'fixx.h5' - INTEGER :: empty_size ! /* Size of an empty file */ - INTEGER :: u ! /* Local index variable */ - INTEGER(SIZE_T) :: LIFECYCLE_LOCAL_HEAP_SIZE_HINT = 256 - INTEGER :: LIFECYCLE_MAX_COMPACT = 4 - INTEGER :: LIFECYCLE_MIN_DENSE = 3 - INTEGER :: LIFECYCLE_EST_NUM_ENTRIES = 4 - INTEGER :: LIFECYCLE_EST_NAME_LEN=8 - CHARACTER(LEN=3) :: LIFECYCLE_TOP_GROUP="top" -! These value are taken from H5Gprivate.h - INTEGER :: H5G_CRT_GINFO_MAX_COMPACT = 8 - INTEGER :: H5G_CRT_GINFO_MIN_DENSE = 6 - INTEGER :: H5G_CRT_GINFO_EST_NUM_ENTRIES = 4 - INTEGER :: H5G_CRT_GINFO_EST_NAME_LEN = 8 - logical :: cleanup - - WRITE(*,*) 'group lifecycle' - - ! /* Create file */ - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl2) - CALL check("H5Fcreate_f",error,total_error) - - !/* Close file */ - CALL H5Fclose_f(fid,error) - CALL check("H5Fclose_f",error,total_error) - - ! /* Get size of file as empty */ - ! if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR - - ! /* Re-open file */ - - CALL H5Fopen_f(filename, H5F_ACC_RDWR_F, fid, error,access_prp=fapl2) - CALL check("H5Fopen_f",error,total_error) - - - ! /* Set up group creation property list */ - CALL H5Pcreate_f(H5P_GROUP_CREATE_F,gcpl,error) - CALL check("H5Pcreate_f",error,total_error) - - - ! /* Query default group creation property settings */ - CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) - CALL check("H5Pget_local_heap_size_hint_f",error,total_error) - CALL verify("H5Pget_local_heap_size_hint_f", lheap_size_hint,0,total_error) - - CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_link_phase_change_f", error, total_error) - CALL verify("H5Pget_link_phase_change_f", max_compact, H5G_CRT_GINFO_MAX_COMPACT,total_error) - CALL verify("H5Pget_link_phase_change_f", min_dense, H5G_CRT_GINFO_MIN_DENSE,total_error) - - - CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) - CALL check("H5Pget_est_link_info_f", error, total_error) - CALL verify("H5Pget_est_link_info_f", est_num_entries, H5G_CRT_GINFO_EST_NUM_ENTRIES,total_error) - CALL verify("H5Pget_est_link_info_f", est_name_len, H5G_CRT_GINFO_EST_NAME_LEN,total_error) - - - !/* Set GCPL parameters */ - - CALL H5Pset_local_heap_size_hint_f(gcpl, LIFECYCLE_LOCAL_HEAP_SIZE_HINT, error) - CALL check("H5Pset_local_heap_size_hint_f", error, total_error) - CALL H5Pset_link_phase_change_f(gcpl, LIFECYCLE_MAX_COMPACT, LIFECYCLE_MIN_DENSE, error) - CALL check("H5Pset_link_phase_change_f", error, total_error) - CALL H5Pset_est_link_info_f(gcpl, LIFECYCLE_EST_NUM_ENTRIES, LIFECYCLE_EST_NAME_LEN, error) - CALL check("H5Pset_est_link_info_f", error, total_error) - - ! /* Create group for testing lifecycle */ - - CALL H5Gcreate_f(fid, LIFECYCLE_TOP_GROUP, gid, error, gcpl_id=gcpl) - CALL check("H5Gcreate_f", error, total_error) - - ! /* Query group creation property settings */ - - CALL H5Pget_local_heap_size_hint_f(gcpl, lheap_size_hint, error) - CALL check("H5Pget_local_heap_size_hint_f",error,total_error) - CALL verify("H5Pget_local_heap_size_hint_f", lheap_size_hint,LIFECYCLE_LOCAL_HEAP_SIZE_HINT,total_error) - - CALL H5Pget_link_phase_change_f(gcpl, max_compact, min_dense, error) - CALL check("H5Pget_link_phase_change_f", error, total_error) - CALL verify("H5Pget_link_phase_change_f", max_compact, LIFECYCLE_MAX_COMPACT,total_error) - CALL verify("H5Pget_link_phase_change_f", min_dense, LIFECYCLE_MIN_DENSE,total_error) - - CALL H5Pget_est_link_info_f(gcpl, est_num_entries, est_name_len, error) - CALL check("H5Pget_est_link_info_f", error, total_error) - CALL verify("H5Pget_est_link_info_f", est_num_entries, LIFECYCLE_EST_NUM_ENTRIES,total_error) - CALL verify("H5Pget_est_link_info_f", est_name_len, LIFECYCLE_EST_NAME_LEN,total_error) - - - ! /* Use internal testing routine to check that the group has no links or symbol table */ - ! if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR - -!!$ /* Create first "bottom" group */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); -!!$ IF((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != 1) TEST_ERROR -!!$ -!!$ /* Create several more bottom groups, to push the top group almost to a symbol table */ -!!$ /* (Start counting at '1', since we've already created one bottom group */ -!!$ for(u = 1; u < LIFECYCLE_MAX_COMPACT; u++) { -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != LIFECYCLE_MAX_COMPACT) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != FALSE) TEST_ERROR -!!$ -!!$ /* Check that the object header is only one chunk and the space has been allocated correctly */ -!!$ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total != 151) TEST_ERROR -!!$ if(oinfo.hdr.space.free != 0) TEST_ERROR -!!$ if(oinfo.hdr.nmesgs != 6) TEST_ERROR -!!$ if(oinfo.hdr.nchunks != 1) TEST_ERROR -!!$ -!!$ /* Create one more "bottom" group, which should push top group into using a symbol table */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ -!!$ /* Check on bottom group's status */ -!!$ if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR -!!$ -!!$ /* Close bottom group */ -!!$ if(H5Gclose(gid2) < 0) TEST_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR -!!$ -!!$ /* Check that the object header is still one chunk and the space has been allocated correctly */ -!!$ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR -!!$ if(oinfo.hdr.space.total != 151) TEST_ERROR -!!$ if(oinfo.hdr.space.free != 92) TEST_ERROR -!!$ if(oinfo.hdr.nmesgs != 3) TEST_ERROR -!!$ if(oinfo.hdr.nchunks != 1) TEST_ERROR -!!$ -!!$ /* Unlink objects from top group */ -!!$ while(u >= LIFECYCLE_MIN_DENSE) { -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ u--; -!!$ } /* end while */ -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR -!!$ -!!$ /* Unlink one more object from the group, which should transform back to using links */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ u--; -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR -!!$ if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR -!!$ if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR -!!$ -!!$ /* Unlink last two objects from top group */ -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ u--; -!!$ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); -!!$ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ -!!$ /* Check on top group's status */ -!!$ if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR - - !/* Close top group */ - CALL H5Gclose_f(gid, error) - CALL check("H5Gclose_f", error, total_error) - - !/* Unlink top group */ - - CALL H5Ldelete_f(fid, LIFECYCLE_TOP_GROUP, error) - CALL check("H5Ldelete_f", error, total_error) - - ! /* Close GCPL */ - CALL H5Pclose_f(gcpl, error) - CALL check("H5Pclose_f", error, total_error) - - ! /* Close file */ - CALL H5Fclose_f(fid,error) - CALL check("H5Fclose_f",error,total_error) - -!!$ /* Get size of file as empty */ -!!$ if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR -!!$ -!!$ /* Verify that file is correct size */ -!!$ if(file_size != empty_size) TEST_ERROR - - IF(cleanup) CALL h5_cleanup_f("fixx", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - END SUBROUTINE lifecycle -!/*------------------------------------------------------------------------- -! * Function: cklinks -! * -! * Purpose: Open the file created in the first step and check that the -! * links look correct. -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: M.S. Breitenfeld -! * April 14, 2008 -! * -! * Modifications: Modified Original C code -! * -! *------------------------------------------------------------------------- -! */ - - - SUBROUTINE cklinks(fapl, total_error) - -! USE ISO_C_BINDING - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER :: error - - INTEGER(HID_T) :: file -! H5O_info_t oinfo1, oinfo2; -! H5L_info_t linfo2; - - CHARACTER(LEN=12), PARAMETER :: filename ='TestLinks.h5' - CHARACTER(LEN=12) :: linkval - -! TYPE(C_PTR) :: linkval - - LOGICAL :: Lexists - - -!!$ if(new_format) -!!$ TESTING("link queries (w/new group format)") -!!$ else -!!$ TESTING("link queries") - - ! /* Open the file */ - CALL H5Fopen_f(filename, H5F_ACC_RDONLY_F, file, error,access_prp=fapl) - CALL check("H5Fopen_f",error,total_error) - - - ! /* Hard link */ -!!$ IF(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ IF(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ IF(H5O_TYPE_DATASET != oinfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { -!!$ H5_FAILED(); -!!$ puts(" Hard link test failed. Link seems not to point to the "); -!!$ puts(" expected file location."); -!!$ TEST_ERROR -!!$ } /* end if */ - - - CALL H5Lexists_f(file,"d1",Lexists, error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) - - CALL H5Lexists_f(file,"grp1/hard",Lexists, error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) - - -!!$ /* Symbolic link */ -!!$ if(H5Oget_info_by_name(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5O_TYPE_DATASET != oinfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a dataset\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) { -!!$ H5_FAILED(); -!!$ puts(" Soft link test failed. Link seems not to point to the "); -!!$ puts(" expected file location."); -!!$ TEST_ERROR -!!$ } /* end if */ - -! CALL H5Lget_val(file, "grp1/soft", INT(LEN(linkval), SIZE_T), linkval, error) - - -!!$ if(H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(HDstrcmp(linkval, "/d1")) { -!!$ H5_FAILED(); -!!$ puts(" Soft link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR -!!$ -!!$ /* Dangling link */ -!!$ H5E_BEGIN_TRY { -!!$ status = H5Oget_info_by_name(file, "grp1/dangle", &oinfo2, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(status >= 0) { -!!$ H5_FAILED(); -!!$ puts(" H5Oget_info_by_name() should have failed for a dangling link."); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5L_TYPE_SOFT != linfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_val(file, "grp1/dangle", linkval, sizeof linkval, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf(" %d: Can't retrieve link value\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(HDstrcmp(linkval, "foobar")) { -!!$ H5_FAILED(); -!!$ puts(" Dangling link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR -!!$ -!!$ /* Recursive link */ -!!$ H5E_BEGIN_TRY { -!!$ status = H5Oget_info_by_name(file, "grp1/recursive", &oinfo2, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(status >= 0) { -!!$ H5_FAILED(); -!!$ puts(" H5Oget_info_by_name() should have failed for a recursive link."); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR -!!$ if(H5L_TYPE_SOFT != linfo2.type) { -!!$ H5_FAILED(); -!!$ printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(H5Lget_val(file, "grp1/recursive", linkval, sizeof linkval, H5P_DEFAULT) < 0) { -!!$ H5_FAILED(); -!!$ printf(" %d: Can't retrieve link value\n", __LINE__); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ if(HDstrcmp(linkval, "/grp1/recursive")) { -!!$ H5_FAILED(); -!!$ puts(" Recursive link test failed. Wrong link value"); -!!$ TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Non-existant link */ -!!$ if(H5Lexists(file, "foobar", H5P_DEFAULT) == TRUE) FAIL_STACK_ERROR - - ! /* Cleanup */ - CALL H5Fclose_f(file,error) - CALL check("H5Fclose_f",error,total_error) - - END SUBROUTINE cklinks - - -!/*------------------------------------------------------------------------- -! * Function: delete_by_idx -! * -! * Purpose: Create a group with creation order indices and test deleting -! * links by index. -! * -! * Return: Total error -! * -! * C Programmer: Quincey Koziol -! * Tuesday, November 14, 2006 -! * -! * Adapted to FORTRAN: M.S. Breitenfeld -! * March 3, 2008 -! * -! *------------------------------------------------------------------------- -! */ -SUBROUTINE delete_by_idx(cleanup, fapl, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: file_id ! /* File ID */ - INTEGER(HID_T) :: group_id ! /* Group ID */ - INTEGER(HID_T) :: gcpl_id ! /* Group creation property list ID */ - - INTEGER :: idx_type ! /* Type of index to operate on */ - LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) - ! /* Use index on creation order values */ - INTEGER :: max_compact ! /* Maximum # of links to store in group compactly */ - INTEGER :: min_dense ! /* Minimum # of links to store in group "densely" */ - - CHARACTER(LEN=7) :: objname ! /* Object name */ - CHARACTER(LEN=8) :: filename = 'file0.h5' ! /* File name */ - CHARACTER(LEN=7) :: tmpname ! /* Temporary link name */ - CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" - - LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! Indicates the size, in the number of characters, of the attribute - - INTEGER :: u ! /* Local index variable */ - INTEGER :: Input1, i - INTEGER(HID_T) :: group_id2 - - INTEGER :: iorder ! /* Order within in the index */ - CHARACTER(LEN=2) :: chr2 - INTEGER :: error - ! - ! - ! - CHARACTER(LEN=6) :: filename1 - CHARACTER(LEN=6) :: filename2 - CHARACTER(LEN=80) :: fix_filename1 - CHARACTER(LEN=80) :: fix_filename2 - INTEGER(SIZE_T) :: size_tmp - - LOGICAL :: cleanup - - DO i = 1, 80 - fix_filename1(i:i) = " " - fix_filename2(i:i) = " " - ENDDO - - ! /* Loop over operating on different indices on link fields */ - DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F - ! /* Loop over operating in different orders */ - DO iorder = H5_ITER_INC_F, H5_ITER_DEC_F - ! /* Loop over using index for creation order value */ - DO i = 1, 2 - ! /* Print appropriate test message */ - IF(idx_type == H5_INDEX_CRT_ORDER_F)THEN - IF(iorder == H5_ITER_INC_F)THEN - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by creation order index in increasing order w/o creation order index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by creation order index in decreasing order w/o creation order index" - ENDIF - ENDIF - ELSE - IF(iorder == H5_ITER_INC_F)THEN - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by name index in increasing order w/o creation order index" - ENDIF - ELSE - IF(use_index(i))THEN - WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/creation order index" - ELSE - WRITE(*,'(5x,A)')"deleting links by name index in decreasing order w/o creation order index" - ENDIF - ENDIF - ENDIF -! CALL h5_fixname_f(filename1, fix_filename1, H5P_DEFAULT_F, error) -! IF(error .NE. 0) STOP - - ! /* Create file */ - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp=fapl) - CALL check("delete_by_idx.H5Fcreate_f", error, total_error) - - ! /* Create group creation property list */ - CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, error ) - CALL check("delete_by_idx.H5Pcreate_f", error, total_error) - - ! /* Set creation order tracking & indexing on group */ - IF(use_index(i))THEN - Input1 = H5P_CRT_ORDER_INDEXED_F - ELSE - Input1 = 0 - ENDIF - - CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), error) - CALL check("delete_by_idx.H5Pset_link_creation_order_f", error, total_error) - - ! /* Create group with creation order tracking on */ - CALL H5Gcreate_f(file_id, CORDER_GROUP_NAME, group_id, error, gcpl_id=gcpl_id) - CALL check("delete_by_idx.H5Gcreate_f", error, total_error) - - ! /* Query the group creation properties */ - CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, error) - CALL check("delete_by_idx.H5Pget_link_phase_change_f", error, total_error) - - - ! /* Delete links from one end */ - - ! /* Check for deletion on empty group */ - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) - CALL VERIFY("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - ! /* Create several links, up to limit of compact form */ - DO u = 0, max_compact-1 - ! /* Make name for link */ - WRITE(chr2,'(I2.2)') u - objname = 'fill '//chr2 - - ! /* Create hard link, with group object */ - CALL H5Gcreate_f(group_id, objname, group_id2, error) - CALL check("delete_by_idx.H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id2, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - ! /* Verify link information for new link */ - CALL link_info_by_idx_check(group_id, objname, u, & - .TRUE., use_index, total_error) - ENDDO - - ! /* Verify state of group (compact) */ - ! IF(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR - - ! /* Check for out of bound deletion */ - - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(u,HSIZE_T), error) - CALL VERIFY("delete_by_idx.H5Ldelete_by_idx_f", error, -1, total_error) ! test should fail (error = -1) - - - ! /* Delete links from compact group */ - - DO u = 0, (max_compact - 1) -1 - ! /* Delete first link in appropriate order */ - CALL H5Ldelete_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), error) - CALL check("delete_by_idx.H5Ldelete_by_idx_f", error, total_error) - ! /* Verify the link information for first link in appropriate order */ - ! HDmemset(&linfo, 0, sizeof(linfo)); - - CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - - IF(iorder.EQ.H5_ITER_INC_F)THEN - CALL VERIFY("delete_by_idx.H5Lget_info_by_idx_f", corder, u+1, total_error) - ELSE - CALL VERIFY("delete_by_idx.H5Lget_info_by_idx_f", corder, (max_compact - (u + 2)), total_error) - ENDIF - - ! /* Verify the name for first link in appropriate order */ - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ size_tmp = 20 -!!$ CALL H5Lget_name_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), size_tmp, tmpname, error) -!!$ CALL check("delete_by_idx.H5Lget_name_by_idx_f", error, total_error) -!!$ -!!$ IF(order .EQ. H5_ITER_INC_F)THEN -!!$ WRITE(chr2,'(I2.2)') u + 1 -!!$ ELSE -!!$ WRITE(chr2,'(I2.2)') (max_compact - (u + 2)) -!!$ ENDIF -!!$ objname = 'fill '//chr2 -!!$ PRINT*,objname, tmpname -!!$ CALL verifyString("delete_by_idx.H5Lget_name_by_idx_f", objname, tmpname, total_error) - ENDDO -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ -!!$ /* Create more links, to push group into dense form */ -!!$ for(u = 0; u < (max_compact * 2); u++) { -!!$ hid_t group_id2; /* Group ID */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(u >= max_compact) -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Verify link information for new link */ -!!$ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Check for out of bound deletion again */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR -!!$ -!!$ /* Delete links from dense group, in appropriate order */ -!!$ for(u = 0; u < ((max_compact * 2) - 1); u++) { -!!$ /* Delete first link in appropriate order */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for first link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != (u + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - (u + 2))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for first link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", (u + 1)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - (u + 2))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR -!!$ -!!$ /* Check for deletion on empty group again */ -!!$ H5E_BEGIN_TRY { -!!$ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); -!!$ } H5E_END_TRY; -!!$ if(ret >= 0) TEST_ERROR -!!$ -!!$ -!!$ /* Delete links in middle */ -!!$ -!!$ -!!$ /* Create more links, to push group into dense form */ -!!$ for(u = 0; u < (max_compact * 2); u++) { -!!$ hid_t group_id2; /* Group ID */ -!!$ -!!$ /* Make name for link */ -!!$ sprintf(objname, "filler %02u", u); -!!$ -!!$ /* Create hard link, with group object */ -!!$ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Gclose(group_id2) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (dense) */ -!!$ if(u >= max_compact) -!!$ if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR -!!$ -!!$ /* Verify link information for new link */ -!!$ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete every other link from dense group, in appropriate order */ -!!$ for(u = 0; u < max_compact; u++) { -!!$ /* Delete link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for current link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != ((u * 2) + 1)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 2))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for current link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", ((u * 2) + 1)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete remaining links from dense group, in appropriate order */ -!!$ for(u = 0; u < (max_compact - 1); u++) { -!!$ /* Delete link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for first link in appropriate order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) { -!!$ if(linfo.corder != ((u * 2) + 3)) TEST_ERROR -!!$ } /* end if */ -!!$ else { -!!$ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 4))) TEST_ERROR -!!$ } /* end else */ -!!$ -!!$ /* Verify the name for first link in appropriate order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(order == H5_ITER_INC) -!!$ sprintf(objname, "filler %02u", ((u * 2) + 3)); -!!$ else -!!$ sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); -!!$ if(HDstrcmp(objname, tmpname)) TEST_ERROR -!!$ } /* end for */ -!!$ -!!$ /* Delete last link */ -!!$ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR -!!$ -!!$ /* Verify state of group (empty) */ -!!$ if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR -!!$ if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR -!!$ -!!$ -!!$ - ! /* Close the group */ - CALL H5Gclose_f(group_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - !/* Close the group creation property list */ - CALL H5Pclose_f(gcpl_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - !/* Close the file */ - CALL H5Fclose_f(file_id, error) - CALL check("delete_by_idx.H5Gclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("file0", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - ENDDO - ENDDO - ENDDO -!!$ -!!$ return 0; -!!$ -!!$error: -!!$ H5E_BEGIN_TRY { -!!$ H5Pclose(gcpl_id); -!!$ H5Gclose(group_id); -!!$ H5Fclose(file_id); -!!$ } H5E_END_TRY; -!!$ return -1; -!!$} /* end delete_by_idx() */ - -END SUBROUTINE delete_by_idx - - - -!/*------------------------------------------------------------------------- -! * Function: link_info_by_idx_check -! * -! * Purpose: Support routine for link_info_by_idx, to verify the link -! * info is correct for a link -! * -! * Note: This routine assumes that the links have been inserted in the -! * group in alphabetical order. -! * -! * Return: Success: 0 -! * Failure: -1 -! * -! * Programmer: Quincey Koziol -! * Tuesday, November 7, 2006 -! * -! *------------------------------------------------------------------------- -! */ -SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & - hard_link, use_index, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: group_id - CHARACTER(LEN=*), INTENT(IN) :: linkname - INTEGER, INTENT(IN) :: n - LOGICAL, INTENT(IN) :: hard_link - LOGICAL, INTENT(IN) :: use_index - - LOGICAL :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T) :: data_size ! Indicates the size, in the number of characters, of the attribute - - CHARACTER(LEN=7) :: tmpname !/* Temporary link name */ - CHARACTER(LEN=3) :: tmpname_small !/* to small temporary link name */ - CHARACTER(LEN=10) :: tmpname_big !/* to big temporary link name */ - - CHARACTER(LEN=7) :: valname !/* Link value name */ - CHARACTER(LEN=7) :: tmpval !/* Temporary link value */ - CHARACTER(LEN=2) :: chr2 - INTEGER(SIZE_T) :: size_tmp - INTEGER :: error - - ! /* Make link value for increasing/native order queries */ - - WRITE(chr2,'(I2.2)') n - valname = 'valn.'//chr2 - - ! /* Verify the link information for first link, in increasing creation order */ - ! HDmemset(&linfo, 0, sizeof(linfo)); - CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL VERIFY("H5Lget_info_by_idx_f", corder, 0, total_error) - - ! /* Verify the link information for new link, in increasing creation order */ - ! HDmemset(&linfo, 0, sizeof(linfo)); - CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), & - f_corder_valid, corder, cset, data_size, error) - CALL check("H5Lget_info_by_idx_f", error, total_error) - CALL VERIFY("H5Lget_info_by_idx_f", corder, n, total_error) - - ! /* Verify value for new soft link, in increasing creation order */ -!!$ IF(hard_link)THEN -!!$ ! HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ -!!$ CALL H5Lget_val_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, n, tmpval, INT(7,SIZE_T),error) -!!$ CALL check("H5Lget_val_by_idx",error,total_error) -!!$ -!!$! IF(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ ENDIF - - ! /* Verify the name for new link, in increasing creation order */ - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); - - ! The actual size of tmpname should be 7 - - size_tmp = INT(3,SIZE_T) - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), size_tmp, tmpname_small, error) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:LEN(tmpname_small)), tmpname_small(1:LEN(tmpname_small)), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - - ! try it with the correct size - size_tmp = INT(LEN(tmpname),SIZE_T) - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), size_tmp, tmpname, error) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:LEN(tmpname)), tmpname(1:LEN(tmpname)), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - - size_tmp = INT(LEN(tmpname_big),SIZE_T) - CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), size_tmp, tmpname_big, error) - CALL check("link_info_by_idx_check.H5Lget_name_by_idx_f", error, total_error) - CALL verifyString("link_info_by_idx_check.H5Lget_name_by_idx_f", & - linkname(1:7), tmpname_big(1:7), total_error) - CALL VERIFY("link_info_by_idx_check.H5Lget_name_by_idx_f", INT(size_tmp), 7, total_error) - - ! Try with a buffer set to small - -!!$ size_tmp = INT(4,SIZE_T) -!!$ CALL H5Lget_name_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), size_tmp, tmpname, error) -!!$ CALL check("H5Lget_name_by_idx_f", error, total_error) -!!$ CALL verifyString("H5Lget_name_by_idx_f", linkname, tmpname, total_error) - - -!!$ -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR - -!!$ /* Don't test "native" order if there is no creation order index, since -!!$ * there's not a good way to easily predict the link's order in the name -!!$ * index. -!!$ */ -!!$ if(use_index) { -!!$ /* Verify the link information for first link, in native creation order (which is increasing) */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in native creation order (which is increasing) */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in native creation order (which is increasing) */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in native creation order (which is increasing) */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the link information for first link, in decreasing creation order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in decreasing creation order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in decreasing creation order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in decreasing creation order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ -!!$ /* Verify the link information for first link, in increasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in increasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in increasing link name order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in increasing link name order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ /* Don't test "native" order queries on link name order, since there's not -!!$ * a good way to easily predict the order of the links in the name index. -!!$ */ -!!$ -!!$ /* Verify the link information for first link, in decreasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != 0) TEST_ERROR -!!$ -!!$ /* Verify the link information for new link, in decreasing link name order */ -!!$ HDmemset(&linfo, 0, sizeof(linfo)); -!!$ if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(linfo.corder != (int64_t)n) TEST_ERROR -!!$ -!!$ /* Verify value for new soft link, in decreasing link name order */ -!!$ if(!hard_link) { -!!$ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(valname, tmpval)) TEST_ERROR -!!$ } /* end if */ -!!$ -!!$ /* Verify the name for new link, in decreasing link name order */ -!!$ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); -!!$ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR -!!$ if(HDstrcmp(linkname, tmpname)) TEST_ERROR -!!$ -!!$ /* Success */ -!!$ return(0); -!!$ -!!$error: -!!$ /* Failure */ -!!$ return(-1); -!!$} /* end link_info_by_idx_check() */ - - END SUBROUTINE link_info_by_idx_check - - -!/*------------------------------------------------------------------------- -! * Function: test_lcpl -! * -! * Purpose: Tests Link Creation Property Lists -! * -! * Return: Success: 0 -! * Failure: number of errors -! * -! * Programmer: M.S. Breitenfeld -! * Modified C routine -! * March 12, 2008 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - - - SUBROUTINE test_lcpl(cleanup, fapl, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - LOGICAL :: cleanup - - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: group_id - INTEGER(HID_T) :: space_id, data_space - INTEGER(HID_T) :: dset_id - INTEGER(HID_T) :: type_id - INTEGER(HID_T) :: lcpl_id - - INTEGER :: cset ! Indicates the character set used for the link’s name. - INTEGER :: corder ! Specifies the link’s creation order position. - LOGICAL :: f_corder_valid ! Indicates whether the value in corder is valid. - INTEGER :: link_type ! Specifies the link class: - ! H5L_LINK_HARD_F - Hard link - ! H5L_LINK_SOFT_F - Soft link - ! H5L_LINK_EXTERNAL_F - External link - ! H5L_LINK_ERROR _F - Error - INTEGER :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(HSIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value - INTEGER(HSIZE_T) :: data_size ! Indicates the size, in the number of characters, of the attribute - - CHARACTER(LEN=1024) :: filename = 'tempfile.h5' - INTEGER, PARAMETER :: TEST6_DIM1 = 8, TEST6_DIM2 = 7 - INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) - - INTEGER :: encoding - INTEGER :: error - LOGICAL :: Lexists - INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: extend_dim = (/TEST6_DIM1-2,TEST6_DIM2-3/) - INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsout, maxdimsout ! dimensions - - INTEGER :: i - - WRITE(*,*) "link creation property lists (w/new group format)" - - - !/* Actually, intermediate group creation is tested elsewhere (tmisc). - ! * Here we only need to test the character encoding property */ - - !/* Create file */ - ! h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("test_lcpl.H5Fcreate_f", error, total_error) - - - ! /* Create and link a group with the default LCPL */ - - CALL H5Gcreate_f(file_id, "/group", group_id, error) - CALL check("test_lcpl.H5Gcreate_f", error, total_error) - - - ! /* Check that its character encoding is the default */ - - CALL H5Lget_info_f(file_id, "group", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error, H5P_DEFAULT_F) - -!/* File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. */ -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL VERIFY("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - ! /* Create and commit a datatype with the default LCPL */ - CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("test_lcpl.h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "/type", type_id, error) - CALL check("test_lcpl.h5tcommit_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("test_lcpl.h5tclose_f", error, total_error) - - - ! /* Check that its character encoding is the default */ - CALL H5Lget_info_f(file_id, "type", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.h5tclose_f", error, total_error) - -!/* File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. */ -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - !/* Create a dataspace */ - CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("test_lcpl.h5screate_simple_f",error,total_error) - - ! /* Create a dataset using the default LCPL */ - CALL h5dcreate_f(file_id, "/dataset", H5T_NATIVE_INTEGER, space_id, dset_id, error) - CALL check("test_lcpl.h5dcreate_f", error, total_error) - CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) - - ! Reopen - - CALL H5Dopen_f(file_id, "/dataset", dset_id, error) - CALL check("test_lcpl.h5dopen_f", error, total_error) - - ! /* Extend the dataset */ - CALL H5Dset_extent_f(dset_id, extend_dim, error) - CALL check("test_lcpl.H5Dset_extent_f", error, total_error) - ! /* Verify the dataspaces */ - ! - !Get dataset's dataspace handle. - ! - CALL h5dget_space_f(dset_id, data_space, error) - CALL check("h5dget_space_f",error,total_error) - - CALL h5sget_simple_extent_dims_f(data_space, dimsout, maxdimsout, error) - CALL check("test_lcpl.h5sget_simple_extent_dims_f",error, total_error) - - DO i = 1, 2 - CALL VERIFY("H5Sget_simple_extent_dims", dimsout(i), extend_dim(i), total_error) - CALL VERIFY("H5Sget_simple_extent_dims", maxdimsout(i), dims(i), total_error) - ENDDO - - ! /* close data set */ - - CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) - - ! /* Check that its character encoding is the default */ - CALL H5Lget_info_f(file_id, "dataset", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - -!/* File-wide default character encoding can not yet be set via the file -! * creation property list and is always ASCII. */ -!#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - - CALL verify("test_lcpl.h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) - - !/* Create a link creation property list with the UTF-8 character encoding */ - CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("test_lcpl.h5Pcreate_f",error,total_error) - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) - - ! /* Create and link a group with the new LCPL */ - CALL H5Gcreate_f(file_id, "/group2", group_id, error,lcpl_id=lcpl_id) - CALL check("test_lcpl.test_lcpl.H5Gcreate_f", error, total_error) - CALL H5Gclose_f(group_id, error) - CALL check("test_lcpl.test_lcpl.H5Gclose_f", error, total_error) - - - !/* Check that its character encoding is UTF-8 */ - CALL H5Lget_info_f(file_id, "group2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! /* Create and commit a datatype with the new LCPL */ - - CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("test_lcpl.h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "/type2", type_id, error, lcpl_id=lcpl_id) - CALL check("test_lcpl.h5tcommit_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("test_lcpl.h5tclose_f", error, total_error) - - - !/* Check that its character encoding is UTF-8 */ - CALL H5Lget_info_f(file_id, "type2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - ! /* Create a dataset using the new LCPL */ - CALL h5dcreate_f(file_id, "/dataset2", H5T_NATIVE_INTEGER, space_id, dset_id, error,lcpl_id=lcpl_id) - CALL check("test_lcpl.h5dcreate_f", error, total_error) - - CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) - - CALL H5Pget_char_encoding_f(lcpl_id, encoding, error) - CALL check("test_lcpl.H5Pget_char_encoding_f", error, total_error) - CALL VERIFY("test_lcpl.H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) - - ! /* Check that its character encoding is UTF-8 */ - CALL H5Lget_info_f(file_id, "dataset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) - - ! /* Create a new link to the dataset with a different character encoding. */ - CALL H5Pclose_f(lcpl_id, error) - CALL check("test_lcpl.H5Pclose_f", error, total_error) - - CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("test_lcpl.h5Pcreate_f",error,total_error) - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) - CALL H5Lcreate_hard_f(file_id, "/dataset2", file_id, "/dataset2_link", error, lcpl_id) - CALL check("test_lcpl.H5Lcreate_hard_f",error, total_error) - - CALL H5Lexists_f(file_id,"/dataset2_link",Lexists, error) - CALL check("test_lcpl.H5Lexists",error, total_error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) - - ! /* Check that its character encoding is ASCII */ - CALL H5Lget_info_f(file_id, "/dataset2_link", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - ! /* Check that the first link's encoding hasn't changed */ - - CALL H5Lget_info_f(file_id, "/dataset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) - - - !/* Make sure that LCPLs work properly for other API calls: */ - !/* H5Lcreate_soft */ - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) - CALL H5Lcreate_soft_f("dataset2", file_id, "slink_to_dset2",error,lcpl_id) - CALL check("H5Lcreate_soft_f", error, total_error) - - CALL H5Lget_info_f(file_id, "slink_to_dset2", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! /* H5Lmove */ - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) - - CALL H5Lmove_f(file_id, "slink_to_dset2", file_id, "moved_slink", error, lcpl_id, H5P_DEFAULT_F) - CALL check("test_lcpl.H5Lmove_f",error, total_error) - - CALL H5Lget_info_f(file_id, "moved_slink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) - - - ! /* H5Lcopy */ - - CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) - - CALL H5Lcopy_f(file_id, "moved_slink", file_id, "copied_slink", error, lcpl_id) - - CALL H5Lget_info_f(file_id, "copied_slink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! /* H5Lcreate_external */ - - CALL H5Lcreate_external_f("test_lcpl.filename", "path", file_id, "extlink", error, lcpl_id) - CALL check("test_lcpl.H5Lcreate_external_f", error, total_error) - - CALL H5Lget_info_f(file_id, "extlink", & - cset, corder, f_corder_valid, link_type, address, val_size, & - error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) - - - ! /* Close open IDs */ - - CALL H5Pclose_f(lcpl_id, error) - CALL check("test_lcpl.H5Pclose_f", error, total_error) - CALL H5Sclose_f(space_id, error) - CALL check("test_lcpl.h5Sclose_f",error,total_error) - CALL H5Fclose_f(file_id, error) - CALL check("test_lcpl.H5Fclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f("tempfile", H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - -END SUBROUTINE test_lcpl - -SUBROUTINE objcopy(fapl, total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(INOUT) :: total_error - INTEGER(HID_T), INTENT(IN) :: fapl - - INTEGER(HID_T) :: fapl2, pid - - INTEGER :: flag, cpy_flags - - INTEGER :: error - - flag = H5O_COPY_SHALLOW_HIERARCHY_F - -!/* Copy the file access property list */ - CALL H5Pcopy_f(fapl, fapl2, error) - CALL check("H5Pcopy_f", error, total_error) - -!/* Set the "use the latest version of the format" bounds for creating objects in the file */ - CALL H5Pset_libver_bounds_f(fapl2, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - - ! /* create property to pass copy options */ - CALL h5pcreate_f(H5P_OBJECT_COPY_F, pid, error) - CALL check("h5pcreate_f",error, total_error) - - ! /* set options for object copy */ - CALL H5Pset_copy_object_f(pid, flag, error) - CALL check("H5Pset_copy_object_f",error, total_error) - - ! /* Verify object copy flags */ - CALL H5Pget_copy_object_f(pid, cpy_flags, error) - CALL check("H5Pget_copy_object_f",error, total_error) - CALL VERIFY("H5Pget_copy_object_f", cpy_flags, flag, total_error) - -!!$ -!!$ CALL test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, -!!$ FALSE, "H5Ocopy(): without attributes"); - - CALL lapl_nlinks(fapl2, total_error) - -END SUBROUTINE objcopy - - -!/*------------------------------------------------------------------------- -! * Function: lapl_nlinks -! * -! * Purpose: Check that the maximum number of soft links can be adjusted -! * by the user using the Link Access Property List. -! * -! * Return: Success: 0 -! * -! * Failure: -1 -! * -! * Programmer: James Laird -! * Tuesday, June 6, 2006 -! * -! * Modifications: -! * -! *------------------------------------------------------------------------- -! */ - -SUBROUTINE lapl_nlinks( fapl, total_error) - - USE HDF5 - - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl - INTEGER, INTENT(INOUT) :: total_error - - INTEGER :: error - - INTEGER(HID_T) :: fid = (-1) !/* File ID */ - INTEGER(HID_T) :: gid = (-1), gid2 = (-1) !/* Group IDs */ - INTEGER(HID_T) :: plist = (-1) ! /* lapl ID */ - INTEGER(HID_T) :: tid = (-1), sid = (-1), did = (-1) ! /* Other IDs */ - INTEGER(HID_T) :: gapl = (-1), dapl = (-1), tapl = (-1) ! /* Other property lists */ - - CHARACTER(LEN=7) :: objname ! /* Object name */ - INTEGER(size_t) :: name_len ! /* Length of object name */ - CHARACTER(LEN=12) :: filename = 'TestLinks.h5' - INTEGER(size_t) :: nlinks ! /* nlinks for H5Pset_nlinks */ - INTEGER(hsize_t), DIMENSION(2) :: dims - INTEGER(size_t) :: buf_size = 7 - - WRITE(*,*) "adjusting nlinks with LAPL (w/new group format)" - -!!$ /* Make certain test is valid */ -!!$ /* XXX: should probably make a "generic" test that creates the proper -!!$ * # of links based on this value - QAK -!!$ */ -!!$ HDassert(H5L_NUM_LINKS == 16); - - ! /* Create file */ - CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) - CALL check(" lapl_nlinks.h5fcreate_f",error,total_error) - - ! /* Create group with short name in file (used as target for links) */ - CALL H5Gcreate_f(fid, "final", gid, error) - CALL check(" lapl_nlinks.H5Gcreate_f", error, total_error) - - !/* Create chain of soft links to existing object (limited) */ - CALL H5Lcreate_soft_f("final", fid, "soft1", error) - CALL H5Lcreate_soft_f("soft1", fid, "soft2", error) - CALL H5Lcreate_soft_f("soft2", fid, "soft3", error) - CALL H5Lcreate_soft_f("soft3", fid, "soft4", error) - CALL H5Lcreate_soft_f("soft4", fid, "soft5", error) - CALL H5Lcreate_soft_f("soft5", fid, "soft6", error) - CALL H5Lcreate_soft_f("soft6", fid, "soft7", error) - CALL H5Lcreate_soft_f("soft7", fid, "soft8", error) - CALL H5Lcreate_soft_f("soft8", fid, "soft9", error) - CALL H5Lcreate_soft_f("soft9", fid, "soft10", error) - CALL H5Lcreate_soft_f("soft10", fid, "soft11", error) - CALL H5Lcreate_soft_f("soft11", fid, "soft12", error) - CALL H5Lcreate_soft_f("soft12", fid, "soft13", error) - CALL H5Lcreate_soft_f("soft13", fid, "soft14", error) - CALL H5Lcreate_soft_f("soft14", fid, "soft15", error) - CALL H5Lcreate_soft_f("soft15", fid, "soft16", error) - CALL H5Lcreate_soft_f("soft16", fid, "soft17", error) - - !/* Close objects */ - CALL H5Gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - CALL h5fclose_f(fid, error) - CALL check("h5fclose_f",error,total_error) - - !/* Open file */ - - CALL h5fopen_f(FileName, H5F_ACC_RDWR_F, fid, error, fapl) - CALL check("h5open_f",error,total_error) - - !/* Create LAPL with higher-than-usual nlinks value */ - !/* Create a non-default lapl with udata set to point to the first group */ - - CALL H5Pcreate_f(H5P_LINK_ACCESS_F,plist,error) - CALL check("h5Pcreate_f",error,total_error) - nlinks = 20 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f",error,total_error) - !/* Ensure that nlinks was set successfully */ - nlinks = 0 - CALL H5Pget_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f",error,total_error) - CALL VERIFY("H5Pset_nlinks_f",INT(nlinks), 20, total_error) - - - !/* Open object through what is normally too many soft links using - ! * new property list */ - - CALL H5Oopen_f(fid,"soft17",gid,error,plist) - CALL check("H5Oopen_f",error,total_error) - - !/* Check name */ - CALL h5iget_name_f(gid, objname, buf_size, name_len, error) - CALL check("h5iget_name_f",error,total_error) - CALL VerifyString("h5iget_name_f", TRIM(objname),"/soft17", total_error) - !/* Create group using soft link */ - CALL H5Gcreate_f(gid, "new_soft", gid2, error) - CALL check("H5Gcreate_f", error, total_error) - - ! /* Close groups */ - CALL H5Gclose_f(gid2, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(gid, error) - CALL check("H5Gclose_f", error, total_error) - - - !/* Set nlinks to a smaller number */ - nlinks = 4 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - !/* Ensure that nlinks was set successfully */ - nlinks = 0 - - CALL H5Pget_nlinks_f(plist, nlinks, error) - CALL check("H5Pget_nlinks_f",error,total_error) - CALL VERIFY("H5Pget_nlinks_f", INT(nlinks), 4, total_error) - - ! /* Try opening through what is now too many soft links */ - - CALL H5Oopen_f(fid,"soft5",gid,error,plist) - CALL VERIFY("H5Oopen_f", error, -1, total_error) ! should fail - - ! /* Open object through lesser soft link */ - CALL H5Oopen_f(fid,"soft4",gid,error,plist) - CALL check("H5Oopen_",error,total_error) - - ! /* Check name */ - CALL h5iget_name_f(gid, objname, buf_size, name_len, error) - CALL check("h5iget_name_f",error,total_error) - CALL VerifyString("h5iget_name_f", TRIM(objname),"/soft4", total_error) - - ! /* Test other functions that should use a LAPL */ - nlinks = 20 - CALL H5Pset_nlinks_f(plist, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - !/* Try copying and moving when both src and dst contain many soft links - ! * using a non-default LAPL - ! */ - CALL H5Lcopy_f(fid, "soft17", fid, "soft17/newer_soft", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcopy_f",error,total_error) - - CALL H5Lmove_f(fid, "soft17/newer_soft", fid, "soft17/newest_soft", error, lapl_id=plist) - CALL check("H5Lmove_f",error, total_error) - - ! /* H5Olink */ - CALL H5Olink_f(gid, fid, "soft17/link_to_group", error, H5P_DEFAULT_F, plist) - CALL check("H5Olink_f", error, total_error) - - ! /* H5Lcreate_hard and H5Lcreate_soft */ - CALL H5Lcreate_hard_f(fid, "soft17", fid, "soft17/link2_to_group", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_hard_f", error, total_error) - - - CALL H5Lcreate_soft_f("/soft4", fid, "soft17/soft_link",error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_soft_f", error, total_error) - - ! /* H5Ldelete */ - CALL h5ldelete_f(fid, "soft17/soft_link", error, plist) - CALL check("H5Ldelete_f", error, total_error) - -!!$ /* H5Lget_val and H5Lget_info */ -!!$ if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR -!!$ if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR -!!$ - - ! /* H5Lcreate_external and H5Lcreate_ud */ - CALL H5Lcreate_external_f("filename", "path", fid, "soft17/extlink", error, H5P_DEFAULT_F, plist) - CALL check("H5Lcreate_external_f", error, total_error) - -!!$ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR -!!$ if(H5Lcreate_ud(fid, "soft17/udlink", UD_HARD_TYPE, NULL, (size_t)0, H5P_DEFAULT, plist) < 0) TEST_ERROR -!!$ - ! /* Close plist */ - CALL h5pclose_f(plist, error) - CALL check("h5pclose_f", error, total_error) - - ! /* Create a datatype and dataset as targets inside the group */ - CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(gid, "datatype", tid, error) - CALL check("h5tcommit_f", error, total_error) - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f", error, total_error) - -!!$ -!!$ dims[0] = 2; -!!$ dims[1] = 2; -!!$ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR -!!$ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR -!!$ if(H5Dclose(did) < 0) TEST_ERROR -!!$ - !/* Close group */ - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - -!!$ -!!$ /* Try to open the objects using too many symlinks with default *APLs */ -!!$ H5E_BEGIN_TRY { -!!$ if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >= 0) -!!$ FAIL_PUTS_ERROR(" Should have failed for too many nested links.") -!!$ } H5E_END_TRY -!!$ - ! /* Create property lists with nlinks set */ - - CALL H5Pcreate_f(H5P_GROUP_ACCESS_F,gapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pcreate_f(H5P_DATATYPE_ACCESS_F,tapl,error) - CALL check("h5Pcreate_f",error,total_error) - CALL H5Pcreate_f(H5P_DATASET_ACCESS_F,dapl,error) - CALL check("h5Pcreate_f",error,total_error) - - - nlinks = 20 - CALL H5Pset_nlinks_f(gapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - CALL H5Pset_nlinks_f(tapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - CALL H5Pset_nlinks_f(dapl, nlinks, error) - CALL check("H5Pset_nlinks_f", error, total_error) - - !/* We should now be able to use these property lists to open each kind - ! * of object. - ! */ - - CALL H5Gopen_f(fid, "soft17", gid, error, gapl) - CALL check("H5Gopen_f",error,total_error) - - CALL H5Topen_f(fid, "soft17/datatype", tid, error, tapl) - CALL check("H5Gopen_f",error,total_error) - -!!$ if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR - - ! /* Close objects */ - - CALL h5gclose_f(gid, error) - CALL check("h5gclose_f",error,total_error) - CALL h5tclose_f(tid, error) - CALL check("h5tclose_f", error, total_error) - -!!$ if(H5Dclose(did) < 0) TEST_ERROR -!!$ - ! /* Close plists */ - - CALL h5pclose_f(gapl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(tapl, error) - CALL check("h5pclose_f", error, total_error) - -!!$ if(H5Pclose(dapl) < 0) TEST_ERROR -!!$ -!!$ /* Unregister UD hard link class */ -!!$ if(H5Lunregister(UD_HARD_TYPE) < 0) TEST_ERROR -!!$ - - ! /* Close file */ - CALL H5Fclose_f(fid, error) - CALL check("H5Fclose_f", error, total_error) - -END SUBROUTINE lapl_nlinks diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 deleted file mode 100644 index d0c3f16..0000000 --- a/fortran/test/tH5O.f90 +++ /dev/null @@ -1,208 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -SUBROUTINE test_h5o(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - ! /* Output message about test being performed */ - WRITE(*,*) "Testing Objects" - -!!$ test_h5o_open(); /* Test generic OPEN FUNCTION */ -!!$ test_h5o_open_by_addr(); /* Test opening objects by address */ -!!$ test_h5o_close(); /* Test generic CLOSE FUNCTION */ -!!$ test_h5o_refcount(); /* Test incrementing and decrementing reference count */ -!!$ test_h5o_plist(); /* Test object creation properties */ - CALL test_h5o_link(total_error) ! /* Test object link routine */ - -END SUBROUTINE test_h5o - -!/**************************************************************** -!** -!** test_h5o_link: Test creating link to object -!** -!****************************************************************/ - -SUBROUTINE test_h5o_link(total_error) - - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: total_error - - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: group_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: dset_id - INTEGER(HID_T) :: type_id - INTEGER(HID_T) :: fapl_id - INTEGER(HID_T) :: lcpl_id - CHARACTER(LEN=8), PARAMETER :: TEST_FILENAME = 'TestFile' - INTEGER, PARAMETER :: TEST6_DIM1 = 2, TEST6_DIM2 = 5 - INTEGER(HSIZE_T), DIMENSION(1:2), PARAMETER :: dims = (/TEST6_DIM1,TEST6_DIM2/) - INTEGER, DIMENSION(1:TEST6_DIM1,1:TEST6_DIM2) :: wdata, rdata - - INTEGER, PARAMETER :: TRUE = 1, FALSE = 0 - - LOGICAL :: committed ! /* Whether the named datatype is committed */ - - INTEGER :: i, n, j - INTEGER :: error ! /* Value returned from API calls */ - - ! /* Initialize the raw data */ - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - wdata(i,j) = i*j - ENDDO - ENDDO - - ! /* Create the dataspace */ - CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! /* Create LCPL with intermediate group creation flag set */ - CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) - CALL check("h5Pcreate_f",error,total_error) - - CALL H5Pset_create_inter_group_f(lcpl_id, TRUE, error) - CALL check("H5Pset_create_inter_group_f",error,total_error) - - ! /* Loop over using new group format */ - ! for(new_format = FALSE; new_format <= TRUE; new_format++) { - - !/* Make a FAPL that uses the "use the latest version of the format" bounds */ - CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,error) - CALL check("h5Pcreate_f",error,total_error) - - ! /* Set the "use the latest version of the format" bounds for creating objects in the file */ - - CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) - CALL check("H5Pset_libver_bounds_f",error, total_error) - -!!$ ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST); - - ! /* Create a new HDF5 file */ - CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) - CALL check("H5Fcreate_f", error, total_error) - - ! /* Close the FAPL */ - CALL h5pclose_f(fapl_id, error) - CALL check("h5pclose_f",error,total_error) - - ! /* Create and commit a datatype with no name */ - CALL H5Tcopy_f( H5T_NATIVE_INTEGER, type_id, error) - CALL check("H5Tcopy",error,total_error) - - CALL H5Tcommit_anon_f(file_id, type_id, error) ! using no optional parameters - CALL check("H5Tcommit_anon",error,total_error) - - CALL H5Tcommitted_f(type_id, committed, error) - CALL check("H5Tcommitted_f",error,total_error) - CALL verifyLogical("H5Tcommitted_f", committed, .TRUE., total_error) - - ! /* Create a dataset with no name using the committed datatype*/ - CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters - CALL check("H5Dcreate_anon_f",error,total_error) - - - ! /* Verify that we can write to and read from the dataset */ - - ! /* Write the data to the dataset */ - - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error, & - mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL check("h5dwrite_f", error, total_error) - - ! /* Read the data back */ - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & - mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL check("h5dread_f", error, total_error) - - ! /* Verify the data */ - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - CALL VERIFY("H5Dread_f",wdata(i,j),rdata(i,j),total_error) - wdata(i,j) = i*j - ENDDO - ENDDO - - ! /* Create a group with no name*/ - - CALL H5Gcreate_anon_f(file_id, group_id, error) - CALL check("H5Gcreate_anon", error, total_error) - - ! /* Link nameless datatype into nameless group */ - CALL H5Olink_f(type_id, group_id, "datatype", error, H5P_DEFAULT_F) - CALL check("H5Olink_f", error, total_error) - - ! /* Link nameless dataset into nameless group with intermediate group */ - CALL H5Olink_f(dset_id, group_id, "inter_group/dataset", error, lcpl_id, H5P_DEFAULT_F) - CALL check("H5Olink_f", error, total_error) - - ! /* Close IDs for dataset and datatype */ - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f", error, total_error) - - - ! /* Re-open datatype using new link */ - CALL H5Topen_f(group_id, "datatype", type_id, error) - CALL check("h5topen_f", error, total_error) - - ! /* Link nameless group to root group and close the group ID*/ - CALL H5Olink_f(group_id, file_id, "/group", error) - CALL check("H5Olink_f", error, total_error) - - - CALL h5gclose_f(group_id, error) - CALL check("h5gclose_f",error,total_error) - - ! /* Open dataset through root group and verify its data */ - - CALL H5Dopen_f(file_id, "/group/inter_group/dataset", dset_id, error) - CALL check("test_lcpl.h5dopen_f", error, total_error) - - ! /* Read data from dataset */ - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & - H5S_ALL_F, H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) - CALL check("h5dread_f", error, total_error) - - ! /* Verify the data */ - DO i = 1, TEST6_DIM1 - DO j = 1, TEST6_DIM2 - CALL VERIFY("H5Dread",wdata(i,j),rdata(i,j),total_error) - ENDDO - ENDDO - ! /* Close open IDs */ - - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - ! /* Close remaining IDs */ - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5pclose_f(lcpl_id,error) - CALL check("h5pclose_f", error, total_error) - -END SUBROUTINE test_h5o_link diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 index 9dfc374..687bb06 100644 --- a/fortran/test/tH5R.f90 +++ b/fortran/test/tH5R.f90 @@ -17,435 +17,377 @@ ! ! Testing Reference Interface functionality. ! -! The following subroutine tests h5rcreate_f, h5rdereference_f, h5rget_name_f +! The following subroutine tests h5rcreate_f, h5rdereference_f ! and H5Rget_object_type functions ! -SUBROUTINE refobjtest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=9), PARAMETER :: filename = "reference" - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=8), PARAMETER :: dsetnamei = "INTEGERS" - CHARACTER(LEN=17), PARAMETER :: dsetnamer = "OBJECT_REFERENCES" - CHARACTER(LEN=6), PARAMETER :: groupname1 = "GROUP1" - CHARACTER(LEN=6), PARAMETER :: groupname2 = "GROUP2" - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: grp1_id ! Group identifier - INTEGER(HID_T) :: grp2_id ! Group identifier - INTEGER(HID_T) :: dset1_id ! Dataset identifier - INTEGER(HID_T) :: dsetr_id ! Dataset identifier - INTEGER(HID_T) :: type_id ! Type identifier - INTEGER(HID_T) :: space_id ! Dataspace identifier - INTEGER(HID_T) :: spacer_id ! Dataspace identifier - INTEGER :: error, obj_type - INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/5/) - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr= (/4/) - INTEGER(HSIZE_T), DIMENSION(1) :: my_maxdims = (/5/) - INTEGER :: rank = 1 - INTEGER :: rankr = 1 - TYPE(hobj_ref_t_f), DIMENSION(4) :: ref - TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out - INTEGER(HSIZE_T), DIMENSION(1) :: ref_dim - INTEGER, DIMENSION(5) :: DATA = (/1, 2, 3, 4, 5/) - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - - CHARACTER(LEN=7) :: buf ! buffer to hold the region name - CHARACTER(LEN=16) :: buf_big ! buffer bigger then needed - CHARACTER(LEN=4) :: buf_small ! buffer smaller then needed - INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name - - ! - !Create a new file with Default file access and - !file creation properties . - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - - ! - ! Create a group inside the file - ! - CALL h5gcreate_f(file_id, groupname1, grp1_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - ! Create a group inside the group GROUP1 - ! - CALL h5gcreate_f(grp1_id, groupname2, grp2_id, error) - CALL check("h5gcreate_f",error,total_error) - - ! - ! Create dataspaces for datasets - ! - CALL h5screate_simple_f(rank, dims, space_id, error, maxdims=my_maxdims) - CALL check("h5screate_simple_f",error,total_error) - CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) - CALL check("h5screate_simple_f",error,total_error) - - ! - ! Create integer dataset - ! - CALL h5dcreate_f(file_id, dsetnamei, H5T_NATIVE_INTEGER, space_id, & - dset1_id, error) - CALL check("h5dcreate_f",error,total_error) - ! - ! Create dataset to store references to the objects - ! - CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_OBJ, spacer_id, & - dsetr_id, error) - CALL check("h5dcreate_f",error,total_error) - ! - ! Create a datatype and store in the file - ! - CALL h5tcopy_f(H5T_NATIVE_REAL, type_id, error) - CALL check("h5tcopy_f",error,total_error) - CALL h5tcommit_f(file_id, "MyType", type_id, error) - CALL check("h5tcommit_f",error,total_error) - - ! - ! Close dataspaces, groups and integer dataset - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5sclose_f(spacer_id, error) - CALL check("h5sclose_f",error,total_error) - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - CALL h5gclose_f(grp1_id, error) - CALL check("h5gclose_f",error,total_error) - CALL h5gclose_f(grp2_id, error) - CALL check("h5gclose_f",error,total_error) - - ! - ! Craete references to two groups, integer dataset and shared datatype - ! and write it to the dataset in the file - ! - CALL h5rcreate_f(file_id, groupname1, ref(1), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, dsetnamei, ref(3), error) - CALL check("h5rcreate_f",error,total_error) - CALL h5rcreate_f(file_id, "MyType", ref(4), error) - CALL check("h5rcreate_f",error,total_error) - ref_dim(1) = SIZE(ref) - CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_dim, error) - CALL check("h5dwrite_f",error,total_error) - - ! getting path to normal dataset in root group - - CALL H5Rget_name_f(dsetr_id, ref(1), buf, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(7,SIZE_T), total_error) - CALL VerifyString("H5Rget_name_f", buf, "/GROUP1", total_error) - - ! with buffer bigger then needed - - CALL H5Rget_name_f(dsetr_id, ref(1), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(7,SIZE_T),total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) - - ! getting path to dataset in /Group1 - - CALL H5Rget_name_f(dsetr_id, ref(2), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(14,SIZE_T),total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) - - ! - !Close the dataset - ! - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f",error,total_error) - - ! - ! Reopen the dataset with object references - ! - CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error) - CALL check("h5dopen_f",error,total_error) - ref_dim(1) = SIZE(ref_out) - CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_dim, error) - CALL check("h5dread_f",error,total_error) - - ! - !get the third reference's type and Dereference it - ! - CALL h5rget_object_type_f(dsetr_id, ref(3), obj_type, error) - CALL check("h5rget_object_type_f",error,total_error) - IF (obj_type == H5G_DATASET_F) THEN - CALL h5rdereference_f(dsetr_id, ref(3), dset1_id, error) - CALL check("h5rdereference_f",error,total_error) - - data_dims(1) = 5 - CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) - CALL check("h5dwrite_f",error,total_error) - END IF - - ! - !get the fourth reference's type and Dereference it - ! - CALL h5rget_object_type_f(dsetr_id, ref(4), obj_type, error) - CALL check("h5rget_object_type_f",error,total_error) - IF (obj_type == H5G_TYPE_F) THEN - CALL h5rdereference_f(dsetr_id, ref(4), type_id, error) - CALL check("h5rdereference_f",error,total_error) - END IF - - ! - ! Close all objects. - ! - CALL h5dclose_f(dset1_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5tclose_f(type_id, error) - CALL check("h5tclose_f",error,total_error) - - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f",error,total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) - - - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN - -END SUBROUTINE refobjtest -! -! The following subroutine tests h5rget_region_f, h5rcreate_f, h5rget_name_f, -! and h5rdereference_f functionalities -! -SUBROUTINE refregtest(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=6), PARAMETER :: filename = "Refreg" - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=6), PARAMETER :: dsetnamev = "MATRIX" - CHARACTER(LEN=17), PARAMETER :: dsetnamer = "REGION_REFERENCES" + SUBROUTINE refobjtest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=9), PARAMETER :: filename = "reference" + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=8), PARAMETER :: dsetnamei = "INTEGERS" + CHARACTER(LEN=17), PARAMETER :: dsetnamer = "OBJECT_REFERENCES" + CHARACTER(LEN=6), PARAMETER :: groupname1 = "GROUP1" + CHARACTER(LEN=6), PARAMETER :: groupname2 = "GROUP2" + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: grp1_id ! Group identifier + INTEGER(HID_T) :: grp2_id ! Group identifier + INTEGER(HID_T) :: dset1_id ! Dataset identifier + INTEGER(HID_T) :: dsetr_id ! Dataset identifier + INTEGER(HID_T) :: type_id ! Type identifier + INTEGER(HID_T) :: space_id ! Dataspace identifier + INTEGER(HID_T) :: spacer_id ! Dataspace identifier + INTEGER :: error, obj_type + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/5/) + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr= (/4/) + INTEGER(HSIZE_T), DIMENSION(1) :: my_maxdims = (/5/) + INTEGER :: rank = 1 + INTEGER :: rankr = 1 + TYPE(hobj_ref_t_f), DIMENSION(4) :: ref + TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out + INTEGER(HSIZE_T), DIMENSION(1) :: ref_dim + INTEGER, DIMENSION(5) :: data = (/1, 2, 3, 4, 5/) + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + + + ! + !Create a new file with Default file access and + !file creation properties . + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + - CHARACTER(LEN=7) :: buf ! buffer to hold the region name - CHARACTER(LEN=11) :: buf_big ! buffer bigger then needed - CHARACTER(LEN=4) :: buf_small ! buffer smaller then needed - INTEGER(SIZE_T) :: buf_size ! returned size of the region buffer name - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: space_id ! Dataspace identifier - INTEGER(HID_T) :: spacer_id ! Dataspace identifier - INTEGER(HID_T) :: dsetv_id ! Dataset identifier - INTEGER(HID_T) :: dsetr_id ! Dataset identifier - INTEGER :: error - TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references - TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out ! - INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! - INTEGER(HSIZE_T), DIMENSION(2) :: start - INTEGER(HSIZE_T), DIMENSION(2) :: count - INTEGER :: rankr = 1 - INTEGER :: rank = 2 - INTEGER , DIMENSION(2,9) :: DATA - INTEGER , DIMENSION(2,9) :: data_out = 0 - INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord - INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points - coord = RESHAPE((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points - DATA = RESHAPE ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/)) + ! + ! Create a group inside the file + ! + CALL h5gcreate_f(file_id, groupname1, grp1_id, error) + CALL check("h5gcreate_f",error,total_error) - ! - ! Initialize FORTRAN predefined datatypes. - ! - ! CALL h5init_types_f(error) - ! CALL check("h5init_types_f", error, total_error) - ! - ! Create a new file. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - IF (error .NE. 0) THEN - WRITE(*,*) "Cannot modify filename" - STOP - ENDIF - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - ! Default file access and file creation - ! properties are used. - CALL check("h5fcreate_f", error, total_error) - ! - ! Create dataspaces: - ! - ! for dataset with references to dataset regions - ! - CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! for integer dataset - ! - CALL h5screate_simple_f(rank, dims, space_id, error) - CALL check("h5screate_simple_f", error, total_error) - ! - ! Create and write datasets: - ! - ! Integer dataset - ! - CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, & - dsetv_id, error) - CALL check("h5dcreate_f", error, total_error) - data_dims(1) = 2 - data_dims(2) = 9 - CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) - CALL check("h5dwrite_f", error, total_error) + ! + ! Create a group inside the group GROUP1 + ! + CALL h5gcreate_f(grp1_id, groupname2, grp2_id, error) + CALL check("h5gcreate_f",error,total_error) - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - ! - ! Dataset with references - ! - CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, & - dsetr_id, error) - CALL check("h5dcreate_f", error, total_error) - ! - ! Create a reference to the hyperslab selection. - ! - start(1) = 0 - start(2) = 3 - COUNT(1) = 2 - COUNT(2) = 3 - CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, & - start, count, error) - CALL check("h5sselect_hyperslab_f", error, total_error) - CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) - CALL check("h5rcreate_f", error, total_error) - ! - ! Create a reference to elements selection. - ! - CALL h5sselect_none_f(space_id, error) - CALL check("h5sselect_none_f", error, total_error) - CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,& - coord, error) - CALL check("h5sselect_elements_f", error, total_error) - CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error) - CALL check("h5rcreate_f", error, total_error) - ! - ! Write dataset with the references. - ! - ref_dim(1) = SIZE(ref) - CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, ref_dim, error) - CALL check("h5dwrite_f", error, total_error) - ! - ! Close all objects. - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5sclose_f(spacer_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - ! - ! Reopen the file to test selections. - ! - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL check("h5fopen_f", error, total_error) - CALL h5dopen_f(file_id, dsetnamer, dsetr_id, error) - CALL check("h5dopen_f", error, total_error) - ! - ! Read references to the dataset regions. - ! - ref_dim(1) = SIZE(ref_out) - CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) - CALL check("h5dread_f", error, total_error) + ! + ! Create dataspaces for datasets + ! + CALL h5screate_simple_f(rank, dims, space_id, error, maxdims=my_maxdims) + CALL check("h5screate_simple_f",error,total_error) + CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) + CALL check("h5screate_simple_f",error,total_error) + ! + ! Create integer dataset + ! + CALL h5dcreate_f(file_id, dsetnamei, H5T_NATIVE_INTEGER, space_id, & + dset1_id, error) + CALL check("h5dcreate_f",error,total_error) + ! + ! Create dataset to store references to the objects + ! + CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_OBJ, spacer_id, & + dsetr_id, error) + CALL check("h5dcreate_f",error,total_error) + ! + ! Create a datatype and store in the file + ! + CALL h5tcopy_f(H5T_NATIVE_REAL, type_id, error) + CALL check("h5tcopy_f",error,total_error) + CALL h5tcommit_f(file_id, "MyType", type_id, error) + CALL check("h5tcommit_f",error,total_error) - ! Get name of the dataset the first region reference points to using H5Rget_name_f - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(7,SIZE_T),total_error) - CALL VerifyString("H5Rget_name_f", buf, "/MATRIX", total_error) + ! + ! Close dataspaces, groups and integer dataset + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5sclose_f(spacer_id, error) + CALL check("h5sclose_f",error,total_error) + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f",error,total_error) + CALL h5gclose_f(grp1_id, error) + CALL check("h5gclose_f",error,total_error) + CALL h5gclose_f(grp2_id, error) + CALL check("h5gclose_f",error,total_error) - ! Get name of the dataset the first region reference points to using H5Rget_name_f - ! buffer bigger then needed - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_big, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(7,SIZE_T),total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) + ! + ! Craete references to two groups, integer dataset and shared datatype + ! and write it to the dataset in the file + ! + CALL h5rcreate_f(file_id, groupname1, ref(1), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, dsetnamei, ref(3), error) + CALL check("h5rcreate_f",error,total_error) + CALL h5rcreate_f(file_id, "MyType", ref(4), error) + CALL check("h5rcreate_f",error,total_error) + ref_dim(1) = size(ref) + CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_dim, error) + CALL check("h5dwrite_f",error,total_error) - ! Get name of the dataset the first region reference points to using H5Rget_name_f - ! buffer smaller then needed - CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_small, error, buf_size ) - CALL check("H5Rget_name_f", error, total_error) - CALL VERIFY("H5Rget_name_f", buf_size,INT(7,SIZE_T),total_error) - CALL VerifyString("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) + ! + !Close the dataset + ! + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f",error,total_error) + ! + ! Reopen the dataset with object references + ! + CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error) + CALL check("h5dopen_f",error,total_error) + ref_dim(1) = size(ref_out) + CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_dim, error) + CALL check("h5dread_f",error,total_error) + + ! + !get the third reference's type and Dereference it + ! + CALL h5rget_object_type_f(dsetr_id, ref(3), obj_type, error) + CALL check("h5rget_object_type_f",error,total_error) + if (obj_type == H5G_DATASET_F) then + CALL h5rdereference_f(dsetr_id, ref(3), dset1_id, error) + CALL check("h5rdereference_f",error,total_error) + + data_dims(1) = 5 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, data, data_dims, error) + CALL check("h5dwrite_f",error,total_error) + end if - ! - ! Dereference the first reference. - ! - CALL H5rdereference_f(dsetr_id, ref_out(1), dsetv_id, error) - CALL check("h5rdereference_f", error, total_error) - CALL H5rget_region_f(dsetr_id, ref_out(1), space_id, error) - CALL check("h5rget_region_f", error, total_error) + ! + !get the fourth reference's type and Dereference it + ! + CALL h5rget_object_type_f(dsetr_id, ref(4), obj_type, error) + CALL check("h5rget_object_type_f",error,total_error) + if (obj_type == H5G_TYPE_F) then + CALL h5rdereference_f(dsetr_id, ref(4), type_id, error) + CALL check("h5rdereference_f",error,total_error) + end if + + ! + ! Close all objects. + ! + CALL h5dclose_f(dset1_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5tclose_f(type_id, error) + CALL check("h5tclose_f",error,total_error) + + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f",error,total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + + + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN + + END SUBROUTINE refobjtest +! +! The following subroutine tests h5rget_region_f, h5rcreate_f +! and h5rdereference_f functionalities +! + SUBROUTINE refregtest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error - ! Get name of the dataset the second region reference points to using H5Rget_name_f - CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size - CALL check("H5Rget_name_f", error, total_error) - CALL VerifyString("H5Rget_name_f", buf, "/MATRIX", total_error) + CHARACTER(LEN=6), PARAMETER :: filename = "Refreg" + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=6), PARAMETER :: dsetnamev = "MATRIX" + CHARACTER(LEN=17), PARAMETER :: dsetnamer = "REGION_REFERENCES" + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: space_id ! Dataspace identifier + INTEGER(HID_T) :: spacer_id ! Dataspace identifier + INTEGER(HID_T) :: dsetv_id ! Dataset identifier + INTEGER(HID_T) :: dsetr_id ! Dataset identifier + INTEGER :: error + TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references + TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out ! + INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! + INTEGER(HSIZE_T), DIMENSION(2) :: start + INTEGER(HSIZE_T), DIMENSION(2) :: count + INTEGER :: rankr = 1 + INTEGER :: rank = 2 + INTEGER , DIMENSION(2,9) :: data + INTEGER , DIMENSION(2,9) :: data_out = 0 + INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord + INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points + INTEGER :: i, j + coord = reshape((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points + data = reshape ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/)) - ! - ! Read selected data from the dataset. - ! - data_dims(1) = 2 - data_dims(2) = 9 - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & - mem_space_id = space_id, file_space_id = space_id) - CALL check("h5dread_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - data_out = 0 - ! - ! Dereference the second reference. - ! - CALL H5rdereference_f(dsetr_id, ref_out(2), dsetv_id, error) - CALL check("h5rdereference_f", error, total_error) + ! + ! Initialize FORTRAN predefined datatypes. + ! +! CALL h5init_types_f(error) +! CALL check("h5init_types_f", error, total_error) + ! + ! Create a new file. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + if (error .ne. 0) then + write(*,*) "Cannot modify filename" + stop + endif + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + ! Default file access and file creation + ! properties are used. + CALL check("h5fcreate_f", error, total_error) + ! + ! Create dataspaces: + ! + ! for dataset with references to dataset regions + ! + CALL h5screate_simple_f(rankr, dimsr, spacer_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! for integer dataset + ! + CALL h5screate_simple_f(rank, dims, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create and write datasets: + ! + ! Integer dataset + ! + CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, & + dsetv_id, error) + CALL check("h5dcreate_f", error, total_error) + data_dims(1) = 2 + data_dims(2) = 9 + CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) - CALL H5rget_region_f(dsetr_id, ref_out(2), space_id, error) - CALL check("h5rget_region_f", error, total_error) - ! - ! Read selected data from the dataset. - ! - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & - mem_space_id = space_id, file_space_id = space_id) - CALL check("h5dread_f", error, total_error) - ! - ! Close all objects - ! - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5dclose_f(dsetv_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5dclose_f(dsetr_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + ! + ! Dataset with references + ! + CALL h5dcreate_f(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, & + dsetr_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Create a reference to the hyperslab selection. + ! + start(1) = 0 + start(2) = 3 + count(1) = 2 + count(2) = 3 + CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, & + start, count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) + CALL check("h5rcreate_f", error, total_error) + ! + ! Create a reference to elements selection. + ! + CALL h5sselect_none_f(space_id, error) + CALL check("h5sselect_none_f", error, total_error) + CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,& + coord, error) + CALL check("h5sselect_elements_f", error, total_error) + CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error) + CALL check("h5rcreate_f", error, total_error) + ! + ! Write dataset with the references. + ! + ref_dim(1) = size(ref) + CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, ref_dim, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! Close all objects. + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5sclose_f(spacer_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + ! + ! Reopen the file to test selections. + ! + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL check("h5fopen_f", error, total_error) + CALL h5dopen_f(file_id, dsetnamer, dsetr_id, error) + CALL check("h5dopen_f", error, total_error) + ! + ! Read references to the dataset regions. + ! + ref_dim(1) = size(ref_out) + CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) + CALL check("h5dread_f", error, total_error) + ! + ! Dereference the first reference. + ! + CALL H5rdereference_f(dsetr_id, ref_out(1), dsetv_id, error) + CALL check("h5rdereference_f", error, total_error) + CALL H5rget_region_f(dsetr_id, ref_out(1), space_id, error) + CALL check("h5rget_region_f", error, total_error) + ! + ! Read selected data from the dataset. + ! + data_dims(1) = 2 + data_dims(2) = 9 + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & + mem_space_id = space_id, file_space_id = space_id) + CALL check("h5dread_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + data_out = 0 + ! + ! Dereference the second reference. + ! + CALL H5rdereference_f(dsetr_id, ref_out(2), dsetv_id, error) + CALL check("h5rdereference_f", error, total_error) + + CALL H5rget_region_f(dsetr_id, ref_out(2), space_id, error) + CALL check("h5rget_region_f", error, total_error) + ! + ! Read selected data from the dataset. + ! + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & + mem_space_id = space_id, file_space_id = space_id) + CALL check("h5dread_f", error, total_error) + ! + ! Close all objects + ! + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5dclose_f(dsetv_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5dclose_f(dsetr_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - RETURN + if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN -END SUBROUTINE refregtest + END SUBROUTINE refregtest diff --git a/fortran/test/tH5Sselect.f90 b/fortran/test/tH5Sselect.f90 index a004ba7..2f77db9 100644 --- a/fortran/test/tH5Sselect.f90 +++ b/fortran/test/tH5Sselect.f90 @@ -52,6 +52,10 @@ ! INTEGER(HSIZE_T), DIMENSION(3) :: dimsm = (/7,7,3/) + ! + !to get Dataset dimensions + ! + INTEGER(HSIZE_T), DIMENSION(2) :: dims_out ! !Dataset dimensions @@ -99,18 +103,21 @@ ! INTEGER :: memrank = 3 - + ! + !integer to get the dataspace rank from dataset + ! + INTEGER :: rank ! !general purpose integer ! - INTEGER :: i, j + INTEGER :: i, j, k ! !flag to check operation success ! - INTEGER :: error + INTEGER :: error, error_n INTEGER(HSIZE_T), DIMENSION(3) :: data_dims @@ -390,7 +397,8 @@ ! !flag to check operation success ! - INTEGER :: error + INTEGER :: error + LOGICAL :: status INTEGER(HSIZE_T), DIMENSION(3) :: data_dims @@ -712,7 +720,8 @@ INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: dataspace ! Dataspace identifier + INTEGER(HID_T) :: memspace ! memspace identifier ! !Dataset dimensions @@ -754,6 +763,10 @@ ! INTEGER(HSIZE_T), DIMENSION(RANK, NUMPS) :: coord + ! + !Size of the hyperslab in memory + ! + INTEGER(HSIZE_T), DIMENSION(3) :: count_out = (/3,4,1/) ! !Number of hyperslabs selected in the current dataspace @@ -789,9 +802,19 @@ INTEGER, DIMENSION(5,6) :: data ! + !output buffer + ! + INTEGER, DIMENSION(7,7,3) :: data_out + + ! + !general purpose integer + ! + INTEGER :: i, j, k + + ! !flag to check operation success ! - INTEGER :: error + INTEGER :: error, error_n INTEGER(HSIZE_T), DIMENSION(3) :: data_dims ! diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90 index 4857a2b..3bbb974 100644 --- a/fortran/test/tH5T.f90 +++ b/fortran/test/tH5T.f90 @@ -27,7 +27,7 @@ ! The following H5T interface functions are tested: ! h5tcopy_f, h5tset(get)_size_f, h5tcreate_f, h5tinsert_f, h5tclose_f, ! h5tget_class_f, h5tget_member_name_f, h5tget_member_offset_f, h5tget_member_type_f, -! h5tequal_f, h5tinsert_array_f, h5tcommit_f, h5tencode_f, h5tdecode_f +! h5tequal_f, h5tinsert_array_f, h5tcommit_f USE HDF5 ! This module contains all necessary modules @@ -88,12 +88,6 @@ INTEGER(SIZE_T) :: sizechar INTEGER(HSIZE_T), DIMENSION(1) :: data_dims LOGICAL :: flag = .TRUE. - - CHARACTER(LEN=1024) :: cmpd_buf - INTEGER(size_t) :: cmpd_buf_size=0 - INTEGER(hid_t) :: decoded_sid1 - INTEGER :: decoded_tid1 - data_dims(1) = dimsize ! ! Initialize data buffer. @@ -182,36 +176,7 @@ ! offset = offset + type_sized ! Offset of the last member is 14 CALL h5tinsert_f(dtype_id, "real_field", offset, H5T_NATIVE_REAL, error) - CALL check("h5tinsert_f", error, total_error) - -!!$ !/*----------------------------------------------------------------------- -!!$ ! * Test encoding and decoding compound datatypes -!!$ ! *----------------------------------------------------------------------- -!!$ !*/ -!!$ ! /* Encode compound type in a buffer */ -!!$ -!!$ ! First find the buffer size -!!$ -!!$ CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) -!!$ CALL check("H5Tencode_f", error, total_error) -!!$ -!!$ ! /* Try decoding bogus buffer */ -!!$ -!!$ CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) -!!$ CALL VERIFY("H5Tdecode_f", error, -1, total_error) -!!$ -!!$ CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) -!!$ CALL check("H5Tencode_f", error, total_error) -!!$ -!!$ ! /* Decode from the compound buffer and return an object handle */ -!!$ CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) -!!$ CALL check("H5Tdecode_f", error, total_error) -!!$ -!!$ ! /* Verify that the datatype was copied exactly */ -!!$ -!!$ CALL H5Tequal_f(decoded_tid1, dtype_id, flag, error) -!!$ CALL check("H5Tequal_f", error, total_error) -!!$ CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) + CALL check("h5tinsert_f", error, total_error) ! ! Create the dataset with compound datatype. @@ -520,33 +485,7 @@ endif enddo ! - ! *----------------------------------------------------------------------- - ! * Test encoding and decoding compound datatypes - ! *----------------------------------------------------------------------- - ! - ! /* Encode compound type in a buffer */ - ! -- First find the buffer size - - CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) - CALL check("H5Tencode_f", error, total_error) - ! /* Try decoding bogus buffer */ - - CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) - CALL VERIFY("H5Tdecode_f", error, -1, total_error) - - CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error) - CALL check("H5Tencode_f", error, total_error) - - ! /* Decode from the compound buffer and return an object handle */ - CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error) - CALL check("H5Tdecode_f", error, total_error) - - ! /* Verify that the datatype was copied exactly */ - - CALL H5Tequal_f(decoded_tid1, dtype_id, flag, error) - CALL check("H5Tequal_f", error, total_error) - CALL VerifyLogical("H5Tequal_f", flag, .TRUE., total_error) ! ! Close all open objects. ! diff --git a/fortran/test/tH5VL.f90 b/fortran/test/tH5VL.f90 index 13f2af1..998fef5 100644 --- a/fortran/test/tH5VL.f90 +++ b/fortran/test/tH5VL.f90 @@ -364,6 +364,7 @@ INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: dset_id ! Dataset identifier INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: vltype_id ! Datatype identifier INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/4/) ! Dataset dimensions @@ -373,9 +374,10 @@ CHARACTER(LEN=10), DIMENSION(4) :: string_data ! Array of strings CHARACTER(LEN=10), DIMENSION(4) :: string_data_out ! Data buffers + CHARACTER(LEN=10) :: tmp_str INTEGER :: error ! Error flag - INTEGER :: i !general purpose integers + INTEGER :: i, j !general purpose integers INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/10,4/) INTEGER(HID_T) :: vl_type_id LOGICAL :: vl_flag diff --git a/fortran/test/tH5Z.f90 b/fortran/test/tH5Z.f90 index ea567a2..2a71961 100644 --- a/fortran/test/tH5Z.f90 +++ b/fortran/test/tH5Z.f90 @@ -22,7 +22,7 @@ IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error - LOGICAL :: status + LOGICAL :: status, status1 INTEGER(HID_T) :: crtpr_id, xfer_id INTEGER :: nfilters INTEGER :: error diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90 index eb033b6..673a8e2 100644 --- a/fortran/test/tf.f90 +++ b/fortran/test/tf.f90 @@ -23,60 +23,30 @@ !DEC$attributes dllexport :: check !DEC$endif -SUBROUTINE check(string,error,total_error) - CHARACTER(LEN=*) :: string - INTEGER :: error, total_error - IF (error .LT. 0) THEN - total_error=total_error+1 - WRITE(*,*) string, " FAILED" - ENDIF - RETURN -END SUBROUTINE check + SUBROUTINE check(string,error,total_error) + CHARACTER(LEN=*) :: string + INTEGER :: error, total_error + if (error .lt. 0) then + total_error=total_error+1 + write(*,*) string, " failed" + endif + RETURN + END SUBROUTINE check -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verify -!DEC$endif -SUBROUTINE VERIFY(string,value,correct_value,total_error) - CHARACTER(LEN=*) :: string - INTEGER :: value, correct_value, total_error - IF (value .NE. correct_value) THEN - total_error=total_error+1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN -END SUBROUTINE verify - -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verifyLogical -!DEC$endif -SUBROUTINE verifyLogical(string,value,correct_value,total_error) - CHARACTER(LEN=*) :: string - LOGICAL :: value, correct_value - INTEGER :: total_error - IF (value .NEQV. correct_value) THEN - total_error = total_error + 1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN -END SUBROUTINE verifyLogical !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verifyLogical +!DEC$attributes dllexport :: verify !DEC$endif -SUBROUTINE verifyString(string, value,correct_value,total_error) - CHARACTER(LEN=*) :: string - CHARACTER(LEN=*) :: value, correct_value - INTEGER :: total_error - IF (TRIM(value) .NE. TRIM(correct_value)) THEN - total_error = total_error + 1 - WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string - ENDIF - RETURN -END SUBROUTINE verifyString - + SUBROUTINE verify(string,value,correct_value,total_error) + CHARACTER(LEN=*) :: string + INTEGER :: value, correct_value, total_error + if (value .ne. correct_value) then + total_error=total_error+1 + write(*,*) string + endif + RETURN + END SUBROUTINE verify !---------------------------------------------------------------------- ! Name: h5_fixname_f @@ -98,46 +68,46 @@ END SUBROUTINE verifyString ! ! !---------------------------------------------------------------------- -SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr) + SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5_fixname_f !DEC$endif - USE H5GLOBAL - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name - CHARACTER(LEN=*), INTENT(IN) :: full_name ! full name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list - - INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string - INTEGER(SIZE_T) :: full_namelen ! Length of the full name character string + USE H5GLOBAL + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name + CHARACTER(LEN=*), INTENT(IN) :: full_name ! full name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list + + INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string + INTEGER(SIZE_T) :: full_namelen ! Length of the full name character string ! INTEGER(HID_T) :: fapl_default - INTERFACE - INTEGER FUNCTION h5_fixname_c(base_name, base_namelen, fapl, & - full_name, full_namelen) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_FIXNAME_C':: h5_fixname_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: base_name - !DEC$ATTRIBUTES reference :: full_name - CHARACTER(LEN=*), INTENT(IN) :: base_name - INTEGER(SIZE_T) :: base_namelen - INTEGER(HID_T), INTENT(IN) :: fapl - CHARACTER(LEN=*), INTENT(IN) :: full_name - INTEGER(SIZE_T) :: full_namelen - END FUNCTION h5_fixname_c - END INTERFACE - - base_namelen = LEN(base_name) - full_namelen = LEN(full_name) - hdferr = h5_fixname_c(base_name, base_namelen, fapl, & - full_name, full_namelen) - -END SUBROUTINE h5_fixname_f + INTERFACE + INTEGER FUNCTION h5_fixname_c(base_name, base_namelen, fapl, & + full_name, full_namelen) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_FIXNAME_C':: h5_fixname_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: base_name + !DEC$ATTRIBUTES reference :: full_name + CHARACTER(LEN=*), INTENT(IN) :: base_name + INTEGER(SIZE_T) :: base_namelen + INTEGER(HID_T), INTENT(IN) :: fapl + CHARACTER(LEN=*), INTENT(IN) :: full_name + INTEGER(SIZE_T) :: full_namelen + END FUNCTION h5_fixname_c + END INTERFACE + + base_namelen = LEN(base_name) + full_namelen = LEN(full_name) + hdferr = h5_fixname_c(base_name, base_namelen, fapl, & + full_name, full_namelen) + + END SUBROUTINE h5_fixname_f !---------------------------------------------------------------------- ! Name: h5_cleanup_f @@ -158,37 +128,37 @@ END SUBROUTINE h5_fixname_f ! ! !---------------------------------------------------------------------- -SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr) + SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5_cleanup_f !DEC$endif - USE H5GLOBAL - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list - - INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string - - INTERFACE - INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl) - USE H5GLOBAL - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_CLEANUP_C':: h5_cleanup_c - !DEC$ ENDIF - !DEC$ATTRIBUTES reference :: base_name - CHARACTER(LEN=*), INTENT(IN) :: base_name - INTEGER(SIZE_T) :: base_namelen - INTEGER(HID_T), INTENT(IN) :: fapl - END FUNCTION h5_cleanup_c - END INTERFACE - - base_namelen = LEN(base_name) - hdferr = h5_cleanup_c(base_name, base_namelen, fapl) - -END SUBROUTINE h5_cleanup_f + USE H5GLOBAL + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list + + INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string + + INTERFACE + INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_CLEANUP_C':: h5_cleanup_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: base_name + CHARACTER(LEN=*), INTENT(IN) :: base_name + INTEGER(SIZE_T) :: base_namelen + INTEGER(HID_T), INTENT(IN) :: fapl + END FUNCTION h5_cleanup_c + END INTERFACE + + base_namelen = LEN(base_name) + hdferr = h5_cleanup_c(base_name, base_namelen, fapl) + + END SUBROUTINE h5_cleanup_f !---------------------------------------------------------------------- ! Name: h5_exit_f @@ -210,25 +180,25 @@ END SUBROUTINE h5_cleanup_f ! ! !---------------------------------------------------------------------- -SUBROUTINE h5_exit_f(status) + SUBROUTINE h5_exit_f(status) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: h5_exit_f !DEC$endif - IMPLICIT NONE - INTEGER, INTENT(IN) :: status ! Return code - - INTERFACE - SUBROUTINE h5_exit_c(status) - !DEC$ IF DEFINED(HDF5F90_WINDOWS) - !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_EXIT_C':: h5_exit_c - !DEC$ ENDIF - INTEGER, INTENT(IN) :: status - END SUBROUTINE h5_exit_c - END INTERFACE - - CALL h5_exit_c(status) - -END SUBROUTINE h5_exit_f + IMPLICIT NONE + INTEGER, INTENT(IN) :: status ! Return code + + INTERFACE + SUBROUTINE h5_exit_c(status) + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_EXIT_C':: h5_exit_c + !DEC$ ENDIF + INTEGER, INTENT(IN) :: status + END SUBROUTINE h5_exit_c + END INTERFACE + + CALL h5_exit_c(status) + + END SUBROUTINE h5_exit_f diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 3502b3a..e80f86c 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -1353,9 +1353,7 @@ herr_t H5TBdelete_record( hid_t loc_id, size_t *src_offset; size_t *src_sizes; hsize_t nrows; -#if defined (SHRINK) hsize_t dims[1]; -#endif /*------------------------------------------------------------------------- @@ -1443,11 +1441,9 @@ herr_t H5TBdelete_record( hid_t loc_id, * Change the table dimension *------------------------------------------------------------------------- */ -#if defined (SHRINK) dims[0] = ntotal_records - nrecords; if(H5Dset_extent( did, dims ) < 0) goto out; -#endif /* End access to the dataset */ if(H5Dclose( did ) < 0) diff --git a/perform/Makefile.am b/perform/Makefile.am index e2c5822..f82def8 100644 --- a/perform/Makefile.am +++ b/perform/Makefile.am @@ -39,10 +39,11 @@ endif # These are the programs that `make all' or `make tests' will build and which # `make check' will run. List them in the order they should be run. -TEST_PROG = iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) +TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS) check_PROGRAMS=$(TEST_PROG_PARA) $(TEST_PROG) h5perf_SOURCES=pio_perf.c pio_engine.c pio_timer.c +h5perf_serial_SOURCES=sio_perf.c sio_engine.c sio_timer.c # These are the files that `make clean' (and derivatives) will remove from # this directory. @@ -52,6 +53,7 @@ CLEANFILES=*.h5 *.raw *.dat x-gnuplot # depend on test or tools library. LDADD=$(LIBHDF5) h5perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) perf_LDADD=$(LIBH5TEST) $(LIBHDF5) iopipe_LDADD=$(LIBH5TEST) $(LIBHDF5) zip_perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) diff --git a/perform/Makefile.in b/perform/Makefile.in index 3ba09a9..a4dc884 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -67,7 +67,8 @@ CONFIG_CLEAN_FILES = @BUILD_PARALLEL_CONDITIONAL_TRUE@ mpi-perf$(EXEEXT) @BUILD_ALL_CONDITIONAL_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2) am__EXEEXT_4 = iopipe$(EXEEXT) chunk$(EXEEXT) overhead$(EXEEXT) \ - zip_perf$(EXEEXT) perf_meta$(EXEEXT) $(am__EXEEXT_3) + zip_perf$(EXEEXT) perf_meta$(EXEEXT) h5perf_serial$(EXEEXT) \ + $(am__EXEEXT_3) benchpar_SOURCES = benchpar.c benchpar_OBJECTS = benchpar.$(OBJEXT) benchpar_LDADD = $(LDADD) @@ -80,6 +81,10 @@ am_h5perf_OBJECTS = pio_perf.$(OBJEXT) pio_engine.$(OBJEXT) \ pio_timer.$(OBJEXT) h5perf_OBJECTS = $(am_h5perf_OBJECTS) h5perf_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +am_h5perf_serial_OBJECTS = sio_perf.$(OBJEXT) sio_engine.$(OBJEXT) \ + sio_timer.$(OBJEXT) +h5perf_serial_OBJECTS = $(am_h5perf_serial_OBJECTS) +h5perf_serial_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) iopipe_SOURCES = iopipe.c iopipe_OBJECTS = iopipe.$(OBJEXT) iopipe_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) @@ -112,10 +117,12 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) iopipe.c mpi-perf.c \ - overhead.c perf.c perf_meta.c zip_perf.c -DIST_SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) iopipe.c \ - mpi-perf.c overhead.c perf.c perf_meta.c zip_perf.c +SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) \ + $(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \ + perf_meta.c zip_perf.c +DIST_SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) \ + $(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \ + perf_meta.c zip_perf.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -358,8 +365,9 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib # These are the programs that `make all' or `make tests' will build and which # `make check' will run. List them in the order they should be run. -TEST_PROG = iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) +TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS) h5perf_SOURCES = pio_perf.c pio_engine.c pio_timer.c +h5perf_serial_SOURCES = sio_perf.c sio_engine.c sio_timer.c # These are the files that `make clean' (and derivatives) will remove from # this directory. @@ -369,6 +377,7 @@ CLEANFILES = *.h5 *.raw *.dat x-gnuplot # depend on test or tools library. LDADD = $(LIBHDF5) h5perf_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +h5perf_serial_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) perf_LDADD = $(LIBH5TEST) $(LIBHDF5) iopipe_LDADD = $(LIBH5TEST) $(LIBHDF5) zip_perf_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) @@ -438,6 +447,9 @@ chunk$(EXEEXT): $(chunk_OBJECTS) $(chunk_DEPENDENCIES) h5perf$(EXEEXT): $(h5perf_OBJECTS) $(h5perf_DEPENDENCIES) @rm -f h5perf$(EXEEXT) $(LINK) $(h5perf_OBJECTS) $(h5perf_LDADD) $(LIBS) +h5perf_serial$(EXEEXT): $(h5perf_serial_OBJECTS) $(h5perf_serial_DEPENDENCIES) + @rm -f h5perf_serial$(EXEEXT) + $(LINK) $(h5perf_serial_OBJECTS) $(h5perf_serial_LDADD) $(LIBS) iopipe$(EXEEXT): $(iopipe_OBJECTS) $(iopipe_DEPENDENCIES) @rm -f iopipe$(EXEEXT) $(LINK) $(iopipe_OBJECTS) $(iopipe_LDADD) $(LIBS) @@ -473,6 +485,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_perf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_timer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_engine.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_perf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip_perf.Po@am__quote@ .c.o: diff --git a/perform/sio_engine.c b/perform/sio_engine.c new file mode 100644 index 0000000..92d6f1c --- /dev/null +++ b/perform/sio_engine.c @@ -0,0 +1,1746 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Author: Christian Chilan, April 2008 + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "hdf5.h" + +#ifdef H5_HAVE_GPFS +# include +#endif /* H5_HAVE_GPFS */ + +#include "sio_perf.h" +#include "sio_timer.h" + +/* Macro definitions */ + +/* sizes of various items. these sizes won't change during program execution */ +/* The following three must have the same type */ +#define ELMT_SIZE (sizeof(unsigned char)) /* we're doing bytes */ +#define ELMT_H5_TYPE H5T_NATIVE_UCHAR + +#define GOTOERROR(errcode) { ret_code = errcode; goto done; } +#define GOTODONE { goto done; } +#define ERRMSG(mesg) { \ + fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ + mesg, (int)__LINE__, __FILE__); \ +} + +#define MSG(mesg) { \ + fprintf(stderr, "(%s) at line %4d in %s\n", \ + mesg, (int)__LINE__, __FILE__); \ +} + +/* verify: if val is false (0), print mesg. */ +#define VRFY(val, mesg) do { \ + if (!val) { \ + ERRMSG(mesg); \ + GOTOERROR(FAIL); \ + } \ +} while(0) + +/* POSIX I/O macros */ +#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600) +#define POSIXOPEN(fn, F) HDopen(fn, F, 0600) +#define POSIXCLOSE(F) HDclose(F) +#define POSIXSEEK(F,L) HDlseek(F, L, SEEK_SET) +#define POSIXWRITE(F,B,S) HDwrite(F,B,S) +#define POSIXREAD(F,B,S) HDread(F,B,S) + +enum { + SIO_CREATE = 1, + SIO_WRITE = 2, + SIO_READ = 4 +}; + +/* Global variables */ +static int clean_file_g = -1; /*whether to cleanup temporary test */ +/*files. -1 is not defined; */ +/*0 is no cleanup; 1 is do cleanup */ + +/* + * In a parallel machine, the filesystem suitable for compiling is + * unlikely a parallel file system that is suitable for parallel I/O. + * There is no standard pathname for the parallel file system. /tmp + * is about the best guess. + */ +#ifndef HDF5_PARAPREFIX +# ifdef __PUMAGON__ +/* For the PFS of TFLOPS */ +# define HDF5_PARAPREFIX "pfs:/pfs_grande/multi/tmp_1" +# else +# define HDF5_PARAPREFIX "" +# endif /* __PUMAGON__ */ +#endif /* !HDF5_PARAPREFIX */ + +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif /* !MIN */ + +/* the different types of file descriptors we can expect */ +typedef union _file_descr { + int posixfd; /* POSIX file handle*/ + hid_t h5fd; /* HDF5 file */ +} file_descr; + +/* local functions */ +static char *sio_create_filename(iotype iot, const char *base_name, + char *fullname, size_t size, parameters *param); +static herr_t do_write(results *res, file_descr *fd, parameters *parms, void *buffer); +static herr_t do_read(results *res, file_descr *fd, parameters *parms, void *buffer); +static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer); +static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffer); +static herr_t dset_read(int localrank, file_descr *fd, parameters *parms, void *buffer); +static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer); +static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, + int flags); +hid_t set_vfd(parameters *param); +static herr_t do_fclose(iotype iot, file_descr *fd); +static void do_cleanupfile(iotype iot, char *fname); + +/* GPFS-specific functions */ +#ifdef H5_HAVE_GPFS +static void gpfs_access_range(int handle, off_t start, off_t length, int is_write); +static void gpfs_free_range(int handle, off_t start, off_t length); +static void gpfs_clear_file_cache(int handle); +static void gpfs_cancel_hints(int handle); +static void gpfs_start_data_shipping(int handle, int num_insts); +static void gpfs_start_data_ship_map(int handle, int partition_size, + int agent_count, int *agent_node_num); +static void gpfs_stop_data_shipping(int handle); +static void gpfs_invalidate_file_cache(const char *filename); +#endif /* H5_HAVE_GPFS */ + +/* global variables */ +static off_t offset[MAX_DIMS]; /* dataset size in bytes */ +static size_t buf_offset[MAX_DIMS]; /* dataset size in bytes */ +static int order[MAX_DIMS]; /* dimension access order */ +static size_t linear_buf_size; /* linear buffer size */ +static int cont_dim; /* lowest dimension for contiguous POSIX + access */ +static size_t cont_size; /* size of contiguous POSIX access */ +static hid_t fapl; /* file access list */ +static unsigned char *buf_p; /* buffer pointer */ +static unsigned char *buf2_p; /* buffer pointer */ +static const char *multi_letters = "msbrglo"; /* string for multi driver */ +static char *buffer2=NULL; /* buffer for data verification */ + +/* HDF5 global variables */ +static hsize_t h5count[MAX_DIMS]; /*selection count */ +static hssize_t h5offset[MAX_DIMS]; /* Selection offset within dataspace */ +static hid_t h5dset_space_id = -1; /*dataset space ID */ +static hid_t h5mem_space_id = -1; /*memory dataspace ID */ +static hid_t h5ds_id = -1; /*dataset handle */ +static hid_t h5dcpl = -1; /* Dataset creation property list */ +static hid_t h5dxpl = -1; /* Dataset transfer property list */ + +/* + * Function: do_sio + * Purpose: SIO Engine where IO are executed. + * Return: results + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + results +do_sio(parameters param) +{ + char *buffer = NULL; /*data buffer pointer */ + off_t nbytes; /* dataset raw size */ + off_t dset_size[MAX_DIMS]; /* dataset size in bytes */ + size_t buf_size[MAX_DIMS]; /* general buffer size in bytes */ + size_t chk_size[MAX_DIMS]; /* chunk size in bytes */ + file_descr fd; /* file handles */ + iotype iot; /* API type */ + char base_name[256]; /* test file base name */ + /* return codes */ + herr_t ret_code = 0; /*return code */ + results res; + + char fname[FILENAME_MAX]; /* test file name */ + int i; + /* HDF5 variables */ + herr_t hrc; /*HDF5 return code */ + + /* Sanity check parameters */ + + /* IO type */ + iot = param.io_type; + + switch (iot) { + case POSIXIO: + fd.posixfd = -1; + res.timers = sio_time_new(); + break; + case HDF5: + fd.h5fd = -1; + res.timers = sio_time_new(); + break; + default: + /* unknown request */ + fprintf(stderr, "Unknown IO type request (%d)\n", iot); + GOTOERROR(FAIL); + } + + nbytes = param.num_bytes; + linear_buf_size = 1; + + for (i=0; i 0\n", i,(long_long)buf_size[i]); + GOTOERROR(FAIL); + } + + if ((param.dset_size[i]%param.buf_size[i])!=0) { + HDfprintf(stderr, + "Dataset size[%d] (%Hd) must be a multiple of the " + "trasfer buffer size[%d] (%Hd)\n",param.rank, + (long_long)param.dset_size[i], param.rank, (long_long)param.buf_size[i]); + GOTOERROR(FAIL); + } + + } + + /* Allocate transfer buffer */ + buffer2 = malloc(linear_buf_size); + if ((buffer = malloc(linear_buf_size)) == NULL){ + HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", + (long_long)(linear_buf_size)); + GOTOERROR(FAIL); + } + + if (sio_debug_level >= 4) + + /* output all of the times for all iterations */ + fprintf(output, "Timer details:\n"); + + /* + * Write performance measurement + */ + /* Open file for write */ + + strcpy(base_name, "#sio_tmp"); + sio_create_filename(iot, base_name, fname, sizeof(fname), ¶m); + + if (sio_debug_level > 0) + HDfprintf(output, "data filename=%s\n", + fname); + + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); + VRFY((hrc == SUCCESS), "do_fopen failed"); + + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + hrc = do_write(&res, &fd, ¶m, buffer); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + VRFY((hrc == SUCCESS), "do_write failed"); + + /* Close file for write */ + hrc = do_fclose(iot, &fd); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + VRFY((hrc == SUCCESS), "do_fclose failed"); + + if (!param.h5_write_only) { + /* + * Read performance measurement + */ + + /* Open file for read */ + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + hrc = do_fopen(¶m, fname, &fd, SIO_READ); + VRFY((hrc == SUCCESS), "do_fopen failed"); + + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + hrc = do_read(&res, &fd, ¶m, buffer); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + VRFY((hrc == SUCCESS), "do_read failed"); + + /* Close file for read */ + hrc = do_fclose(iot, &fd); + + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + VRFY((hrc == SUCCESS), "do_fclose failed"); + } + + do_cleanupfile(iot, fname); + +done: + /* clean up */ + /* release HDF5 objects */ + + /* close any opened files */ + /* no remove(fname) because that should have happened normally. */ + switch (iot) { + case POSIXIO: + if (fd.posixfd != -1) + hrc = do_fclose(iot, &fd); + break; + case HDF5: + if (fd.h5fd != -1) + hrc = do_fclose(iot, &fd); + break; + } + + /* release generic resources */ + if (buffer) + free(buffer); + + res.ret_code = ret_code; + return res; +} + +/* + * Function: sio_create_filename + * Purpose: Create a new filename to write to. Determine the correct + * suffix to append to the filename by the type of I/O we're + * doing. Also, place in the /tmp/{$USER,$LOGIN} directory if + * USER or LOGIN are specified in the environment. + * Return: Pointer to filename or NULL + * Programmer: Bill Wendling, 21. November 2001 + * Modifications: Support for file drivers. Christian Chilan, April, 2008 + */ + static char * +sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size, parameters *param) +{ + const char *prefix, *suffix=""; + char *ptr, last = '\0'; + size_t i, j; + vfdtype vfd; + vfd = param->vfd; + + if (!base_name || !fullname || size < 1) + return NULL; + + memset(fullname, 0, size); + + switch (iot) { + case POSIXIO: + suffix = ".posix"; + break; + case HDF5: + suffix = ".h5"; + if (vfd == family) + suffix = "%05d.h5"; + else if (vfd == multi) + suffix = NULL; + break; + } + + /* First use the environment variable and then try the constant */ + prefix = getenv("HDF5_PARAPREFIX"); + +#ifdef HDF5_PARAPREFIX + if (!prefix) + prefix = HDF5_PARAPREFIX; +#endif /* HDF5_PARAPREFIX */ + + /* Prepend the prefix value to the base name */ + if (prefix && *prefix) { + /* If the prefix specifies the HDF5_PARAPREFIX directory, then + * default to using the "/tmp/$USER" or "/tmp/$LOGIN" + * directory instead. */ + register char *user, *login, *subdir; + + user = getenv("USER"); + login = getenv("LOGIN"); + subdir = (user ? user : login); + + if (subdir) { + for (i = 0; i < size && prefix[i]; i++) + fullname[i] = prefix[i]; + + fullname[i++] = '/'; + + for (j = 0; i < size && subdir[j]; i++, j++) + fullname[i] = subdir[j]; + } else { + /* We didn't append the prefix yet */ + strncpy(fullname, prefix, MIN(strlen(prefix), size)); + } + + if ((strlen(fullname) + strlen(base_name) + 1) < size) { + /* Append the base_name with a slash first. Multiple slashes are + * handled below. */ + h5_stat_t buf; + + if (HDstat(fullname, &buf) < 0) + /* The directory doesn't exist just yet */ + if (mkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST) { + /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory. + * Default to PREFIX's original prefix value. */ + strcpy(fullname, prefix); + } + + strcat(fullname, "/"); + strcat(fullname, base_name); + } else { + /* Buffer is too small */ + return NULL; + } + } else if (strlen(base_name) >= size) { + /* Buffer is too small */ + return NULL; + } else { + strcpy(fullname, base_name); + } + + /* Append a suffix */ + if (suffix) { + if (strlen(fullname) + strlen(suffix) >= size) + return NULL; + + strcat(fullname, suffix); + } + + /* Remove any double slashes in the filename */ + for (ptr = fullname, i = j = 0; ptr && i < size; i++, ptr++) { + if (*ptr != '/' || last != '/') + fullname[j++] = *ptr; + + last = *ptr; + } + + return fullname; +} + +/* + * Function: do_write + * Purpose: Write the required amount of data to the file. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ +static herr_t +do_write(results *res, file_descr *fd, parameters *parms, void *buffer) +{ + int ret_code = SUCCESS; + char dname[64]; + long i; + /* HDF5 variables */ + herr_t hrc; /*HDF5 return code */ + hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */ + hsize_t h5chunk[MAX_DIMS]; /*dataset dim sizes */ + hsize_t h5block[MAX_DIMS]; /*dataspace selection */ + hsize_t h5stride[MAX_DIMS]; /*selection stride */ + hsize_t h5start[MAX_DIMS]; /*selection start */ + hsize_t h5maxdims[MAX_DIMS]; + int rank; /*rank of dataset */ + /* Prepare buffer for verifying data */ +/* if (parms->verify) + memset(buffer,1,linear_buf_size); */ + + buf_p=(unsigned char *)buffer; + + for (i=0; i < linear_buf_size; i++) + buf_p[i]=i%128; + + rank = parms->rank; + + for (i=0; iio_type) { + case POSIXIO: + + /* determine lowest dimension for contiguous POSIX access */ + cont_dim = rank; + + for (i=rank-1; i>=0; i--) { + if (parms->buf_size[i]==parms->dset_size[i]) + cont_dim = i; + else + break; + } + + /* determine size of the contiguous POSIX access */ + cont_size = (!cont_dim)? 1 : parms->buf_size[cont_dim-1]; + for (i=cont_dim; ibuf_size[i]; + + break; + + case HDF5: /* HDF5 setup */ + + for (i=0; i < rank; i++){ + h5dims[i] = parms->dset_size[i]; + h5start[i] = 0; + h5stride[i] = 1; + h5block[i] = 1; + h5count[i] = parms->buf_size[i]; + h5chunk[i] = parms->chk_size[i]; + h5maxdims[i] = H5S_UNLIMITED; + + } + + if (parms->h5_use_chunks && parms->h5_extendable) { + h5dset_space_id = H5Screate_simple(rank, h5count, h5maxdims); + VRFY((h5dset_space_id >= 0), "H5Screate_simple"); + } + else { + h5dset_space_id = H5Screate_simple(rank, h5dims, NULL); + VRFY((h5dset_space_id >= 0), "H5Screate_simple"); + } + + hrc = H5Sselect_hyperslab(h5dset_space_id, H5S_SELECT_SET, + h5start, h5stride, h5count, h5block); + VRFY((hrc >= 0), "H5Sselect_hyperslab"); + + /* Create the memory dataspace that corresponds to the xfer buffer */ + h5mem_space_id = H5Screate_simple(rank, h5count, NULL); + VRFY((h5mem_space_id >= 0), "H5Screate_simple"); + + /* Create the dataset transfer property list */ + h5dxpl = H5Pcreate(H5P_DATASET_XFER); + if (h5dxpl < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); + } + + break; + } /* end switch */ + + + /* create dataset */ + switch (parms->io_type) { + case POSIXIO: + break; + + case HDF5: + h5dcpl = H5Pcreate(H5P_DATASET_CREATE); + + if (h5dcpl < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); + } + + if(parms->h5_use_chunks) { + /* Set the chunk size to be the same as the buffer size */ + hrc = H5Pset_chunk(h5dcpl, rank, h5chunk); + if (hrc < 0) { + fprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } /* end if */ + } /* end if */ + + sprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes); + h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, + h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); + + if (h5ds_id < 0) { + fprintf(stderr, "HDF5 Dataset Create failed\n"); + GOTOERROR(FAIL); + } + + hrc = H5Pclose(h5dcpl); + /* verifying the close of the dcpl */ + if (hrc < 0) { + fprintf(stderr, "HDF5 Property List Close failed\n"); + GOTOERROR(FAIL); + } + + break; + } + + /* Start "raw data" write timer */ + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + + /* Perform write */ + hrc = dset_write(rank-1, fd, parms, buffer); + + if (hrc < 0) { + fprintf(stderr, "Error in dataset write\n"); + GOTOERROR(FAIL); + } + + + /* Stop "raw data" write timer */ + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + + /* Calculate write time */ + + /* Close dataset. Only HDF5 needs to do an explicit close. */ + if (parms->io_type == HDF5) { + hrc = H5Dclose(h5ds_id); + + if (hrc < 0) { + fprintf(stderr, "HDF5 Dataset Close failed\n"); + GOTOERROR(FAIL); + } + + h5ds_id = -1; + } /* end if */ + +done: + + /* release HDF5 objects */ + if (h5dset_space_id != -1) { + hrc = H5Sclose(h5dset_space_id); + if (hrc < 0){ + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + ret_code = FAIL; + } else { + h5dset_space_id = -1; + } + } + + if (h5mem_space_id != -1) { + hrc = H5Sclose(h5mem_space_id); + if (hrc < 0) { + fprintf(stderr, "HDF5 Memory Space Close failed\n"); + ret_code = FAIL; + } else { + h5mem_space_id = -1; + } + } + + if (h5dxpl != -1) { + hrc = H5Pclose(h5dxpl); + if (hrc < 0) { + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + ret_code = FAIL; + } else { + h5dxpl = -1; + } + } + + return ret_code; +} + +/* + * Function: dset_write + * Purpose: Write buffer into the dataset. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + +static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) +{ + int cur_dim = order[local_dim]-1; + int ret_code = SUCCESS; + int k; + hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; + long i,j; + herr_t hrc; + + /* iterates according to the dimensions in order array */ + for (i=0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]){ + + h5offset[cur_dim] = offset[cur_dim] = i; + + if (local_dim > 0){ + + dset_write(local_dim-1, fd, parms, buffer); + + }else{ + + switch (parms->io_type) { + + case POSIXIO: + /* initialize POSIX offset in the buffer */ + for (j=0; j < parms->rank; j++) { + buf_offset[j]=0; + } + buf_p = (unsigned char *)buffer; + /* write POSIX buffer */ + posix_buffer_write(0, fd, parms, buffer); + break; + + case HDF5: + /* if dimensions are extendable, extend them as needed during + access */ + if (parms->h5_use_chunks && parms->h5_extendable) { + + hrc=H5Sget_simple_extent_dims(h5dset_space_id,dims,maxdims); + VRFY((hrc >= 0), "H5Sget_simple_extent_dims"); + + for (k=0; k < parms->rank; k++){ + + if (dims[k] <= h5offset[k]) { + dims[k] = dims[k]+h5count[k]; + hrc=H5Sset_extent_simple(h5dset_space_id,parms->rank,dims,maxdims); + VRFY((hrc >= 0), "H5Sset_extent_simple"); + hrc=H5Dset_extent(h5ds_id,dims); + VRFY((hrc >= 0), "H5Dextend"); + } + } + } + /* applies offset */ + hrc = H5Soffset_simple(h5dset_space_id, h5offset); + VRFY((hrc >= 0), "H5Soffset_simple"); + + /* Write the buffer out */ + hrc=H5Sget_simple_extent_dims(h5dset_space_id,dims,maxdims); + hrc = H5Dwrite(h5ds_id, ELMT_H5_TYPE, h5mem_space_id, + h5dset_space_id, h5dxpl, buffer); + VRFY((hrc >= 0), "H5Dwrite"); + + break; + } /* switch (parms->io_type) */ + } + } +done: + return ret_code; +} + +/* + * Function: posix_buffer_write + * Purpose: Write buffer into the POSIX file considering contiguity. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + +static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) +{ + int dtype_size = 1; + int ret_code = SUCCESS; + long i; + size_t d_offset; + size_t linear_dset_offset = 0; + int j, rc; + + /* if dimension is not contiguous, call recursively */ + if (local_dim < parms->rank-1 && local_dim != cont_dim) { + + for (i=0; i < parms->buf_size[local_dim]; i += dtype_size) { + buf_offset[local_dim] = i; + posix_buffer_write(local_dim+1, fd, parms, buffer); + + /* if next dimension is cont_dim, it will fill out the buffer + traversing the entire dimension local_dim without the need + of performing iteration */ + if (local_dim+1==cont_dim) + break; + } + /* otherwise, perform contiguous POSIX access */ + } else { + + buf_offset[local_dim] = 0; + + /* determine offset in the buffer */ + for (i=0; i < parms->rank; i++){ + d_offset=1; + + for (j=i+1; j < parms->rank; j++) + d_offset *= parms->dset_size[j]; + + linear_dset_offset += (offset[i]+buf_offset[i])*d_offset; + } + + /* only care if seek returns error */ + rc = POSIXSEEK(fd->posixfd, linear_dset_offset) < 0 ? -1 : 0; + VRFY((rc==0), "POSIXSEEK"); + /* check if all bytes are written */ + rc = ((ssize_t)cont_size == + POSIXWRITE(fd->posixfd, buf_p, cont_size)); + VRFY((rc != 0), "POSIXWRITE"); + + /* Advance location in buffer */ + buf_p += cont_size; + + } +done: + return ret_code; +} + +/* + * Function: do_read + * Purpose: Read the required amount of data to the file. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ +static herr_t +do_read(results *res, file_descr *fd, parameters *parms, void *buffer) +{ + int ret_code = SUCCESS; + char dname[64]; + long i; + /* HDF5 variables */ + herr_t hrc; /*HDF5 return code */ + hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */ + hsize_t h5chunk[MAX_DIMS]; /*dataset dim sizes */ + hsize_t h5block[MAX_DIMS]; /*dataspace selection */ + hsize_t h5stride[MAX_DIMS]; /*selection stride */ + hsize_t h5start[MAX_DIMS]; /*selection start */ + int rank; + + /* Prepare buffer for verifying data */ + for (i=0; i < linear_buf_size; i++) + buffer2[i]=i%128; + + rank = parms->rank; + for (i=0; iio_type) { + case POSIXIO: + cont_dim = rank; + + for (i=rank-1; i>=0; i--) { + if (parms->buf_size[i]==parms->dset_size[i]) + cont_dim = i; + else + break; + } + cont_size = (!cont_dim)? 1 : parms->buf_size[cont_dim-1]; + for (i=cont_dim; ibuf_size[i]; + + break; + + case HDF5: /* HDF5 setup */ + for (i=0; i < rank; i++){ + h5dims[i] = parms->dset_size[i]; + h5start[i] = 0; + h5stride[i] = 1; + h5block[i] = 1; + h5count[i] = parms->buf_size[i]; + h5chunk[i] = parms->chk_size[i]; + } + + h5dset_space_id = H5Screate_simple(rank, h5dims, NULL); + VRFY((h5dset_space_id >= 0), "H5Screate_simple"); + + hrc = H5Sselect_hyperslab(h5dset_space_id, H5S_SELECT_SET, + h5start, h5stride, h5count, h5block); + VRFY((hrc >= 0), "H5Sselect_hyperslab"); + + /* Create the memory dataspace that corresponds to the xfer buffer */ + h5mem_space_id = H5Screate_simple(rank, h5count, NULL); + VRFY((h5mem_space_id >= 0), "H5Screate_simple"); + + /* Create the dataset transfer property list */ + h5dxpl = H5Pcreate(H5P_DATASET_XFER); + if (h5dxpl < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); + } + + break; + } /* end switch */ + + + /* create dataset */ + switch (parms->io_type) { + case POSIXIO: + break; + + case HDF5: + sprintf(dname, "Dataset_%ld", parms->num_bytes); + h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT); + if (h5ds_id < 0) { + fprintf(stderr, "HDF5 Dataset open failed\n"); + GOTOERROR(FAIL); + } + + break; + + } /* end switch */ + + /* Start "raw data" read timer */ + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + hrc = dset_read(rank-1, fd, parms, buffer); + + if (hrc < 0) { + fprintf(stderr, "Error in dataset read\n"); + GOTOERROR(FAIL); + } + + /* Stop "raw data" read timer */ + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + + /* Calculate read time */ + + /* Close dataset. Only HDF5 needs to do an explicit close. */ + if (parms->io_type == HDF5) { + hrc = H5Dclose(h5ds_id); + + if (hrc < 0) { + fprintf(stderr, "HDF5 Dataset Close failed\n"); + GOTOERROR(FAIL); + } + + h5ds_id = -1; + } /* end if */ + +done: + + /* release HDF5 objects */ + if (h5dset_space_id != -1) { + hrc = H5Sclose(h5dset_space_id); + if (hrc < 0){ + fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + ret_code = FAIL; + } else { + h5dset_space_id = -1; + } + } + + if (h5mem_space_id != -1) { + hrc = H5Sclose(h5mem_space_id); + if (hrc < 0) { + fprintf(stderr, "HDF5 Memory Space Close failed\n"); + ret_code = FAIL; + } else { + h5mem_space_id = -1; + } + } + + if (h5dxpl != -1) { + hrc = H5Pclose(h5dxpl); + if (hrc < 0) { + fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + ret_code = FAIL; + } else { + h5dxpl = -1; + } + } + + return ret_code; +} + +/* + * Function: dset_read + * Purpose: Read buffer into the dataset. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + +static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer) +{ + int cur_dim = order[local_dim]-1; + int ret_code = SUCCESS; + long i,j; + herr_t hrc; + + /* iterate on the current dimension */ + for (i=0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]){ + + h5offset[cur_dim] = offset[cur_dim] = i; + + /* if traverse in order array is incomplete, recurse */ + if (local_dim > 0){ + + ret_code = dset_read(local_dim-1, fd, parms, buffer); + + /* otherwise, write buffer into dataset */ + }else{ + + switch (parms->io_type) { + + case POSIXIO: + for (j=0; jrank; j++) { + buf_offset[j] = 0; + } + buf_p = (unsigned char*)buffer; + buf2_p = (unsigned char*)buffer2; + posix_buffer_read(0, fd, parms, buffer); + break; + + case HDF5: + hrc = H5Soffset_simple(h5dset_space_id, h5offset); + VRFY((hrc >= 0), "H5Soffset_simple"); + /* Read the buffer out */ + hrc = H5Dread(h5ds_id, ELMT_H5_TYPE, h5mem_space_id, + h5dset_space_id, h5dxpl, buffer); + VRFY((hrc >= 0), "H5Dread"); +#if 0 + for (j=0; jio_type) */ + } + } +done: + return ret_code; +} + +/* + * Function: posix_buffer_read + * Purpose: Read buffer into the POSIX file considering contiguity. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + +static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer) +{ + int dtype_size = 1; + int ret_code = SUCCESS; + long i; + size_t d_offset; + size_t linear_dset_offset = 0; + int j, rc; + + /* if local dimension is not contiguous, recurse */ + if (local_dim < parms->rank-1 && local_dim != cont_dim) { + + for (i=0; i < parms->buf_size[local_dim]; i += dtype_size) { + buf_offset[local_dim] = i; + ret_code = posix_buffer_read(local_dim+1, fd, parms, buffer); + if (local_dim+1==cont_dim) + break; + } + /* otherwise, perform contiguous POSIX access */ + } else { + + buf_offset[local_dim] = 0; + /* determine offset in buffer */ + for (i=0; irank; i++){ + d_offset=1; + + for (j=i+1; jrank; j++) + d_offset *= parms->dset_size[j]; + + linear_dset_offset += (offset[i]+buf_offset[i])*d_offset; + } + + /* only care if seek returns error */ + rc = POSIXSEEK(fd->posixfd, linear_dset_offset) < 0 ? -1 : 0; + VRFY((rc==0), "POSIXSEEK"); + /* check if all bytes are read */ + rc = ((ssize_t)cont_size == + POSIXREAD(fd->posixfd, buf_p, cont_size)); + VRFY((rc != 0), "POSIXREAD"); +#if 0 + for (j=0; jio_type) { + case POSIXIO: + if (flags & (SIO_CREATE | SIO_WRITE)) + fd->posixfd = POSIXCREATE(fname); + else + fd->posixfd = POSIXOPEN(fname, O_RDONLY); + + if (fd->posixfd < 0 ) { + fprintf(stderr, "POSIX File Open failed(%s)\n", fname); + GOTOERROR(FAIL); + } + + break; + + case HDF5: + + fapl = set_vfd(param); + + if (fapl < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); + } + + /* create the parallel file */ + if (flags & (SIO_CREATE | SIO_WRITE)) { + fd->h5fd = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + } else { + fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, fapl); + } + + + if (fd->h5fd < 0) { + fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + GOTOERROR(FAIL); + } + break; + } + +done: + return ret_code; +} + +/* + * Function: set_vfd + * Purpose: Sets file driver. + * Return: SUCCESS or FAIL + * Programmer: Christian Chilan, April, 2008 + * Modifications: + */ + +hid_t +set_vfd(parameters *param) +{ + hid_t fapl = -1; + vfdtype vfd; + + vfd = param->vfd; + + if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) return -1; + + if (vfd == sec2) { + /* Unix read() and write() system calls */ + if (H5Pset_fapl_sec2(fapl)<0) return -1; + } else if (vfd == stdio) { + /* Standard C fread() and fwrite() system calls */ + if (H5Pset_fapl_stdio(fapl)<0) return -1; + } else if (vfd == core) { + /* In-core temporary file with 1MB increment */ + if (H5Pset_fapl_core(fapl, (size_t)1024*1024, TRUE)<0) return -1; + } else if (vfd == split) { + /* Split meta data and raw data each using default driver */ + if (H5Pset_fapl_split(fapl, + "-m.h5", H5P_DEFAULT, + "-r.h5", H5P_DEFAULT)<0) + return -1; + } else if (vfd == multi) { + /* Multi-file driver, general case of the split driver */ + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + char sv[H5FD_MEM_NTYPES][1024]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + H5FD_mem_t mt; + + HDmemset(memb_map, 0, sizeof memb_map); + HDmemset(memb_fapl, 0, sizeof memb_fapl); + HDmemset(memb_name, 0, sizeof memb_name); + HDmemset(memb_addr, 0, sizeof memb_addr); + + assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + for (mt=H5FD_MEM_DEFAULT; mtposixfd); + + if (rc != 0){ + fprintf(stderr, "POSIX File Close failed\n"); + GOTOERROR(FAIL); + } + + fd->posixfd = -1; + break; + + case HDF5: + hrc = H5Fclose(fd->h5fd); + + if (hrc < 0) { + fprintf(stderr, "HDF5 File Close failed\n"); + GOTOERROR(FAIL); + } + + fd->h5fd = -1; + break; + } + +done: + return ret_code; +} + + +/* + * Function: do_cleanupfile + * Purpose: Cleanup temporary file unless HDF5_NOCLEANUP is set. + * Return: void + * Programmer: Albert Cheng 2001/12/12 + * Modifications: Support for file drivers. Christian Chilan, April, 2008 + */ + static void +do_cleanupfile(iotype iot, char *filename) +{ + char temp[2048]; + int j; + hid_t driver; + + if (clean_file_g == -1) + clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0; + + if (clean_file_g){ + + switch (iot) { + case POSIXIO: + HDremove(filename); + break; + + case HDF5: + driver = H5Pget_driver(fapl); + + if (driver == H5FD_FAMILY) { + for (j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); + + if (HDaccess(temp, F_OK) < 0) + break; + + HDremove(temp); + } + } else if (driver == H5FD_CORE) { + hbool_t backing; /* Whether the core file has backing store */ + + H5Pget_fapl_core(fapl,NULL,&backing); + + /* If the file was stored to disk with bacing store, remove it */ + if(backing) + HDremove(filename); + + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; + assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + + for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", + filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } + } else { + HDremove(filename); + } + H5Pclose(fapl); + break; + } +} +} + +#ifdef H5_HAVE_GPFS + +/* Descriptions here come from the IBM GPFS Manual */ + +/* + * Function: gpfs_access_range + * Purpose: Declares an access range within a file for an + * application. + * + * The application will access file offsets within the given + * range, and will not access offsets outside the range. + * Violating this hint may produce worse performance than if + * no hint was specified. + * + * This hint is useful in situations where a file is + * partitioned coarsely among several nodes. If the ranges + * do not overlap, each node can specify which range of the + * file it will access, with a performance improvement in + * some cases, such as for sequential writing within a + * range. + * + * Subsequent GPFS_ACCESS_RANGE hints will replace a hint + * passed earlier. + * + * START - The start of the access range offset, in + * bytes, from the beginning of the file + * LENGTH - Length of the access range. 0 indicates to + * the end of the file + * IS_WRITE - 0 indicates READ access, 1 indicates WRITE access + * Return: Nothing + * Programmer: Bill Wendling, 03. June 2002 + * Modifications: + */ + static void +gpfs_access_range(int handle, off_t start, off_t length, int is_write) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsAccessRange_t access; + } access_range; + + access_range.hdr.totalLength = sizeof(access_range); + access_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + access_range.hdr.fcntlReserved = 0; + access_range.access.structLen = sizeof(gpfsAccessRange_t); + access_range.access.structType = GPFS_ACCESS_RANGE; + access_range.access.start = start; + access_range.access.length = length; + access_range.access.isWrite = is_write; + + if (gpfs_fcntl(handle, &access_range) != 0) { + fprintf(stderr, + "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", + errno, access_range.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_free_range + * Purpose: Undeclares an access range within a file for an + * application. + * + * The application will no longer access file offsets within + * the given range. GPFS flushes the data at the file + * offsets and removes it from the cache. + * + * Multi-node applications that have finished one phase of + * their computation may wish to use this hint before the + * file is accessed in a conflicting mode from another node + * in a later phase. The potential performance benefit is + * that GPFS can avoid later synchronous cache consistency + * operations. + * + * START - The start of the access range offset, in + * bytes from the beginning of the file. + * LENGTH - Length of the access range. 0 indicates to + * the end of the file. + * Return: Nothing + * Programmer: Bill Wendling, 03. June 2002 + * Modifications: + */ + static void +gpfs_free_range(int handle, off_t start, off_t length) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsFreeRange_t range; + } free_range; + + /* Issue the invalidate hint */ + free_range.hdr.totalLength = sizeof(free_range); + free_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + free_range.hdr.fcntlReserved = 0; + free_range.range.structLen = sizeof(gpfsFreeRange_t); + free_range.range.structType = GPFS_FREE_RANGE; + free_range.range.start = start; + free_range.range.length = length; + + if (gpfs_fcntl(handle, &free_range) != 0) { + fprintf(stderr, + "gpfs_fcntl free range failed for range %d:%d. errno=%d errorOffset=%d\n", + start, length, errno, free_range.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_clear_file_cache + * Purpose: Indicates file access in the near future is not expected. + * + * The application does not expect to make any further + * accesses to the file in the near future, so GPFS removes + * any data or metadata pertaining to the file from its + * cache. + * + * Multi-node applications that have finished one phase of + * their computation may wish to use this hint before the + * file is accessed in a conflicting mode from another node + * in a later phase. The potential performance benefit is + * that GPFS can avoid later synchronous cache consistency + * operations. + * Return: Nothing + * Programmer: Bill Wendling, 03. June 2002 + * Modifications: + */ + static void +gpfs_clear_file_cache(int handle) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsClearFileCache_t clear; + } clear_cache; + + clear_cache.hdr.totalLength = sizeof(clear_cache); + clear_cache.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + clear_cache.hdr.fcntlReserved = 0; + clear_cache.clear.structLen = sizeof(gpfsClearFileCache_t); + clear_cache.clear.structType = GPFS_CLEAR_FILE_CACHE; + + if (gpfs_fcntl(handle, &clear_cache) != 0) { + fprintf(stderr, + "gpfs_fcntl clear file cache directive failed. errno=%d errorOffset=%d\n", + errno, clear_cache.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_cancel_hints + * Purpose: Indicates to remove any hints against the open file + * handle. + * + * GPFS removes any hints that may have been issued against + * this open file handle: + * + * - The hint status of the file is restored ot what it + * would have been immediately after being opened, but + * does not affect the contents of the GPFS file + * cache. Cancelling an earlier hint that resulted in + * data being removed from the GPFS file cache does + * not bring that data back int othe cache; data + * re-enters the cache only pon access by the + * application or by user-driven or automatic + * prefetching. + * - Only the GPFS_MULTIPLE_ACCESS_RANGE hint has a + * state that might be removed by the + * GPFS_CANCEL_HINTS directive. + * Return: Nothing + * Programmer: Bill Wendling, 03. June 2002 + * Modifications: + */ + static void +gpfs_cancel_hints(int handle) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsCancelHints_t cancel; + } cancel_hints; + + cancel_hints.hdr.totalLength = sizeof(cancel_hints); + cancel_hints.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + cancel_hints.hdr.fcntlReserved = 0; + cancel_hints.cancel.structLen = sizeof(gpfsCancelHints_t); + cancel_hints.cancel.structType = GPFS_CANCEL_HINTS; + + if (gpfs_fcntl(handle, &cancel_hints) != 0) { + fprintf(stderr, + "gpfs_fcntl cancel hints directive failed. errno=%d errorOffset=%d\n", + errno, cancel_hints.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_start_data_shipping + * Purpose: Initiates data shipping mode. + * + * Once all participating threads have issued this directive + * for a file, GPFS enters a mode where it logically + * partitions the blocks of the file among a group of agent + * nodes. The agents are those nodes on which one or more + * threads have issued the GPFS_DATA_SHIP_START directive. + * Each thread that has issued a GPFS_DATA_SHIP_START + * directive and the associated agent nodes are referred to + * as the data shipping collective. + * + * The second parameter is the total number of open + * instances on all nodes that will be operating on the + * file. Must be called for every such instance with the + * same value of NUM_INSTS. + * + * NUM_INSTS - The number of open file instances, on all + * nodes, collaborating to operate on the file + * Return: Nothing + * Programmer: Bill Wendling, 28. May 2002 + * Modifications: + */ + static void +gpfs_start_data_shipping(int handle, int num_insts) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsDataShipStart_t start; + } ds_start; + + ds_start.hdr.totalLength = sizeof(ds_start); + ds_start.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + ds_start.hdr.fcntlReserved = 0; + ds_start.start.structLen = sizeof(gpfsDataShipStart_t); + ds_start.start.structType = GPFS_DATA_SHIP_START; + ds_start.start.numInstances = num_insts; + ds_start.start.reserved = 0; + + if (gpfs_fcntl(handle, &ds_start) != 0) { + fprintf(stderr, + "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", + errno, ds_start.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_start_data_ship_map + * Purpose: Indicates which agent nodes are to be used for data + * shipping. GPFS recognizes which agent nodes to use for + * data shipping. + * + * PARTITION_SIZE - The number of contiguous bytes per + * server. This value must be a + * multiple of the number of bytes in a + * single file system block + * AGENT_COUNT - The number of entries in the + * agentNodeNumber array + * AGENT_NODE_NUM - The data ship agent node numbers as + * listed in the SDT or the global ODM + * + * Return: Nothing + * Programmer: Bill Wendling, 10. Jul 2002 + * Modifications: + */ + static void +gpfs_start_data_ship_map(int handle, int partition_size, int agent_count, + int *agent_node_num) +{ + int i; + struct { + gpfsFcntlHeader_t hdr; + gpfsDataShipMap_t map; + } ds_map; + + ds_map.hdr.totalLength = sizeof(ds_map); + ds_map.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + ds_map.hdr.fcntlReserved = 0; + ds_map.map.structLen = sizeof(gpfsDataShipMap_t); + ds_map.map.structType = GPFS_DATA_SHIP_MAP; + ds_map.map.partitionSize = partition_size; + ds_map.map.agentCount = agent_count; + + for (i = 0; i < agent_count; ++i) + ds_map.map.agentNodeNumber[i] = agent_node_num[i]; + + if (gpfs_fcntl(handle, &ds_map) != 0) { + fprintf(stderr, + "gpfs_fcntl DS map directive failed. errno=%d errorOffset=%d\n", + errno, ds_map.hdr.errorOffset); + exit(EXIT_FAILURE); + } +} + +/* + * Function: gpfs_stop_data_shipping + * Purpose: Takes a file out of the data shipping mode. + * + * - GPFS waits for all threads that issued the + * GPFS_DATA_SHIP_START directive to issue this directive, + * then flushes the dirty file data to disk. + * + * - While a gpfs_cntl() call is blocked for other threads, + * the call can be interrupted by any signal. If a signal + * is delivered to any of the waiting calls, all waiting + * calls on every node will be interrupted and will return + * EINTR. GPFS will not cancel data shipping mode if such + * a signal occurs. It is the responsibility of the + * application to mask off any signals that might normally + * occur while waiting for another node in the data + * shipping collective. Several libraries use SIGALRM; the + * thread that makes the gpfs_fcntl() call should use + * sigthreadmask to mask off delivery of this signal while + * inside the call. + * Return: Nothing + * Programmer: Bill Wendling, 28. May 2002 + * Modifications: + */ + static void +gpfs_stop_data_shipping(int handle) +{ + struct { + gpfsFcntlHeader_t hdr; + gpfsDataShipStop_t stop; + } ds_stop; + + ds_stop.hdr.totalLength = sizeof(ds_stop); + ds_stop.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + ds_stop.hdr.fcntlReserved = 0; + ds_stop.stop.structLen = sizeof(ds_stop.stop); + ds_stop.stop.structType = GPFS_DATA_SHIP_STOP; + + if (gpfs_fcntl(handle, &ds_stop) != 0) + fprintf(stderr, + "gpfs_fcntl DS stop directive failed. errno=%d errorOffset=%d\n", + errno, ds_stop.hdr.errorOffset); +} + +/* + * Function: gpfs_invalidate_file_cache + * Purpose: Invalidate all cached data held on behalf of a file on + * this node. + * Return: Nothing + * Programmer: Bill Wendling, 03. June 2002 + * Modifications: + */ + static void +gpfs_invalidate_file_cache(const char *filename) +{ + int handle; + struct { + gpfsFcntlHeader_t hdr; + gpfsClearFileCache_t inv; + } inv_cache_hint; + + /* Open the file. If the open fails, the file cannot be cached. */ + handle = open(filename, O_RDONLY, 0); + + if (handle == -1) + return; + + /* Issue the invalidate hint */ + inv_cache_hint.hdr.totalLength = sizeof(inv_cache_hint); + inv_cache_hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + inv_cache_hint.hdr.fcntlReserved = 0; + inv_cache_hint.inv.structLen = sizeof(gpfsClearFileCache_t); + inv_cache_hint.inv.structType = GPFS_CLEAR_FILE_CACHE; + + if (gpfs_fcntl(handle, &inv_cache_hint) != 0) { + fprintf(stderr, + "gpfs_fcntl clear cache hint failed for file '%s'.", + filename); + fprintf(stderr, " errno=%d errorOffset=%d\n", + errno, inv_cache_hint.hdr.errorOffset); + exit(1); + } + + /* Close the file */ + if (close(handle) == -1) { + fprintf(stderr, + "could not close file '%s' after flushing file cache, ", + filename); + fprintf(stderr, "errno=%d\n", errno); + exit(1); + } +} + +#else + +/* turn the stubs off since some compilers are warning they are not used */ +#if 0 +/* H5_HAVE_GPFS isn't defined...stub functions */ + + static void +gpfs_access_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length, + int UNUSED is_write) +{ + return; +} + + static void +gpfs_free_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length) +{ + return; +} + + static void +gpfs_clear_file_cache(int UNUSED handle) +{ + return; +} + + static void +gpfs_cancel_hints(int UNUSED handle) +{ + return; +} + + static void +gpfs_start_data_shipping(int UNUSED handle, int UNUSED num_insts) +{ + return; +} + + static void +gpfs_stop_data_shipping(int UNUSED handle) +{ + return; +} + + static void +gpfs_start_data_ship_map(int UNUSED handle, int UNUSED partition_size, + int UNUSED agent_count, int UNUSED *agent_node_num) +{ + return; +} + + static void +gpfs_invalidate_file_cache(const char UNUSED *filename) +{ + return; +} + +#endif /* 0 */ + +#endif /* H5_HAVE_GPFS */ + + diff --git a/perform/sio_perf.c b/perform/sio_perf.c new file mode 100644 index 0000000..9e5ed23 --- /dev/null +++ b/perform/sio_perf.c @@ -0,0 +1,1446 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Serial HDF5 Performance Testing Code + * -------------------------------------- + * + * Portable code to test performance on the different platforms we support. + * This is what the report should look like: + * + * nprocs = Max#Procs + * IO API = POSIXIO + * # Files = 1, # of dsets = 1000, Elements per dset = 37000 + * Write Results = x MB/s + * Read Results = x MB/s + * # Files = 1, # of dsets = 3000, Elements per dset = 37000 + * Write Results = x MB/s + * Read Results = x MB/s + * + * . . . + * + * + * IO API = HDF5 + * # Files = 1, # of dsets = 1000, Elements per dset = 37000 + * Write Results = x MB/s + * Read Results = x MB/s + * # Files = 1, # of dsets = 3000, Elements per dset = 37000 + * Write Results = x MB/s + * Read Results = x MB/s + * + * . . . + * + * + * . . . + * + */ + +/* system header files */ +#include +#include +#include + +#include "hdf5.h" + + +/* our header files */ +#include "sio_perf.h" + +/* useful macros */ +#define TAB_SPACE 4 + +#define ONE_KB 1024 +#define ONE_MB (ONE_KB * ONE_KB) +#define ONE_GB (ONE_MB * ONE_KB) + +#define SIO_POSIX 0x1 +#define SIO_HDF5 0x4 + +/* report 0.0 in case t is zero too */ +#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ +#ifndef FALSE +#define FALSE (!TRUE) +#endif /* FALSE */ + +/* global variables */ +FILE *output; /* output file */ +int sio_debug_level = 0;/* The debug level: + * 0 - Off + * 1 - Minimal + * 2 - Some more + * 3 - Maximal + * 4 - Maximal & then some + */ + +/* local variables */ +static const char *progname = "h5perf_serial"; + +/* + * Command-line options: The user can specify short or long-named + * parameters. The long-named ones can be partially spelled. When + * adding more, make sure that they don't clash with each other. + */ + +/* + * It seems that only the options that accept additional information + * such as dataset size (-e) require the colon next to it. + */ +#if 1 +static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; +#else +static const char *s_opts = "a:A:bB:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:wx:X:"; +#endif /* 1 */ +static struct long_options l_opts[] = { + { "align", require_arg, 'a' }, + { "alig", require_arg, 'a' }, + { "ali", require_arg, 'a' }, + { "al", require_arg, 'a' }, + { "api", require_arg, 'A' }, + { "ap", require_arg, 'A' }, +#if 0 + /* a sighting of the elusive binary option */ + { "binary", no_arg, 'b' }, + { "binar", no_arg, 'b' }, + { "bina", no_arg, 'b' }, + { "bin", no_arg, 'b' }, + { "bi", no_arg, 'b' }, +#endif /* 0 */ + { "block-size", require_arg, 'B' }, + { "block-siz", require_arg, 'B' }, + { "block-si", require_arg, 'B' }, + { "block-s", require_arg, 'B' }, + { "block-", require_arg, 'B' }, + { "block", require_arg, 'B' }, + { "bloc", require_arg, 'B' }, + { "blo", require_arg, 'B' }, + { "bl", require_arg, 'B' }, + { "chunk", no_arg, 'c' }, + { "chun", no_arg, 'c' }, + { "chu", no_arg, 'c' }, + { "ch", no_arg, 'c' }, + { "collective", no_arg, 'C' }, + { "collectiv", no_arg, 'C' }, + { "collecti", no_arg, 'C' }, + { "collect", no_arg, 'C' }, + { "collec", no_arg, 'C' }, + { "colle", no_arg, 'C' }, + { "coll", no_arg, 'C' }, + { "col", no_arg, 'C' }, + { "co", no_arg, 'C' }, + { "debug", require_arg, 'D' }, + { "debu", require_arg, 'D' }, + { "deb", require_arg, 'D' }, + { "de", require_arg, 'D' }, + { "file-driver", require_arg, 'v' }, + { "file-drive", require_arg, 'v' }, + { "file-driv", require_arg, 'v' }, + { "file-dri", require_arg, 'v' }, + { "file-dr", require_arg, 'v' }, + { "file-d", require_arg, 'v' }, + { "file-", require_arg, 'v' }, + { "file", require_arg, 'v' }, + { "fil", require_arg, 'v' }, + { "fi", require_arg, 'v' }, + { "geometry", no_arg, 'g' }, + { "geometr", no_arg, 'g' }, + { "geomet", no_arg, 'g' }, + { "geome", no_arg, 'g' }, + { "geom", no_arg, 'g' }, + { "geo", no_arg, 'g' }, + { "ge", no_arg, 'g' }, + { "help", no_arg, 'h' }, + { "hel", no_arg, 'h' }, + { "he", no_arg, 'h' }, + { "interleaved", require_arg, 'I' }, + { "interleave", require_arg, 'I' }, + { "interleav", require_arg, 'I' }, + { "interlea", require_arg, 'I' }, + { "interle", require_arg, 'I' }, + { "interl", require_arg, 'I' }, + { "inter", require_arg, 'I' }, + { "inte", require_arg, 'I' }, + { "int", require_arg, 'I' }, + { "in", require_arg, 'I' }, + { "max-num-processes", require_arg, 'P' }, + { "max-num-processe", require_arg, 'P' }, + { "max-num-process", require_arg, 'P' }, + { "max-num-proces", require_arg, 'P' }, + { "max-num-proce", require_arg, 'P' }, + { "max-num-proc", require_arg, 'P' }, + { "max-num-pro", require_arg, 'P' }, + { "max-num-pr", require_arg, 'P' }, + { "max-num-p", require_arg, 'P' }, + { "min-num-processes", require_arg, 'p' }, + { "min-num-processe", require_arg, 'p' }, + { "min-num-process", require_arg, 'p' }, + { "min-num-proces", require_arg, 'p' }, + { "min-num-proce", require_arg, 'p' }, + { "min-num-proc", require_arg, 'p' }, + { "min-num-pro", require_arg, 'p' }, + { "min-num-pr", require_arg, 'p' }, + { "min-num-p", require_arg, 'p' }, + { "max-xfer-size", require_arg, 'X' }, + { "max-xfer-siz", require_arg, 'X' }, + { "max-xfer-si", require_arg, 'X' }, + { "max-xfer-s", require_arg, 'X' }, + { "max-xfer", require_arg, 'X' }, + { "max-xfe", require_arg, 'X' }, + { "max-xf", require_arg, 'X' }, + { "max-x", require_arg, 'X' }, + { "min-xfer-size", require_arg, 'x' }, + { "min-xfer-siz", require_arg, 'x' }, + { "min-xfer-si", require_arg, 'x' }, + { "min-xfer-s", require_arg, 'x' }, + { "min-xfer", require_arg, 'x' }, + { "min-xfe", require_arg, 'x' }, + { "min-xf", require_arg, 'x' }, + { "min-x", require_arg, 'x' }, + { "mpi-posix", no_arg, 'm' }, + { "mpi-posi", no_arg, 'm' }, + { "mpi-pos", no_arg, 'm' }, + { "mpi-po", no_arg, 'm' }, + { "mpi-p", no_arg, 'm' }, + { "mpi-", no_arg, 'm' }, + { "mpi", no_arg, 'm' }, + { "mp", no_arg, 'm' }, + { "num-bytes", require_arg, 'e' }, + { "num-byte", require_arg, 'e' }, + { "num-byt", require_arg, 'e' }, + { "num-by", require_arg, 'e' }, + { "num-b", require_arg, 'e' }, + { "num-dsets", require_arg, 'd' }, + { "num-dset", require_arg, 'd' }, + { "num-dse", require_arg, 'd' }, + { "num-ds", require_arg, 'd' }, + { "num-d", require_arg, 'd' }, + { "num-files", require_arg, 'F' }, + { "num-file", require_arg, 'F' }, + { "num-fil", require_arg, 'F' }, + { "num-fi", require_arg, 'F' }, + { "num-f", require_arg, 'F' }, + { "num-iterations", require_arg, 'i' }, + { "num-iteration", require_arg, 'i' }, + { "num-iteratio", require_arg, 'i' }, + { "num-iterati", require_arg, 'i' }, + { "num-iterat", require_arg, 'i' }, + { "num-itera", require_arg, 'i' }, + { "num-iter", require_arg, 'i' }, + { "num-ite", require_arg, 'i' }, + { "num-it", require_arg, 'i' }, + { "num-i", require_arg, 'i' }, + { "order", require_arg, 'r' }, + { "orde", require_arg, 'r' }, + { "ord", require_arg, 'r' }, + { "or", require_arg, 'r' }, + { "output", require_arg, 'o' }, + { "outpu", require_arg, 'o' }, + { "outp", require_arg, 'o' }, + { "out", require_arg, 'o' }, + { "ou", require_arg, 'o' }, + { "extendable", no_arg, 't' }, + { "extendabl", no_arg, 't' }, + { "extendab", no_arg, 't' }, + { "extenda", no_arg, 't' }, + { "extend", no_arg, 't' }, + { "exten", no_arg, 't' }, + { "exte", no_arg, 't' }, + { "ext", no_arg, 't' }, + { "ex", no_arg, 't' }, + { "threshold", require_arg, 'T' }, + { "threshol", require_arg, 'T' }, + { "thresho", require_arg, 'T' }, + { "thresh", require_arg, 'T' }, + { "thres", require_arg, 'T' }, + { "thre", require_arg, 'T' }, + { "thr", require_arg, 'T' }, + { "th", require_arg, 'T' }, + { "write-only", require_arg, 'w' }, + { "write-onl", require_arg, 'w' }, + { "write-on", require_arg, 'w' }, + { "write-o", require_arg, 'w' }, + { "write", require_arg, 'w' }, + { "writ", require_arg, 'w' }, + { "wri", require_arg, 'w' }, + { "wr", require_arg, 'w' }, + { NULL, 0, '\0' } +}; + +struct options { + long io_types; /* bitmask of which I/O types to test */ + const char *output_file; /* file to print report to */ + long num_dsets; /* number of datasets */ + long num_files; /* number of files */ + off_t num_bpp; /* number of bytes per proc per dset */ + int num_iters; /* number of iterations */ + off_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Dimension access order */ + int dset_rank; /* Rank */ + int buf_rank; /* Rank */ + int order_rank; /* Rank */ + int chk_rank; /* Rank */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ + off_t h5_alignment; /* alignment in HDF5 file */ + off_t h5_threshold; /* threshold for alignment in HDF5 file */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int h5_extendable; /* Perform the write tests only */ + unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ + int verify; /* Verify data correctness */ + vfdtype vfd; /* File driver */ + +}; + +typedef struct _minmax { + double min; + double max; + double sum; + int num; +} minmax; + +/* local functions */ +static off_t parse_size_directive(const char *size); +static struct options *parse_command_line(int argc, char *argv[]); +static void run_test_loop(struct options *options); +static int run_test(iotype iot, parameters parms, struct options *opts); +static void output_all_info(minmax *mm, int count, int indent_level); +static void get_minmax(minmax *mm, double val); +static minmax accumulate_minmax_stuff(minmax *mm, int count); +static void output_results(const struct options *options, const char *name, + minmax *table, int table_size, off_t data_size); +static void output_report(const char *fmt, ...); +static void print_indent(register int indent); +static void usage(const char *prog); +static void report_parameters(struct options *opts); + +/* + * Function: main + * Purpose: Start things up. + * Return: EXIT_SUCCESS or EXIT_FAILURE + * Programmer: Bill Wendling, 30. October 2001 + * Modifications: + */ +int +main(int argc, char **argv) +{ + int ret; + int exit_value = EXIT_SUCCESS; + struct options *opts = NULL; + + output = stdout; + + opts = parse_command_line(argc, argv); + + if (!opts) { + exit_value = EXIT_FAILURE; + goto finish; + } + + if (opts->output_file) { + if ((output = fopen(opts->output_file, "w")) == NULL) { + fprintf(stderr, "%s: cannot open output file\n", progname); + perror(opts->output_file); + goto finish; + } + } + + report_parameters(opts); + + run_test_loop(opts); + +finish: + free(opts); + return exit_value; +} + +/* + * Function: run_test_loop + * Purpose: Run the I/O tests. Write the results to OUTPUT. + * + * - The slowest changing part of the test is the number of + * processors to use. For each loop iteration, we divide that + * number by 2 and rerun the test. + * + * - The second slowest is what type of IO API to perform. We have + * three choices: POSIXIO, and HDF5. + * + * - Then we change the size of the buffer. This information is + * inferred from the number of datasets to create and the number + * of integers to put into each dataset. The backend code figures + * this out. + * + * Return: Nothing + * Programmer: Bill Wendling, 30. October 2001 + * Modifications: + * Added 2D testing (Christian Chilan, 10. August 2005) + */ +static void +run_test_loop(struct options *opts) +{ + parameters parms; + int i; + int doing_sio; /* if this process is doing SIO */ + size_t buf_bytes; + /* load options into parameter structure */ + parms.num_files = opts->num_files; + parms.num_dsets = opts->num_dsets; + parms.num_iters = opts->num_iters; + parms.rank = opts->dset_rank; + parms.h5_align = opts->h5_alignment; + parms.h5_thresh = opts->h5_threshold; + parms.h5_use_chunks = opts->h5_use_chunks; + parms.h5_extendable = opts->h5_extendable; + parms.h5_write_only = opts->h5_write_only; + parms.h5_use_mpi_posix = opts->h5_use_mpi_posix; + parms.verify = opts->verify; + parms.vfd = opts->vfd; + + /* load multidimensional options */ + parms.num_bytes = 1; + buf_bytes = 1; + for (i=0; ibuf_size[i]; + parms.dset_size[i] = opts->dset_size[i]; + parms.chk_size[i] = opts->chk_size[i]; + parms.order[i] = opts->order[i]; + parms.num_bytes *= opts->dset_size[i]; + buf_bytes *= opts->buf_size[i]; + } + + /* print size information */ + output_report("Transfer Buffer Size (bytes): %d\n", buf_bytes); + output_report("File Size(MB): %.2f\n",((double)parms.num_bytes) / ONE_MB); + + print_indent(0); + if (opts->io_types & SIO_POSIX) + run_test(POSIXIO, parms, opts); + + print_indent(0); + if (opts->io_types & SIO_HDF5) + run_test(HDF5, parms, opts); +} + +/* + * Function: run_test + * Purpose: Inner loop call to actually run the I/O test. + * Return: Nothing + * Programmer: Bill Wendling, 18. December 2001 + * Modifications: + */ +static int +run_test(iotype iot, parameters parms, struct options *opts) +{ + results res; + register int i, ret_value = SUCCESS; + int comm_size; + off_t raw_size; + minmax *write_sys_mm_table=NULL; + minmax *write_mm_table=NULL; + minmax *write_gross_mm_table=NULL; + minmax *write_raw_mm_table=NULL; + minmax *read_sys_mm_table=NULL; + minmax *read_mm_table=NULL; + minmax *read_gross_mm_table=NULL; + minmax *read_raw_mm_table=NULL; + minmax write_sys_mm = {0.0, 0.0, 0.0, 0}; + minmax write_mm = {0.0, 0.0, 0.0, 0}; + minmax write_gross_mm = {0.0, 0.0, 0.0, 0}; + minmax write_raw_mm = {0.0, 0.0, 0.0, 0}; + minmax read_sys_mm = {0.0, 0.0, 0.0, 0}; + minmax read_mm = {0.0, 0.0, 0.0, 0}; + minmax read_gross_mm = {0.0, 0.0, 0.0, 0}; + minmax read_raw_mm = {0.0, 0.0, 0.0, 0}; + + raw_size = (off_t)parms.num_bytes; + parms.io_type = iot; + print_indent(2); + output_report("IO API = "); + + switch (iot) { + case POSIXIO: + output_report("POSIX\n"); + break; + case HDF5: + output_report("HDF5\n"); + break; + } + + /* allocate space for tables minmax and that it is sufficient */ + /* to initialize all elements to zeros by calloc. */ + write_sys_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + + if (!parms.h5_write_only) { + read_sys_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + } + + /* Do IO iteration times, collecting statistics each time */ + for (i = 0; i < parms.num_iters; ++i) { + double t; + res = do_sio(parms); + + /* gather all of the "sys write" times */ + t = get_time(res.timers, HDF5_MPI_WRITE); + get_minmax(&write_sys_mm, t); + + write_sys_mm_table[i] = write_sys_mm; + + /* gather all of the "write" times */ + t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); + get_minmax(&write_mm, t); + + write_mm_table[i] = write_mm; + + /* gather all of the "write" times from open to close */ + t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS); + get_minmax(&write_gross_mm, t); + + write_gross_mm_table[i] = write_gross_mm; + + /* gather all of the raw "write" times */ + t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS); + get_minmax(&write_raw_mm, t); + + write_raw_mm_table[i] = write_raw_mm; + + if (!parms.h5_write_only) { + /* gather all of the "mpi read" times */ + t = get_time(res.timers, HDF5_MPI_READ); + get_minmax(&read_sys_mm, t); + + read_sys_mm_table[i] = read_sys_mm; + + /* gather all of the "read" times */ + t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS); + get_minmax(&read_mm, t); + + read_mm_table[i] = read_mm; + + /* gather all of the "read" times from open to close */ + t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS); + get_minmax(&read_gross_mm, t); + + read_gross_mm_table[i] = read_gross_mm; + + /* gather all of the raw "read" times */ + t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS); + get_minmax(&read_raw_mm, t); + + read_raw_mm_table[i] = read_gross_mm; + } + sio_time_destroy(res.timers); + } + + /* + * Show various statistics + */ + /* Write statistics */ + /* Print the raw data throughput if desired */ + if (opts->print_raw) { + /* accumulate and output the max, min, and average "raw write" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Raw Data Write details:\n"); + output_all_info(write_raw_mm_table, parms.num_iters, 4); + } + + output_results(opts,"Raw Data Write",write_raw_mm_table,parms.num_iters,raw_size); + } /* end if */ + + /* show sys write statics */ +#if 0 + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("MPI Write details:\n"); + output_all_info(write_sys_mm_table, parms.num_iters, 4); + } +#endif + /* We don't currently output the MPI write results */ + + /* accumulate and output the max, min, and average "write" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Write details:\n"); + output_all_info(write_mm_table, parms.num_iters, 4); + } + + output_results(opts,"Write",write_mm_table,parms.num_iters,raw_size); + + /* accumulate and output the max, min, and average "gross write" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Write Open-Close details:\n"); + output_all_info(write_gross_mm_table, parms.num_iters, 4); + } + + output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size); + + if (!parms.h5_write_only) { + /* Read statistics */ + /* Print the raw data throughput if desired */ + if (opts->print_raw) { + /* accumulate and output the max, min, and average "raw read" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Raw Data Read details:\n"); + output_all_info(read_raw_mm_table, parms.num_iters, 4); + } + + output_results(opts, "Raw Data Read", read_raw_mm_table, + parms.num_iters, raw_size); + } /* end if */ + + /* show mpi read statics */ +#if 0 + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("MPI Read details:\n"); + output_all_info(read_sys_mm_table, parms.num_iters, 4); + } +#endif + /* We don't currently output the MPI read results */ + + /* accumulate and output the max, min, and average "read" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Read details:\n"); + output_all_info(read_mm_table, parms.num_iters, 4); + } + + output_results(opts, "Read", read_mm_table, parms.num_iters, raw_size); + + /* accumulate and output the max, min, and average "gross read" times */ + if (sio_debug_level >= 3) { + /* output all of the times for all iterations */ + print_indent(3); + output_report("Read Open-Close details:\n"); + output_all_info(read_gross_mm_table, parms.num_iters, 4); + } + + output_results(opts, "Read Open-Close", read_gross_mm_table, + parms.num_iters, raw_size); + } + + /* clean up our mess */ + free(write_sys_mm_table); + free(write_mm_table); + free(write_gross_mm_table); + free(write_raw_mm_table); + + if (!parms.h5_write_only) { + free(read_sys_mm_table); + free(read_mm_table); + free(read_gross_mm_table); + free(read_raw_mm_table); + } + + return ret_value; +} + +/* + * Function: output_all_info + * Purpose: + * Return: Nothing + * Programmer: Bill Wendling, 29. January 2002 + * Modifications: + */ +static void +output_all_info(minmax *mm, int count, int indent_level) +{ + int i; + + for (i = 0; i < count; ++i) { + print_indent(indent_level); + output_report("Iteration %d:\n", i + 1); + print_indent(indent_level + 1); + output_report("Minimum Time: %.2fs\n", mm[i].min); + print_indent(indent_level + 1); + output_report("Maximum Time: %.2fs\n", mm[i].max); + } +} + +/* + * Function: get_minmax + * Purpose: Gather all the min, max and total of val. + * Return: Nothing + * Programmer: Bill Wendling, 21. December 2001 + * Modifications: + * Use MPI_Allreduce to do it. -akc, 2002/01/11 + */ + +static void +get_minmax(minmax *mm, double val) +{ + mm->max = val; + mm->min = val; + mm->sum = val; +} + +/* + * Function: accumulate_minmax_stuff + * Purpose: Accumulate the minimum, maximum, and average of the times + * across all processes. + * Return: TOTAL_MM - the total of all of these. + * Programmer: Bill Wendling, 21. December 2001 + * Modifications: + * Changed to use seconds instead of MB/s - QAK, 5/9/02 + */ +static minmax +accumulate_minmax_stuff(minmax *mm, int count) +{ + int i; + minmax total_mm; + + total_mm.sum = 0.0; + total_mm.max = -DBL_MAX; + total_mm.min = DBL_MAX; + total_mm.num = count; + + for (i = 0; i < count; ++i) { + double m = mm[i].max; + + total_mm.sum += m; + + if (m < total_mm.min) + total_mm.min = m; + + if (m > total_mm.max) + total_mm.max = m; + } + + return total_mm; +} + + +/* + * Function: output_results + * Purpose: Print information about the time & bandwidth for a given + * minmax & # of iterations. + * Return: Nothing + * Programmer: Quincey Koziol, 9. May 2002 + * Modifications: + */ +static void +output_results(const struct options *opts, const char *name, minmax *table, + int table_size,off_t data_size) +{ + minmax total_mm; + + total_mm = accumulate_minmax_stuff(table, table_size); + + print_indent(3); + output_report("%s (%d iteration(s)):\n", name,table_size); + + /* Note: The maximum throughput uses the minimum amount of time & vice versa */ + + print_indent(4); + output_report("Maximum Throughput: %6.2f MB/s", MB_PER_SEC(data_size,total_mm.min)); + if(opts->print_times) + output_report(" (%7.3f s)\n", total_mm.min); + else + output_report("\n"); + + print_indent(4); + output_report("Average Throughput: %6.2f MB/s", + MB_PER_SEC(data_size,total_mm.sum / total_mm.num)); + if(opts->print_times) + output_report(" (%7.3f s)\n", (total_mm.sum / total_mm.num)); + else + output_report("\n"); + + print_indent(4); + output_report("Minimum Throughput: %6.2f MB/s", MB_PER_SEC(data_size,total_mm.max)); + if(opts->print_times) + output_report(" (%7.3f s)\n", total_mm.max); + else + output_report("\n"); +} + +/* + * Function: output_report + * Purpose: Print a line of the report. Only do so if I'm the 0 process. + * Return: Nothing + * Programmer: Bill Wendling, 19. December 2001 + * Modifications: + */ +static void +output_report(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(output, fmt, ap); + va_end(ap); +} + +/* + * Function: print_indent + * Purpose: Print spaces to indent a new line of text for pretty printing + * things. + * Return: Nothing + * Programmer: Bill Wendling, 29. October 2001 + * Modifications: + */ +static void +print_indent(register int indent) +{ + indent *= TAB_SPACE; + + for (; indent > 0; --indent) + fputc(' ', output); +} + +static void +recover_size_and_print(long_long val, const char *end) +{ + if (val >= ONE_KB && (val % ONE_KB) == 0) { + if (val >= ONE_MB && (val % ONE_MB) == 0) { + if (val >= ONE_GB && (val % ONE_GB) == 0) + HDfprintf(output, "%HdGB%s", val / ONE_GB, end); + else + HDfprintf(output, "%HdMB%s", val / ONE_MB, end); + } else { + HDfprintf(output, "%HdKB%s", val / ONE_KB, end); + } + } else { + HDfprintf(output, "%Hd%s", val, end); + } +} + +static void +print_io_api(long io_types) +{ + if (io_types & SIO_POSIX) + HDfprintf(output, "posix "); + if (io_types & SIO_HDF5) + HDfprintf(output, "hdf5 "); + HDfprintf(output, "\n"); +} + +static void +report_parameters(struct options *opts) +{ + int i, rank; + rank = opts->dset_rank; + + print_version("HDF5 Library"); /* print library version */ + HDfprintf(output, "==== Parameters ====\n"); + + HDfprintf(output, "IO API="); + print_io_api(opts->io_types); + + HDfprintf(output, "Number of iterations=%Hd\n", + (long_long)opts->num_iters); + + HDfprintf(output, "Dataset size="); + + for (i=0; idset_size[i], " "); + HDfprintf(output, "\n"); + + + HDfprintf(output, "Transfer buffer size="); + for (i=0; ibuf_size[i], " "); + HDfprintf(output, "\n"); + + HDfprintf(output, "Dimension access order="); + for (i=0; iorder[i], " "); + HDfprintf(output, "\n"); + + if (opts->io_types & SIO_HDF5) { + + HDfprintf(output, "HDF5 data storage method="); + + if (opts->h5_use_chunks){ + + HDfprintf(output, "Chunked\n"); + HDfprintf(output, "HDF5 chunk size="); + for (i=0; ichk_size[i], " "); + HDfprintf(output, "\n"); + + HDfprintf(output, "HDF5 dataset dimensions="); + if (opts->h5_extendable) { + HDfprintf(output, "Extendable\n"); + } + else { + HDfprintf(output, "Fixed\n"); + } + } + else { + HDfprintf(output, "Contiguous\n"); + } + + HDfprintf(output, "HDF5 file driver="); + if (opts->vfd==sec2) { + HDfprintf(output, "sec2\n"); + } else if (opts->vfd==stdio) { + HDfprintf(output, "stdio\n"); + } else if (opts->vfd==core) { + HDfprintf(output, "core\n"); + } else if (opts->vfd==split) { + HDfprintf(output, "split\n"); + } else if (opts->vfd==multi) { + HDfprintf(output, "multi\n"); + } else if (opts->vfd==family) { + HDfprintf(output, "family\n"); + } else if (opts->vfd==direct) { + HDfprintf(output, "direct\n"); + } + } + HDfprintf(output, "==== End of Parameters ====\n"); + HDfprintf(output, "\n"); +} + +/* + * Function: parse_command_line + * Purpose: Parse the command line options and return a STRUCT OPTIONS + * structure which will need to be freed by the calling function. + * Return: Pointer to an OPTIONS structure + * Programmer: Bill Wendling, 31. October 2001 + * Modifications: + * Added 2D testing (Christian Chilan, 10. August 2005) + */ +static struct options * +parse_command_line(int argc, char *argv[]) +{ + register int opt; + struct options *cl_opts; + int i, default_rank, actual_rank, ranks[4]; + cl_opts = (struct options *)malloc(sizeof(struct options)); + + cl_opts->output_file = NULL; + cl_opts->io_types = 0; /* will set default after parsing options */ + cl_opts->num_iters = 1; + + default_rank = 2; + + cl_opts->dset_rank = 0; + cl_opts->buf_rank = 0; + cl_opts->chk_rank = 0; + cl_opts->order_rank = 0; + + for (i=0; ibuf_size[i]=(i+1)*10; + cl_opts->dset_size[i]=(i+1)*100; + cl_opts->chk_size[i]=(i+1)*10; + cl_opts->order[i]=i+1; + } + + cl_opts->vfd = sec2; + + cl_opts->print_times = FALSE; /* Printing times is off by default */ + cl_opts->print_raw = FALSE; /* Printing raw data throughput is off by default */ + cl_opts->h5_alignment = 1; /* No alignment for HDF5 objects by default */ + cl_opts->h5_threshold = 1; /* No threshold for aligning HDF5 objects by default */ + cl_opts->h5_use_chunks = FALSE; /* Don't chunk the HDF5 dataset by default */ + cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ + cl_opts->h5_extendable = FALSE; /* Use extendable dataset */ + cl_opts->h5_use_mpi_posix = FALSE; /* Don't use MPI-posix VFD for HDF5 I/O by default */ + cl_opts->verify = FALSE; /* No Verify data correctness by default */ + + while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + switch ((char)opt) { + case 'a': + cl_opts->h5_alignment = parse_size_directive(opt_arg); + break; + case 'A': + { + const char *end = opt_arg; + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + if (!strcasecmp(buf, "hdf5")) { + cl_opts->io_types |= SIO_HDF5; + } else if (!strcasecmp(buf, "posix")) { + cl_opts->io_types |= SIO_POSIX; + } else { + fprintf(stderr, "sio_perf: invalid --api option %s\n", + buf); + exit(EXIT_FAILURE); + } + + if (*end == '\0') + break; + + end++; + } + } + + break; +#if 0 + case 'b': + /* the future "binary" option */ + break; +#endif /* 0 */ + case 'c': + /* Turn on chunked HDF5 dataset creation */ + cl_opts->h5_use_chunks = 1; + { + const char *end = opt_arg; + int j = 0; + + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + cl_opts->chk_size[j] = parse_size_directive(buf); + + j++; + + if (*end == '\0') + break; + + end++; + } + cl_opts->chk_rank = j; + } + + break; + + + case 'D': + { + const char *end = opt_arg; + + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + if (strlen(buf) > 1 || isdigit(buf[0])) { + size_t j; + + for (j = 0; j < 10 && buf[j] != '\0'; ++j) + if (!isdigit(buf[j])) { + fprintf(stderr, "sio_perf: invalid --debug option %s\n", + buf); + exit(EXIT_FAILURE); + } + + sio_debug_level = atoi(buf); + + if (sio_debug_level > 4) + sio_debug_level = 4; + else if (sio_debug_level < 0) + sio_debug_level = 0; + } else { + switch (*buf) { + case 'r': + /* Turn on raw data throughput info */ + cl_opts->print_raw = TRUE; + break; + case 't': + /* Turn on time printing */ + cl_opts->print_times = TRUE; + break; + case 'v': + /* Turn on verify data correctness*/ + cl_opts->verify = TRUE; + break; + default: + fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); + exit(EXIT_FAILURE); + } + } + + if (*end == '\0') + break; + + end++; + } + } + + break; + case 'e': + { + const char *end = opt_arg; + int j = 0; + + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + cl_opts->dset_size[j] = parse_size_directive(buf); + + j++; + + if (*end == '\0') + break; + + end++; + } + cl_opts->dset_rank = j; + } + + break; + + case 'i': + cl_opts->num_iters = atoi(opt_arg); + break; + case 'm': + /* Turn on MPI-posix VFL driver for HDF5 I/O */ + cl_opts->h5_use_mpi_posix = TRUE; + break; + case 'o': + cl_opts->output_file = opt_arg; + break; + case 'T': + cl_opts->h5_threshold = parse_size_directive(opt_arg); + break; + case 'v': + if (!strcasecmp(opt_arg, "sec2")) { + cl_opts->vfd=sec2; + } else if (!strcasecmp(opt_arg, "stdio")) { + cl_opts->vfd=stdio; + } else if (!strcasecmp(opt_arg, "core")) { + cl_opts->vfd=core; + } else if (!strcasecmp(opt_arg, "split")) { + cl_opts->vfd=split; + } else if (!strcasecmp(opt_arg, "multi")) { + cl_opts->vfd=multi; + } else if (!strcasecmp(opt_arg, "family")) { + cl_opts->vfd=family; + } else if (!strcasecmp(opt_arg, "direct")) { + cl_opts->vfd=direct; + } else { + fprintf(stderr, "sio_perf: invalid --api option %s\n", + opt_arg); + exit(EXIT_FAILURE); + } + break; + case 'w': + cl_opts->h5_write_only = TRUE; + break; + case 't': + cl_opts->h5_extendable = TRUE; + break; + case 'x': + { + const char *end = opt_arg; + int j = 0; + + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + cl_opts->buf_size[j] = parse_size_directive(buf); + + j++; + + if (*end == '\0') + break; + + end++; + } + cl_opts->buf_rank = j; + } + + break; + + case 'r': + { + const char *end = opt_arg; + int j = 0; + + while (end && *end != '\0') { + char buf[10]; + int i; + + memset(buf, '\0', sizeof(buf)); + + for (i = 0; *end != '\0' && *end != ','; ++end) + if (isalnum(*end) && i < 10) + buf[i++] = *end; + + cl_opts->order[j] = parse_size_directive(buf); + + j++; + + if (*end == '\0') + break; + + end++; + } + + cl_opts->order_rank = j; + } + + break; + + case 'h': + case '?': + default: + usage(progname); + free(cl_opts); + return NULL; + } + } + + /* perform rank consistency analysis */ + actual_rank = 0; + + ranks[0] = cl_opts->dset_rank; + ranks[1] = cl_opts->buf_rank; + ranks[2] = cl_opts->order_rank; + ranks[3] = cl_opts->chk_rank; + + for (i=0; i<4; i++) { + if (ranks[i]>0) { + if (!actual_rank) { + actual_rank = ranks[i]; + } + else { + if (actual_rank != ranks[i]) + exit(EXIT_FAILURE); + } + } + } + + if (!actual_rank) + actual_rank = default_rank; + + cl_opts->dset_rank = actual_rank; + cl_opts->buf_rank = actual_rank; + cl_opts->order_rank = actual_rank; + cl_opts->chk_rank = actual_rank; + + + /* set default if none specified yet */ + if (!cl_opts->io_types) + cl_opts->io_types = SIO_HDF5 | SIO_POSIX; /* run all API */ + + /* verify parameters sanity. Adjust if needed. */ + /* cap xfer_size with bytes per process */ + if (cl_opts->num_iters <= 0) + cl_opts->num_iters = 1; + + return cl_opts; +} + +/* + * Function: parse_size_directive + * Purpose: Parse the size directive passed on the commandline. The size + * directive is an integer followed by a size indicator: + * + * K, k - Kilobyte + * M, m - Megabyte + * G, g - Gigabyte + * + * Return: The size as a off_t because this is related to file size. + * If an unknown size indicator is used, then the program will + * exit with EXIT_FAILURE as the return value. + * Programmer: Bill Wendling, 18. December 2001 + * Modifications: + */ + +static off_t +parse_size_directive(const char *size) +{ + off_t s; + char *endptr; + + s = strtol(size, &endptr, 10); + + if (endptr && *endptr) { + while (*endptr != '\0' && (*endptr == ' ' || *endptr == '\t')) + ++endptr; + + switch (*endptr) { + case 'K': + case 'k': + s *= ONE_KB; + break; + case 'M': + case 'm': + s *= ONE_MB; + break; + case 'G': + case 'g': + s *= ONE_GB; + break; + default: + fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); + exit(EXIT_FAILURE); + } + } + + return s; +} + +/* + * Function: usage + * Purpose: Print a usage message and then exit. + * Return: Nothing + * Programmer: Bill Wendling, 31. October 2001 + * Modifications: + * Added 2D testing (Christian Chilan, 10. August 2005) + */ +static void +usage(const char *prog) +{ + + + print_version(prog); + printf("usage: %s [OPTIONS]\n", prog); + printf(" OPTIONS\n"); + printf(" -h, --help Print a usage message and exit\n"); + printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n"); + printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n"); +#if 0 + printf(" -b, --binary The elusive binary option\n"); +#endif /* 0 */ + printf(" -B S, --block-size=S Block size within transfer buffer\n"); + printf(" (see below for description)\n"); + printf(" [default: half the number of bytes per processor per dataset]\n"); + printf(" -c, --chunk Create HDF5 datasets chunked [default: off]\n"); + printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n"); + printf(" [default: off (i.e. independent I/O)]\n"); + printf(" -d N, --num-dsets=N Number of datasets per file [default:1]\n"); + printf(" -D DL, --debug=DL Indicate the debugging level\n"); + printf(" [default: no debugging]\n"); + printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n"); + printf(" [default: 256K for 1D, 8K for 2D]\n"); + printf(" -F N, --num-files=N Number of files [default: 1]\n"); + printf(" -g, --geometry Use 2D geometry [default: 1D]\n"); + printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n"); + printf(" -I, --interleaved Interleaved block I/O (see below for example)\n"); + printf(" [default: Contiguous block I/O]\n"); + printf(" -m, --mpi-posix Use MPI-posix driver for HDF5 I/O\n"); + printf(" [default: use MPI-I/O driver]\n"); + printf(" -o F, --output=F Output raw data into file F [default: none]\n"); + printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); + printf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); + printf(" [default: all MPI_COMM_WORLD processes ]\n"); + printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n"); + printf(" [default: 1]\n"); + printf(" -w, --write-only Perform write tests not the read tests\n"); + printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n"); + printf(" [default: half the number of bytes per processor per dataset]\n"); + printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n"); + printf(" [default: the number of bytes per processor per dataset]\n"); + printf("\n"); + printf(" F - is a filename.\n"); + printf(" N - is an integer >=0.\n"); + printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n"); + printf(" K - Kilobyte (%d)\n", ONE_KB); + printf(" M - Megabyte (%d)\n", ONE_MB); + printf(" G - Gigabyte (%d)\n", ONE_GB); + printf("\n"); + printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB); + printf("\n"); + printf(" AL - is an API list. Valid values are:\n"); + printf(" phdf5 - Parallel HDF5\n"); + printf(" mpiio - MPI-I/O\n"); + printf(" posix - POSIX\n"); + printf("\n"); + printf(" Example: --api=mpiio,phdf5\n"); + printf("\n"); + printf(" Block size vs. Transfer buffer size:\n"); + printf(" The transfer buffer size is the size of a buffer in memory, which is\n"); + printf(" broken into 'block size' pieces and written to the file. The pattern\n"); + printf(" of the blocks in the file is described below in the 'Interleaved vs.\n"); + printf(" Contiguous blocks' example.\n"); + printf("\n"); + printf(" If the collective I/O option is given, the blocks in each transfer buffer\n"); + printf(" are written at once with an MPI derived type, for the MPI-I/O and PHDF5\n"); + printf(" APIs.\n"); + printf("\n"); + printf(" Interleaved vs. Contiguous blocks:\n"); + printf(" When contiguous blocks are written to a dataset, the dataset is divided\n"); + printf(" into '# processes' regions and each process writes data to its own region.\n"); + printf(" When interleaved blocks are written to a dataset, space for the first\n"); + printf(" block of the first process is allocated in the dataset, then space is\n"); + printf(" allocated for the first block of the second process, etc. until space is\n"); + printf(" allocated for the first block of each process, then space is allocated for\n"); + printf(" the second block of the first process, the second block of the second\n"); + printf(" process, etc.\n"); + printf("\n"); + printf(" For example, with a 4 process run, 1MB bytes-per-process, 256KB transfer\n"); + printf(" buffer size, and 64KB block size,\n"); + printf(" 16 contiguous blocks per process are written to the file like so:\n"); + printf(" 1111111111111111222222222222222233333333333333334444444444444444\n"); + printf(" 16 interleaved blocks per process are written to the file like so:\n"); + printf(" 1234123412341234123412341234123412341234123412341234123412341234\n"); + printf(" If collective I/O is turned on, all of the four blocks per transfer\n"); + printf(" buffer will be written in one collective I/O call.\n"); + printf("\n"); + printf(" DL - is a list of debugging flags. Valid values are:\n"); + printf(" 1 - Minimal\n"); + printf(" 2 - Not quite everything\n"); + printf(" 3 - Everything\n"); + printf(" 4 - The kitchen sink\n"); + printf(" r - Raw data I/O throughput information\n"); + printf(" t - Times as well as throughputs\n"); + printf(" v - Verify data correctness\n"); + printf("\n"); + printf(" Example: --debug=2,r,t\n"); + printf("\n"); + printf(" Environment variables:\n"); + printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); + printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n"); + printf(" HDF5_PARAPREFIX Paralllel data files prefix\n"); + fflush(stdout); +} + diff --git a/perform/sio_perf.h b/perform/sio_perf.h new file mode 100644 index 0000000..b038661 --- /dev/null +++ b/perform/sio_perf.h @@ -0,0 +1,105 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef SIO_PERF_H__ +#define SIO_PERF_H__ + +#include "sio_timer.h" +#ifndef STANDALONE +#include "H5private.h" +#include "h5test.h" +#include "h5tools_utils.h" +#else +#include "sio_standalone.h" +#endif + +/* setup the dataset no fill option if this is v1.5 or more */ +#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4 +#define H5_HAVE_NOFILL 1 +#endif + +#define MAX_DIMS 32 + +typedef enum iotype_ { + POSIXIO, + HDF5 + /*NUM_TYPES*/ +} iotype; + +typedef enum vfdtype_ { + sec2, + stdio, + core, + split, + multi, + family, + direct + /*NUM_TYPES*/ +} vfdtype; + +typedef struct parameters_ { + iotype io_type; /* The type of IO test to perform */ + vfdtype vfd; + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ + int num_iters; /* Number of times to loop doing the IO */ + int rank; /* Rank of dataset */ + off_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Buffer size */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_extendable; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */ + int verify; /* Verify data correctness */ +} parameters; + +typedef struct results_ { + herr_t ret_code; + sio_time *timers; +} results; + +#ifndef SUCCESS +#define SUCCESS 0 +#endif /* !SUCCESS */ + +#ifndef FAIL +#define FAIL -1 +#endif /* !FAIL */ + +extern FILE *output; /* output file */ +extern sio_time *timer_g; /* timer: global for stub functions */ +extern int sio_debug_level; /* The debug level: + * 0 - Off + * 1 - Minimal + * 2 - Some more + * 3 - Maximal + * 4 - Even More Debugging (timer stuff) + */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +extern results do_sio(parameters param); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* PIO_PERF_H__ */ diff --git a/perform/sio_standalone.c b/perform/sio_standalone.c new file mode 100644 index 0000000..8a93541 --- /dev/null +++ b/perform/sio_standalone.c @@ -0,0 +1,286 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +/* This file contains the definition of functions required to build h5perf in + * STANDALONE mode. + * Created: Christian Chilan, 2005/5/18. + */ + +#include "sio_perf.h" + + +/** From h5tools_utils.c **/ + +/* global variables */ +int nCols = 80; + +/* ``get_option'' variables */ +int opt_err = 1; /*get_option prints errors if this is on */ +int opt_ind = 1; /*token pointer */ +const char *opt_arg; /*flag argument (or value) */ + + +int +get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) +{ + static int sp = 1; /* character index in current token */ + int opt_opt = '?'; /* option character passed back to user */ + + if (sp == 1) { + /* check for more flag-like tokens */ + if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { + return EOF; + } else if (HDstrcmp(argv[opt_ind], "--") == 0) { + opt_ind++; + return EOF; + } + } + + if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { + /* long command line option */ + const char *arg = &argv[opt_ind][2]; + int i; + + for (i = 0; l_opts && l_opts[i].name; i++) { + size_t len = HDstrlen(l_opts[i].name); + + if (HDstrncmp(arg, l_opts[i].name, len) == 0) { + /* we've found a matching long command line flag */ + opt_opt = l_opts[i].shortval; + + if (l_opts[i].has_arg != no_arg) { + if (arg[len] == '=') { + opt_arg = &arg[len + 1]; + } else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { + opt_arg = argv[++opt_ind]; + } else if (l_opts[i].has_arg == require_arg) { + if (opt_err) + HDfprintf(stderr, + "%s: option required for \"--%s\" flag\n", + argv[0], arg); + + opt_opt = '?'; + } + } else { + if (arg[len] == '=') { + if (opt_err) + HDfprintf(stderr, + "%s: no option required for \"%s\" flag\n", + argv[0], arg); + + opt_opt = '?'; + } + + opt_arg = NULL; + } + + break; + } + } + + if (l_opts[i].name == NULL) { + /* exhausted all of the l_opts we have and still didn't match */ + if (opt_err) + HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); + + opt_opt = '?'; + } + + opt_ind++; + sp = 1; + } else { + register char *cp; /* pointer into current token */ + + /* short command line option */ + opt_opt = argv[opt_ind][sp]; + + if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { + + if (opt_err) + HDfprintf(stderr, "%s: unknown option \"%c\"\n", + argv[0], opt_opt); + + /* if no chars left in this token, move to next token */ + if (argv[opt_ind][++sp] == '\0') { + opt_ind++; + sp = 1; + } + + return '?'; + } + + if (*++cp == ':') { + /* if a value is expected, get it */ + if (argv[opt_ind][sp + 1] != '\0') { + /* flag value is rest of current token */ + opt_arg = &argv[opt_ind++][sp + 1]; + } else if (++opt_ind >= argc) { + if (opt_err) + HDfprintf(stderr, + "%s: value expected for option \"%c\"\n", + argv[0], opt_opt); + + opt_opt = '?'; + } else { + /* flag value is next token */ + opt_arg = argv[opt_ind++]; + } + + sp = 1; + } else { + /* set up to look at next char in token, next time */ + if (argv[opt_ind][++sp] == '\0') { + /* no more in current token, so setup next token */ + opt_ind++; + sp = 1; + } + + opt_arg = NULL; + } + } + + /* return the current flag character found */ + return opt_opt; +} + + +void +print_version(const char *progname) +{ + printf("%s: Version %u.%u.%u%s%s\n", + progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, + H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE); +} + + + +/** From h5test.c **/ + +#ifdef H5_HAVE_PARALLEL +MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ +#endif + +#if 0 +int +h5_set_info_object(void) +{ + char *envp; /* environment pointer */ + int ret_value=0; + + /* handle any MPI INFO hints via $HDF5_MPI_INFO */ + if ((envp = getenv("HDF5_MPI_INFO")) != NULL){ + char *next, *valp; + + + valp = envp = next = HDstrdup(envp); + + /* create an INFO object if not created yet */ + if (h5_io_info_g == MPI_INFO_NULL) + MPI_Info_create(&h5_io_info_g); + + do { + size_t len; + char *key_val, *endp, *namep; + + if (*valp == ';') + valp++; + + /* copy key/value pair into temporary buffer */ + len = strcspn(valp, ";"); + next = &valp[len]; + key_val = calloc(1, len + 1); + + /* increment the next pointer past the terminating semicolon */ + if (*next == ';') + ++next; + + namep = HDstrncpy(key_val, valp, len); + + /* pass up any beginning whitespaces */ + while (*namep && (*namep == ' ' || *namep == '\t')) + namep++; + + /* eat up any ending white spaces */ + endp = &namep[strlen(namep) - 1]; + + while (endp && (*endp == ' ' || *endp == '\t')) + *endp-- = '\0'; + + /* find the '=' */ + + valp = HDstrchr(namep, '='); + + if (valp != NULL) { /* it's a valid key/value pairing */ + char *tmp_val = valp + 1; + + /* change '=' to \0, move valp down one */ + *valp-- = '\0'; + + /* eat up ending whitespace on the "key" part */ + while (*valp == ' ' || *valp == '\t') + *valp-- = '\0'; + + valp = tmp_val; + + /* eat up beginning whitespace on the "value" part */ + while (*valp == ' ' || *valp == '\t') + *valp++ = '\0'; + + /* actually set the darned thing */ + if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) { + printf("MPI_Info_set failed\n"); + ret_value = -1; + } + } + + valp = next; + HDfree(key_val); + } while (next && *next); + + HDfree(envp); + } + + return ret_value; +} + + +void +h5_dump_info_object(MPI_Info info) +{ + char key[MPI_MAX_INFO_KEY+1]; + char value[MPI_MAX_INFO_VAL+1]; + int flag; + int i, nkeys; + + printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info, + MPI_MAX_INFO_VAL); + if (info==MPI_INFO_NULL){ + printf("object is MPI_INFO_NULL\n"); + } + else { + MPI_Info_get_nkeys(info, &nkeys); + printf("object has %d items\n", nkeys); + for (i=0; i +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +/* maximum of two, three, or four values */ +#undef MAX +#define MAX(a,b) (((a)>(b)) ? (a) : (b)) +#define MAX2(a,b) MAX(a,b) +#define MAX3(a,b,c) MAX(a,MAX(b,c)) +#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) + +/* + * A macro to portably increment enumerated types. + */ +#ifndef H5_INC_ENUM +# define H5_INC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)+1)) +#endif + +/* + * Redefine all the POSIX functions. We should never see a POSIX + * function (or any other non-HDF5 function) in the source! + */ +#define HDabort() abort() +#define HDabs(X) abs(X) +#define HDaccess(F,M) access(F, M) +#define HDacos(X) acos(X) +#ifdef H5_HAVE_ALARM +#define HDalarm(N) alarm(N) +#else /* H5_HAVE_ALARM */ +#define HDalarm(N) (0) +#endif /* H5_HAVE_ALARM */ +#define HDasctime(T) asctime(T) +#define HDasin(X) asin(X) +#define HDassert(X) assert(X) +#define HDatan(X) atan(X) +#define HDatan2(X,Y) atan2(X,Y) +#define HDatexit(F) atexit(F) +#define HDatof(S) atof(S) +#define HDatoi(S) atoi(S) +#define HDatol(S) atol(S) +#define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P) +#define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F) +#define HDcalloc(N,Z) calloc(N,Z) +#define HDceil(X) ceil(X) +#define HDcfgetispeed(T) cfgetispeed(T) +#define HDcfgetospeed(T) cfgetospeed(T) +#define HDcfsetispeed(T,S) cfsetispeed(T,S) +#define HDcfsetospeed(T,S) cfsetospeed(T,S) +#define HDchdir(S) chdir(S) +#define HDchmod(S,M) chmod(S,M) +#define HDchown(S,O,G) chown(S,O,G) +#define HDclearerr(F) clearerr(F) +#define HDclock() clock() +#define HDclose(F) close(F) +#define HDclosedir(D) closedir(D) +#define HDcos(X) cos(X) +#define HDcosh(X) cosh(X) +#define HDcreat(S,M) creat(S,M) +#define HDctermid(S) ctermid(S) +#define HDctime(T) ctime(T) +#define HDcuserid(S) cuserid(S) +#ifdef H5_HAVE_DIFFTIME +#define HDdifftime(X,Y) difftime(X,Y) +#else +#define HDdifftime(X,Y) ((double)(X)-(double)(Y)) +#endif +#define HDdiv(X,Y) div(X,Y) +#define HDdup(F) dup(F) +#define HDdup2(F,I) dup2(F,I) +/* execl() variable arguments */ +/* execle() variable arguments */ +/* execlp() variable arguments */ +#define HDexecv(S,AV) execv(S,AV) +#define HDexecve(S,AV,E) execve(S,AV,E) +#define HDexecvp(S,AV) execvp(S,AV) +#define HDexit(N) exit(N) +#if defined __MWERKS__ +#include +#define HD_exit(N) __exit(N) +#else /* __MWERKS __ */ +#define HD_exit(N) _exit(N) +#endif /* __MWERKS __ */ +#define HDexp(X) exp(X) +#define HDfabs(X) fabs(X) +/* use ABS() because fabsf() fabsl() are not common yet. */ +#define HDfabsf(X) ABS(X) +#define HDfabsl(X) ABS(X) +#define HDfclose(F) fclose(F) +/* fcntl() variable arguments */ +#define HDfdopen(N,S) fdopen(N,S) +#define HDfeof(F) feof(F) +#define HDferror(F) ferror(F) +#define HDfflush(F) fflush(F) +#define HDfgetc(F) fgetc(F) +#define HDfgetpos(F,P) fgetpos(F,P) +#define HDfgets(S,N,F) fgets(S,N,F) +#ifdef _WIN32 +#define HDfileno(F) _fileno(F) +#else /* _WIN32 */ +#define HDfileno(F) fileno(F) +#endif /* _WIN32 */ +#define HDfloor(X) floor(X) +#define HDfmod(X,Y) fmod(X,Y) +#define HDfopen(S,M) fopen(S,M) +#define HDfork() fork() +#define HDfpathconf(F,N) fpathconf(F,N) +H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); +#define HDfputc(C,F) fputc(C,F) +#define HDfputs(S,F) fputs(S,F) +#define HDfread(M,Z,N,F) fread(M,Z,N,F) +#define HDfree(M) free(M) +#define HDfreopen(S,M,F) freopen(S,M,F) +#define HDfrexp(X,N) frexp(X,N) +/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */ +#ifdef H5_HAVE_FREXPF +#define HDfrexpf(X,N) frexpf(X,N) +#else /* H5_HAVE_FREXPF */ +#define HDfrexpf(X,N) frexp(X,N) +#endif /* H5_HAVE_FREXPF */ +#ifdef H5_HAVE_FREXPL +#define HDfrexpl(X,N) frexpl(X,N) +#else /* H5_HAVE_FREXPL */ +#define HDfrexpl(X,N) frexp(X,N) +#endif /* H5_HAVE_FREXPL */ +/* fscanf() variable arguments */ +#ifdef H5_HAVE_FSEEKO + #define HDfseek(F,O,W) fseeko(F,O,W) +#else + #define HDfseek(F,O,W) fseek(F,O,W) +#endif +#define HDfsetpos(F,P) fsetpos(F,P) +/* definitions related to the file stat utilities. + * Windows have its own function names. + * For Unix, if off_t is not 64bit big, try use the pseudo-standard + * xxx64 versions if available. + */ +#ifdef _WIN32 + #ifdef __MWERKS__ + #define HDfstat(F,B) fstat(F,B) + #define HDstat(S,B) stat(S,B) + typedef struct stat h5_stat_t; + typedef off_t h5_stat_size_t; + #else /*MSVC*/ + #define HDfstat(F,B) _fstati64(F,B) + #define HDstat(S,B) _stati64(S,B) + typedef struct _stati64 h5_stat_t; + typedef __int64 h5_stat_size_t; + #endif +#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64) + #define HDfstat(F,B) fstat64(F,B) + #define HDstat(S,B) stat64(S,B) + typedef struct stat64 h5_stat_t; + typedef off64_t h5_stat_size_t; +#else + #define HDfstat(F,B) fstat(F,B) + #define HDstat(S,B) stat(S,B) + typedef struct stat h5_stat_t; + typedef off_t h5_stat_size_t; +#endif + +#define HDftell(F) ftell(F) +#define HDftruncate(F,L) ftruncate(F,L) +#define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) +#define HDgetc(F) getc(F) +#define HDgetchar() getchar() +#define HDgetcwd(S,Z) getcwd(S,Z) +#define HDgetegid() getegid() +#define HDgetenv(S) getenv(S) +#define HDgeteuid() geteuid() +#define HDgetgid() getgid() +#define HDgetgrgid(G) getgrgid(G) +#define HDgetgrnam(S) getgrnam(S) +#define HDgetgroups(Z,G) getgroups(Z,G) +#define HDgetlogin() getlogin() +#define HDgetpgrp() getpgrp() +#define HDgetpid() getpid() +#define HDgetppid() getppid() +#define HDgetpwnam(S) getpwnam(S) +#define HDgetpwuid(U) getpwuid(U) +#define HDgetrusage(X,S) getrusage(X,S) +#define HDgets(S) gets(S) +#define HDgettimeofday(S,P) gettimeofday(S,P) +#define HDgetuid() getuid() +#define HDgmtime(T) gmtime(T) +#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ +#define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ +#define HDisatty(F) isatty(F) +#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ +#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ +#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ +#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ +#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ +#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ +#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ +#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ +#define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ +#define HDkill(P,S) kill(P,S) +#define HDlabs(X) labs(X) +#define HDldexp(X,N) ldexp(X,N) +#define HDldiv(X,Y) ldiv(X,Y) +#define HDlink(OLD,NEW) link(OLD,NEW) +#define HDlocaleconv() localeconv() +#define HDlocaltime(T) localtime(T) +#define HDlog(X) log(X) +#define HDlog10(X) log10(X) +#define HDlongjmp(J,N) longjmp(J,N) +#ifdef _WIN32 + #ifdef __MWERKS__ + #define HDlseek(F,O,W) lseek(F,O,W) + #else /*MSVS */ + #define HDlseek(F,O,W) _lseeki64(F,O,W) + #endif +#else + #ifdef H5_HAVE_FSEEK64 + #define HDlseek(F,O,W) lseek64(F,O,W) + #else + #define HDlseek(F,O,W) lseek(F,O,W) + #endif +#endif +#define HDmalloc(Z) malloc(Z) +#define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z) +#define HDmblen(S,N) mblen(S,N) +#define HDmbstowcs(P,S,Z) mbstowcs(P,S,Z) +#define HDmbtowc(P,S,Z) mbtowc(P,S,Z) +#define HDmemchr(S,C,Z) memchr(S,C,Z) +#define HDmemcmp(X,Y,Z) memcmp(X,Y,Z) +/* + * The (char*) casts are required for the DEC when optimizations are turned + * on and the source and/or destination are not aligned. + */ +#define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) +#define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) +/* + * The (void*) cast just avoids a compiler warning in _WIN32 + */ +#ifdef _WIN32 +#define HDmemset(X,C,Z) memset((void*)(X),C,Z) +#else /* _WIN32 */ +#define HDmemset(X,C,Z) memset(X,C,Z) +#endif /* _WIN32 */ +#ifdef _WIN32 +#define HDmkdir(S,M) _mkdir(S) +#else /* _WIN32 */ +#define HDmkdir(S,M) mkdir(S,M) +#endif /* _WIN32 */ +#define HDmkfifo(S,M) mkfifo(S,M) +#define HDmktime(T) mktime(T) +#define HDmodf(X,Y) modf(X,Y) +#ifdef _O_BINARY +#define HDopen(S,F,M) open(S,F|_O_BINARY,M) +#else +#define HDopen(S,F,M) open(S,F,M) +#endif +#define HDopendir(S) opendir(S) +#define HDpathconf(S,N) pathconf(S,N) +#define HDpause() pause() +#define HDperror(S) perror(S) +#define HDpipe(F) pipe(F) +#define HDpow(X,Y) pow(X,Y) +/* printf() variable arguments */ +#define HDputc(C,F) putc(C,F) +#define HDputchar(C) putchar(C) +#define HDputs(S) puts(S) +#define HDqsort(M,N,Z,F) qsort(M,N,Z,F) +#define HDraise(N) raise(N) + +#ifdef H5_HAVE_RAND_R +#define HDrandom() HDrand() +H5_DLL int HDrand(void); +#elif H5_HAVE_RANDOM +#define HDrand() random() +#define HDrandom() random() +#else +#define HDrand() rand() +#define HDrandom() rand() +#endif + +#define HDread(F,M,Z) read(F,M,Z) +#define HDreaddir(D) readdir(D) +#define HDrealloc(M,Z) realloc(M,Z) +#ifdef H5_VMS +#ifdef __cplusplus +extern "C" { +#endif +int HDremove_all(const char * fname); +#ifdef __cplusplus +} +#endif +#define HDremove(S) HDremove_all(S) +#else +#define HDremove(S) remove(S) +#endif /*H5_VMS*/ +#define HDrename(OLD,NEW) rename(OLD,NEW) +#define HDrewind(F) rewind(F) +#define HDrewinddir(D) rewinddir(D) +#define HDrmdir(S) rmdir(S) +/* scanf() variable arguments */ +#define HDsetbuf(F,S) setbuf(F,S) +#define HDsetgid(G) setgid(G) +#define HDsetjmp(J) setjmp(J) +#define HDsetlocale(N,S) setlocale(N,S) +#define HDsetpgid(P,PG) setpgid(P,PG) +#define HDsetsid() setsid() +#define HDsetuid(U) setuid(U) +/* Windows does not permit setting the buffer size to values + less than 2. */ +#ifndef _WIN32 +#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) +#else +#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) +#endif +#define HDsigaction(N,A) sigaction(N,A) +#define HDsigaddset(S,N) sigaddset(S,N) +#define HDsigdelset(S,N) sigdelset(S,N) +#define HDsigemptyset(S) sigemptyset(S) +#define HDsigfillset(S) sigfillset(S) +#define HDsigismember(S,N) sigismember(S,N) +#define HDsiglongjmp(J,N) siglongjmp(J,N) +#define HDsignal(N,F) signal(N,F) +#define HDsigpending(S) sigpending(S) +#define HDsigprocmask(H,S,O) sigprocmask(H,S,O) +#define HDsigsetjmp(J,N) sigsetjmp(J,N) +#define HDsigsuspend(S) sigsuspend(S) +#define HDsin(X) sin(X) +#define HDsinh(X) sinh(X) +#define HDsleep(N) sleep(N) +#ifdef _WIN32 +#define HDsnprintf _snprintf /*varargs*/ +#else +#define HDsnprintf snprintf /*varargs*/ +#endif +/* sprintf() variable arguments */ +#define HDsqrt(X) sqrt(X) +#ifdef H5_HAVE_RAND_R +H5_DLL void HDsrand(unsigned int seed); +#define HDsrandom(S) HDsrand(S) +#elif H5_HAVE_RANDOM +#define HDsrand(S) srandom(S) +#define HDsrandom(S) srandom(S) +#else +#define HDsrand(S) srand(S) +#define HDsrandom(S) srand(S) +#endif +/* sscanf() variable arguments */ + +#define HDstrcat(X,Y) strcat(X,Y) +#define HDstrchr(S,C) strchr(S,C) +#define HDstrcmp(X,Y) strcmp(X,Y) +#define HDstrcoll(X,Y) strcoll(X,Y) +#define HDstrcpy(X,Y) strcpy(X,Y) +#define HDstrcspn(X,Y) strcspn(X,Y) +#define HDstrerror(N) strerror(N) +#define HDstrftime(S,Z,F,T) strftime(S,Z,F,T) +#define HDstrlen(S) strlen(S) +#define HDstrncat(X,Y,Z) strncat(X,Y,Z) +#define HDstrncmp(X,Y,Z) strncmp(X,Y,Z) +#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) +#define HDstrpbrk(X,Y) strpbrk(X,Y) +#define HDstrrchr(S,C) strrchr(S,C) +#define HDstrspn(X,Y) strspn(X,Y) +#define HDstrstr(X,Y) strstr(X,Y) +#define HDstrtod(S,R) strtod(S,R) +#define HDstrtok(X,Y) strtok(X,Y) +#define HDstrtol(S,R,N) strtol(S,R,N) +H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); +#define HDstrtoul(S,R,N) strtoul(S,R,N) +#define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) +#define HDsysconf(N) sysconf(N) +#define HDsystem(S) system(S) +#define HDtan(X) tan(X) +#define HDtanh(X) tanh(X) +#define HDtcdrain(F) tcdrain(F) +#define HDtcflow(F,A) tcflow(F,A) +#define HDtcflush(F,N) tcflush(F,N) +#define HDtcgetattr(F,T) tcgetattr(F,T) +#define HDtcgetpgrp(F) tcgetpgrp(F) +#define HDtcsendbreak(F,N) tcsendbreak(F,N) +#define HDtcsetattr(F,O,T) tcsetattr(F,O,T) +#define HDtcsetpgrp(F,N) tcsetpgrp(F,N) +#define HDtime(T) time(T) +#define HDtimes(T) times(T) +#define HDtmpfile() tmpfile() +#define HDtmpnam(S) tmpnam(S) +#define HDtolower(C) tolower(C) +#define HDtoupper(C) toupper(C) +#define HDttyname(F) ttyname(F) +#define HDtzset() tzset() +#define HDumask(N) umask(N) +#define HDuname(S) uname(S) +#define HDungetc(C,F) ungetc(C,F) +#ifdef _WIN32 +#define HDunlink(S) _unlink(S) +#else +#define HDunlink(S) unlink(S) +#endif +#define HDutime(S,T) utime(S,T) +#define HDva_arg(A,T) va_arg(A,T) +#define HDva_end(A) va_end(A) +#define HDva_start(A,P) va_start(A,P) +#define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A) +#define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) +#define HDvprintf(FMT,A) vprintf(FMT,A) +#define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A) +#ifdef _WIN32 +# define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A) +#else +# define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A) +#endif +#define HDwait(W) wait(W) +#define HDwaitpid(P,W,O) waitpid(P,W,O) +#define HDwcstombs(S,P,Z) wcstombs(S,P,Z) +#define HDwctomb(S,C) wctomb(S,C) + +#if defined (__MWERKS__) +/* workaround for a bug in the Metrowerks version 6.0 header file for write + which is not defined as const void* + */ +#define HDwrite(F,M,Z) write(F,(void*)M,Z) +#else +#define HDwrite(F,M,Z) write(F,M,Z) +#endif + +/* + * And now for a couple non-Posix functions... Watch out for systems that + * define these in terms of macros. + */ +#ifdef _WIN32 +#define HDstrdup(S) _strdup(S) +#else /* _WIN32 */ + +#if !defined strdup && !defined H5_HAVE_STRDUP +extern char *strdup(const char *s); +#endif + +#define HDstrdup(S) strdup(S) + +#endif /* _WIN32 */ + +/* + * HDF Boolean type. + */ +#ifndef FALSE +# define FALSE 0 +#endif +#ifndef TRUE +# define TRUE 1 +#endif + +/* + * Although `long long' is part of the revised ANSI-C some compilers don't + * support it yet. We define `long_long' as the longest integral integer type + * supported by the compiler, usually 64 bits. It must be legal to qualify + * `long_long' with `unsigned'. + */ +#if H5_SIZEOF_LONG_LONG>0 +# define long_long long long +#elif H5_SIZEOF___INT64>0 +# define long_long __int64 /*Win32*/ +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 +#else +# define long_long long int +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG +#endif + +/** From h5test.h **/ + +#ifdef H5_HAVE_PARALLEL +extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ +#endif + +#ifdef H5_HAVE_PARALLEL +H5TEST_DLL int h5_set_info_object(void); +H5TEST_DLL void h5_dump_info_object(MPI_Info info); +#endif + + + +/** From h5tools_utils.h **/ + +extern int opt_err; /* getoption prints errors if this is on */ +extern int opt_ind; /* token pointer */ +extern const char *opt_arg; /* flag argument (or value) */ + + +enum { + no_arg = 0, /* doesn't take an argument */ + require_arg, /* requires an argument */ + optional_arg /* argument is optional */ +}; + + +typedef struct long_options { + const char *name; /* name of the long option */ + int has_arg; /* whether we should look for an arg */ + char shortval; /* the shortname equivalent of long arg + * this gets returned from get_option */ +} long_options; + +extern int get_option(int argc, const char **argv, const char *opt, + const struct long_options *l_opt); +#endif diff --git a/perform/sio_timer.c b/perform/sio_timer.c new file mode 100644 index 0000000..55031ba --- /dev/null +++ b/perform/sio_timer.c @@ -0,0 +1,198 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: + * + * This is a module of useful timing functions for performance testing. + */ + +#include +#include + +#include "sio_timer.h" + + +#include "sio_perf.h" + +/* + * The number to divide the tv_usec field with to get a nice decimal to add to + * the number of seconds. + */ +#define MICROSECOND 1000000.0 + +/* global variables */ +sio_time *timer_g; /* timer: global for stub functions */ + +/* + * Function: sub_time + * Purpose: Struct two time values, and return the difference, in microseconds + * + * Note that the function assumes that a > b + * Programmer: Leon Arber, 1/27/06 + */ +static double sub_time(struct timeval* a, struct timeval* b) +{ + return (((double)a->tv_sec + + ((double)a->tv_usec) / MICROSECOND) - + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); +} + + +/* + * Function: sio_time_new + * Purpose: Build us a brand, spankin', new performance time object. + * The object is a black box to the user. + * Return: Pointer to sio_time object + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +sio_time * +sio_time_new(void) +{ + sio_time *pt = (sio_time *)calloc(1, sizeof(struct sio_time_)); + + /* set global timer variable */ + timer_g = pt; + + return pt; +} + +/* + * Function: sio_time_destroy + * Purpose: Remove the memory allocated for the sio_time object. Only + * need to call on a pointer allocated with the ``sio_time_new'' + * function. + * Return: Nothing + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +void +sio_time_destroy(sio_time *pt) +{ + free(pt); + /* reset the global timer pointer too. */ + timer_g = NULL; +} + + + +/* + * Function: set_time + * Purpose: Set the time in a ``sio_time'' object. + * Return: Pointer to the passed in ``sio_time'' object. + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +sio_time * +set_time(sio_time *pt, timer_type t, int start_stop) +{ + if (pt) { + if (start_stop == START) { + gettimeofday(&pt->sys_timer[t], NULL); + + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + + + } else { + struct timeval sys_t; + + gettimeofday(&sys_t, NULL); + pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t])); + +/* ((double)sys_t.tv_sec + + ((double)sys_t.tv_usec) / MICROSECOND) - + ((double)pt->sys_timer[t].tv_sec + + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ + + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + + } + + if (sio_debug_level >= 4) { + const char *msg; + + switch (t) { + case HDF5_FILE_OPENCLOSE: + msg = "File Open/Close"; + break; + case HDF5_DATASET_CREATE: + msg = "Dataset Create"; + break; + case HDF5_MPI_WRITE: + msg = "MPI Write"; + break; + case HDF5_MPI_READ: + msg = "MPI Read"; + break; + case HDF5_FINE_WRITE_FIXED_DIMS: + msg = "Fine Write"; + break; + case HDF5_FINE_READ_FIXED_DIMS: + msg = "Fine Read"; + break; + case HDF5_GROSS_WRITE_FIXED_DIMS: + msg = "Gross Write"; + break; + case HDF5_GROSS_READ_FIXED_DIMS: + msg = "Gross Read"; + break; + case HDF5_RAW_WRITE_FIXED_DIMS: + msg = "Raw Write"; + break; + case HDF5_RAW_READ_FIXED_DIMS: + msg = "Raw Read"; + break; + default: + msg = "Unknown Timer"; + break; + } + + fprintf(output, " %s %s: %.2f\n", msg, + (start_stop == START ? "Start" : "Stop"), + pt->total_time[t]); + } + } + + return pt; +} + +/* + * Function: get_time + * Purpose: Get the time from a ``sio_time'' object. + * Return: The number of seconds as a DOUBLE. + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +double +get_time(sio_time *pt, timer_type t) +{ + return pt->total_time[t]; +} +#ifdef STANDALONE +#include "sio_standalone.c" +#endif + diff --git a/perform/sio_timer.h b/perform/sio_timer.h new file mode 100644 index 0000000..d991be7 --- /dev/null +++ b/perform/sio_timer.h @@ -0,0 +1,75 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef SIO_TIMER__ +#define SIO_TIMER__ + +#include "hdf5.h" + +#if defined(H5_TIME_WITH_SYS_TIME) +# include +# include +#elif defined(H5_HAVE_SYS_TIME_H) +# include +#else +# include +#endif + +/* The different types of timers we can have */ +typedef enum timer_type_ { + HDF5_FILE_OPENCLOSE, + HDF5_DATASET_CREATE, + HDF5_MPI_WRITE, + HDF5_MPI_READ, + HDF5_FILE_READ_OPEN, + HDF5_FILE_READ_CLOSE, + HDF5_FILE_WRITE_OPEN, + HDF5_FILE_WRITE_CLOSE, + HDF5_FINE_WRITE_FIXED_DIMS, + HDF5_FINE_READ_FIXED_DIMS, + HDF5_GROSS_WRITE_FIXED_DIMS, + HDF5_GROSS_READ_FIXED_DIMS, + HDF5_RAW_WRITE_FIXED_DIMS, + HDF5_RAW_READ_FIXED_DIMS, + NUM_TIMERS +} timer_type; + + +/* Miscellaneous identifiers */ +enum { + START, /* Start a specified timer */ + STOP /* Stop a specified timer */ +}; + +/* The performance time structure */ +typedef struct sio_time_ { + double total_time[NUM_TIMERS]; + struct timeval sys_timer[NUM_TIMERS]; +} sio_time; + +/* External function declarations */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +extern sio_time *sio_time_new(void); +extern void sio_time_destroy(sio_time *pt); +extern void set_timer_type(sio_time *pt); +extern sio_time *set_time(sio_time *pt, timer_type t, int start_stop); +extern double get_time(sio_time *pt, timer_type t); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* SIO_TIMER__ */ diff --git a/release_docs/HISTORY-1_0-1_8_0_rc3.txt b/release_docs/HISTORY-1_0-1_8_0_rc3.txt new file mode 100644 index 0000000..964d374 --- /dev/null +++ b/release_docs/HISTORY-1_0-1_8_0_rc3.txt @@ -0,0 +1,8985 @@ +HDF5 HISTORY +============ +This file contains history of the HDF5 libraries releases starting with +HDF5-1.0.0 and ending with HDF5-1.8.0-rc3 (the state of the code before i +the HDF5 1.8.0 release). + +CONTENTS + +22. Changes from 1.6.0 to 1.8.0-rc3 +21. Release Information for hdf5-1.6.7 +20. Release Information for hdf5-1.6.6 +19. Release Information for hdf5-1.6.5 +18. Release Information for hdf5-1.6.4 +17. Release Information for hdf5-1.6.3 +16. Release Information for hdf5-1.6.2 +15. Release Information for hdf5-1.6.1 +14. Release Information for hdf5-1.6.0 +13. Release Information for hdf5-1.4.5 +12. Release Information for hdf5-1.4.4 +11. Release Information for hdf5-1.4.3 +10. Release Information for hdf5-1.4.2 +9. Release Information for hdf5-1.4.1 +8. Release Information for hdf5-1.4.0 +7. Release Information for hdf5-1.2.2 +6. Release Information for hdf5-1.2.1 +5. Release Information for hdf5-1.2.0 +4. Changes from Release 1.0.0 to Release 1.0.1 +3. Changes from the Beta 1.0.0 Release to Release 1.0.0 +2. Changes from the Second Alpha 1.0.0 Release to the Beta 1.0.0 Release +1. Changes from the First Alpha 1.0.0 Release to the + Second Alpha 1.0.0 Release + +[Search on the string '%%%%' for per-release section breaks.] + +%%%%1.8.0-rc3%%%% Changes from 1.6.0 to 1.8.0-rc3 + + +HDF5 version 1.8.0-rc3 +================================================================================ + + +INTRODUCTION + +This document describes the differences between HDF5-1.6.* and +Hdf5 1.8.0 release candidate "HDF5-1.8.0-rc3", and contains information +on the platforms tested and known problems in HDF5-1.8.0-rc3. +For more details check the HISTORY.txt file in the HDF5 source. + + +Links to HDF5 1.8.0-rc3 source code, documentation, and additional materials +can be found on THG's development server (www.hdfgroup.uiuc.edu) at the +following location: + http://www.hdfgroup.uiuc.edu/HDF5/release/beta/obtain518.html +User documentation for the beta can be accessed directly at this location: + http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ + +New features of the upcoming 1.8.0 release are described in +the "What's New in 1.8.0?" document: + http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/WhatsNew180.html + +New and modified APIs are described briefly in + http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/WhatsNew180.html +and will be listed in the "HDF5 Software Changes" document: + http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ADGuide/Changes.html + + + +For more information, see the HDF5 home page: + + http://www.hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.0 +- Platforms Tested +- Known Problems + + +New Features +============ + + Configuration: + -------------- + - Removed stream-vfd from the HDF5 library. - AKC 2007/11/19. + - Updated versions of autotools. HDF5 now uses automake 1.10.0, + autoconf 2.61, and libtool 1.5.22. MAM - 2007/7/25. + - Changed default fortran compiler to g95 when gcc is used. - AKC + 2007/2/17. + - 'make check-vfd' can now be run from the top level directory. Not all + tests that 'make check' invokes work with certain Virtual File Drivers, + so those tests have been skipped. - MAM 2006/7/17 + - Added the variable HDF5TestExpress to control how long tests run. + Setting it to a value between 0 and 3 controls how thoroughly the + library is tested, with 0 being an "exhaustive run" and 3 being a + very quick "smoke test." 1 (a "full run") is the default. + -JML 2006/6/21 + - If both shared and static libraries are installed, now both will be + tested during 'make install'. -MAM 2006/06/21 + - Added support to explicity enable stream_vfd or shared libraries + when using parallel via the '--enable-stream_vfd' and + '--enable-shared' options, respectively. If not explicity defined, + These settings default to enabled when parallel is not used, + and disabled when parallel is used. -MAM 2006/06/17 + - Remove the flexible parallel code and the --enable-fphdf5 + configure option, it was never up to production standards + anyway. -QAK 2006/4/20 + - Added a macro hdf5_mpi_special_collective_io_works to filter out + some mpi-io packages that don't support collective IO for no IO + contributions in some processes. -KY 2006/2/16 + - Added -shlib option to link against installed shared libraries to + h5c++ and h5fc. -JML 2005/11/1 + - Added --enable-build-all option to configure, which only developers + should need to use. -JML 2005/10/24 + - Configure uses the 'TR' variable to let the user override the path + to the 'tr' utility. -JML 2005/10/17 + - Configure can recognize -lmpich as a form of MPI library. -AKC- + 2005/9/28. + - MD5 checksumming has been added to snapshot releases. Release + tarballs will be accompanied by .md5 checksum files, which can + be verified using the md5sum utility. -JML 2005/9/6 + - Some configure flags are incompatible (e.g., the C++ APIs cannot + be built using the parallel version of HDF5). configure will now + output errors when some common incompatible features are used + together. -JML 2005/9/6 + - A new API function, H5Tis_hard(), was added to the library. It + checks if a conversion function is a compiler (hard) conversion. + SLU - 2005/9/6 + - t_mpi will run the test_mpio_derived_dtype by default unless it is + known not working (indicated by macro H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS + not defined.) -AKC- 2005/8/23. + - Test execution has changed in a number of ways: + When make is invoked in parallel (using -j), sequential tests + are now executed as parallel make targets. This should make them + finish more quickly on machines with multiple processors. + Since test output is garbled when they are executed by parallel make, + tests now dump their output to foo.log files and foo.logsh files + (for test scripts). These logs are printed to the screen only + when a test fails or when all tests in the current directory have + completed successfully. + When tests pass, they will create a foo.chkexe file. + This prevents the test from executing again until the test or + main library changes. + All files generated by tests (*.chkexe, *.log, and any *.h5 files + created) can be removed by invoking 'make check-clean'. + Sequential and parallel library tests can now be invoked separately. + 'make check-s' will execute only sequential tests, and 'make check-p' + will execute only parallel tests. 'make check' will still execute + all tests. + -JML 2005/08/03 + - On windows, all.zip is deprecated. users should + read INSTALL_Windows.txt to know the details. + Reasons to deprecate all.zip: + 1. Avoid confliction for windows programmers + 2. Decrease size of CVS tree by adding all.zip + 3. Avoid using winzip as the intermediate step + --KY 2005/04/22 + - When HDF5 is created as a shared library, it now uses libtool's + shared library versioning scheme. -JML 2005/04/18 + - HDF5 now uses automake 1.9.5 to generate Makefiles.in. + This has a number of effects on users: + The Fortran compiler should be set using the environment + variable $FC, not $F9X. F9X still works, but is depreciated. + The output of make may be different. This should be only a + cosmetic effect. + make depened (or make dep) is no longer recognized, since automake + handles dependency tracking. + Some new configure options exist. --enable-dependency-tracking + and --disable-dependency-tracking are used to control automake's + dependency tracking. Dependencies are on by default *on most + platforms and compilers*. If --enable-dependency-tracking is + used, they will be enabled on any platform. However, this can + slow down builds or even cause build errors in some cases. + Likewise, --disable-dependency-tracking can speed up builds and + avoid some build errors. + Some make targets have alternate names. make check-install and + make installcheck do the same thing, for instance. + pmake on IRIX can be invoked from the root directory, but the + -V flag must be used to invoke it in any subdirectory or it + will give an error about undefined variables. + JML 2005/01 - 2005/03 + - Hardware conversion between long double and integers is also added. + SLU 2005/02/10 + - Started to support software conversion between long double and + integers. Hardware conversion will come very soon. SLU - 2005/1/6 + - Intel v8.0 compiler would infinite loop when compiling some test + code with -O3 option. Changed enable-production default compiler + option to -O2. AKC - 2004/12/06 + - Long double is assumed to be a supported C data type. It is a + stanadard C89 type. AKC - 2004/10/22 + - The IA64 will use ecc as the C++ compiler by default. + - Added some initial support for making valgrind/Purify (or similar + memory checking products) happier by initializing buffers to zero + and disabling the internal free list code. To take advantage of + this, use the "--enable-using-memchecker" configure option when + building the library. QAK - 2004/07/23 + - Fixed the long compile time of H5detect.c when v7.x Intel Compiler + is used with optimization NOT off. AKC - 2004/05/20 + - Fixed configure setting of C++ for OSF1 platform. AKC - 2004/01/06 + - Prefix default is changed from /usr/local to `pwd`/hdf5. + AKC - 2003/07/09 + + Library: + -------- + - Removed size restrictions on attributes, when using the "latest" + version of the file format. - QAK - 2007/02/21 + - Relaxed restrictions on attribute operations to allow a file ID to + be used as the "location ID". If a file ID is used, the attribute + operation will occur on the root group of the file. + - QAK - 2007/02/09 + - Enabled the CORE driver to read an existing file depending on + the setting of the backing_store for H5Pset_fapl_core and file + open flags. - SLU - 2006/11/30 + - Added new H5Gget_info_by_idx() routine to query the information about + a group according to the order within an index. + - QAK - 2006/11/27 + - Added new H5Gget_info() routine to query the information about a + group by name. + - QAK - 2006/11/27 + - Added new H5Oget_info_by_idx() routine to query the information about + an object in a group according to the order within an index. + - QAK - 2006/11/26 + - Added new H5Oget_info() routine to query the information about an + object in a group by name. + - QAK - 2006/11/26 + - Added new H5Oopen_by_idx() routine to open an object in a group + according to the order within an index. + - QAK - 2006/11/20 + - Added new H5Literate() routine to iterate over links in a group + according to the order within an index. + - QAK - 2006/11/20 + - Added new H5Ldelete_by_idx() routine to delete a link according to + the order within an index. + - QAK - 2006/11/13 + - Added new H5Lget_val_by_idx() routine to query the value of a soft link + according to the order within an index. + - QAK - 2006/11/13 + - Added new H5Lget_name_by_idx() routine to query the name of a link + according to the order within an index. + - QAK - 2006/11/12 + - Added new H5Rget_name() routine to determine the name of the object + that a reference points to, as long as the object is still + reachable in the group hierarchy. + - QAK - 2006/11/10 + - Added new H5Lget_info_by_idx() routine to query the link information + according to the order within an index. + - QAK - 2006/11/10 + - Added feature to H5Iget_name to allow retrieving the name of any + object's ID, as long as the object is still reachable in the + group hierarchy. + - LA - 2006/11/01 + - Added External and User-defined links. + External links are links from one HDF5 file to another; they + require both the name of the file and a path within that file. + User-defined links allow users to supply callback functions + for link traversals, allowing links to exhibit essentially + any behavior. + External links are a kind of user-defined link, so their default + behavior can be overridden by the user. + -JML 2006/8/23 + - Added H5Oopen and H5Oclose for opening objects of unknown type + (as link callback functions do). + -JML 2006/8/23 + - Added H5Oopen_by_addr, H5Oincr_refcount, and H5Odecr_refcount for + opening objects by address. Be very careful with these! + -JML 2006/8/23 + - Added H5Fget_intent to get the "intent" of a file (whether it + was opened with read-write access or read-only. + -JML 2006/8/23 + - Added Link Access Property Lists. They currently contain two + properties, nlinks (H5Pget/set_nlinks) and elink_prefix + (H5Pget/set_elink_prefix). nlinks controls how many soft and + user-defined traversals are allowed before HDF5 assumes it has + found a cycle (previously this defaulted to 16). + The elink_prefix is a filesystem path that is prefixed to the + names of any external link files opened using this LAPL. + -JML 2006/8/23 + - Add H5L link APIs. Old APIs (H5Glink, H5Gmove, etc.) are still + supported but deprecated. + New APIs are: + H5Llink - create a link to an object given its ID + H5Lmove - just like H5Gmove2 + H5Lcopy - copy a link without copying the underlying object + H5Lcreate_hard - like H5Glink2 for hard links + H5Lcreate_soft - like H5Glink2 for soft links + H5Ldelete - just like H5Gunlink + H5Lget_val - just like H5Gget_linkval + H5Lget_info - gets link-specific info (like H5Gget_objinfo) + + In addition, H5Gcreate_anon, H5Tcommit_anon, and H5Dcreate_anon + no longer create links to objects; objects must be manually linked + using H5Llink or they will be deleted when the ID is closed. + + Link Creation Property Lists can be used to pass character + encoding (ASCII or UTF-8) for link names and to set the Intermediate + Group Creation Flag: + H5Pset_char_encoding, H5Pget_char_encoding + H5Pset_copy_object, H5Pget_copy_object + -JML 2006/7/5 + - Added managements of collective IO supports for chunking storage + inside parallel HDF5 + 1) Implemented One IO with collective mode for all chunks in the + application by building one MPI derived datatype accross all + chunks. + 2) Implemented the decision-making support to do collective IO inside + MPI-IO per chunk. + 3) Added the decision-making support to do one IO accross all chunks + or to do multiple IOs with each IO per chunk. + 4) Added the support to handle the case some processes won't do any IOs in + collectively. + 5) Some MPI-IO package(mpich 1.2.6 or lower, e.g.) cannot handle + collective IO correctly for the case when some processes have no + contributions to IOs, a special macro is added to change + collective IO mode to independent IO mode inside HDF5 library. + + Currently we find that MPICH at Linux and vender MPI-IO package at NCSA + Altix cannot handle this case. + + "hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}" + has been added at the end of file and + . + + If MPI-IO packages at your Linux and Altix support this case, + please comment out the last line and report to us at + help@hdfgroup.org. We can tune in our configuration to + support this. + + KY - 2006/02/16 + - Added character encoding to attribute creation property lists. + JML - 2006/01/02 + - Added H5Gcopy() routine to copy objects between while keeping + data in compressed form. QAK - 2005/11/06 + - Added H5Sextent_equal() routine. QAK - 2005/11/06 + - Added HSYS_ERROR which retrieves the system error message and pushes + it to the error stack. This gives more information of the failed + system call. AKC - 2005/08/04 + - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to + allow querying for objects in file that were opened with a particular + file ID, instead of all objects opened in file with any file ID. + QAK - 2005/06/01 + - Added H5T_CSET_UTF8 character set to mark datatypes that use the + UTF-8 Unicode character encoding. Added tests to ensure that + library handles UTF-8 object names, attributes, etc. -JL 2005/05/13 + - HDF5 supports collective MPI-IO for irregular selection with HDF5 + dataset. Irregular selection is when users use H5Sselect_hyperslab + more than once for the same dataset. + Currently, not all MPI-IO packages support complicated MPI derived + datatype used in the implementation of irregular + selection INSIDE HDF5. + 1) DEC 5.x is not supporting complicated derived datatype. + 2) For AIX 5.1, + if your poe version number is 3.2.0.19 or lower, + please edit powerpc-ibm-aix5.x under hdf5/config, + Find the line with + << hdf5_mpi_complex_derived_datatype_works>> + and UNCOMMENT this line before the configure. + check poe version with the following command: + lpp -l all | grep ppe.poe + 3) For Linux cluster, + if mpich version is 1.2.5 or lower, collective irregular selection + IO is not supported, internally independent IO is used. + 4) For IRIX 6.5, + if C compiler version is 7.3 or lower, collective irregular selection + IO is not supported, internally independent IO is used. + 5) For platforms which internally used mpich, if the + mpich version is 1.2.5 or lower, please find the + corresponding config file and add + hdf5_mpi_complex_derived_datatype_works='no' at the + end of the configuration file. For example, at NCSA + SGI Altix, the internal mpich library is 1.2.5. So + hdf5_mpi_complex_derived_datatype_works='no' should be + added at the end of the config file ia64-linux-gnu. + KY - 2005/09/12 + We also found not all MPI-IO packages support collective IO with one + or more processes to have no contributions to IO. + For mpich version 1.2.6 or lower and all IRIX machine, + if the library checks that there are no IO contributions for some + processes, collective IO request is replaced with + independent inside HDF5. + KY - 2006/05/04 + + - HDF5 N-bit filter + HDF5 support N-bit filter from this version, + The N-Bit filter is used effectively for compressing data of N-Bit + datatype as well as compound and array datatype with N-Bit fields. + KY - 2005/04/15 + - HDF5 scaleoffset filter + HDF5 supports scaleoffset filter for users to do data + compression through HDF5 library. + Scale-Offset compression performs a scale and/or offset operation + on each data value and truncates the resulting value to a minimum + number of bits and then stores the data. + Scaleoffset filter supports floating-point and integer datatype. + Please check the HDF5 reference manual for this. + KY - 2005/06/06 + - Retired SRB vfd (--with-srb). Functions H5Pset_fapl_srb and + H5Pget_fapl_srb were removed. EIP - 2005/04/07 + - Retired GASS vfd (--with-gass). Functions H5Pset_fapl_gass and + H5Pget_fapl_gass are removed too. AKC - 2005/3/3 + - Pablo was removed from the source code EIP - 2005/01/21 + - Modified registration of SZIP to dynamically detect the presence + or absence of the encoder. Changed configure and Makefiles, + and tests to dynamically detect encoder. BEM - 2004/11/02 + - Added function H5Pget_data_transform, together with the previously + added H5Pset_data_transform, to support the data transform + feature. AKC - 2004/10/26 + - Compound datatype has been enhanced with a new feature of size + adjustment. The size can be increased and decreased(without + cutting the last member) as long as it doesn't go down to zero. + No API change is involved. SLU - 2004/10/1 + - Put back 6 old error API functions to be backward compatible with + version 1.6. They are H5Epush, H5Eprint, H5Ewalk, H5Eclear, + H5Eset_auto, H5Eget_auto. Their new equivalent functions are + called H5Epush_stack, H5Eprint_stack, H5Ewalk_stack, + H5Eclear_stack, H5Eset_auto_stack, H5Eget_auto_stack. SLU - + 2004/9/2 + - 4 new API functions, H5Tencode, H5Tdecode, H5Sencode, H5Sdecode were + added to the library. Given object ID, these functions encode and + decode HDF5 objects(data type and space) information into and from + binary buffer. SLU - 2004/07/21 + - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for + SZIP compression. Now there is no restriction on the size and shape of the + chunk except that the total number of elements in the chunk cannot be + bigger than 'pixels_per_block' parameter provided by the user. + EIP - 2004/07/21 + - Added support for SZIP without encoder. Added H5Zget_filter_info + and changed H5Pget_filter and H5Pget_filter_by_id to support this + change. JL/NF - 2004/06/30 + - SZIP always uses K13 compression. This flag no longer needs to + be set when calling H5Pset_szip. If the flag for CHIP + compression is set, it will be ignored (since the two are mutually + exclusive). JL/NF - 2004/6/30 + - A new API function H5Fget_name was added. It returns the name + of the file by object(file, group, data set, named data type, + attribute) ID. SLU - 2004/06/29 + - Added support for user defined identifier types. NF/JL - 2004/06/29 + - A new API function H5Fget_filesize was added. It returns the + actual file size of the opened file. SLU - 2004/06/24 + - New Feature of Data transformation is added. AKC - 2004/05/03. + - New exception handler for datatype conversion is put in to + replace the old overflow callback function. This exception + handler is set through H5Pset_type_conv_cb function. + SLU - 2004/4/27 + - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, + will suppress all library version mismatch warning messages. + AKC - 2004/4/14 + - A new type of dataspace, null dataspace(dataspace without any + element) was added. SLU - 2004/3/24 + - Data type conversion(software) from integer to float was added. + SLU - 2004/3/13 + - Data type conversion(software) from float to integer was added. + Conversion from integer to float will be added later. + SLU -2004/2/4 + - Added new H5Premove_filter routine to remove I/O pipeline filters + from dataset creation property lists. PVN - 2004/01/26 + - Added new 'compare' callback parameter to H5Pregister & H5Pinsert + routines. QAK - 2004/01/07 + - Data type conversion(hardware) between integers and floats was added. + SLU 2003/11/21 + - New function H5Iget_file_id() was added. It returns file ID given + an object(dataset, group, or attribute) ID. SLU 2003/10/29 + - Added new fields to the H5G_stat_t for more information about an + object's object header. QAK 2003/10/06 + - Added new H5Fget_freespace() routine to query the free space in a + given file. QAK 2003/10/06 + - Added backward compatability with v1.6 for new Error API. SLU - + 2003/09/24 + - Changed 'objno' field in H5G_stat_t structure from 'unsigned long[2]' + to 'haddr_t'. QAK - 2003/08/08 + - Changed 'fileno' field in H5G_stat_t structure from 'unsigned long[2]' + to 'unsigned long'. QAK - 2003/08/08 + - Changed 'hobj_ref_t' type from structure with array field to 'haddr_t'. + QAK - 2003/08/08 + - Object references (hobj_ref_t) can now be compared with the 'objno' + field in the H5G_stat_t struct for testing if two objects are the + same within a file. QAK - 2003/08/08 + - Switched over to new error API. SLU - 2003/07/25 + + Parallel Library: + ----------------- + - Added mpich2 as a testing "platform" informally. AKC - 2005/9/28. + - A dataset created in serial mode with H5D_ALLOC_TIME_INCR allocation + setting was not extendible, either explicitly by H5Dextend or + implicitly by writing to unallocated chunks. Library now allocates + more space when needed or directed if the file is opened by parallel + mode, independent of what the dataset allocation mode is. + CC/AKC - 2005/08/29. + - Allow compressed, chunked datasets to be read in parallel. + QAK - 2004/10/04 + - Add options of using atomicity and file-sync to test_mpio_1wMr. + AKC - 2003/11/13 + - Added parallel test, test_mpio_1wMr, which tests if the + underlaying parallel I/O system is conforming to the POSIX + write/read requirement. AKC - 2003/11/12 + + Fortran Library: + ---------------- + - added support for shared Fortran libraries. -JML 2005/09/20 + - added missing h5tget_member_class_f function + EIP 2005/04/06 + - added new functions h5fget_name_f and h5fget_filesize_f + EIP 2004/07/08 + - h5dwrite/read_f and h5awrite/read_f functions only accept dims parameter + of the type INTEGER(HSIZE_T). + - added support for native integers of 8 bytes (i.e. when special + compiler flag is specified to set native fortran integers to 8 bytes, + for example, -i8 flag for PGI and Absoft Fortran compilers, + -qintsize=8 flag for IBM xlf compiler). + EIP 2005/06/20 + - added support for "big" REAL and DOUBLE PRECISION types + (usually the size is specified by compilers flags like + -r8, -r16, etc.) + Known problem: multi file test fails when REAL is 16 bytes. + EIP 2005/09/8 + + C++ Library: + ---------------- + - added support for shared C++ libraries. -JML 2005/09/20 + - Added missing member functions + H5::CompType::getMemberArrayType + H5::CompType::getMemberVarLenType + H5::AbstractDs::getArrayType + H5::AbstractDs::getVarLenType + H5::CommonFG::openArrayType + H5::CommonFG::openVarLenType + H5::PropList::copyProp -- this will replace the current + H5::PropList::copyProp in later releases due + to incorrect prototype. + H5::IdComponent::getHDFObjType + BMR - 2005/08/08 + + + Tools: + ------ + - h5repack and h5diff changed command line parameter syntax to be + similar to h5dump, adding also long switch names. PVN - 2008/1/16 + - h5repack now supports adding multiple filters to all objects. + PVN - 2008/1/16 + - h5dump lists groups and attributes in requested orders (by name and + creation order, both ascending and descending). PVN - 2007/10/5 + - h5import imports string (text) data. PVN - 2007/10/5 + - h52gif and gif2h5: Both these tools were revised to include the High + Level Image API support, and tests were added to /hl/tools/gif2h5. + PVN - 2007/04/13 + - h5dump: added support for double long type H5T_NATIVE_LDOUBLE. PVN + 2007/03/13 + - h5dump: added support for binary output, see usage. PVN 2007/03/13 + - h5repack: added support for the new nbit and scaleoffset filters. + PVN - 2007/05/07 + - h5repack: now uses the API function H5Ocopy (of the tool h5copy) to + recreate objects if there is not a user input for changes. PVN - + 2007/05/07 + - h5repack: added support for reading and repacking by hyperslabs for + large files. PVN - 2007/03/01 + - h5repack: a new option allows the copy using the file type (default) + instead of the previous conversion to native type. PVN - 2007/03/01 + - h5repack: output the percentage of compression used. PVN - 2007/03/01 + - h5diff: added support for -p option for unsigned long_long data. PVN + - 2007/02/26 + - h5diff: added support for comparing dataset regions. PVN - 2007/02/20 + - h5diff: added support for reading and comparing by hyperslabs for large files. + PVN - 2007/02/20 + - h5diff: printing of dataset dimensions along with dataset name. PVN -2007/02/19 + - h5dump now uses the new API function H5Rget_name to display the name + of the dataset referenced instead of its ID. PVN - 2007/02/19 + - Added new tool, h5mkgrp. QAK - 2007/02/14 + - Added new tool, h5copy. PVN - 2006/7/15 + - Removed obsolete pdb2hdf5 tool from tools/misc -JML 2005/10/24 + - Added build_h5perf_alone.sh that builds h5perf by standalone mode. + AKC - 2005/09/18. + - Sped up h5dump on files with large numbers of objects. + QAK - 2005/08/25 + - Added a standalone mode for building h5perf. AKC - 2005/08/12 + - new tool, h5jam. See reference manual. 2004/10/08 + - h5repack.sh did not report errors encountered during tests. It does + now. AKC - 2004/04/02 + - Added the MPI-I/O and MPI-POSIX drivers to the list of VFL drivers + available for h5dump and h5ls. RPM & QAK - 2004/02/01 + - Added option --vfd= to h5ls to allow a VFL driver to be selected + by a user. RPM & QAK - 2004/02/01 + - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). + AKC - 2004/01/08 + - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" + respectively if library is built in parallel mode. + WCW - 2003/11/04 + - Added metadata benchmark (perform/perf_meta). SLU - 2003/10/03 + - Changed output of "OID"s from h5dump from "-" to + ":::" to ":" + QAK - 2003/08/08 + + High-Level APIs: + ------ + - Fortran interfaces for the Image, Table and Lite APIs. PVN - 2007/5/1 + - New HDF5 Dimension Scale API (H5DS) allows dimension scales to be + created in an HDF5 file and associated with specific datasets. PVN - 2007/5/1 + - There are two new functions in the Lite library, H5LTtext_to_dtype + and H5LTdtype_to_text. H5LTtext_to_dtype creates a HDF5 data type + given a text description; H5LTdtype_to_text converts a data type + to text description. Only DDL definition is supported as text + desciption now. SLU - 2006/05/17 + - Added Packet Table API for creating tables with less overhead than + H5TB API. Added C++ wrapper for Packet Tables. See documentation. + JML - 2004/03/28 + + Documentation + ------------- + - The documentation for this release is largely complete, but + trails the source code. A few of the newer functions are + not yet documented. FMB - 2007/04/18 + - The user documents for this release can be accessed directly at + this location: + http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ + The most recent document versions (updated daily) in the + 1.8 development branch can be accessed at this location: + http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ + FMB - 2007/04/18 + + +Support for new platforms, languages and compilers. +======================================= + - Added support for Free-BSD on amd64 with GNU C and Fortran compilers + 4.2.1 + EIP - 2007/06/25 + - Added support for sequential and parallel libraries for Intel 64 Linux + cluster (abe.ncsa.uiuc.edu). Among three MPICH packages available on + this machine, only Open MPI works. The VMI has seg fault in hyperslab.c + and bittests.c tests. The MVAPICH2 complained about mpd not running + the parallel test. (see Known Problems section for more info) + EIP - 2007/06/25 + - Added support for HPUX11.23 for both 32 and 64-bit; HDF5 C++ + - Added support for 64-bit Windows with Visual Studio .NET and 2005. + SJW - 2007/06/25 + - Added suport for HPUX11.23 for both 32 and 64-bit; HDF5 C++ + shared library is not supported with +DD64 flag. + EIP - 2006/06/22 + - Added support for VAX floating numbers for Alpha Open VMS 7.3.2 + EIP - 2006/05/05 + - Fixed broken make.com files in tools directories + EIP - 2006/05/05 + - Added support for Alpha Open VMS 7.3.2 EIP - 2006/04/15 + - Added support for Cray X1. JML - 2005/10/03 + - PGI Fortran compiler is supported on Linux64 systems (x86_64) + EIP - 2004/08/19 + - Absoft compiler f95 v9.0 supported on Linux 2.4 + EIP - 2004/07/29 + - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran + compiler version 8.1. This is a default compiler. + - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler + version 8.2; set F9X environment varibale to f95, for example + setenv F9X f95 + Use --disable-shared --enable-static configure flags when Absoft + compiler is used. + EIP - 2004/07/27 + - HDF5 Fortran APIs are supported on MAC OSX with IBM XL Fortran + Compiler version 8.1 Use "--disable-shared --enable-static" + configure flags along with the "--enable-fortran" flag to build + Fortran library. EIP - 2004/01/07 + +Bug Fixes since HDF5-1.6.0 release +================================== + + Library + ------- + - Changed library's behavior for reading files that might have + corrupted object header information from a previous (buggy) + version of the library. By default, the library now rebuilds the + correct object header information instead of issuing an error. + Previous "strict" file format interpretation can be enabled with + the "--enable-strict-format-checks" configure option. + QAK - 2008/01/13 + - Fixed several bugs with writing fill values for datasets that have + a variable-length datatype or component datatype. QAK - 2007/06/19 + - STDIO driver didn't support files bigger than 2GB because the OFFSET + parameter of fseek is of type LONG INT, not big enough for big files. + Use fseeko instead for big files if it's available on the system. + SLU - 2007/4/5 + - Fixed a bug in H5Sselect_valid() that caused an incorrect value to + be returned (0) instead of FAIL on error conditions such as the + selection or extent not being defined. CMC - 2007/01/17 + - Fixed the MULTI driver problem (Bug #731) that corruptted the data. + SLU - 2007/1/12 + - Fixed file corruption bug which could write an incorrect number of + messages to an object's header under certain circumstances. + Generally, the sequence of actions to generate this bug looks + like this: + - Create an object + - Close the file + - Re-open the file + - Add 2 (or more) attributes to the object + - Close the file + - Re-open the file + - Delete one of the attributes on the object + - Add a smaller attribute to the object + - Delete the smaller atttribute on the object + - Add a larger attribute on the object + + After this, the number of header messages stored for the object + will be off by one. Other sequences of modifying attributes on an + object could also trigger this bug. If you are opening an + object and the bottom few messages of the HDF5 error stack + resembles this, the object has been affected by this bug: + + #007: ../../hdf5_v1.6/src/H5C.c line 3887 in H5C_load_entry(): unable to load entry + major(08): Meta data cache layer + minor(40): Unable to load metadata into cache + #008: ../../hdf5_v1.6/src/H5Ocache.c line 332 in H5O_load(): corrupt object header - too few messages + major(12): Object header layer + minor(40): Unable to load metadata into cache + + Specifically, "corrupt object header" is the best string to search + for in the HDF5 error stack output. + + If your files have been affected by this bug, or you are concerned + that your files might have been, please contact the HDF Helpdesk + at help@hdfgroup.org for a tool to detect and repair files + affected by this problem. QAK - 2006/6/16 + - Fixed various problems with retrieving names of objects, especially + with mounted files. QAK - 2005/12/25 + - Fixed core dump when closing root groups opened through two different + file handles that operate on the same actual file. QAK - 2005/10/02 + - Corrected errors when performing various operations on a group opened + by dereferencing an object reference. QAK - 2005/07/30 + - Fixed a bug with named datatypes where a copy of a named datatype + used to create a dataset would accidentally use the original + named datatype for the dataset's datatype. QAK - 2005/07/23 + - Made H5Fget_name() be consistent and always return name of actual + file the ID is in. (Instead of the name of the top file in a + file mounting hierarchy). QAK - 2005/07/19 + - Reworked internal file mounting semantics to hopefully eliminate + mounting problems. We now require that files that are mounting + together all have the same "file close degree". QAK - 2005/07/19 + - More bug fixes on holding open files that are mounted and have + IDs open. QAK - 2005/07/14 + - Don't unmount child files until the parent file actually closes. + (Previously, if an object is holding open a file, the child files + would get unmounted too early). QAK - 2005/07/05 + - Fixed bug where unmounted files could cause the library to go into + an infinite loop when shutting down. QAK - 2005/06/30 + - The library didn't save the information of family driver in file. + The original file member size was lost after file was closed (see + bug #213). This has been fixed by saving driver name and member + file size in the superblock. SLU - 2005/6/24 + - Fixed bug with hyperslab selections that use selection offsets and + operate on chunked datasets going into infinite loop or dumping + core. QAK - 2005/06/17 + - Corrected memory leak and possible corruption when opening a group. + QAK - 2005/06/17 + - Added check for opaque datatype tags being too long (check against + H5T_OPAQUE_TAG_MAX, currently set to 256). QAK - 2005/06/14 + - Fixed various errors in maintaining names for open objects in the + face of unusual mount & unmount operations. QAK - 2005/06/08 + - "SEMI" and "STRONG" file close degree settings now apply only to the + particular file ID being closed, instead of operating on all open + file IDs for a given file. QAK - 2005/06/01 + - For family driver, the library didn't save member size in file. + When file is reopened, the size of 1st member file determine the + member size. Now member size is saved in file and is used to + define member file size. Wrong file access property of member size + will result in a failure. Using any other driver except family + will cause library to return error. So is multi driver. SLU - + 2005/05/24 + - Fixed error in opening object in group that was opened in mounted + file which has been unmounted. QAK - 2005/03/17 + - Fixed a racing condition in MPIPOSIX virtual file drive close + function. Now all processes must completed the close before any + of them is returned. This prevents some "faster" processes start + accessing the file for another purpose (e.g., open with truncate) + while other "slower" processes have not closed the same file with + the previous purpose. AKC - 2005/03/01 + - H5Tget_member_value calls for enum datatype didn't return correct + value if H5Tenum_valueof was called first. It's fixed. SLU - + 2005/02/08 + - For variable-length string, H5Tget_class returned H5T_STRING as its + class. But H5Tdetect_class and H5Tget_member_class considered it + as H5T_VLEN. This is fixed to let all these 3 functions treat it + as H5T_STRING. SLU - 2005/02/08 + - The byte order of 1-byte integer types was fixed as little endian + even on a big-endian machine. This has been corrected. SLU - + 2005/02/07 + - Fix segmentation fault when calling H5Fflush with an attribute that + hasn't had a value written to it open. QAK - 2004/10/18 + - Back up supporting bitfield and time types in H5Tget_native_type. + Leave it to future support. The function simply returns error + message of "not support" for bitfield and time types. + SLU - 2004/10/5 + - Fixed address check in Core VFL driver to avoid spurious address/size + overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 + - Fixed parallel bug in which some processes attempted collective + I/O while others did independent I/O. Bug appeared when some + processes used point selections, and others didn't. JRM - 2004/9/15 + - Corrected error where dataset region references were written in an + incorrect way on Cray machines. PVN & QAK - 2004/09/13 + - The H5Tget_native_type now determines the native type for integers + based on the precision. This is to avoid cases of wrongly converting + an int to a short in machines that have a short of 8 bytes but with + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + - Changed H5Dread() to not overwrite data in an application's buffer + with garbage when accessing a chunked dataset with an undefined + fill value and an unwritten chunk is uncountered. QAK - 2004/08/25 + - Fixed error which could cause a core dump when a type conversion + routine was registered after a compound datatype had been + converted and then an equivalment compound datatype was converted + again. QAK - 2004/08/07 + - Fixed memory overwrite when encoding "multi" file driver information + for file's superblock. QAK - 2004/08/05 + - Fixed obscure bug where a filter which failed during chunk allocation + could allow library to write uncompressed data to disk but think + the data was compressed. QAK - 2004/07/29 + - Fixed bug where I/O to an extendible chunked dataset with zero-sized + dimensions would cause library to fail an assertion. + QAK - 2004/07/27 + - Fixed bug where chunked datasets which have filters defined, + allocation time set to "late" and whose chunks don't align with + the dataspace bounds could have incorrect data stored when + overwriting the entire dataset on the first write. QAK - 2004/07/27 + - Added check to ensure that dataspaces have extents set. JML-2004/07/26 + - Fixed bug on some Solaris systems where HDF5 would try to use + gettimeofday() when that function didn't work properly. + JML - 2004/07/23 + - Fixed bug in H5Sset_extent_simple where setting maximum size to + non-zero, then to zero would cause an error. JML - 2004/07/20 + - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite + when not writing data ("none" selection or hyperslab or point + selection with no elements defined). QAK - 2004/07/20 + - Calling H5Gcreate() on "/" or "." throws an error instead of + failing quietly. JML - 2004/07/19 + - Fixed bug where setting file address size to be very small could + trigger an assert if the file grew to more than 64 KB. Now throws + an error and data can be recovered. JL/NF - 2004/07/14 + - Fixed bug where "resurrecting" a dataset was failing. + QAK - 2004/07/14 + - Fixed bug where incorrect data could be read from a chunked dataset + after it was extended. QAK - 2004/07/12 + - Fixed failure to read data back from file of compound type with + variable-length string as field. SLU - 2004/06/10 + - Fixed potential file corruption bug when a block of metadata could + overlap the end of the internal metadata accumulator buffer and + the buffer would be extended correctly, but would incorrectly + change it's starting address. QAK - 2004/06/09 + - Opaque datatype with no tag failed for some operations. Fixed. + SLU - 2004/6/3 + - Fixed potential file corruption bug where dimensions that were + too large (a value greater than could be represented in 32-bits) + could cause the incorrect amount of space to be allocated in a + file for the raw data for the dataset. QAK - 2004/06/01 + - Fixed dtypes "sw long double -> double" failure in QSC class + machines. AKC - 2004/4/16 + - Fixed problem with fletcher32 filter when converting data of different + endianess. PVN - 2004/03/10 + - Fixed problem with H5Tget_native_type() not handling opaque fields + correctly. QAK - 2004/01/31 + - Fixed several errors in B-tree deletion code which could cause a + B-tree (used with groups and chunked datasets) to become corrupt + with the right sequence of deleted objects. QAK - 2004/01/19 + - Fixed small internal memory leaks of fill-value information. + QAK - 2004/01/13 + - Fixed bug that caused variable-length datatypes (strings or sequences) + used for datasets in files with objects that were unlinked to + fail to be read/written to a file. QAK - 2004/01/13 + - Detect situation where szip 'pixels per block' is larger than the + fastest changing dimension of a dataset's chunk size and disallow + this (due to limits in szip library). QAK - 2003/12/31 + - Fixed bug with flattened hyperslab selections that would generate + incorrect hyperslab information with certain high-dimensionality + combinations of start/stride/count/block information. + QAK - 2003/12/31 + - Fixed bug with variable-length datatypes used in compound datatypes. + SLU - 2003/12/29 + - Fixed bug in parallel I/O routines that would cause reads from + "short datasets" (datasets which were only partially written out) + to return invalid data. QAK & AKC - 2003/12/19 + - Fixed bug where scalar dataspaces for attributes were reporting as + simple dataspaces. QAK - 2003/12/13 + - Fixed problem with selection offsets of hyperslab selections in + chunked datasets causing the library to go into an infinite loop. + QAK - 2003/12/13 + - Fixed H5Giterate to avoid re-using index parameter after iteration + callback has been called (allows iteration callback to modify the + index parameter itself). QAK - 2003/12/06 + - Fixed various floating-point conversion problems, including a + change which could corrupt data when converting from double->float. + QAK - 2003/11/24 + - Changed "single process" metadata writing in library to collective + I/O by all processes, in order to guarantee correct data being + written with MPI-I/O. QAK - 2003/11/20 + - Fixed problems with fill values and variable-length types and also + I/O on VL values that were set to NULL. QAK - 2003/11/08 + - Fixed problems with MPI datatypes that caused ASCI Q machine to + hang. QAK - 2003/10/28 + - Removed HDF5_MPI_PREFER_DERIVED_TYPES environment variable support, + since it had no benefit. QAK - 2003/10/28 + - Single hyperslab selections (which were set with only one call to + H5Sselect_hyperslab) that had dimensions that could be "flattened" + but were interspersed with dimensions that could not be flattened + were not correctly handled, causing core dumps. QAK - 2003/10/25 + - Fixed incorrect datatype of the third parameter to the Fortran90 + h5pset(get)_cache_f subroutine (INTEGER to INTEGER(SIZE_T)) + EIP - 2003/10/13 + - Fixed problems with accessing variable-length data datatypes on + Crays. QAK - 2003/10/10 + - Fixed potential file corruption bug when too many object header + messages (probably attributes, from a user perspective) were + inserted into an object header and certain other conditions were + met. QAK - 2003/10/08 + - Changed implementation of internal ID searching algorithm to avoid + O(n) behavior for many common cases. QAK - 2003/10/06 + - Allow partial parallel writing to compact datasets. QAK - 2003/10/06 + - Correctly create reference to shared datatype in attribute, instead + of making a copy of the shared datatype in the attribute. + QAK - 2003/10/01 + - Revert changes which caused files >2GB to fail when created with + MPI-I/O file driver on certain platforms. QAK - 2003/09/16 + - Allow compound datatypes to grow in size. SLU - 2003/09/10 + - Detect if a type is already packed before attempting to pack it + again or check if it is locked. SLU - 2003/09/10 + - Corrected bug when opening a file twice with read-only permission + for one open and then closing the read-only access file ID would + generate an error. QAK - 2003/09/10 + - Corrected bug in repeated calls to H5Pget_access_plist() which would + incorrectly manage reference counts of internal information and + eventually blow up. QAK - 2003/09/02 + - Return rank of the array datatype on successful call to + H5Tget_array_dims(). QAK - 2003/08/30 + - Corrected bug in H5Tdetect_class which was not correctly detecting + datatype classes of fields in nested compound datatypes in some + circumstances. QAK - 2003/08/30 + - Corrected bug in sieve buffer code which could cause loss of data + when a small dataset was created and deleted in quick succession. + QAK - 2003/08/27 + - Corrected bug in H5Gget_objname_by_idx which was not allowing NULL + for the name when just querying for the object name's length. + QAK - 2003/08/25 + - Corrected bug in variable-length string handling which could + generate a core dump on writing variable-length strings as part + of a compound datatype on certain architectures. QAK - 2003/08/25 + - Corrected bug in H5Tget_native_type which would incorrectly compute + the size of certain compound datatypes and also incorrectly + compute the offset of the last field for those compound datatypes. + QAK - 2003/08/25 + - Corrected bug in H5Tget_native_type which would drop string datatype + metadata (padding, etc.) QAK - 2003/08/25 + - Corrected bugs in H5Gget_num_objs, H5Gget_objname_by_idx and + H5Gget_objtype_by_idx to allow them to accept location IDs, not just + group IDs. QAK - 2003/08/21 + - Corrected bug when using scalar dataspace for memory selection and + operating on chunked dataset. QAK - 2003/08/18 + - Corrected bugs with multiple '/' characters in names for H5Glink + and H5Gunlink. QAK - 2003/08/16 + - Corrected bug with user blocks that didn't allow a user block to + be inserted in front of a file after the file was created. + QAK - 2003/08/13 + - Corrected errors with using point selections to access data in + chunked datasets. QAK - 2003/07/23 + - Corrected error with variable-length datatypes and chunked datasets + caused H5Dwrite to fail sometimes. QAK - 2003/07/19 + - Modified library and file format to support storing indexed storage + (chunked dataset) B-tree's with non-default internal 'K' values. + QAK - 2003/07/15 + - Returned H5T_BKG_TEMP support to library after it was accidentally + removed. QAK - 2003/07/14 + + Configuration + ------------- + - Configure can now use any tr command. No more need for + defining variable TR nor is it supported. -AKC 2006/05/19 + - Parallel I/O with the MPI-I/O driver will no longer work if the + filesystem is not POSIX compliant. The "HDF5_MPI_1_METAWRITE" + environment variable has been removed. QAK - 2004/01/30 + - Fixed the error that cause "make install" to fail because of the + macro definition syntax of "prefix?=..." AKC - 2003/07/22 + + Performance + ------------- + - Optimized I/O for enumerated datatypes that are a superset of source + enumerated datatype. QAK - 2005/03/19 + - More optimizations to inner loops of datatype conversions for + integers and floats which give a 10-50% speedup. QAK - 2003/11/07 + - Hoisted invariant 'if/else's out of inner datatype conversion loop for + integer and floating-point values, giving about a 20% speedup. + QAK - 2003/10/20 + + Tools + ----- + - Fixed h5dump regarding the display of blocks in hyperslab + selections. PVN 2008/01/16 + - Fixed h5diff regarding the display of NaN (Not a Number) + values. PVN 2008/01/16 + - Fixed h5dump regarding the parsing of binary output parameters. + PVN 2008/01/16 + - Fixed memory problems in h52gif and gif2h5. PVN 2008/01/16 + - Fixed h5repack dealing with NULL references. PVN 2008/01/16 + - Fixed h5dump & h5ls to display attributes in "name" order, rather + than the order they are encountered in the object header. + QAK - 2007/10/04 + - Fixed h5dump regarding the display of named datatypes + attributes. PVN 2007/03/13 + - Fixed h5dump regarding the display of group comments. PVN + 2007/03/13 + - Fixed h5dump regarding the display of hardlinks pointing + to the root group. PVN 2007/03/13 + - Fixed h5diff percentage option -p. PVN 2007/03/05 + - Fixed h5dump that caused array indices greater than 2 ^32-1 + not to be printed correctly - PVN 2007/2/19 + - Fixed h5dump to print attributes data in ASCII if -r option is used. + AKC - 2004/11/18 + - Fixed space utilization reported in h5ls to correct error in formula + used. QAK - 2004/10/22 + - Fixed h5redeploy which sometimes complain too many argument for the + test command. (The complain did not hinder the h5redploy to + proceed correctly.) AKC - 2003/11/03 + - Fixed a segmentation fault of h5diff when percentage option is used. + AKC - 2003/08/27 + - Switched away from tools using internal "fixtype" function(s) to use + H5Tget_native_type() internally. QAK - 2003/08/25 + + + Documentation + ------------- + + + F90 APIs + -------- + - h5pget_driver_f was returning information that could not be + interpreted by fortran application program; fixed. EIP - 2005/04/10 + + +Platforms Tested +================ +Platforms marked with * were not tested for hdf5-1.8.0-rc* release +(This information is somewhat out of date and may be inaccurate. It will be + updated for a later release) + +* AIX 5.2 (32/64 bit) xlc 8.0.0.11 + xlC 8.0 + xlf 10.01.0000.0 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 +* AIX 5.3 (32/64 bit) xlc 7.0.0.8 + xlC 7.0.0.8 + xlf 09.01.0000.0007 +* Cray X1 water 3.0.35 Cray Standard C Version 5.4.0.7.4 + Cray Fortran 5.4.0.7.3 + Cray C++ 5.4.0.7.4 + FreeBSD 6.2-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 + (duty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20070620 + FreeBSD 6.2-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 + (liberty) g++ 3.4.6 [FreeBSD] 20060305 + gcc 4.2.1 20080123 + g++ 4.2.1 20080123 + gfortran 4.2.1 20080123 + +* HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.00 + HP F90 v2.9.2 + HP aC++/ANSI C B3910B A.06.00 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m + F90 MIPSpro 7.4.4m + C++ MIPSpro cc 7.4.4m + +* Linux 2.6.9 (RHEL4) Intel 10.0 compilers + (abe.ncsa.uiuc.edu) + Linux 2.4.21-47 gcc 3.2.3 20030502 + (osage) + Linux 2.6.9-42.0.10 gcc 3.4.6 20060404 + (kagiso) PGI 7.0-7 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, ifort, icpc) + Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, g95 (GCC 4.0.3) + (smirom) PGI 6.2-5 (pgcc, pgf90, pgCC) + Intel 9.1 (icc, iort, icpc) + Linux 2.6.5-7.252.1-rtgfx #1 + SMP ia64 Intel(R) C++ Version 9.0 + (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 + SGI MPI + SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 +* SunOS 5.10 i86pc Sun C 5.7 + Sun Fortran 95 8.1 + Sun C++ 5.7 + SunOS 5.10 cc: Sun C 5.8 + (linew) f90: Sun Fortran 95 8.2 + CC: Sun C++ 5.8 + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) gcc 3.2.2 20030222 + Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + IA-64 Linux 2.4.21.SuSE_292.til1 ia64 + (NCSA tg-login) gcc 3.2.2 + Intel(R) C++ Version 8.1 + Intel(R) Fortran Compiler Version 8.1 + mpich-gm-1.2.5..10-intel-r2 + Windows XP + Visual Studio .NET + Visual Studio 2005 w/ Intel Fortran 9.1 + Cygwin(native gcc compiler and g95) + MinGW(native gcc compiler and g95) + Windows XP x64 + Visual Studio 2005 w/ Intel Fortran 9.1 + Windows Vista + Visual Studio 2005 + + MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) +* Alpha Open VMS 7.3 + + +Supported Configuration Features Summary +(This table was not modified for 1.8.0-rc* release; for information contact help@hdfgroup.org) +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +SunOS5.8 64-bit n y n y y y +SunOS5.8 32-bit n y n y y y +SunOS5.10 64-bit y(1) y n y y y +SunOS5.10 32-bit y(1) y n y y y +IRIX64_6.5 64-bit n y y y y y +IRIX64_6.5 32-bit n n n n y y +Cray XT3 (16) n n n n n n +AIX-5.2 & 5.3 32-bit y y y y y y +AIX-5.2 & 5.3 64-bit y y y y y y +Windows XP n y(15) n(15) y y y +Windows XP x64 n y(15) n(15) y y y +Windows Vista n n n y y y +Mac OS X 10.4 PowerPC n n +FreeBSD 4.11 n n n y y y +RedHat EL3 W (3) y(1a) y(10) y(1a) y y y +RedHat EL3 W Intel (3) n y n y y n +RedHat EL3 W PGI (3) n y n y y n +SuSe x86_64 gcc (3,12) y(1a) y(11) n y y y +SuSe x86_64 Int (3,12) n y(13) n y y n +SuSe x86_64 PGI (3,12) n y(8) n y y y +Linux 2.4 Xeon C + Lustre Intel (3,6) n y n y y n +Linux 2.6 SuSE ia64 C + Intel (3,7) y y y y y n +Linux 2.6 SGI Altix + ia64 Intel (3) y y y y y y +Alpha OpenVMS 7.3.2 n y n y n n + + + +Platform Shared Shared Shared static- Thread- + C libs F90 libs C++ libs exec safe +Solaris2.8 64-bit y y y x y +Solaris2.8 32-bit y y y x y +Solaris2.10 64-bit y x y +Solaris2.10 32-bit y x y +IRIX64_6.5 64-bit y y n y y +IRIX64_6.5 32-bit y dna y y y +HPUX11.00 y n y x n +HPUX11.23-32bit y n n y n +HPUX11.23-64bit y dna n y n +Cray XT3 (16) n n n n n +AIX-5.2 & 5.3 32-bit n n n y n +AIX-5.2 & 5.3 64-bit n n n y n +Windows XP y y(15) y y y +Windows XP x64 y y(15) y y y +Windows Vista y n n y y +Mac OS X 10.3 y y n +Mac OS X 10.4 PowerPC +FreeBSD 4.11 y n y y y +RedHat EL3 W (3) y y(10) y y y +RedHat EL3 W Intel (3) y y y y n +RedHat EL3 W PGI (3) y y y y n +SuSe x86_64 W GNU (3,12) y y y y y +SuSe x86_64 W Int (3,12) y y y y(14) n +SuSe x86_64 W PGI (3,12) y y y y(14) n +Linux 2.4 Xeon C + Lustre Intel (6) y y y y n +Linux 2.4 SuSE + ia64 C Intel (7) y y y y n +Linux 2.4 SGI Altix + ia64 Intel y y n +Alpha OpenVMS 7.3.2 n n n y n + + Notes: (1) Using mpich 1.2.6. + (1a) Using mpich2 1.0.6. + (2) Using mpt and mpich 1.2.6. + (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers + (8) pgf90 + (9) With Compaq Visual Fortran 6.6c compiler. + (10) With PGI and Absoft compilers. + (11) PGI and Intel compilers for both C and Fortran + (12) AMD Opteron x86_64 + (13) ifort + (14) Yes with C and Fortran, but not with C++ + (15) Using Visual Studio 2005 or Cygwin + (16) Not tested for this release. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + + +Known Problems +============== +* We discovered two problems when running collective IO parallel HDF5 tests + with chunking storage on ChaMPIon MPI compiler on tungsten, a linux + cluster at NCSA. + Under some complex selection cases, + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates wrong derived data type and corrupt data + may be generated. + This only happens when turning on collective IO with chunking storage + with some complex selections. We haven't found these problems on other + MPI-IO compilers. If you encounter these problems, you may use Independent IO + instead. + + Change the following line in your code: + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + + KY - 2007/08/24 + +* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel + tests failed with MPI-IO file locking message. AKC - 2007/6/25. +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use + -mp -O1 compilation flags to build the libraries. Higher level of optimization + causes failures in several HDF5 library tests. +* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the + shared libraries (tested for 1.8.0-beta2) +* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass + and the parallel tests also pass with lots of non-fatal error messages. +* For LLNL, uP: both serial and parallel pass. Zeus: serial passes but + parallel fails with a known proglem in MPI. ubgl: serial passes but + parallel fails. +* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test +* configuring with --enable-debug=all produces compiler errors on most + platforms. Users who want to run HDF5 in debug mode should use + --enable-debug rather than --enable-debug=all to enable debugging + information on most modules. +* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long + double to (unsigned) long long and from (unsigned)long long to long double. +* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 + optimization flag. +* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to + HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard + for floating-point data. +* On Cray X1, a lone colon on the command line of h5dump --xml (as in + the testh5dumpxml.sh script) is misinterpereted by the operating system + and causes an error. +* On mpich 1.2.5 and 1.2.6, we found that if more than two processes + contribute no IO and the application asks to do IO with collective, we found + that when using 4 processors, a simple collective write will be hung + sometimes. This can be verified with t_mpi test under testpar. +* On IRIX6.5, when C compiler version >7.4, the complicate MPI derived data type + code will work. However, the user should be aware to enlarge MPI_TYPE_MAX environment + variable to some certian value in order to use collective irregular selection code. + For example, the current parallel HDF5 test needs to enlarge MPI_TYPE_MAX to + 200,000 to make the test pass. +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release + after 1.6.4 can still read the dataset created or rewritten with the library + of v1.6.2 or before. SLU - 2005/6/30 +* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + The tests may fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check if there are many old /tmp/s.pedb.* staying around. These are + sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a mean to run poe without the debug socket. + +* The C++ library's tests fails when compiling with PGI C++ compiler. The + workaround until the problem is correctly handled is to use the + flag "--instantiate=local" prior to the configure and build steps, as: + setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher + + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from this site: + ftp://www.hdfgroup.uiuc.edu/pub/outgoing/hdf5/hdf5-1.8.0-pre/PATCH/ + +* Not all platforms behave correctly with szip's shared libraries. Szip is + disabled in these cases, and a message is relayed at configure time. Static + libraries should be working on all systems that support szip, and should be + used when shared libraries are unavailable. There is also a configure error + on Altix machines that incorrectly reports when a version of szip without + an encoder is being used. + +* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 of + the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. However, if + you still experience a problem, you may want to check this line in the + libtool file and make sure that it has the correct value. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* On at least one system, (SDSC DataStar), the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scipts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +* H5Ocopy() does not copy reg_ref attributes correctly when shared-message + is turn on. The value of the reference in the destination attriubte is + wrong. This H5Ocopy problem will affect h5copy tool + +%%%%1.6.7%%%% Release Information for hdf5-1.6.7 (31/January/08) + +HDF5 version 1.6.7 released on Thu Jan 31 21:09:10 CST 2008 +================================================================================ + +INTRODUCTION +============ +This document describes the differences between HDF5-1.6.6 and HDF5-1.6.7 +It contains information on the platforms tested and known problems in +HDF5-1.6.7. For more details, check the HISTORY.txt file in the HDF5 source. + +HDF5 documentation can be found in the distributed release source code +in the subdirectory doc/html/ or on the THG (The HDF Group) FTP server: + + ftp://ftp.hdfgroup.org/HDF5/docs/ + +Documentation for the current release in the HDF5 Release 1.6.x series is +also on the HDF web site: + + http://hdfgroup.org/HDF5/doc1.6/ + +For more information, see the HDF5 home page: + + http://hdfgroup.org/products/hdf5/ + +If you have any questions or comments, please see the HDF Support page +for a list of available resources: + + http://hdfgroup.org/services/support.html + + +CONTENTS +======== +- New Features +- Support for New Platforms, Languages and Compilers +- Bug Fixes since HDF5-1.6.6 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + Configuration: + ------------------------- + '--enable-stream-vfd' and '--disable-stream-vfd' are no longer valid + configure options because the stream I/O driver has ben removed from + the distribution. + + Source code distribution + ======================== + Library: + -------- + The stream I/O driver is not included with the HDF5 Library in this + release. The source code files hdf5/src/H5FDstream.c and + hdf5/src/H5FDstream.h and the driver ENUM value H5FD_STREAM have been + removed. + + Parallel Library: + ----------------- + None + + Tools: + ------ + None + + F90 API: + -------- + None + + C++ API: + -------- + None + + +Support for New Platforms, Languages and Compilers +================================================== + +No new platorms, languages, or compilers are supported in this release. + + +Bug Fixes since HDF5-1.6.6 Release +================================== + + Library + ------- + - H5Iget_name could not be used with an object identifier returned + by H5Rdereference; the function would not be able to determine + a valid object name. It has been fixed. SLU - 2008/1/30 + - Changed library's behavior for reading files that might have + corrupted object header information from a previous (buggy) + version of the library. By default, the library now rebuilds the + correct object header information instead of issuing an error. + Previous "strict" file format interpretation can be enabled with + the "--enable-strict-format-checks" configure option. + QAK - 2008/01/13 + - Fixed bug in H5Epush() which was clearing the error stack before + pushing new error value. QAK - 2007/08/23 + - Fixed bug in H5Ewalk() which was not passing back the return value + from error stack walking callback. QAK - 2007/08/23 + + + Configuration + ------------- + None + + + Performance + ------------- + None + + + Tools + ----- + None + + + Documentation + ------------- + None + + + F90 API + ------- + None + + + C++ API + ------- + None + + +Documentation +============= + HDF5 documentation can be found in the distributed release source + code in the subdirectory doc/html/ (start with index.html) or on the + THG (The HDF Group) FTP server: + + ftp://ftp.hdfgroup.org/HDF5/docs/ + + Online documentation for the current release in the HDF5 Release 1.6.x + series can be found on the THG web site: + + http://hdfgroup.org/HDF5/doc1.6/ + + A listing of interface changes from release to release can be found + in the document "HDF5 Software Changes from Release to Release": + + http://hdfgroup.org/HDF5/doc1.6/ADGuide/Changes.html + + Since the stream I/O driver is not included in this release, the + functions H5Pset_fapl_stream and H5Pget_fapl_stream and the stream + ENUM value H5FD_STREAM have been removed from the documentation. + + +Platforms Tested +================ + + AIX 5.2 (32/64 bit) xlc 8.0.0.11 + (datastar) xlC 8.0 + xlf 10.01.0000.0002 + + FreeBSD 6.2 (32- and 64-bit) gcc and g++3.4.6 + (duty and liberty) gcc and g++ 4.2.1 + + IRIX64 6.5 MIPSpro cc 7.4.4m + (ucar mop1 64 & n32) F90 MIPSpro 7.4.4m (64 only) + C++ MIPSpro cc 7.4.4m + + Linux 2.4.21-47.ELsmp #1 SMP gcc 3.2.3 + i686 i386 GNU/Linux + (osage) + + Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 + SMP i686 i386 G95 (GCC 4.0.3 (g95 0.91!) April 18 2007) + (kagiso) PGI C, Fortran, C++ 7.0-7 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 9.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 9.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 9.1 + Absoft 32-bit Fortran 95 10.0.4 + MPICH mpich2-1.0.6p1 compiled with + gcc 4.2.1 and G95 (GCC 4.0.3 (g95 0.91!) + + Linux 2.6.16.46-0.12-debug #1 Intel(R) C++ Version 10.0.025 + SMP ia64 GNU/Linux Intel(R) Fortran Itanium(R) Version 10.0.025 + (ucar hir1) + + Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T Ver. 9.1.037 + SMP x86_64 GNU/Linux Intel(R) Fortran Intel(R) EM64T Ver. 9.1.031 + (smirom) PGI C, Fortran, C++ Version 7.0-7 + for 64-bit target on x86-64 + tested for both 32- and 64-bit binaries + + Linux 2.6.5-7.287.3-sn2 #1 Intel(R) C++ Version 9.0 + Altix SMP ia64 Intel(R) Fortran Itanium(R) Version 9.0 + (cobalt) SGI MPI + + SunOS 5.8 32- and 64-bit Sun WorkShop 6 update 2 C 5.3 + (sol) Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 + + SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.8 + (linew) Sun WorkShop 6 update 2 Fortran 95 8.2 + Sun WorkShop 6 update 2 C++ 5.8 + Patch 121019-06 + + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + PGI C Version 6.0-5 + PGI C++ Version 6.0-5 + PGI Fortran Version 6.0-5 + gcc (GCC) 3.2.2 (Red Hat Linux 3.2.2-5) + + Xeon Linux 2.6.9-42.0.10.EL_lustre-1.4.10.1smp + (abe) Intel(R) C++ Version 10.0 + Intel(R) Fortran Compiler Version 10.0 + Open MPI 1.2.2 + + IA-64 Linux 2.4.21-309.tg1 #1 SMP + ia64 gcc (GCC) 3.2.2 + (NCSA tg-login) Intel(R) C++ Version 8.1 + Intel(R) Fortran Compiler Version 8.1 + mpich-gm-1.2.6..14-intel-r2 + + Windows XP Visual Studio 6.0 + Visual Studio .NET (with Intel Fortran 9.1) + Visual Studio 2005 (with Intel Fortran 9.1) + cygwin (gcc 3.4.4) + + Windows Vista Visual studio 2005 + MAC OS X Intel Darwin 8.10.1 + i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + g95 0.91 + + +Supported Configuration Features Summary +======================================== + +Key: y = Tested and supported + n = Not supported or not tested in this release + C = Cluster + W = Workstation + ( ) = Footnote appears below second table + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.8 32-bit n y n y n y +Solaris2.8 64-bit n y n n y y +Solaris2.10 32-bit n y n y y y +Solaris2.10 64-bit n y n n y y +IRIX64_6.5 32-bit n n n n y y +IRIX64_6.5 64-bit n y n n y y +WinXP Visual Studio 6.0 n n n y y y +WinXP CYGWIN n n n y y y +WinXP 2005 n y n y y y +WinXP .Net n y n y y y +WinVista 2005 n n n y y y +Mac OS X 10.4.10 n y n y y y +AIX-5.2 & 5.3 32- and 64-bit y y y y y y +FreeBSD 6.2 32- and 64-bit n n n y y y +RedHat Linux 2.4.21 W n n n n y n +RedHat Linux 2.6.9-42 i686 GNU (1) W y y y y y y +RedHat Linux 2.6.9-42 i686 Intel W n y n y y n +RedHat Linux 2.6.9-42 i686 PGI W n y n y y n +SuSE Linux 2.6.16 x86_64 GNU (1) W y y n y y y +SuSE Linux 2.6.16 x86_64 Intel W n y n y y n +SuSE Linux 2.6.16 x86_64 PGI W n y n y y n +RHEL 4 Linux 2.6.9 Xeon Lustre C n y n y y y +RedHat Linux 2.4 Xeon Lustre C n y n y y n +SuSE Linux 2.4 ia64 C y y y y y y +SuSe Linux 2.6.5 SGI Altix ia64 n y n y y y + + +Platform Shared static- Thread- + libraries(4) exec safe +Solaris2.8 32- and 64-bit y n y +Solaris2.10 32- and 64-bit y n y +IRIX64_6.5 32-bit y n y +IRIX64_6.5 64-bit y n y +WinXP Visual Studio 6.0 y n n +WinXP CYGWIN y n n +WinXP 2005 y n n +WinXP .Net y n n +WinVista 2005 y n n +Mac OS X 10.4.10 y n n +AIX-5.2 & 5.3 32- and 64-bit n n n +FreeBSD 6.2 32- and 64-bit y n n +RedHat Linux 2.4.21 W y n n +SuSE Linux 2.6.9-42 i686 GNU (1) W y n y +SuSE Linux 2.6.9-42 i686 Intel W y n n +SuSE Linux 2.6.9-42 i686 PGI W n n n +SuSE Linux 2.6.16 x86_64 GNU (1) W y n y +SuSE Linux 2.6.16 x86_64 Intel W y n n +SuSE Linux 2.6.16 x86_64 PGI W n n n +RHEL 4 Linux 2.6.9 Xeon Lustre C y n n +RedHat Linux 2.4 Xeon Lustre C y n n +SuSE Linux 2.4 ia64 C y n n +SuSe Linux 2.6.5 SGI Altix ia64 n n n + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: +(1) Fortran compiled with g95. + + +Known Problems +============== +* We discovered two problems when running collective IO parallel HDF5 tests + with chunking storage with the ChaMPIon MPI compiler on tungsten, a Linux + cluster at NCSA. + Under some complex selection cases, + 1) MPI_Get_element returns the wrong value. + 2) MPI_Type_struct also generates the wrong derived datatype and corrupt + data may be generated. + This only happens when turning on collective IO with chunking storage + with some complex selections. We haven't found these problems on other + MPI-IO compilers. If you encounter these problems, you may use Independent + IO instead. + + To avoid this problem, change the following line in your code: + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + + to + H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + + KY - 2007/08/24 + +* QSC (an HP alpha-based OSF1 cluster) does not create h5pfc correctly. It + does not include the -lmpi properly. This will be fixed in the next + release. AKC - 2007/08/07. + +* On IRIX64 6.5 (UCAR SGI mop1), when testing HDF5 tools with an HDF5 shared + library, especially for h5repacktst and h52gifgentst, the following (or a + similar) error message may appear: + "523648:lt-h5repacktst: rld: Fatal Error: Cannot Successfully map soname + 'libh5test.so.1' under any of the filenames .......(bunch of directories) + " + And the testing will fail. + + We believe this is a libtool problem. One way to get rid of this is to + add the paths of libh5test.so.1 and libh5.so.1 to the shared library path. + + For 32-bit: + You may do this, under csh: + setenv LD_LIBRARYN32_PATH .......(existing paths):[full path of HDF5 + directory/test/.libs]:[full path of HDF5 directory/src/.libs] + + For 64-bit: + setenv LD_LIBRARY64_PATH ......(existing paths):[full path of HDF5 + directory/test/.libs]:[full path of HDF5 directory/src/.libs] + + NOTE: This problem ONLY affects the testing of the HDF5 library when you + build from source. It won't affect any applications that would like to link + with the HDF5 shared library since the shared library path needs to be set + anyway. KY - 2007/8/2 + +* QSC (an HP alpha-based OSF1 cluster) failed the testpar/testphdf5 sub-test + "calloc". All other tests passed. This indicates that a dataset using + chunked storage created by serial HDF5 may not work properly with parallel + HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x + calloc". AKC - 2007/7/12. + +* The Intel C Compiler for the Linux x86_64 platform (EM64T-based, v8.1) has + an optimization error in the datatypes conversion code. Before running + configure, edit the file config/intel-flags by changing the setting of + PROD_CFLAGS from -O3 to -O0. Then run configure. AKC - 2005/11/10. + +* When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 on IRIX + 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for + example 120000, in order to pass the complicated collective IO tests inside + the parallel HDF5 library. This is not a problem inside the parallel HDF5 + library. You can always set a bigger number on your system. KY - 2005/10/6 + +* A contiguous or chunked dataset created by a sequential version of HDF5 + might not be able to be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the + dataset creation property list to avoid the problem. EIP - 2005/09/09 + +* A dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC (a filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. HDF5 library releases + after 1.6.4 can still read datasets created or rewritten with an HDF5 + library of v1.6.2 or before. SLU - 2005/7/8 + +* For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests, all related to the multi driver. The problem has + been reported to the vendor. + +* test/big fails sometimes with the message "Possible overlap with another + region." The test selects regions randomly, and this error occurs when + two regions overlap each other; it is a bug in the test and not in + HDF5. Since the error is triggered by a random situation, it will + usually disappear if the test is re-run. + +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but + have a "guard" statement in stdint.h that will #error and skip the rest + of the header file if the C99 option is not used explicitly. Hardsetting + $CC to c99 will resolve the problem. AKC - 2004/12/13 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may also fail with messages like "The socket name is already + in use". HDF5 does not use sockets. This is due to problems of the + poe command trying to set up the debug socket. Check whether there are + many old /tmp/s.pedb.* files staying around. These are sockets used by + the poe command and left behind due to failed commands. Ask your system + administrator to clean them out. Lastly, request IBM to provide a means + to run poe without the debug socket. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on the IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + The --enable-static-exec configure flag also fails to correctly compile + on the HPUX 11.00. + + It is suggested that you don't use this option on these platforms + during configuration. + +* Use the --disable-shared configure flag if building with an Absoft Fortran + compiler. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8. + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the following test: + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to + 10**-308. If -ieee is not used, the converted double values are mostly + 0.0, but occasionally appear as 10**-308. This has been reported to the + system staff. + + All other tests have passed. + +* On at least one system, SDSC DataStar, the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF5 make files and test scripts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However, on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. JM - 2004/9/15 + +%%%%1.6.6%%%% Release Information for hdf5-1.6.6 (16/August/08) + +HDF5 version 1.6.6 released on Thu Aug 16 11:17:10 CDT 2007 +================================================================================ + +INTRODUCTION +============ +This document describes the differences between HDF5-1.6.5 and +HDF5-1.6.6 It contains information on the platforms tested and +known problems in HDF5-1.6.6. For more details, check the HISTORY.txt +file in the HDF5 source. + +HDF5 documentation can be found in the distributed release source +code in the subdirectory doc/html/ or on the THG (The HDF Group) +ftp server (ftp.hdfgroup.org) in the directory: + + /HDF5/docs/ + +Documentation for the current release is also on the HDF web site: + + http://hdfgroup.org/HDF5/doc/ + +For more information, see the HDF5 home page at: + + http://hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to: + + help@hdfgroup.org + + +CONTENTS +======== +- New Features +- Support for New Platforms, Languages and Compilers +- Bug Fixes since HDF5-1.6.5 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + Configuration: + ------------------------- + - HDF5 now uses autoconf 2.61 to generate configure. MAM - 2007/7/25. + + Source code distribution + ======================== + Library: + -------- + - None + + Parallel Library: + ----------------- + - None + + Tools: + ------ + - h52gif and gif2h5: Both these tools were revised to include High + Level Image API support. Tests were added to /hl/tools/gif2h5. + PVN - 2007/04/13 + - h5dump: Added support for double long type H5T_NATIVE_LDOUBLE. + PVN - 2007/03/13 + - h5dump: Added support for binary output; see usage. PVN 2007/03/13 + - h5repack: Added support for reading and writing by hyperslabs for + large files. PVN - 2007/03/01 + - h5repack: A new option allows the copy to use the source file type + (default) instead of the previous conversion to native type. + PVN - 2007/03/01 + - h5repack: Added output of the percentage of compression achieved. + PVN - 2007/03/01 + - h5diff: Added support for comparing dataset regions. PVN - + 2007/02/20 + - h5diff: Added support for reading and comparing by hyperslabs for + large files. PVN - 2007/02/20 + - h5diff: Added printing of dataset dimensions along with dataset + name. + PVN - 2007/02/19 + + F90 API: + -------- + - None + + C++ API: + -------- + - Added support for Szip: DSetCreatPropList::setSzip - BMR 2007/01/24 + + +Support for New Platforms, Languages and Compilers +================================================== + - Added support for MAC Intel (Darwin 8.8.2) (gcc 4.0.1 and g95 0.91) + EIP - 2007/02/13 + - Added support for GNU C compiler version 4.2.1 for FreeBSD 6.2 + (32- and 64-bit) + + +Bug Fixes since HDF5-1.6.5 Release +================================== + + Library + ------- + - Fixed several bugs with writing fill values for datasets that have + a variable-length datatype or component datatype. QAK - +2007/06/19 + - STDIO driver didn't support files bigger than 2GB because the OFFSET + parameter of fseek is of type LONG INT, not big enough for big + files. Use fseeko instead for big files if it's available on the + system. SLU - 2007/4/5 + - Relaxed restrictions on attribute operations to allow a file ID to + be used as the "location ID". If a file ID is used, the attribute + operation will occur on the root group of the file. + QAK - 2007/02/09 + - Fixed a bug in H5Sselect_valid() that caused an incorrect value to + be returned (0) instead of FAIL on error conditions such as the + selection or extent not being defined. CMC - 2007/01/05 + - Fixed potential file corruption bug which could overwrite a portion + of an object's header when an attribute was renamed. If the new + name for the attribute was longer than the old name, it was +possible + that the attribute would grow enough to overwrite another message + in the object's header. QAK - 2007/01/02 + - Fixed file corruption bug which could write an incorrect number of + messages to an object's header under certain circumstances. + Generally, the sequence of actions to generate this bug looks + like this: + - Create an object. + - Close the file. + - Re-open the file. + - Add 2 (or more) attributes to the object. + - Close the file. + - Re-open the file. + - Delete one of the attributes on the object. + - Add a smaller attribute to the object. + - Delete the smaller atttribute on the object. + - Add a larger attribute on the object. + + After this, the number of header messages stored for the object + will be off by one. Other sequences of modifying attributes on an + object could also trigger this bug. If you are opening an + object and the bottom few messages of the HDF5 error stack + resembles the following, the object has been affected by this bug: + + #007: ../../hdf5_v1.6/src/H5C.c line 3887 in H5C_load_entry(): +unable to load entry + major(08): Meta data cache layer + minor(40): Unable to load metadata into cache + #008: ../../hdf5_v1.6/src/H5Ocache.c line 332 in H5O_load(): +corrupt object header - too few messages + major(12): Object header layer + minor(40): Unable to load metadata into cache + + Specifically, "corrupt object header" is the best string to search + for in the HDF5 error stack output. + + If your files have been affected by this bug, or you are concerned + that your files might have been, please contact the HDF Helpdesk + at help@hdfgroup.org for a tool to detect and repair files + affected by this problem. QAK - 2006/6/16 + + - Fixed various problems with retrieving names of objects, especially + with mounted files. QAK - 2005/12/25 + + Configuration + ------------- + - Changed to default to --disable-shared if parallel is enabled. + AKC - 2007/5/12 + - Corrected a coding error in configure when it tries to locate the + needed MPI and MPI-IO library for the fortran interface. + AKC - 007/5/9. + - Changed default fortran compiler to g95 when gcc is used. + AKC - 007/2/17. + - Configure can now use any tr command. No more need for + defining the variable TR, nor is it supported. AKC - 2006/05/20 + + Performance + ------------- + - None + + Tools + ----- + - Fixed a bug in h5dump regarding the display of named datatypes + attributes. PVN - 2007/03/13 + - Fixed a bug in h5dump regarding the display of group comments. + PVN - 2007/03/13 + - Fixed a bug in h5dump regarding the display of hardlinks pointing + to the root group. PVN - 2007/03/13 + - Fixed a bug in the h5diff percentage option -p. PVN - 2007/03/05 + - Fixed a bug in h5dump that caused array indices greater than 2^32-1 + not to be printed correctly. PVN - 2007/2/19 + + Documentation + ------------- + - Corrected errors and extended the descriptions in Reference Manual + entries for several functions. + + F90 API + ------- + - None + + C++ API + ------- + - Changed + StrType::StrType(const size_t& size); + to + StrType::StrType(const int dummy, const size_t& size); + because the first one clashed with + StrType::StrType(const hid_t existing_id); - BMR 2007/05/03 + - Wrappers of H5Rcreate had incorrect prototypes. Added these + overloaded functions: + IdComponent::reference(void* ref, const char* name, +DataSpace& + dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) + IdComponent::void reference(void* ref, const char* name) + IdComponent::reference(void* ref, const H5std_string& name) + and will remove these incorrect member functions: + DataSet::Reference + DataType::Reference + Group::Reference + H5File::Reference + - Added wrappers for H5Rdereference as constructors: + DataSet(IdComponent& obj, void* ref); + Group(IdComponent& obj, void* ref); + DataType(IdComponent& obj, void* ref); + + +Documentation +============= + + HDF5 documentation can be found in the distributed release source + code in the subdirectory doc/html/ (start with index.html) or on the + THG (The HDF Group) ftp server (ftp.hdfgroup.org) in the directory: + + /HDF5/docs/ + + Online documentation for the current release can be found on the THG + web site: + + http://hdfgroup.org/HDF5/doc/ + + +Platforms Tested +================ + + AIX 5.2 (32/64 bit) xlc 6.0.0.8 + (datastar) xlC 6.0.0.9 + xlf 8.1.1.7 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + + AIX 5.3 (32/64 bit) xlc 7.0.0.0 + (copper) xlC 7.0. + xlf 9.1.0.3 + + FreeBSD 6.2 (32- and 64-bit) gcc and g++3.4.6 + (duty and liberty) gcc and g++ 4.2.1 + + HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.02 + (sirius) HP F90 v3.1 (32-bit only) + HP aC++/ANSI C B3910B A.06.02 + + IRIX64 6.5 MIPSpro cc 7.4.4m + (ucar mop1 64 & n32) F90 MIPSpro 7.4.4m (64 only) + C++ MIPSpro cc 7.4.4m + + Linux 2.4.21-47.ELsmp #1 SMP gcc 3.2.3 + i686 i386 GNU/Linux + (osage) + + Linux 2.6.9-42.0.10.ELsmp #1 gcc (GCC) 3.4.6 + SMP i686 i386 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) + (kagiso) PGI C, Fortran, C++ 6.2-5 32-bit + icc (ICC) 9.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 9.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 9.1 + Absoft 32-bit Fortran 95 10.0.4 + MPICH mpich2-1.0.4p1 compiled with + gcc 3.4.6 and G95 (GCC 4.0.3 (g95 0.91!) + + Linux 2.6.16.46-0.12-debug #1 + SMP ia64 GNU/Linux Intel(R) C++ Version 10.0.025 + (ucar hir1) Intel(R) Fortran Itanium(R) Version 10.0.025 + + Linux 2.6.16.46-0.14-smp #1 Intel(R) C++ for Intel(R) EM64T Ver. 9.1.037 + SMP x86_64 GNU/Linux Intel(R) Fortran Intel(R) EM64T Ver. 9.1.031 + (smirom) PGI C, Fortran, C++ Version 6.2-5 + for 64-bit target on x86-64 + tested for both 32- and 64-bit binaries + + Linux 2.6.5-7.283-rtgfx Altix + SMP ia64 Intel(R) C++ Version 9.0 + (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 + SGI MPI + + OSF1 V5.1 (QSC) Compaq C V6.5-011 + (See "Known Problems.") HP Fortran V5.5A-3548 + Compaq C++ V6.5-036 + MPIX200_64_r13.4 + + SunOS 5.8 32- and 64-bit Sun WorkShop 6 update 2 C 5.3 + (sol) Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 + + SunOS 5.10 32- and 64-bit Sun WorkShop 6 update 2 C 5.8 + (linew) Sun WorkShop 6 update 2 Fortran 95 8.2 + Sun WorkShop 6 update 2 C++ 5.8 + Patch 121019-06 + + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + PGI C Version 6.0 + PGI C++ Version 6.0 + PGI Fortran Version 6.0 + gcc (GCC) 3.2.2 (Red Hat Linux 3.2.2-5) + + Xeon Linux 2.6.9-42.0.10.EL_lustre-1.4.10.1smp + (abe) Intel(R) C++ Version 10.0 + Intel(R) Fortran Compiler Version 10.0 + Open MPI 1.2.2 + + IA-64 Linux 2.4.21.SuSE_292.til1 + ia64 gcc (GCC) 3.2.2 + (NCSA tg-login) Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + mpich-gm-1.2.5..10-intel-r2 + + Windows XP Visual Studio 6.0 + Visual Studio .NET (with Intel Fortran 9.0) + Visual Studio 2005 (with Intel Fortran 9.0) + cygwin (gcc 3.4.4) + + MAC OS X Intel Darwin 8.10.1 + i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 + g95 0.91 + + +Supported Configuration Features Summary +======================================== + +Key: y = Tested and supported + n = Not supported or not tested in this release + C = Cluster + W = Workstation + ( ) = Footnote appears below second table + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.8 32- and 64-bit n y n y y y +Solaris2.10 32- and 64-bit n y n y y y +IRIX64_6.5 32-bit n n n n y y +IRIX64_6.5 64-bit n y n n y y +HPUX11.23-32bit n y n y y y +HPUX11.23-64bit n n n y y y +WinXP Visual Studio 6.0 n n n y y y +WinXP CYGWIN n n n y y y +WinXP 2005 n y n y y y +WinXP .Net n y n y y y +Mac OS X 10.4.10 n y n y y y +AIX-5.2 & 5.3 32- and 64-bit y y y y y y +FreeBSD 6.2 32- and 64-bit n n n y y y +RedHat Linux 2.4.21 W n n n y y y +SuSE Linux 2.6.9-42 i686 GNU (1) W y y y y y y +SuSE Linux 2.6.9-42 i686 Intel W n y n y y y +SuSE Linux 2.6.9-42 i686 PGI W n y n y y y +SuSE Linux 2.6.16 x86_64 GNU (1) W y y y y y y +SuSE Linux 2.6.16 x86_64 Intel W n y n y y y +SuSE Linux 2.6.16 x86_64 PGI W n y n y y y +RHEL 4 Linux 2.6.9 Xeon Lustre C y y y y y y +RedHat Linux 2.4 Xeon Lustre C n y n y y y +SuSE Linux 2.4 ia64 C y y y y y y +SuSe Linux 2.6.16 SGI Altix ia64 n y n y y y +SuSe Linux 2.6.5 SGI Altix ia64 n y n y y y +OSF1 v5.1 y y y y y n + + +Platform Shared static- Thread- STREAM- + libraries(4) exec safe VFD +Solaris2.8 32- and 64-bit y n y y +Solaris2.10 32- and 64-bit y n y y +IRIX64_6.5 32-bit y n y y +IRIX64_6.5 64-bit y n y y +HPUX11.23-32bit y (3) n n y +HPUX11.23-64bit y (3) n n y +WinXP Visual Studio 6.0 y n n n +WinXP CYGWIN y n n n +WinXP 2005 y n n n +WinXP .Net y n n n +Mac OS X 10.4.10 y n n y +AIX-5.2 & 5.3 32- and 64-bit n n n y +FreeBSD 6.2 32- and 64-bit y n n y +RedHat Linux 2.4.21 W y n n y +SuSE Linux 2.6.9-42 i686 GNU (1) W y n y y +SuSE Linux 2.6.9-42 i686 Intel W y n n y +SuSE Linux 2.6.9-42 i686 PGI W n n n y +SuSE Linux 2.6.16 x86_64 GNU (1) W y n n y +SuSE Linux 2.6.16 x86_64 Intel W y n n y +SuSE Linux 2.6.16 x86_64 PGI W n n n y +RHEL 4 Linux 2.6.9 Xeon Lustre C y n n y +RedHat Linux 2.4 Xeon Lustre C y n n y +SuSE Linux 2.4 ia64 C y n n y +SuSe Linux 2.6.16 SGI Altix ia64 n n n y +SuSe Linux 2.6.5 SGI Altix ia64 n n n y +OSF1 v5.1 n n n y + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: +(1) Fortran compiled with g95. +(2) In most cases, shared libraries are provided only for the C library, + except on Windows where they are provided for C, C++, and Fortran. +(3) C++ works only with static libraries. + + +Known Problems +============== +* QSC (an HP alpha-based OSF1 cluster) does not create h5pfc correctly. It + does not include the -lmpi properly. This will be fixed in the next + release. AKC - 2007/08/07. + +* On IRIX64 6.5 (UCAR SGI mop1), when testing HDF5 tools with an HDF5 shared + library, especially for h5repacktst and h52gifgentst, the following (or + similar) error message may appear: + "523648:lt-h5repacktst: rld: Fatal Error: Cannot Successfully map soname + 'libh5test.so.1' under any of the filenames .......(bunch of directories) + " + And the testing will fail. + We believe this is a libtool problem. One way to get rid of this is to + add the paths of libh5test.so.1 and libh5.so.1 to the shared library path. + + For 32-bit: + You may do this, under csh: + setenv LD_LIBRARYN32_PATH .......(existing pathes):[full path of HDF5 + directory/test/.libs]:[full path of HDF5 directory/src/.libs] + + For 64-bit: + setenv LD_LIBRARY64_PATH ......(existing pathes):[full path of HDF5 + directory/test/.libs]:[full path of HDF5 directory/src/.libs] + + NOTE: This problem ONLY affects the testing of the HDF5 library when you + build from source. It won't affect any applications that would like to link + with the HDF5 shared library since the shared library path needs to be set + anyway. KY - 2007/8/2 + +* QSC (an HP alpha-based OSF1 cluster) failed the testpar/testphdf5 sub-test + "calloc". All other tests passed. This indicates that a dataset using + chunked storage created by serial HDF5 may not work properly with parallel + HDF5. The calloc test can be skipped by running "prun ... testphdf5 -x + calloc". AKC - 2007/7/12. + +* The Intel C Compiler for the Linux x86_64 platform (EM64T-based, v8.1) has + an optimization error in the datax types conversion code. Before running + configure, edit the file config/intel-flags by changing the setting of + PROD_CFLAGS from -O3 to -O0. Then run configure. AKC - 2005/11/10. + +* When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 on IRIX + 6.5, set the environment variable MPI_TYPE_MAX to be a bigger number, for + example 120000, in order to pass the complicated collective IO tests inside + the parallel HDF5 library. This is not a problem inside the parallel HDF5 + library. You can always set a bigger number on your system. KY - 2005/10/6 + +* A contiguous or chunked dataset created by a sequential version of HDF5 + might not be able to be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the + dataset creation property list to avoid the problem. EIP - 2005/09/09 + +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC (a filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release + after 1.6.4 can still read the dataset created or rewritten with the library + of v1.6.2 or before. SLU - 2005/7/8 + +* For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests, all related to the multi driver. The problem has + been reported to the vendor. + +* test/big fails sometimes with the message "Possible overlap with another + region." The test selects regions randomly, and this error occurs when + two regions overlap each other; it is a bug in the test and not in + HDF5. Since the error is triggered by a random situation, it will + usually disappear if the test is re-run. + +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but + have a "guard" statement in stdint.h that will #error and skip the rest + of the header file if the C99 option is not used explicitly. Hardsetting + $CC to c99 will resolve the problem. AKC - 2004/12/13 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + + The tests may also fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check whether there are many old /tmp/s.pedb.* files staying around. These + are sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a means to run poe without the debug socket. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on the IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + The --enable-static-exec configure flag also fails to correctly compile + on the HPUX 11.00. + + It is suggested that you don't use this option on these platforms + during configuration. + +* The Stream VFD is not supported under Windows. + +* Use the --disable-shared configure flag if building with Absoft Fortran + compiler. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8. + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the following test: + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to + 10**-308. If -ieee is not used, the converted double values are mostly + 0.0, but occasionally appear as 10**-308. This has been reported to the + system staff. + + All other tests have passed. + +* On at least one system, SDSC DataStar, the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF5 make files and test scripts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However, on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. JM - 2004/9/15 + + +%%%%1.6.5%%%% Release Information for hdf5-1.6.5 (10/November/05) + + +HDF5 version 1.6.5 released on Thu Nov 10 18:17:53 CST 2005 +================================================================================ + +INTRODUCTION +============ +This document describes the differences between HDF5-1.6.4 and +HDF5-1.6.5. It contains information on the platforms tested and +known problems in HDF5-1.6.5. For more details, check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +Documentation for the current release is also on the HDF web site: + + http://hdf.ncsa.uiuc.edu/HDF5/doc/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS +======== +- New Features +- Support for New Platforms, Languages and Compilers +- Bug Fixes since HDF5-1.6.4 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + Configuration: + ------------------------- + - Added yodconfigure, a configure tool, that patches up the configure + file to allow configure to launch executable via the proper + launching command like "yod -sz 1". AKC - 2005/11/10 + - Configure now recognizes the TR variable as the location of the + tr utility. JML 2005/10/20 + + Source code distribution: + ------------------------- + - Added g95 as a testing "platform" informally. AKC - 2005/10/04. + - Added MD5 checksumming to snapshot releases. Releases will now + produce an .md5 file as well as a .tar archive. md5sum can be + used to verify the arvhice with the .md5 checksum. -JL 2005/09/06 + + Library: + -------- + - Added HSYS_ERROR which retrieves the system error message and pushes + it to the error stack. This provides more information regarding the + failed system call. AKC - 2005/08/04 + - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to + allow querying for objects in a file that was opened with a particular + file ID, instead of all objects opened in the file with any file ID. + QAK - 2005/06/01 + + Parallel Library: + ----------------- + - Added mpich2 as a testing "platform" informally. AKC - 2005/10/04. + - HDF5 supports collective MPI-IO for irregular selection with HDF5 + dataset. Irregular selection is when users use API H5Sselect_hyperslab + more than once for the same dataset. + Currently, not all MPI-IO packages support the complicated + MPI derived datatypes used in the implementation of irregular + selections INSIDE HDF5. + 1) DEC 5.x wdoes not support complicated derived datatypes. + 2) For AIX 5.1: + If your poe version number is 3.2.0.20 or lower, + please edit powerpc-ibm-aix5.x in the directory hdf5/config/. + Find the line with + << hdf5_mpi_complex_derived_datatype_works >> + and UNCOMMENT this line before the configure. + check poe version with the following command: + lpp -l all | grep ppe.poe + 3) For Linux cluster,: + If mpich version is 1.2.5 or lower, collective irregular selection + IO is not supported; internally independent IO is used. + 4) For IRIX 6.5: + if C compiler version is 7.3 or lower, collective irregular + selection IO is not supported; internally independent IO is used. + 5) For platforms which internally used mpich: + If the mpich version is 1.2.5 or lower, please find the + corresponding config (in hdf5/config) file and add + hdf5_mpi_complex_derived_datatype_works='no' + at the end of the configuration file. For example, on the + NCSA SGI Altix, the internal mpich library is 1.2.5. So + hdf5_mpi_complex_derived_datatype_works='no' + should be added at the end of the config file ia64-linux-gnu. + KY - 2005/09/12 + + Tools: + ------ + - Removed obsolete pdb2hdf tool. JML - 2005/10/28 + - Sped up h5dump on files with large numbers of objects. + QAK - 2005/08/25 + + F90 API: + -------- + - Added missing h5tget_member_class_f function + EIP 2005/04/06 + C++ API: + -------- + - Added missing member functions: + H5::CompType::getMemberArrayType + H5::CompType::getMemberVarLenType + H5::AbstractDs::getArrayType + H5::AbstractDs::getVarLenType + H5::CommonFG::openArrayType + H5::CommonFG::openVarLenType + H5::PropList::copyProp -- this will replace the current + H5::PropList::copyProp in later releases due + to incorrect prototype. + BMR - 2005/07/27 + + +Support for New Platforms, Languages and Compilers +================================================== + - Added support for RedStorm platform (serial only.) AKC 2005/11/10 + - Added support for BG/L platform (serial only.) LA 2005/11/10 + - Added support for HPUX 11.23 (IA64); only C and C++ are supported + with the +DD64 flag + EIP 2005/10/05 + + + Configuration + ------------- + - Added support for Cray X1. JML 2005/10/03 + + +Bug Fixes since HDF5-1.6.4 Release +================================== + + Library + ------- + - Fixed collective IO in chunking-storage. HDF5 may have called the + wrong routine when the shape of the dataspace in the file and in + the bufferred chunk were different. This bug was fixed to make sure + the correct routine is called. KY - 2005/10/19 + - Fixed core dump when closing root groups opened through two different + file handles that operate on the same actual file. QAK - 2005/10/02 + - The ./dsets tests used to fail in the TFLOPS machine if the + test program, dsets.c, was compiled with the -O option. + The HDF5 library still worked correctly with the -O option. Only + the ./dsets failed. It is fixed. AKC - 2005/09/14 + - Corrected errors when performing various operations on a group opened + by dereferencing an object reference. QAK - 2005/07/30 + - Fixed a bug with named datatypes where a copy of a named datatype + used to create a dataset would accidentally use the original + named datatype for the dataset's datatype. QAK - 2005/07/23 + - Made H5Fget_name() to be consistent and always return name of actual + file the ID is in. (Instead of the name of the top file in a + file mounting hierarchy). QAK - 2005/07/19 + - Reworked internal file mounting semantics to hopefully eliminate + mounting problems. We now require that files that are mounting + together all have the same "file close degree". QAK - 2005/07/19 + - More bug fixes on holding open files that are mounted and have + IDs open. QAK - 2005/07/14 + - Dataset sieve buffer cache was inadvertantly disabled; it has been + re-enabled. QAK - 2005/07/08 + - Don't unmount child files until the parent file actually closes. + (Previously, if an object was holding open a file, the child files + would get unmounted too early). QAK - 2005/07/05 + - Fixed bug where unmounted files could cause the library to go into + an infinite loop when shutting down. QAK - 2005/06/30 + - Fixed bug with hyperslab selections that use selection offsets and + operate on chunked datasets going into infinite loop or dumping + core. QAK - 2005/06/17 + - Corrected memory leak and possible corruption when opening a group. + QAK - 2005/06/17 + - Added check for opaque datatype tags being too long (check against + H5T_OPAQUE_TAG_MAX, currently set to 256). QAK - 2005/06/14 + - Fixed various errors in maintaining names for open objects in the + face of unusual mount & unmount operations. QAK - 2005/06/08 + - "SEMI" and "STRONG" file close degree settings now apply only to the + particular file ID being closed, instead of operating on all open + file IDs for a given file. QAK - 2005/06/01 + - Fixed error in opening object in a group that was opened in a mounted + file which has been unmounted. QAK - 2005/03/17 + + Configuration + ------------- + - Configure can recognize -lmpich as a form of MPI library. -AKC- + 2005/9/28. + - Changed default C++ compiler for the IA64 platform from icc to + icpc which is the preferred compiler for Intel Compiler version + 8. AKC - 2005/09/02 + + Performance + ------------- + - Optimized I/O for enumerated datatypes that are a superset of a + source enumerated datatype. QAK - 2005/03/19 + + Tools + ----- + + Documentation + ------------- + + F90 API + ------- + - h5pget_driver_f was returning information that could not be + interpreted by a Fortran application program; fixed. EIP - 2005/04/10 + + C++ API + ------- + - Several member functions' prototype changed due to the + "int -> unsigned" change in the main library. They are: + H5::CompType::getMemberDataType(unsigned member_num) + H5::CompType::getMemberCompType(unsigned member_num) + H5::CompType::getMemberEnumType(unsigned member_num) + H5::CompType::getMemberIntType(unsigned member_num) + H5::CompType::getMemberFloatType(unsigned member_num) + H5::CompType::getMemberStrType(unsigned member_num) + BMR - 2005/07/27 + + + + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 + xlf 8.1.1.3 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 + mpxlf_r 8.1.1.3 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + AIX 5.2 (32/64 bit) xlc 6.0.0.8 + xlC 6.0.0.9 + xlf 8.1.1.7 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + AIX 5.2 (32/64 bit, LLNL frost) xlc 6.0.0.8 + xlC 6.0.0.8 + xlf 8.1.1.7 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + AIX 5.3 (32/64 bit) xlc 7.0.0.0 + xlC 7.0. + xlf 9.1.0.3 + Cray X1 water 3.0.35 Cray Standard C Version 5.4.0.7.4 + Cray Fortran 5.4.0.7.3 + Cray C++ 5.4.0.7.4 + FreeBSD 4.11 gcc 2.95.4 + g++ 2.95.4 + gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.00 + HP F90 v2.9 + HP aC++/ANSI C B3910B A.06.00 + IRIX64 6.5 (tesla -64) MIPSpro cc 7.4.2m + F90 MIPSpro 7.4.2m + C++ MIPSpro cc 7.4.2m + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + C++ MIPSpro cc 7.3.1.3m + mpt 1.6 + Linux 2.4.20-28.7 gcc 2.96 + (eirene, verbena) gcc 3.3.2 + PGI compilers (pgcc, pgf90, pgCC) + version 5.2-1 + Absoft Fortran compiler v9.0 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 + MPIch 1.2.6 + Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) + (mir) PGI 5.2-1 C and F90 (with k3-32) + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 + Linux 2.4.21-sgi306rp21 Altix + SMP ia64 Intel(R) C++ Version 8.1 + (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 + SGI MPI + OSF1 V5.1 (QSC) Compaq C V6.5-011 + HP Fortran V5.5A-3548 + Compaq C++ V6.5-036 + MPIX200_64_r13.4 + OSF1 V5.1 (PSC) Compaq C V6.5-303 + HP Fortran V5.5A-3548 + Compaq C++ V6.5-040 + SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + SunOS 5.9 32,64 Sun C 5.6 2004/07/15 + (Solaris 2.9) Sun Fortran 95 8.0 2004/07/15 + Sun C++ 5.6 2004/07/15 + SunOS 5.10 Sun WorkShop 6 update 2 C 5.3 + Sun WorkShop 6 update 2 Fortran 95 6.2 + Sun WorkShop 6 update 2 C++ 5.3 + Patch 111685-13 + Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre + (tungsten) Intel(R) C++ Version 9.0 + Intel(R) Fortran Compiler Version 9.0 + IA-64 Linux 2.4.21.SuSE_292.til1 ia64 + (NCSA tg-login) Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + mpich-gm-1.2.5..10-intel-r2 + Windows XP MSVC++.NET + MSVC++ 6.0 + Intel 8.1 C++ + MAC OS X Darwin 7.5 + gcc and g++ Apple Computer, Inc. GCC + version 1175, based on gcc version 3.3.2 + IBM XL Fortran version 8.1 + Absoft Fortran compiler v8.2 + + +Supported Configuration Features Summary +======================================== + +Key: y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +IBM BG/L (16) n n n n y y +Solaris2.8 64-bit y y y(1) y y y +Solaris2.8 32-bit y y y(1) y y y +Solaris2.9 64-bit y(1) y y(1) y y y +Solaris2.9 32-bit y(1) y y(1) y y y +Solaris2.10 64-bit y(1) y n y y y +Solaris2.10 32-bit y(1) y n y y y +IRIX64_6.5 64-bit y(2) y y y y y +IRIX64_6.5 32-bit y(2) n n n y y +HPUX11.00 y(1) y y y y y +HPUX11.23-32bit n y n y y y +HPUX11.23-64bit n n n y y y +OSF1 v5.1 y y y y y y +X1 y y y y y n +AIX-5.1, 5.2 & 5.3 32-bit y y y y y y +AIX-5.1, 5.2 & 5.3 64-bit y y y y y y +WinXP Visual Studio 6.0 n n(9) n y y y +WinXP .Net n n n y(8) y y +Mac OS X 10.3 n y(10) n y y y +FreeBSD 4.11 n n n y y y +RedHat 7.3 W (3) y(1) y(11) n y y y +RedHat 7.3 W Intel (3) n y n y y y +RedHat 7.3 W PGI (3) n y n y y y +RedStorm (16) n y n y y n +SuSe x86_64 gcc (3,13) n y(12) n y y y +SuSe x86_64 icc (3,13) n y(14) n y y y +Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y y +Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y +Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y + + +Platform Shared static- Thread- STREAM- + libraries(4) exec safe VFD +IBM BG/L n y n n +Solaris2.8 64-bit y x y y +Solaris2.8 32-bit y x y y +Solaris2.9 64-bit y x y y +Solaris2.9 32-bit y x y y +Solaris2.10 64-bit y x y y +Solaris2.10 32-bit y x y y +IRIX64_6.5 64-bit y y y y +IRIX64_6.5 32-bit y y y y +HPUX11.00 y x n y +HPUX11.23 y y n y +OSF1 v5.1 y y n y +X1 n y n y +AIX-5.1, 5.2 & 5.3 32-bit n y n y +AIX-5.1, 5.2 & 5.3 64-bit n y n y +WinXP Visual Studio 6.0 y y n n +WinXP .Net y y n n +Mac OS X 10.3 y y n y +FreeBSD 4.11 y y y y +RedHat 7.3 W (3) y y y y +RedHat 7.3 W Intel (3) n y n y +RedHat 7.3 W PGI (3) n y n y +RedStorm n y n y +SuSe x86_64 gcc (3,13) n y n y +SuSe x86_64 icc (3,13) y y(15) n y +Linux 2.4 Xeon C Lustre Intel (3,6) y y n y +Linux 2.4 SuSE ia64 C Intel (3,7) y y n n +Linux 2.4 SGI Altix ia64 Intel (3) y y n y + + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: (1) Using mpich 1.2.6 + (2) Using mpt and mpich 1.2.6. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + (4) Shared libraries are provided only for the C library, + except on Windows where they are provided for C and C++. + (5) Using mpt. + (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp-perfctr-lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_292.til1. Ia64 cluster with Intel compilers + (8) Intel 8.1 + (9) One test of this release failed with Compaq Visual Fortran 6.6c. + No binary fortran release will be provided. Users should build + the library by themselves and use it at their own risk. + We recommend that users use HDF5 1.7 instead + or use Compaq Visual Fortran 6.0. + (10) IBM XLF and Absoft + (11) PGI, Absoft. No shared libraries with Absoft; + use '--disable-shared'. + (12) PGI and Intel compilers for both C and Fortran + (13) AMD Opteron x86_64 + (14) ifort + (15) Yes with C and Fortran, but not with C++ + (16) Only serial is ported. PFS does not work for PHDF5 yet. + FMB/EIP - 2005/11/10 + + +Known Problems +============== +* Intel Compilers for Linux x86_86 platforms (EM64T-based, v8.1) has + optimization error in the data types conversion code. Before running + configure, edit the file config/intel-flags by changing the setting of + PROD_CFLAGS from -O3 to -O0, then run configure. AKC - 2005/11/10. + +* Fortran testing and compiling failures on windows XP + 1. Compaq visual fortran 6.6c with VS 6.0 + The Fortran tests failed for both release, release dll, debug and debug + dll. The failure is a random one. We won't provide fortran libraries. The + same test passed with the 1.7.51 snapshot. You may find the 1.7.51 + snapshot under ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/snapshots/. + 2. Intel fortran 8.1 under .Net environment + The fortran library cannot even be compiled. Some users have pointed this + to intel forum. + +* When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 at IRIX + 6.5, set enviroment variable MPI_TYPE_MAX to be a bigger number, for example + 120000, in order to pass the complicated collective IO tests inside parallel + HDF5 library. This is not a problem inside parallel HDF5 library. You can + always set a bigger number in your system. + KY - 2005/10/6 + +* A contiguous or chunked dataset created by a sequential version may + not be modified with a parallel version of the library. + Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the + dataset creation property list to avoid the problem. + EIP - 2005/09/09 + +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release + after 1.6.4 can still read the dataset created or rewritten with the library + of v1.6.2 or before. SLU - 2005/7/8 + +* For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. + +* test/big fails sometimes with the message "Possible overlap with another + region." The test selects regions randomly, and this error occurs when + two regions overlap each other; it is a bug in the test and not in + HDF5. Since the error is triggered by a random situation, it will + usually disappear if the test is re-run. + +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but it + has a "guard" statement in stdint.h that will #error and skip the rest + of the header file if C99 option is not used explicitly. Hardset + $CC to c99 will resolve the problem. AKC - 2004/12/13 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + The tests may fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check if there are many old /tmp/s.pedb.* staying around. These are + sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a means to run poe without the debug socket. + +* Two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) + failed on windows xp with .NET for debug and debug dll. Release and + Release dll work fine. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + The --enable-static-exec configure flag also fails to correctly compile + on the HPUX 11.00. + + It is suggested that you don't use this option on these platforms + during configuration. + +* The Stream VFD was not tested yet under Windows. + + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ + +* Use --disable-shared configure flag if building with Absoft Fortran + compiler. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8. + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. + If -ieee is not used, the converted double values are mostly 0.0 but + occasionally as 1**-308. This has been reported to the system staff. + All other tests have passed. + +* Fortran release DLL randomly failed with Compaq Visual Fortran 6.6c on + Windows. + +* Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, + Building Fortran static library with Intel 8.1 in .NET environment + requires manually setting the project file. + Please contact to hdfhelp@ncsa.uiuc.edu if you need to build + Fortran static library with Intel 8.1 with .NET environment. + +* On at least one system, SDSC DataStar, the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scripts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However, on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +%%%%1.6.4%%%% Release Information for hdf5-1.6.4 (15/March/05) + + +HDF5 version 1.6.4 released on Tue Mar 15 20:38:48 CST 2005 +================================================================================ + +INTRODUCTION +============ +This document describes the differences between HDF5-1.6.3 and +HDF5-1.6.4, and contains information on the platforms tested and +known problems in HDF5-1.6.4. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS +======== +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.3 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + Source code distribution: + ------------------------- + + The High-Level (HL) C APIs were added to the source code distribution. + For HL documentation, see + http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5hl.html. + + The HL library, libhdf5_hl.a(so), is built and installed by default. + Use --disable-hl configure flag to disable the HL library. + + Library: + -------- + - We recommend you to use SZIP v2.0 with this release. + For more information see + http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/ + - The compound datatype has been enhanced with a new feature of size + adjustment. The size can be increased and decreased (without + cutting the last member). No API change is involved. SLU - + 2004/10/1 + - Removed PABLO support. 2005/01/20 EIP + + Parallel Library: + ----------------- + - Allow compressed, chunked datasets to be read in parallel. + QAK - 2004/10/04 + + Tools: + ------ + - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 + + F90 API: + -------- + No new features in this release. + + C++ API: + -------- + - Started using C library's reference counting in place of the class + RefCounter, which existed before the C mechanism was available. + As a result, RefCounter has been removed. 2005/03/12 BMR + + +Support for new platforms, languages and compilers. +======================================= + + Configuration + ------------- + - Upgraded from GNU autoconf 2.53 to autoconf 2.59. JML - 2005/01/31 + + +Bug Fixes since HDF5-1.6.3 release +================================== + + Library + ------- + - Fixed a racing condition in MPIPOSIX virtual file drive close + function. Now all processes must completed the close before any + of them is returned. This prevents some "faster" processes start + accessing the file for another purpose (e.g., open with truncate) + while other "slower" processes have not closed the same file with + the previous purpose. AKC - 2005/03/01 + - H5Tget_member_value calls for enum datatype didn't return correct + value if H5Tenum_valueof was called first. It's fixed. SLU - + 2005/02/08 + - For variable-length string, H5Tget_class returned H5T_STRING as its + class. But H5Tdetect_class and H5Tget_member_class considered it + as H5T_VLEN. This is fixed to let all these 3 functions treat it + as H5T_STRING. SLU - 2005/02/08 + - The byte order of all 1-byte integer types was fixed as + little-endian even on a big-endian machine. It's corrected. + SLU - 2005/02/07 + - Fixed segmentation fault when calling H5Fflush with an attribute that + hasn't had a value written to it open. QAK - 2004/10/18 + - Backed out support for bitfield and time types in H5Tget_native_type. + Leave it to future support. The function simply returns error + message of "not support" for bitfield and time types. SLU - 2004/10/5 + - Fixed address check in Core VFL driver to avoid spurious address/size + overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 + - Fixed problem where chunked datasets were not able to be deleted + from a file under certain circumstances. QAK - 2004/09/27/ + + Configuration + ------------- + - IRIX64 MIPSpro compiler of 7.4.x supports C99 features. Default + to use the 'c99' compiler if available. AKC - 2004/12/13 + - Intel v8.0 compiler would infinite loop when compiling some test + code with -O3 option. Changed enable-production default compiler + option to -O2. AKC - 2004/12/06 + - Long double is assumed to be a supported C data type. It is a + standard C89 type. AKC - 2004/10/22 + + Performance + ------------- + Many changes were made to the library to improve performance, + especially for the variable-length datatypes and metadata cache. + + Tools + ----- + - h5fc and h5c++ work correctly when -c compiler flag + is used. EIP - 2005/03/14 + - Fixed h5dump to print attributes data in ASCII if -r option is used. + AKC - 2004/11/18 + - Fixed space utilization reported in h5ls to correct error + in formula used. QAK - 2004/10/22 + + Documentation + ------------- + + F90 API + ------- + - On windows, previously Fortran DLL built and tested failed. + Now Fortran DLL has been built and tested successfully + with Dec Fortran 6.6c or Dec Fortran 6.0. + + C++ API + ------- + + +Documentation +============= + + HDF5 Library documentation + -------------------------- + No substantive changes to the structure or types of content in the + HDF5 Library documentation. + + Windows installation documentation + ---------------------------------- + 1. On Windows zlib has been updated to 1.2.2. You may find the binary at + either http://www.zlib.net/zlib122-dll.zip or + ftp://hdf.ncsa.uiuc.edu/lib-external/zlib/bin/windows + + 2. Only DLLs of external libraries (zlib and szip) are linked with the + HDF5 Library. We will no longer provide binary to link static library + with HDF5. For details, please check INSTALL_Windows in this directory. + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 + xlf 8.1.1.3 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 + mpxlf_r 8.1.1.3 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + AIX 5.2 (32/64 bit) xlc 6.0.0.8 + xlC 6.0.0.9 + xlf 8.1.1.7 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + AIX 5.2 (32/64 bit, LLNL frost) xlc 6.0.0.8 + xlC 6.0.0.8 + xlf 8.1.1.7 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.7 + Cray T90 sn7001 10.0.0md Cray Standard C Version 6.4.0.3 + Cray Fortran Version 3.4.0.0 + Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.3.6 + Cray Fortran Version 3.6.0.3.1 + FreeBSD 4.9 gcc 2.95.4 + g++ 2.95.4 + gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + MPIch 1.2.4 + IRIX64 6.5 (tesla -64) MIPSpro cc 7.4.2m + F90 MIPSpro 7.4.2m + C++ MIPSpro cc 7.4.2m + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + C++ MIPSpro cc 7.3.1.3m + mpt 1.6 + Linux 2.4.20-28.7 gcc 2.96 + (eirene, verbena) gcc 3.3.2 + PGI compilers (pgcc, pgf90, pgCC) + version 5.2-1 + Absoft Fortran compiler v9.0 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 + MPIch 1.2.6 + Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) + (mir) PGI 5.2-1 C and F90 (with k3-32) + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 + Linux 2.4.21-sgi303r2 Altix + SMP ia64 Intel(R) C++ Version 8.1 + (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 + SGI MPI + OSF1 V5.1 (QSC) Compaq C V6.5-011 + HP Fortran V5.5A-3548 + Compaq C++ V6.5-036 + MPIX200_64_r13.4 + OSF1 V5.1 (PSC) Compaq C V6.5-303 + HP Fortran V5.5A-3548 + Compaq C++ V6.5-040 + MPIX200_64_r13.4 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + SunOS 5.9 32,64 Sun C 5.6 2004/07/15 + (Solaris 2.9) Sun Fortran 95 8.0 2004/07/15 + Sun C++ 5.6 2004/07/15 + TFLOPS r1.0.4 v4.5.2 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + Xeon Linux 2.4.20-31.9smp_perfctr_lustre + (tungsten) Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 + (NCSA tg-login) Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + mpich-gm-1.2.5..intel + Windows XP MSVC++.NET + MSVC++ 6.0 + Compaq Visual Fortran 6.6C + Intel 8.1 C++ + MAC OS X Darwin 7.5 + gcc and g++ Apple Computer, Inc. GCC + version 1175, based on gcc version 3.3.2 + IBM XL Fortran version 8.1 + Absoft Fortran compiler v8.2 + + +Supported Configuration Features Summary +======================================== + +Key: y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.8 64-bit y y y(1) y y y +Solaris2.8 32-bit y y y(1) y y y +Solaris2.9 64-bit y(1) y y(1) y y y +Solaris2.9 32-bit y(1) y y(1) y y y +IRIX64_6.5 64-bit y(2) y y y y y +IRIX64_6.5 32-bit y(2) n n n y y +HPUX11.00 y(1) y y y y y +OSF1 v5.1 y y y y y y +T90 IEEE n y n n y n +SV1 y(5) y y(5) n y n +TFLOPS y(1) n n n y n +AIX-5.1 & 5.2 32-bit y y y y y y +AIX-5.1 & 5.2 64-bit y y y y y y +WinXP Visual Studio 6.0 n y(9) n y y y +WinXP .Net n n n y(8) y y +Mac OS X 10.3 n y(10) n y y y +FreeBSD 4.9 y(1) n n y y y +RedHat 7.3 W (3) y(1) y(11) n y y y +RedHat 7.3 W Intel (3) n y n y y y +RedHat 7.3 W PGI (3) n y n y y y +SuSe x86_64 gcc (3,13) n y(12) n y y y +SuSe x86_64 icc (3,13) n y(14) n y y y +Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y y +Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y +Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y + + +Platform Shared static- Thread- STREAM- + libraries(4) exec safe VFD +Solaris2.8 64-bit y x y y +Solaris2.8 32-bit y x y y +Solaris2.9 64-bit y x y y +Solaris2.9 32-bit y x y y +IRIX64_6.5 64-bit y y y y +IRIX64_6.5 32-bit y y y y +HPUX11.00 y x n y +OSF1 v5.1 y y n y +T90 IEEE n y n y +SV1 n y n y +TFLOPS n y n n +AIX-5.1 & 5.2 32-bit n y n y +AIX-5.1 & 5.2 64-bit n y n y +WinXP Visual Studio 6.0 y y n n +WinXP .Net y y n n +Mac OS X 10.3 y y n y +FreeBSD 4.9 y y y y +RedHat 7.3 W (3) y y y y +RedHat 7.3 W Intel (3) n y n y +RedHat 7.3 W PGI (3) n y n y +SuSe x86_64 gcc (3,13) n y n y +SuSe x86_64 icc (3,13) y y(15) n y +Linux 2.4 Xeon C Lustre Intel (3,6) y y n y +Linux 2.4 SuSE ia64 C Intel (3,7) y y n n +Linux 2.4 SGI Altix ia64 Intel (3) y y n y + + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: (1) Using mpich 1.2.6 + (2) Using mpt and mpich 1.2.6. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + (4) Shared libraries are provided only for the C library, + except on Windows where they are provided for C and C++. + (5) Using mpt. + (6) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre + and Intel compilers + (7) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers + (8) Intel 8.1 + (9) Compaq Visual Fortran 6.6C + (10) IBM XLF and Absoft + (11) PGI, Absoft. No shared libraries with Absoft; + use '--disable-shared'. + (12) PGI and Intel compilers for both C and Fortran + (13) AMD Opteron x86_64 + (14) ifort + (15) Yes with C and Fortran, but not with C++ + FMB/EIP - 2005/03/15 + + +Known Problems +============== +* test/big fails sometimes with the message "Possible overlap with another + region." The test selects regions randomly, and this error occurs when + two regions overlap each other; it is an bug in the test and not in + HDF5. Since the error is triggered by a random situation, it will + usually disappear if the test is re-run. + +* Cray SV1 fails to correctly convert between floating-point and "long double" + for software conversion. Problem is being investigated. SLU - 2005/03/04 + +* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but it + has a "guard" statement in stdint.h that will #error and skip the rest + of the header file if C99 option is not used explicitly. Hardset + $CC to c99 will resolve the problem. AKC - 2004/12/13 + +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + The tests may fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check if there are many old /tmp/s.pedb.* staying around. These are + sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a mean to run poe without the debug socket. + +* Fortran subroutine h5pget_driver_f doesn't return a correct driver + information. + +* There are two h5dump xml tests(h5dump --xml thlink.h5 and + h5dump --xml tmany.h5) failed on windows xp with .NET for debug and + debug dll. Release and Release dll work fine. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed. + h5ls appears to be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ + +* On some platforms that use Intel and Absoft compilers to build HDF5 fortran + library, compilation may fail for fortranlib_test.f90, fflush1.f90 and + fflush2.f90 complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* Use --disable-shared configure flag if building with Absoft Fortran + compiler + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. + If -ieee is not used, the converted double values are mostly 0.0 but + occasionally as 1**-308. This has been reported to the system staff. + All other tests have passed. + +* The C++ library's tests fails when compiling with PGI C++ compiler. The + workaround until the problem is correctly handled is to use the + flag "--instantiate=local" prior to the configure and build steps, as: + setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher + setenv CXX "pgCC -tlocal" for others + +* Fortran release DLL randomly failed with compaq visual fortran 6.6c on + windows. + +* Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, + To build Fortran Static library with Intel 8.1 in .NET environment + needs manually setting the project file, + please contact to hdfhelp@ncsa.uiuc.edu if you need to build + fortran static library with Intel 8.1 with .NET environment. + +* On at least one system, (SDSC DataStar), the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scripts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + + +%%%%1.6.3%%%% Release Information for hdf5-1.6.3 (22/September/04) + +HDF5 version 1.6.3 released on Wed Sep 22 11:30:11 CDT 2004 +================================================================================ + + +INTRODUCTION + +This document describes the differences between HDF5-1.6.2 and +HDF5-1.6.3, and contains information on the platforms tested and +known problems in HDF5-1.6.3. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.2 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration: + -------------- + - Added some initial support for making purify (or similar memory + checking products) happier by initializing buffers to zero and + disabling the internal free list code. To take advantage of this, + define 'H5_USING_PURIFY' in your CFLAGS when building the library. + QAK - 2004/07/23 + + - WINDOWS building,testing and installing improvements + + - On Windows, FORTRAN,C++ and C projects are merged into one zip file, + users can choose an option to build either FORTRAN or C++ or both + with basic C library.For detailed information, + please read INSTALL_Windows.txt. + + - On Windows, szip compression library with or without encoder can be easily + turned off or on when building HDF5. For detailed information, + please read INSTALL_Windows.txt, especially section V. + + - On Windows, an optional procedure for building,testing and installing + HDF5 from command line is provided. This procedure is supposed to be + convenient for experienced users, please read + INSTALL_windows_From_Command_Line.txt for details. + + - On Windows, an alternative short instruction document for building, + testing and installing HDF5 is provided. This instruction is supposed to + be convenient for general users, please read + INSTALL_Windows_Short.txt for details. + + - On Windows, h5repack,h5diff,h5ls and h5import tool tests have been added. + KY - 2004/9/16 + + + Library: + -------- + - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for + SZIP compression. Now there is no restriction on the size and shape of the + chunk except that the total number of elements in the chunk cannot be + bigger than 'pixels_per_block' parameter provided by the user. + EIP - 2004/07/21 + - HDF5 can now link to SZIP with or without szip's encoder. + The new API function H5Zget_filter_info can be used to check + szip's status. Attempting to assign szip to a dataset property + list or attempting to write with szip will generate an error if + szip's encoder is disabled. JL/NF - 2004/6/30 + - SZIP always uses K13 compression. This flag no longer needs to + be set when calling H5Pset_szip. If the flag for CHIP + compression is set, it will be ignored (since the two are mutually + exclusive). JL/NF - 2004/6/30 + - A new API function H5Fget_name was added. It returns the name + of the file by object(file, group, data set, named data type, + attribute) ID. SLU - 2004/06/29 + - A new API function H5Fget_filesize was added. It returns the + actual file size of the opened file. SLU - 2004/06/24 + - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, + will suppress all library version mismatch warning messages. + AKC - 2004/4/14 + + Parallel Library: + ----------------- + + Tools: + ------ + - h5repack was added to the tools suite. h5repack regenerates an HDF5 file + from another HDF5 file, optionally applying HDF5 filters (compression) + and/or chunking to the copied file. The filters options are read from + the command line. See /doc/html/Tools.html for more details. + PVN - 2004/9/13 + + - h5dump includes new features: + 1) Printing of dataset filters, storage layout and fill value information. + 2) Print a list of the file contents. + 3) Escape non printing characters. + 4) Print the content of the boot block. + 5) Print array indices with the data (the default). + These options are all switch controlled. See /doc/html/Tools.html for more details. + PVN - 2004/9/13 + + + F90 API: + -------- + - added new subroutines: + h5fget_filesize_f + h5iget_file_id_f + h5premove_filter_f + h5zget_filter_info_f + EIP 2004/9/21 + + - added new h5fget_name_f and h5fget_filesize_f subroutines + EIP 2004/07/08 + + C++ API: + -------- + - Added wrappers for array and variable length datatypes APIs + - Added wrappers for newly added APIs from H5T, H5F, and H5I + - Added many wrappers that were missing from the H5P API + - Added the ability to reference HDF5 objects to these classes: + DataSet, DataType, Group, and H5File (wrappers for H5R APIs) + BMR 2004/08/04 + + +Support for new platforms, languages and compilers. +======================================= + - Added PGI Fortran support for Linux64 (x86_64) systems + EIP - 2004/08/19 + - Absoft compiler f95 v9.0 is supported on Linux 2.4 32bit + EIP - 2004/07/29 + - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran + compiler version 8.1. This is a default compiler. + - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler + version 8.2; set F9X environment variable to f95, for example + setenv F9X f95 + Use --disable-shared --enable-static configure flags when Absoft + compiler is used. + EIP - 2004/07/27 + +Bug Fixes since HDF5-1.6.2 release +================================== + + Library + ------- + - Fixed parallel bug in which some processes attempted collective + I/O while others did independent I/O. Bug appeared when some + processes used point selections, and others didn't. JRM - 2004/9/15 + - Corrected error where dataset region references were written in an + incorrect way on Cray machines. PVN & QAK - 2004/09/13 + - The H5Tget_native_type now determines the native type for integers + based on the precision. This is to avoid cases of wrongly converting + an int to a short in machines that have a short of 8 bytes but with + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + - Changed H5Dread() to not overwrite data in an application's buffer + with garbage when accessing a chunked dataset with an undefined fill + value and an unwritten chunk is uncountered. QAK - 2004/08/25 + - Fixed error which could cause a core dump when a type conversion + routine was registered after a compound datatype had been + converted and then an equivalent compound datatype was converted + again. QAK - 2004/08/07 + - Fixed memory overwrite when encoding "multi" file driver information + for file's superblock. QAK - 2004/08/05 + - Fixed obscure bug where a filter which failed during chunk allocation + could allow library to write uncompressed data to disk but think + the data was compressed. QAK - 2004/07/29 + - Fixed bug where I/O to an extendible chunked dataset with zero-sized + dimensions would cause library to fail an assertion. + QAK - 2004/07/27 + - Fixed bug where chunked datasets which have filters defined, + allocation time set to "late" and whose chunks don't align with + the dataspace bounds could have incorrect data stored when + overwriting the entire dataset on the first write. QAK - 2004/07/27 + - Added check to ensure that dataspaces have extents set. JML-2004/07/26 + - Fixed bug on some Solaris systems where HDF5 would try to use + gettimeofday() when that function didn't work properly. + JML - 2004/07/23 + - Fixed bug in H5Sset_extent_simple where setting maximum size to + non-zero, then to zero would cause an error. JML - 2004/07/20 + - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite + when not writing data ("none" selection or hyperslab or point + selection with no elements defined). QAK - 2004/07/20 + - Calling H5Gcreate() on "/" or "." throws an error instead of + failing quietly. JML - 2004/07/19 + - Fixed bug where setting file address size to be very small could + trigger an assert if the file grew to more than 64 KB. Now throws + an error and data can be recovered. JL/NF - 2004/07/14 + - Fixed bug where "resurrecting" a dataset was failing. + QAK - 2004/07/14 + - Fixed bug where incorrect data could be read from a chunked dataset + after it was extended. QAK - 2004/07/12 + - After compound datatype with variable-length string in the fields + is committed to file, the size is messed up when it's read back. + Fixed. SLU - 2004/06/11 + - Fixed potential file corruption bug when a block of metadata could + overlap the end of the internal metadata accumulator buffer and + the buffer would be extended correctly, but would incorrectly + change it's starting address. QAK - 2004/06/09 + - Opaque datatype with no tag failed for some operations. Fixed. + SLU - 2004/6/3 + - Fixed potential file corruption bug where dimensions that were + too large (a value greater than could be represented in 32-bits) + could cause the incorrect amount of space to be allocated in a + file for the raw data for the dataset. QAK - 2004/06/01 + - Fixed dtypes "sw long double -> double" failure in QSC class + machines. AKC - 2004/4/16 + + Configuration + ------------- + - Fixed the long compile time of H5detect.c when v7.x Intel Compiler + is used with optimization NOT off. AKC - 2004/05/20 + + Performance + ------------- + + Tools + ----- + - On SGI h5dump displayed only part of the data due to the bug + in the system printf; fixed. + EIP - 2004/09/21 + Documentation + ------------- + - Several descriptive errors have been fixed throughout the + documentation, particularly in the reference manual (RM). + A selection particularly worthy of note would be these: + - The H5Pset_szip description in the RM has been expanded and + corrected to facilitate use of SZIP compression. + - A note has been added to the H5Dcreate description that an + unexplained failure is likely to be due to a property list error + that is detected only at the time of dataset creation. + - + FMB - 2004/09/21 + + F90 API + ------- + + Fortran functions h5dwrite/read_f and h5awrite/read_f do not + accept dims parameter of INTEGER type anymore. Code was removed. + 2004/04/15 + C++ API + ------- + - H5::Exception's and its subclasses' constructors that were + overloaded to take char pointers are removed and constructors + that passed in reference of 'string' are changed to pass + by value. In addition, the default value of the data member + H5::Exception::detailMessage is changed from 0/NULL to + DEFAULT_MSG ("No detailed information provided".) + - Prototype for DSetCreatPropList::setLayout is changed: 1st parameter + is removed because it was there only by mistake. + BMR 2004/08/04 + +Documentation +============= + HDF5 Library documentation + -------------------------- + - HDF5 C++ API Reference Manual + This document has been added to the HDF5 document set. + The predecessor document, "HDF5 C++ Interfaces," has been removed. + - HDF5 C++ API Design Specification + A first draft of this document has been added to the HDF5 document + set. The draft has been posted on the HDF5 website and a link + has been added to the HDF5 documents index (index.html at the top + level of the document set). + - Parallel HDF5 + In prior releases, the HDF5 document set included two parallel + HDF5 documents. Those documents have been deleted and the + HDF5 documents index (index.html) now links to a "Parallel HDF5" + page on the HDF5 website (http://hdf.ncsa.uiuc.edu/HDF5/PHDF5/). + - HDF5 High Level APIs + Links to the HDF5 High Level APIs and to the HDF5 High Level + Reference Manual have been added to the HDF5 documents index + (index.html). + - HDF5 Reference Manual + Tools: h5repack -- A description of the new h5repack tool has been + added to the Tools page. + Tools: h5dump -- Several new options have been added to h5dump. + New functions -- All new functions have been added to the RM. + API changes -- Relevant function descriptions have been updated in + instances where programming interfaces have changed. + FMB - 2004/09/21 + + Windows installation documentation + ---------------------------------- + - INSTALL_Windows.txt has been enhanced to include instructions building + HDF5 with FORTRAN and C++. + - Two optional installation documents have been added. They are + INSTALL_Windows_Short.txt and INSTALL_Windows_From_Command_Line.txt. + INSTALL_Windows_Short.txt is supposed to help general users who + only want to build,test and install HDF5 in a quick way. + INSTALL_Windows_From_Command_Line.txt is supposed to help users who + would like to compile,test and install HDF5 in command line environment. + - INSTALL_Windows_withcpp.txt and INSTALL_Windows_withF90.txt became + obsolete. Files are deleted from the release_docs directory. + KY 2004/09/16, EIP 2004/9/21 + + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 + xlf 8.1.1.3 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 + mpxlf_r 8.1.1.3 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + AIX 5.2 xlc 6.0.0.8 + xlC 6.0.0.8 + xlf 8.1.1.6 + mpcc_r 6.0.0.8 + mpxlf_r 8.1.1.6 + Cray T90 sn7001 10.0.0md Cray Standard C Version 6.4.0.3 + Cray Fortran Version 3.4.0.0 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.3 + Cray Fortran Version 3.6.0.3 + Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.3.6 + Cray Fortran Version 3.6.0.3.1 + FreeBSD 4.9 gcc 2.95.4 + g++ 2.95.4 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + MPIch 1.2.4 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + C++ MIPSpro cc 7.3.1.3m + mpt 1.6 + Linux 2.4.18 gcc 2.96, 3.3.2 + g++ 3.3.2 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 + MPIch 1.2.4 + Absoft Fortran compiler v9.0 + Linux 2.4.20-8 gcc 3.3.2 + PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 + MPIch 1.2.4 + Linux 2.4.21-2.9.5ws #3 gcc 3.2.3 (Red Hat Linux 3.2.3-16) + SMP x86_64 g++ 3.2.3 + Linux 2.4.21-4.ELsmp Intel(R) C++ 32-bit Version 8.0 + Intel(R) Fortran 32-bit Version 8.0 + gcc 3.4.0 + MPICH 1..5.2 Inmel 8.0 + Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) + g++ 3.2.2 + Linux 2.6.4-52smp x86_64 gcc 3.3.3 (SuSE Linux 9.1 AMD64)) + PGI 5.2-1 C and F90 + + Linux 2.4.21-sgi Altix + SMP ia64 Intel(R) C++ Version 8.0 + Intel(R) Fortran Itanium(R) Version 8.0 + SGI MPI + OSF1 V5.1 Compaq C V6.5-303 + HP Fortran V5.5A-3548 + Compaq C++ V6.5-040 + MPI_64bit_R13 + SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + TFLOPS r1.0.4 v4.4.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + IA-32 Linux 2.4.18 gcc 2.96 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + + Xeon Linux 2.4.20-31.9smp_perfctr_lustre + Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + + IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + + IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 + Intel(R) C++ Version 8.0 + Intel(R) Fortran Compiler Version 8.0 + mpich-gm-1.2.5..intel + + Windows 2000 (NT5.0) MSVC++ 6.0 + MSVC++ .NET + DEC Visual Fortran 6.0 + Intel C and F90 compilers version 7.1 + Code Warrior 8.0 + Windows XP MSVC++.NET + MSVC++ 6.0 + DEC Visual Fortran 6.0 + + MAC OS X Darwin 7.5 + gcc and g++ Apple Computer, Inc. GCC + version 1175, based on gcc version 3.3.2 + IBM XL Fortran version 8.1 + Absoft Fortran compiler v8.2 + + + +Supported Configuration Features Summary +======================================== + +Key: y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +Solaris2.7 64-bit y (1) y y (1) y y y +Solaris2.7 32-bit y (1) y y (1) y y y +Solaris2.8 64-bit y (1) y y (1) y y y +Solaris2.8 32-bit y y y (1) y y y +IRIX64_6.5 64-bit y (2) y y y y y +IRIX64_6.5 32-bit y (2) n n n y y +HPUX11.00 y (1) y y y y y +OSF1 v5.1 y y y y y y +T90 IEEE n y n n y n +T3E y (5) y y (5) n y n +SV1 y (5) y y (5) n y n +TFLOPS y (1) n n n y n +AIX-5.1 & 5.2 32-bit y y y y y y +AIX-5.1 & 5.2 64-bit y y y y y y +WinXP Visual Studio 6.0 n y (9) n y y y +WinXP .Net n n n y y y +WinXP Code Warrior n n n n y y +Win2000 Visual Studio 6.0 n y (10) n y y y +Win2000 Visual Studio Intel (6) n y n y y y +Win2000 .Net n n n y y y +Mac OS X 10.3 n y (11) n y y y +FreeBSD 4.9 y (1) n n y y y +RedHat 7 W (3) y (1) y (12) n y y y +RedHat 7.3 W Intel (3) n y n y y y +RedHat 7.3 W PGI (3) n y n y y y +RedHat 8 & SuSe x86_64 gcc (3) n y (13) n y y y +Linux 2.4 Xeon C Lustre Intel (3,7) n y n y y y +Linux 2.4 SuSE ia64 C Intel (3,8) y y y y y y +Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y + + +Platform Shared static- Thread- STREAM- + libraries (4) exec safe VFD +Solaris2.7 64-bit y x y y +Solaris2.7 32-bit y x y y +Solaris2.8 64-bit y x y y +Solaris2.8 32-bit y x y y +IRIX64_6.5 64-bit y y y y +IRIX64_6.5 32-bit y y y y +HPUX11.00 y x n y +OSF1 v5.1 y y n y +T90 IEEE n y n y +T3E n y n y +SV1 n y n y +TFLOPS n y n n +AIX-5.1 & 5.2 32-bit n y n y +AIX-5.1 & 5.2 64-bit n y n y +WinXP Visual Studio 6.0 y y n n +WinXP .Net y y n n +WinXP Code Warrior n y n n +Win2000 Visual Studio 6.0 y y n n +Win2000 Visual Studio Intel (6) y y n n +Win2000 .Net y y n n +Mac OS X 10.3 y y n y +FreeBSD 4.9 y y y y +RedHat 7 W (3) y y y y +RedHat 7.3 W Intel (3) n y n y +RedHat 7.3 W PGI (3) n y n y +RedHat 8 & SuSe x86_64 gcc (3) n y n y +Linux 2.4 Xeon C Lustre Intel (3,7) y y n y +Linux 2.4 SuSE ia64 C Intel (3,8) y y n n +Linux 2.4 SGI Altix ia64 Intel (3) y y n y + + + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: (1) Using mpich 1.2.4 + (2) Using mpt and mpich 1.2.4 + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated + W or C indicates workstation or cluster, respectively + (4) Shared libraries are provided only for the C library, + except on Windows where they are provided for C and C++ + (5) Using mpt + (6) Intel 7.1 compilers in Visual Studio 6.0 environment + (7) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre + and Intel compilers + (8) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers + (9) DEC Visual Fortran 6.0 and Intel 7.1 + (10) DEC Visual Fortran 6.0 + (11) IBM XLF and Absoft + (12) PGI, Absoft + (13) PGI + FMB/EIP - 2004/09/21 + + + +Known Problems +============== +* h5fc and h5c++ compilation scripts have a bug: object files (*.o) cannot be + created when source code is compiled using h5fc or h5c++. We will provide + a fix. Please check ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ + for the patches. + +* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. + +* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) + failed on windows xp with .NET for debug and debug dll. Release and Release + dll work fine. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ + +* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 of + the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. However, if + you still experience a problem, you may want to check this line in the + libtool file and make sure that it has the correct value. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. + If -ieee is not used, the converted double values are mostly 0.0 but + occasionally as 1**-308. This has been reported to the system staff. + All other tests have passed. + +* On at least one system, (SDSC DataStar), the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scripts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +%%%%1.6.2%%%% Release Information for hdf5-1.6.2 (12/February/04) + +HDF5 version 1.6.2 released on Thu Feb 12 14:18:13 CST 2004 +================================================================================ + + +INTRODUCTION + +This document describes the differences between HDF5-1.6.1 and +HDF5-1.6.2, and contains information on the platforms tested and +known problems in HDF5-1.6.2. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.1 +- Documentation +- Platforms Tested +- Supported Configuration Features Summary +- Known Problems + + +New Features +============ + + Configuration: + -------------- + - Default of $prefix is changed to $PWD/hdf5 so that multiple + builds using --srcdir is possible in the same machine. + AKC - 2003/12/1 + + Library: + -------- + - Added H5Iget_ref, H5Iinc_ref and H5Idec_ref routines to the C + library and the FORTRAN wrapper. See the reference manual for a + full description of these new routines. QAK - 2003/12/11 + + Parallel Library: + ----------------- + - The parallel tests in testpar/ now provides different levels of + verbosity via the '-v' option. The default is less verbose + than before. AKC - 2004/01/23 + - Added parallel test, test_mpio_1wMr, which tests if the + underlaying parallel I/O system is conforming to the POSIX + write/read requirement. This version includes options of using + atomicity and file-sync. AKC - 2003/11/27 + + Tools: + ------ + - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). + AKC - 2004/01/08 + - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" + respectively if library is built in parallel mode. AKC - 2004/01/07 + - Added metadata benchmark (perform/perf_meta). SLU - 2003/10/03 + + C++ API: + -------- + + +Support for new platforms, languages and compilers. +======================================= + - HDF5 Fortran APIs are supported on MAC OSX with IBM XL Fortran compiler + version 8.1 Beta + Use --disbale-shared --enable-static flags with configure when + building HDF5 Fortran Library on MAC OSX. + - C and C++ Libraries are available for Linux64 RH8 + - C, C++ and Fortran sequential Libraries, and C and Fortran parallel + Libraries are available for Altix (Linux ia64) + +Bug Fixes since HDF5-1.6.1 release +================================== + + Library + ------- + - Fixed problem with H5Tget_native_type() not handling opaque fields + correctly. QAK - 2004/01/31 + - Fixed several errors in B-tree deletion code which could cause a + B-tree (used with groups and chunked datasets) to become corrupt + with the right sequence of deleted objects. QAK - 2004/01/19 + - Fixed small internal memory leaks of fill-value information. + QAK - 2004/01/13 + - Fixed bug that caused variable-length datatypes (strings or sequences) + used for datasets in files with objects that were unlinked to + fail to be read/written to a file. QAK - 2004/01/13 + - Detect situation where szip 'pixels per block' is larger than the + fastest changing dimension of a dataset's chunk size and disallow + this (due to limits in szip library). QAK - 2003/12/31 + - Fixed bug with flattened hyperslab selections that would generate + incorrect hyperslab information with certain high-dimensionality + combinations of start/stride/count/block information. + QAK - 2003/12/31 + - Fixed bug with variable-length datatypes used in compound datatypes. + SLU - 2003/12/29 + - Fixed bug in parallel I/O routines that would cause reads from + "short datasets" (datasets which were only partially written out) + to return invalid data. QAK & AKC - 2003/12/19 + - Fixed bug where scalar dataspaces for attributes were reporting as + simple dataspaces. QAK - 2003/12/13 + - Fixed problem with selection offsets of hyperslab selections in + chunked datasets causing the library to go into an infinite loop. + QAK - 2003/12/13 + - Fixed H5Giterate to avoid re-using index parameter after iteration + callback has been called (allows iteration callback to modify the + index parameter itself). QAK - 2003/12/06 + - Fixed various floating-point conversion problems, including a + change which could corrupt data when converting from double->float. + QAK - 2003/11/24 + - Changed "single process" metadata writing in library to collective + I/O by all processes, in order to guarantee correct data being + written with MPI-I/O. QAK - 2003/11/20 + - Fixed problems with fill values and variable-length types and also + I/O on VL values that were set to NULL. QAK - 2003/11/08 + - Fixed problems with MPI datatypes that caused ASCI Q machine to + hang. QAK - 2003/10/28 + - Removed HDF5_MPI_PREFER_DERIVED_TYPES environment variable support, + since it had no benefit. QAK - 2003/10/28 + - Single hyperslab selections (which were set with only one call to + H5Sselect_hyperslab) that had dimensions that could be "flattened" + but were interspersed with dimensions that could not be flattened + were not correctly handled, causing core dumps. QAK - 2003/10/25 + - Avoid metadata cache from preempting current dataset object header + when looking up information about the named datatype that the + dataset uses. QAK - 2003/10/20 + + Configuration + ------------- + - Parallel I/O with the MPI-I/O driver will no longer work if the + filesystem is not POSIX compliant. The "HDF5_MPI_1_METAWRITE" + environment variable has been removed. QAK - 2004/01/30 + + Performance + ------------- + - More optimizations to inner loops of datatype conversions for + integers and floats which give a 10-50% speedup. QAK - 2003/11/07 + - Hoisted invariant 'if/else's out of inner datatype conversion loop for + integer and floating-point values, giving about a 20% speedup. + QAK - 2003/10/20 + + Tools + ----- + - Fixed h5redeploy which sometimes complain too many argument for the + test command. (The complain did not hinder the h5redploy to proceed + correctly.) AKC - 2003/11/03 + + Documentation + ------------- + + +Documentation +============= + + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 + xlf 8.1.0.3 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + poe 3.2.0.10 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 + Cray Fortran Version 3.6.0.2 + Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 + Cray Fortran Version 3.6.0.2 + Cray T90IEEE 10.0.0md Cray Standard C Version 6.4.0.3 + Cray Fortran Version 3.4.0.0 + FreeBSD 4.9 gcc 2.95.4 + g++ 2.95.4 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + MPIch 1.2.4 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + C++ MIPSpro cc 7.3.1.3m + Linux 2.4.18 gcc 2.96, 3.3.2 + g++ 3.3.2 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 + MPIch 1.2.4 + Linux 2.4.20-8 gcc 3.3.2 + PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 + MPIch 1.2.4 + Linux 2.4.21-2.9.5ws #3 gcc 3.2.3 (Red Hat Linux 3.2.3-16) + SMP x86_64 g++ 3.2.3 + Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) + g++ 3.2.2 + + Linux 2.4.21-sgi Altix + SMP ia64 Intel(R) C++ Version 7.1 + Intel(R) Fortran Itanium(R) Version 7.1 + SGI MPI + OSF1 V5.1 Compaq C V6.4-014 + Compaq Fortran V5.5-2602 + Compaq Fortran V5.5-1877 + Compaq C++ V6.5-033 + Compaq C++ V6.5-030 + MPI_64bit_R13 + SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + TFLOPS r1.0.4 v4.4.2 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + IA-32 Linux 2.4.18 gcc 2.96 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + + IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + + IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + mpich-gm-1.2.5..intel + + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Intel C and F90 compilers version 7.1 + Code Warrior 8.0 + Windows XP MSVC++.NET + MAC OS X Darwin 7.2 + gcc and g++ Apple Computer, Inc. GCC + version 1175, based on gcc version 3.3.2 + IBM XL Fortran version 8.1 Beta + + + +Supported Configuration Features Summary +======================================== + +Key: y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C C F90 F90 C++ Shared zlib + parallel parallel libraries (4) +Solaris2.7 64-bit y y (1) y y (1) y y y +Solaris2.7 32-bit y y (1) y y (1) y y y +Solaris2.8 64-bit y y (1) y y (1) y y y +Solaris2.8 32-bit y y y y (1) y y y +IRIX64_6.5 64-bit y y (2) y y y y y +IRIX64_6.5 32-bit y y (2) n n n y y +HPUX11.00 y y (1) y y y y y +OSF1 v5.1 y y y y y y y +T3E y y (5) y y (5) n n y +SV1 y y (5) y y (5) n n y +T90 IEEE y y (5) y y (5) n n y +TFLOPS n y (1) n n n n y +AIX-5.1 32-bit y y y y y n y +AIX-5.1 64-bit y y y y y n y +WinXP Visual Studio (7) y n n n y y y +WinXP Intel y n n n y y y +WinXP CW y n n n n n y +Win2000 Visual Studio y n y n y y y +Win2000 Intel y n y n y y y +Mac OS X 10.3 y n y n y y y +FreeBSD 4.9 y y (1) n n y y y +RedHat 7, 8 & 9 ia32 y y (1) y(PGI) n y y y + W gcc (3) +RedHat 7.3 ia32 W Intel (3) y n y n y n y +RedHat 7.3 ia32 W PGI (3) y n y n y n y +RedHat 7 ia32 C Intel (3) y n y n y n y +RedHat 7.1 ia64 C Intel (3) y n y n y n y +RedHat 8 & SuSe x86_64 y n n n y n y + gcc (3) +Linux 2.4 SGI Altix ia64 y n y n y y y + Intel (3) + + +Platform static- Thread- SZIP GASS STREAM- High- H4/H5 + exec safe VFD level tools + APIs (6) +Solaris2.7 64-bit x y y n y y n +Solaris2.7 32-bit x y y n y y y +Solaris2.8 64-bit x y y n y y n +Solaris2.8 32-bit x y y n y y y +IRIX64_6.5 64-bit x y y y y y y +IRIX64_6.5 32-bit x y y y y y y +HPUX11.00 x n y n y y y +OSF1 v5.1 y n y n y y y +T3E y n n n y y y +SV1 y n n n y y y +T90 IEEE y n n n y y n +TFLOPS y n n n n n n +AIX-5.1 32-bit y n y n y y y +AIX-5.1 64-bit y n y n y y y +WinXP Visual Studio y n y n n y y +WinXP Intel y n y n n y y +WinXP CW y n y n n y y +Win2000 Visual Studio y n y n n y y +Win2000 Intel y n y n n y y +Mac OS X 10.3 y n y n y y n +FreeBSD 4.9 y y y n y y y +RedHat 7, 8 & 9 ia32 y y y n y y y + W gcc (3) +RedHat 7.3 ia32 W Intel (3) y n y n y n n +RedHat 7.3 ia32 W PGI (3) y n y n y n n +RedHat 7 ia32 C Intel (3) y n y n y y y +RedHat 7.1 ia64 C Intel (3) y n y n y y y +RedHat 8 & SuSe x86_64 y n y n y y y + gcc (3) +Linux 2.4 SGI Altix ia64 y n y n y y y + Intel (3) + + +Compiler versions for each platform are listed in the "Platforms Tested" +table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, +compilers used are the system compilers. + +Footnotes: (1) Using mpich 1.2.4. + (2) Using mpt and mpich 1.2.4. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. + W or C indicates workstation or cluster, respectively. + (4) Shared libraries are provided only for the C library, + except on Windows where they are provided for C and C++. + (5) Using mpt. + (6) Includes the H4toH5 Library and the h4toh5 and h5toh4 + utilities. + + +Known Problems +============== +* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. + +* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) + failed on windows xp with .NET for debug and debug dll. Release and Release + dll work fine. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.2/F90_source_for_Crays + +* On some platforms that use Intel compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 of + the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. However, if + you still experience a problem, you may want to check this line in the + libtool file and make sure that it has the correct value. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* In LANL QSC, the new cc compiler has problems converting small values of + long long (absolute values less than 1**-308) to double. This triggers + the test/dtypes to report failure in the + Testing random sw long double -> double conversions + If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. + If -ieee is not used, the converted double values are mostly 0.0 but + occassionaly as 1**-308. This has been reported to the system staff. + All other tests have passed. + +* On AIX 5.1 when 64-bit parallel C Library is built with zlib configured in, + compilation fails for H5Zdeflate.c. To bypass the problem, remove "const" + definition in front of H5Z_DEFLATE in H5Zpkg.h line 29. + +%%%%1.6.1%%%% Release Information for hdf5-1.6.1 (16/October/03) + +15. Release information for HDF5 version 1.6.1 +================================================ + +INTRODUCTION + +This document describes the differences between HDF5-1.6.0 and +HDF5-1.6.1, and contains information on the platforms tested and +known problems in HDF5-1.6.1. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.6.0 +- Documentation +- Platforms Tested +- Known Problems + + +New Features +============ + + Configuration: + -------------- + + Library: + -------- + - Added new fields to the H5G_stat_t for more information about an + object's object header. QAK 2003/10/06 + - Added new H5Fget_freespace() routine to query the free space in a + given file. QAK 2003/10/06 + + Parallel Library: + ----------------- + + Tools: + ------ + + C++ API: + -------- + - Added overloaded functions read and write to H5::Attribute. + BMR - 2003/04/21 + - Added an overloaded constructor H5::StrType so the need to separately + set the length of the string type can be eliminated. BMR - 2003/04/21 + - Added overloaded functions read and write to H5::DataSet. + BMR - 2003/04/27 + + The following items were added but not documented in previous releases: + + - On windows, any application, that uses the C++ API dll, must + include the name HDF5CPP_USEDLL in its project setting. (Feb 17, 2002) + BMR - 2003/10/10 + - Added missing default constructor H5::H5File. (Apr 26, 2002) + BMR - 2003/10/10 + - Added new member function H5::DataSet::fillMemBuf per the new C + API H5Dfill, which fills the elements in a selection for a memory + buffer with a fill value. (May 16, 2002) BMR - 2003/10/10 + - Added the new member function getMemberIndex to H5::EnumType + and H5::CompType to match the new C API H5Tget_member_index. Given + the name of a member of an enumeration or compound datatype, this + new function queries the index of the member. (May 16, 2002) + BMR - 2003/10/10 + - Added these member functions to H5::Group per the new C functions + H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx: + + getNumObjs: Returns the number of objects in the group. + + getObjnameByIdx: Retrieves the name of an object in a group, + given an index + + getObjTypeByIdx: Returns the type of an object in a group, + given an index + (Jan 20, 2003) BMR - 2003/10/10 + + +Support for new platforms, languages and compilers. +======================================= + - gcc 3.3.1 is supported on Linux. + + +Bug Fixes since HDF5-1.6.0 release +================================== + + Library + ------- + - Fixed incorrect datatype of the third parameter to the Fortran90 + h5pset(get)_cache_f functions (INTEGER to INTEGER(SIZE_T)) EIP - 2003/10/13 + - Fixed problems with accessing variable-length data datatypes on + Crays. QAK - 2003/10/10 + - Fixed potential file corruption bug when too many object header + messages (probably attributes, from a user perspective) were + inserted into an object header and certain other conditions were + met. QAK - 2003/10/08 + - Changed implementation of internal ID searching algorithm to avoid + O(n) behavior for many common cases. QAK - 2003/10/06 + - Allow partial parallel writing to compact datasets. QAK - 2003/10/06 + - Correctly create reference to shared datatype in attribute, instead + of making a copy of the shared datatype in the attribute. + QAK - 2003/10/01 + - Revert changes which caused files >2GB to fail when created with + MPI-I/O file driver on certain platforms. QAK - 2003/09/16 + - Allow compound datatypes to grow in size. SLU - 2003/09/10 + - Detect if a type is already packed before attempting to pack it + again or check if it is locked. SLU - 2003/09/10 + - Corrected bug when opening a file twice with read-only permission + for one open and then closing the read-only access file ID would + generate an error. QAK - 2003/09/10 + - Corrected bug in repeated calls to H5Pget_access_plist() which would + incorrectly manage reference counts of internal information and + eventually blow up. QAK - 2003/09/02 + - Return rank of the array datatype on successful call to + H5Tget_array_dims(). QAK - 2003/08/30 + - Corrected bug in H5Tdetect_class which was not correctly detecting + datatype classes of fields in nested compound datatypes in some + circumstances. QAK - 2003/08/30 + - Corrected bug in sieve buffer code which could cause loss of data + when a small dataset was created and deleted in quick succession. + QAK - 2003/08/27 + - Corrected bug in H5Gget_objname_by_idx which was not allowing NULL + for the name when just querying for the object name's length. + QAK - 2003/08/25 + - Corrected bug in variable-length string handling which could + generate a core dump on writing variable-length strings as part + of a compound datatype on certain architectures. QAK - 2003/08/25 + - Corrected bug in H5Tget_native_type which would incorrectly compute + the size of certain compound datatypes and also incorrectly + compute the offset of the last field for those compound datatypes. + QAK - 2003/08/25 + - Corrected bug in H5Tget_native_type which would drop string datatype + metadata (padding, etc.) QAK - 2003/08/25 + - Corrected bugs in H5Gget_num_objs, H5Gget_objname_by_idx and + H5Gget_objtype_by_idx to allow them to accept location IDs, not just + group IDs. QAK - 2003/08/21 + - Corrected bug when using scalar dataspace for memory selection and + operating on chunked dataset. QAK - 2003/08/18 + - Corrected bugs with multiple '/' characters in names for H5Glink + and H5Gunlink. QAK - 2003/08/16 + - Corrected bug with user blocks that didn't allow a user block to + be inserted in front of a file after the file was created. + QAK - 2003/08/13 + - Corrected errors with using point selections to access data in + chunked datasets. QAK - 2003/07/23 + - Corrected error with variable-length datatypes and chunked datasets + which caused H5Dwrite to fail sometimes. QAK - 2003/07/19 + - Modified library and file format to support storing indexed storage + (chunked dataset) B-tree's with non-default internal 'K' values. + QAK - 2003/07/15 + - Returned H5T_BKG_TEMP support to library after it was accidentally + removed. QAK - 2003/07/14 + + Configuration + ------------- + - Fixed the error that caused "make install" to fail because of the + macro definition syntax of "prefix?=..." AKC - 2003/07/22 + + Performance + ------------- + + Tools + ----- + - Fixed a segmentation fault of h5diff when percentage option is used. + AKC - 2003/08/27 + - Switched away from tools using internal "fixtype" function(s) to use + H5Tget_native_type() internally. QAK - 2003/08/25 + + Documentation + ------------- + - Added two missing Fortran APIs (h5pget_fapl_mpiposix_f and + h5pset_fapl_mpiposix_f) to the reference manual. + FMB - 2003/10/15 + - Corrected the reference manual descriptions of H5open/h5open_f and + H5close/h5close_f to indicate that these calls are required in + Fortran90 applications. FMB - 2003/10/15 + + +Documentation +============= + + Fortran90 APIs are being integrated into the main body of the + HDF5 Reference Manual (RM). This process is complete in all RM sections + except H5P. + + A PDF version of the RM will be posted on the HDF5 website + (at http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/) approximately one week + after the release. + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 + xlf 8.1.0.3 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + poe 3.2.0.10 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 + Cray Fortran Version 3.6.0.2 + Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 + Cray Fortran Version 3.6.0.2 + Cray T90IEEE 10.0.1.01y Cray Standard C Version 6.4.0.2.3 + Cray Fortran Version 3.4.0.3 + FreeBSD 4.9 gcc 2.95.4 + g++ 2.95.4 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + HP MPI 01.07.00.00 + IRIX 6.5 MIPSpro cc 7.3.1.2m + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + MPIch 1.2.4 + Linux 2.4.18 gcc 2.96, 3.2.2, 3.3.1 + g++ 3.2.2, 3.2.3 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 + MPIch 1.2.4 + Linux 2.4.20-8 gcc 3.2.2 + OSF1 V5.1 Compaq C V6.4-014 + Compaq C V6.3-027 + Compaq Fortran V5.5-2602 + Compaq C++ V6.5-030 + MPI_64bit_R5 + g++ version 3.0 for C++ + SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + TFLOPS r1.0.4 v4.4.0 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + IA-32 Linux 2.4.9 gcc 2.96 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Intel C and F90 compilers version 7.1 + Code Warrior 8.0 + Windows XP MSVC++.NET + MAC OS X Darwin 6.8 + gcc and g++ Apple Computer, Inc. GCC + version 1175, based on gcc version 3.1 + + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C C F90 F90 C++ Shared zlib + parallel parallel libraries (4) +Solaris2.7 64-bit y y (1) y y (1) y y y +Solaris2.7 32-bit y y (1) y y (1) y y y +Solaris2.8 64-bit y y (1) y y (1) y y y +Solaris2.8 32-bit y y y y (1) y y y +IRIX6.5 y y (1) n n n y y +IRIX64_6.5 64-bit y y (2) y y y y y +IRIX64_6.5 32-bit y y (2) n n n y y +HPUX11.00 y y (1) y y y y y +OSF1 v5.1 y y y y y y y +T3E y y (5) y y (5) n n y +SV1 y y (5) y y (5) n n y +T90 IEEE y y (5) y y (5) n n y +TFLOPS n y (1) n n n n y +AIX-5.1 32-bit y y y y y n y +AIX-5.1 64-bit y y y y y n y +WinXP (6) y n n n y y y +WinXP Intel y n n n y y y +Win2000 y n y n y y y +Win2000 Intel y n y n y y y +WinNT CW y n n n n n y +Mac OS X 10.2 y n n n y y y +FreeBSD y y (1) n n y y y +Linux 2.4 gcc (3) y y (1) y (PGI) n y y y +Linux 2.4 Intel (3) y n y n y n y +Linux 2.4 PGI (3) y n y n y n y +Linux 2.4 IA32 Intel y n y n y n y +Linux 2.4 IA64 Intel y n y n y n y + + +ASCII Table 2 -- for RELEASE.txt + +Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 + exec safe VFD APIs tools (7) +Solaris2.7 64-bit x y y n y y n +Solaris2.7 32-bit x y y n y y y +Solaris2.8 64-bit x y y n y y n +Solaris2.8 32-bit x y y n y y y +IRIX6.5 x n y n y y y +IRIX64_6.5 64-bit x y y y y y y +IRIX64_6.5 32-bit x y y y y y y +HPUX11.00 x n y n y y y +OSF1 v5.1 y n y n y y y +T3E y n n n y y y +SV1 y n n n y y y +T90 IEEE y n n n y y n +TFLOPS y n n n n n n +AIX-5.1 32-bit y n y n y y y +AIX-5.1 64-bit y n y n y y y +WinXP (6) y n y n n y y +WinXP Intel y n y n n y y +Win2000 y n y n n y y +Win2000 Intel y n y n n y y +WinNT CW y n y n n y y +Mac OS X 10.2 y n y n y y n +FreeBSD y y y n y y y +Linux 2.4 gcc (3) y y y n y y y +Linux 2.4 Intel (3) y n y n y n n +Linux 2.4 PGI (3) y n y n y n n +Linux 2.4 IA32 Intel y n y n y y y +Linux 2.4 IA64 Intel y n y n y y y + + Notes: (1) Using mpich 1.2.4. + (2) Using mpt and mpich 1.2.4. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. + (4) Shared libraries are provided only for the C library, except + on Windows where they are provided for C and C++. + (5) Using mpt. + (6) Binaries only; source code for this platform is not being + released at this time. + (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 + utilities. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + + +Known Problems +============== +* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. + The fix willl be available in the 1.6.2 release. +* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) + failed on windows xp with .NET for debug and debug dll. Release and Release + dll work fine. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + +* On some platforms that use Intel compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + + ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays + +* On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 of + the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. However, if + you still experience a problem, you may want to check this line in the + libtool file and make sure that it has the correct value. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 +%%%%1.6.0%%%% Release Information for hdf5-1.6.0 (03/July/03) + +14. Release information for HDF5 version 1.6.0 +================================================ + + +INTRODUCTION + +This document describes the differences between HDF5-1.4.* and +HDF5-1.6.0, and contains information on the platforms tested and +known problems in HDF5-1.6.0. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.4.0 +- Platforms Tested +- Known Problems + + +New Features +============ + +Configuration: +-------------- +The following flags have been added to the configuration script: +--enable-hdf5v1_4 Compile the HDF5 v1.4 compatibility interface +--enable-filters=all Turn on all internal I/O filters. One may also + specify a comma-separated list of filters or the + word no. The default is all internal I/O filters. +--with-mpe=DIR Use MPE instrumentation [default=no] +--with-szlib=DIR Use szlib library for external szlib I/O filter + [default=no] + +Library: +-------- + Summary: This release has the following new features that are not + available in 1.4.* releases + + 1. Generic properties to give application more control on I/O pipeline + 2. Time allocation and fill value properties + 3. New filters: external compression filter szip + internal shuffling and checksum filters + 4. Compact storage layout for datasets + 5. Redesigned I/O pipeline for better performance. + + For more information see + http://hdf.ncsa.uiuc.edu/HDF5/doc_resource/SZIP/index.html + http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide.html + http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/Changes.html + + Complete list of changes: + + * Changed dataset modification time to _not_ be updated when raw data is + written to a dataset. The modification time is only updated when the + dataset's metadata is modified. QAK - 2003/06/10 + * Changed H5Sget_select_bounds to use 'hssize_t *' for start and end + parameters, instead of 'hsize_t *', to better match other parts of the + dataspace API. QAK - 2003/06/04 + * Changed raw data I/O to only access each chunk once, improving performance + in many situations with hyperslabs and large chunks or chunks with + filters. These improvements are currently limited to serial I/O, with + similar parallel I/O improvements forthcoming sometime in the future. + QAK - 2003/05/07 + * Added parameter to the MPI/POSIX driver. If GPFS is enabled (by + modifying the H5FDmpiposix.c file to uncomment the USE_GPFS_HINTS + macro), then this extra parameter will turn GPFS hints on and off + during runtime. BW - 2003/05/05 + * Added option to print 1-byte integer datasets as ASCII to h5dump. BW - + 2003/04/30 + * Added a new utility "h5fc". It can be used to compile easily Fortran + programs which use HDF5. It automatically uses the compiler the HDF5 + library was built with and links in any libraries HDF5 requires. + BW - 2003/04/10 + * Added new dataset creation property list functions for working with + I/O filters: H5Pmodify_filter, H5Pget_filter_by_id and + H5Pall_filters_avail. Also changed H5Zregister to use new method + of registering filters with library. QAK - 2003/04/08 + * The first version of szip compression support were implemented. + User should have static szlib library installed. Using function + H5Pset_szip to pass the szip parameters to the HDF5 library. + More detailed decription of the process will be followed. + KY-2003/04/01 + * Added Fletcher32 checksum as a filter in pipeline. It only works in + chunked dataset. SLU - 2003/2/11 + * MPICH/MPE instrumentation feature added. Use --with-mpe[=DIR] to configure + it. AKC - 2003/1/3 + * New functions H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx + are added to the library. SLU - 2002/11/25 + * H5Dget_offset is added to return the offset of a dataset's data relative + to the beginning of the file. SLU - 2002/11/7 + * Functions H5Tget_native_type and H5Tis_variable_str are added. The first + one reconstructs a datatype based on native memory datatype. The second + one checks if a datatype is variable string. SLU - 2002/11/6 + * Added environment variable "HDF5_DISABLE_VERSION_CHECK", which disables + the version checking between the header files and the library linked into + an application if set to '1'. This should be used with caution, mis- + matched headers and library binaries can cause _serious_ problems. + QAK - 2002/10/15 + * Added new API function to get the name of an object in a file, using + an open ID (hid_t). QAK - 2002/10/14 + * Added API functions to return pointer to low-level file handle + (H5Fget_vfd_handle and H5FDget_vfd_handle) and related property list + setting functions(H5Pset_family_offset and H5Pset_multi_type). + SLU - 2002/09/30 + * Changed "H5P[set|get]_space_time" functions to "H5P[set|get]_alloc_time" + Unify all symbolic names for these functions to use "alloc time" instead + of other names. QAK - 2002/09/13 + * Added "H5D_SPACE_ALLOC_INCR" setting to H5D_SPACE_ALLOC_EARLY and + H5D_SPACE_ALLOC_LATE for H5Dset_space_time(). This allows chunked + datasets to be incrementally allocated as in the 1.4.x branch. + QAK - 2002/08/27 + * Compact dataset is added to the library. The data will be stored in + the header message of dataset layout. Space allocation time has to be + EARLY. No hyperslab is supported for parallel collective write. There + is no API changes except activating H5Pset_layout and H5Pget_layout for + compact dataset. -SLU, 2002/8/20 + * Added 'closing' parameter to VFL 'flush' callback function and H5FDflush. + This allows the library to indicate that the file will be closed + immediately following the call to 'flush' and can be used to avoid actions + that are duplicated in the VFL 'close' callback function. QAK - 2002/05/20 + * Added feature to parallel chunk allocation routine to not write fill + values to chunks allocated if the user has set the "fill time" to never. + This can improve parallel I/O performance for chunked + datasets. QAK - 2002/05/17 + * New functions H5Glink2 and H5Gmove2 were added to allow link and move to + be in different locations in the same file. The old functions H5Glink + and H5Gmove remain valid. SLU - 2002/04/26 + * Fill-value's behaviors for contiguous dataset have been redefined. + Basicly, dataset won't allocate space until it's necessary. Full details + are available at http://hdf.ncsa.uiuc.edu/RFC/Fill_Value, at this moment. + SLU - 2002/04/11 + * Added new routine "H5Dfill" to fill a selection with a particular value + in memory. QAK - 2002/04/09 + * Improved performance of "regular" hyperslab I/O when using MPI-IO and the + datatype conversion is unneccessary. QAK - 2002/04/02 + * Improved performance of single hyperslab I/O when datatype conversion is + unneccessary. QAK - 2002/04/02 + * Added new "H5Sget_select_type" API function to determine which type of + selection is defined for a dataspace ("all", "none", "hyperslab" or + "point"). QAK - 2002/02/07 + * Added support to read/write portions of chunks directly, if they are + uncompressed and too large to cache. This should speed up I/O on chunked + datasets for a few more cases. QAK - 2002/01/31 + * Added H5Rget_obj_type() API function, which performs the same functionality + as H5Rget_object_type(), but requires the reference type as a parameter + in order to correctly handle dataset region references. Moved + H5Rget_object_type() to be only compiled into the library when v1.4 + compatibility is enabled. + * Added a new file access property, file close degree, to control file + close behavior. It has four values, H5F_CLOSE_WEAK, H5F_CLOSE_SEMI, + H5F_CLOSE_STRONG, and H5F_CLOSE_DEFAULT. Two correspont functions + H5Pset_fclose_degree and H5Pget_fclose_degree are also provided. Two + new functions H5Fget_obj_count and H5Fget_obj_ids are offerted to assist + this new feature. For full details, please refer to the reference + manual under the description of H5Fcreate, H5Fopen, H5Fclose and the + functions mentioned above. + * Removed H5P(get|set)_hyper_cache API function, since the property is no + longer used. + * Improved performance of non-contiguous hyperslabs (built up with + several hyperslab selection calls). + * Improved performance of single, contiguous hyperslabs when reading or + writing. + * As part of the transition to using generic properties everywhere, the + parameter of H5Pcreate changed from H5P_class_t to hid_t, as well + the return type of H5Pget_class changed from H5P_class_t to hid_t. + Further changes are still necessary and will be documented here as they + are made. + * Improved regular hyperslab I/O by about a factor of 6 or so. + * Modified the Pablo build procedure to permit building of the instrumented + library to link either with the Trace libraries as before or with the + Pablo Performance Caputure Facility. + * Added new F90 APIs for generic properties, new filters, and + time/space allocation properties. + * C++ API: + - Added two new member functions: Exception::getFuncName() and + Exception::getCFuncName() to provide the name of the member + function, where an exception is thrown. + - IdComponent::operator= becomes a virtual function because + DataType, DataSpace, and PropList provide their own + implementation. The new operator= functions invoke H5Tcopy, + H5Scopy, and H5Pcopy to make a copy of a datatype, dataspace, + and property list, respectively. + +Parallel Library: +----------------- + +Tools: +------ + * When the "-S" option for "simple" output is chosen, h5ls now displays + modification times of datasets in UTC instead of local time. + QAK - 2003/06/06 + * h5diff to compare two HDF5 files was added + * h5import to import ascii and binary data to an HDF5 file was added. + Old h5import tool in the tools/misc directory was renamed to + h5createU8 to reflect its purpose. h5createU8 will be deleted in + 1.6.1 release. + * Two new scripts h5fc and h5c++ were added to compile F90 and C++ + HDF5 applications. + +Support for new platforms, languages and compilers. +======================================= + * Added C++ API support on HPUX11.00. BMR - 2003/03/19 + * Absoft compiler is supported for Fortran HDF5 Library. + When building with Absoft compiler, add -DH5_ABSOFT to + C compilation flags to get correct names of C functions + called by Fortran APIs. + + +Bug Fixes since HDF5-1.4.0 release +================================== + +Library +------- + * Don't attempt to perform collective I/O on chunked datasets with + parallel I/O. QAK - 2003/06/05 + * The library now correctly reuses space when objects are deleted in the + file. This should be handled correctly for every situation, except + datasets with variable-length datatypes are not returning the space they + use in the global heap currently. QAK - 2003/04/13 + * Fixed error in B-tree deletion routine which could cause groups to be + corrupted when objects are removed from them. + QAK - 2003/04/11 + * Fixed error in file space freeing code which could cause metadata to + fail to be written to the file. + QAK - 2003/04/11 + * -O caused errors in AIX 5.x platforms. Removed it from + --enable-production mode. AKC - 2003/03/31 + * Corrected memory/resource leaks in per-thread key information when + thread-safe operation was enabled. QAK - 2003/02/07 + * Improved error assertion for nil VL strings, making it fails with error + stack instead of just assertion failure. SLU - 2002/12/16 + * Added two new API functions: H5Zunregister & H5Zfilter_avail. + QAK - 2002/11/16 + * Add data shuffle filter(source code H5Zshuffle.c), the combination of the + shuffling and compression can make data compression better without suffering + much encoding and decoding CPU time for many application datasets(especially + for floating point data). This adds a new API function: H5Pset_shuffle. + KY - 2002/11/13 + * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 + * New functions H5Gget_comment(modification), H5Aget_storage_size, + H5Arename. SLU - 2002/10/29 + * Fixed an assertion of H5S_select_iterate that did not account for scalar + type that has no dimension sizes. AKC - 2002/10/15 + * Partially fixed space allocation inefficiencies in the file by + improving our algorithms for re-using freed space. QAK - 2002/08/27 + * Fixed data corruption problem which could occur when fill values were + written to a contiguously stored dataset in parallel. QAK - 2002/08/27 + * Fixed VL memory leak when data is overwritten. The heap objects holding + old data are freed. If the fill value writting time is set to + H5D_FILL_TIME_NEVER, the library prohibits user to create VL type dataset. + The library free all the heap objects storing VL type if there is nested + VL type(a VL type contains another VL type). SLU - 2002/07/10 + * Tweaked a few API functions to use 'size_t' instead of 'unsigned' or + 'hsize_t', which may cause errors in some cases. + + +Configuration +------------- + * Included the both the examples of fortran and c++ "make check-install" + testing. This tests the correctness of the h5fc command. AKC - 2003/04/22 + * When using gcc 3.x, we use -std=c99 instead of -ansi for compiling. + QAK - 2003/04/11 + * IA64 platform has its own configure setting and use Intel Compilers as + the default compilers (were gcc and pgf90 before.) This also eliminated + the segmentation fault in the fortran test. The missing reference of + "exit" is fixed too. AKC - 2003/04/02 + +Performance +------------- + * Improved dataset creation time by about 30% (relative to the 1.4.x + branch). + +Tools +----- + + * Added a -force option to h5redeploy. AKC - 2003/03/04 + * The VL string bug(data and datatype cannot be shown) in h5dump is fixed. + -SLU - 2002/11/18 + * Fixed segfault if h5dump was invoked with some options but no file + (e.g., h5dump -H). -AKC, 2002/10/15 + * Fixed so that the "-i" flag works correctly with the h5dumper. + * Fixed segfault when "-v" flag was used with the h5dumper. + + +Documentation +------------- + + + + + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 + xlf 8.1.0.3 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 + poe 3.2.0.10 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 + Cray Fortran Version 3.6.0.0.2 + mpt 2.2.0.0 + Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 + mpt 2.2.0.0 + Cray Fortran Version 3.6.0.0.2 + Cray T90IEEE 10.0.1.01y Cray Standard C Version 6.4.0.2.3 + Cray Fortran Version 3.4.0.3 + mpt 2.1.0.0 + FreeBSD 4.7 gcc 2.95.4 + g++ 2.95.5 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP ANSI C++ B3910B A.03.13 + MPIch 1.2.4 + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + MPIch 1.2.4 + Linux 2.4.18 gcc 2.96, 3.2.2, 3.2.3 + g++ 3.2.2, 3.2.3 + Intel(R) C++ Version 7.1 + Intel(R) Fortran Compiler Version 7.1 + PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 + MPIch 1.2.4 + OSF1 V5.1 Compaq C V6.4-014 + Compaq C V6.3-027 + Compaq Fortran V5.5-1877 + Compaq C++ V6.5-014 + MPI_64bit_R5 + g++ version 3.0 for C++ + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8/32 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + SunOS 5.8/64 Sun WorkShop 6 update 2 C 5.3 + (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 + Sun WorkShop 6 update 2 C++ 5.3 + TFLOPS r1.0.4 v4.3.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + IA-32 Linux 2.4.9 gcc 2.96 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Intel C and F90 compilers version 7.1 + Code Warrior 8.0 + Windows XP MSVC++.NET + MAC OS X Darwin 6.5 + gcc and g++ Apple Computer, Inc. GCC + version 1161, based on gcc version 3.1 + + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + +Platform C C F90 F90 C++ Shared zlib + parallel parallel libraries (4) +Solaris2.7 64-bit y y (1) y y (1) y y y +Solaris2.7 32-bit y y (1) y y (1) y y y +Solaris2.8 64-bit y y (1) y y (1) y y y +Solaris2.8 32-bit y y y y (1) y y y +IRIX6.5 y y (1) n n n y y +IRIX64_6.5 64-bit y y (2) y y y y y +IRIX64_6.5 32-bit y y (2) n n n y y +HPUX11.00 y y (1) y y y y y +OSF1 v5.1 y y y y y y y +T3E y y (5) y y (5) n n y +SV1 y y (5) y y (5) n n y +T90 IEEE y y (5) y y (5) n n y +TFLOPS n y (1) n n n n y +AIX-5.1 32-bit y y y y y n y +AIX-5.1 64-bit y y y y y n y +WinXP (6) y n n n y y y +WinXP Intel y n n n y y y +Win2000 y n y n y y y +Win2000 Intel y n y n y y y +WinNT CW y n n n n n y +Mac OS X 10.2 y n n n y y y +FreeBSD y y (1) n n y y y +Linux 2.4 gcc (3) y y (1) y (PGI) n y y y +Linux 2.4 Intel (3) y n y n y n y +Linux 2.4 PGI (3) y n y n y n y +Linux 2.4 IA32 Intel y n y n y n y +Linux 2.4 IA64 Intel y n y n y n y + + +ASCII Table 2 -- for RELEASE.txt + +Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 + exec safe VFD APIs tools (7) +Solaris2.7 64-bit x y y n y y n +Solaris2.7 32-bit x y y n y y y +Solaris2.8 64-bit x y y n y y n +Solaris2.8 32-bit x y y n y y y +IRIX6.5 x n y n y y y +IRIX64_6.5 64-bit x y y y y y y +IRIX64_6.5 32-bit x y y y y y y +HPUX11.00 x n y n y y y +OSF1 v5.1 y n y n y y y +T3E y n n n y y y +SV1 y n n n y y y +T90 IEEE y n n n y y n +TFLOPS y n n n n n n +AIX-5.1 32-bit y n y n y y y +AIX-5.1 64-bit y n y n y y y +WinXP (6) y n y n n y y +WinXP Intel y n y n n y y +Win2000 y n y n n y y +Win2000 Intel y n y n n y y +WinNT CW y n y n n y y +Mac OS X 10.2 y n y n y y n +FreeBSD y y y n y y y +Linux 2.4 gcc (3) y y y n y y y +Linux 2.4 Intel (3) y n y n y n n +Linux 2.4 PGI (3) y n y n y n n +Linux 2.4 IA32 Intel y n y n y y y +Linux 2.4 IA64 Intel y n y n y y y + + Notes: (1) Using mpich 1.2.4. + (2) Using mpt and mpich 1.2.4. + (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. + (4) Shared libraries are provided only for the C library, except + on Windows where they are provided for C and C++. + (5) Using mpt. + (6) Binaries only; source code for this platform is not being + released at this time. + (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 + utilities. + Compiler versions for each platform are listed in the preceding + "Platforms Tested" table. + + + +Known Problems +============== + +* PGI C++ compiler fails when compiling the C++ library's tests. + Therefore, we cannot verify that the C++ library built with the PGI C++ + compiler is correct. + +* The h5dump tests may fail to match the expected output on some platforms + (e.g. parallel jobs, Windows) where the error messages directed to + "stderr" do not appear in the "right order" with output from stdout. + This is not an error. + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + It is suggested that you don't use this option on these platforms + during configuration. + +* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + + +* The Stream VFD was not tested yet under Windows. It is not supported + in the TFLOPS machine. + + +* The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Before building HDF5 F90 Library from source on Crays + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files + from the site: + +* On some platforms that use Intel compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + + ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays + +* On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 of + the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. However, if + you still experience a problem, you may want to check this line in the + libtool file and make sure that it has the correct value. + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 +----------------------------------------------------------------------- +%%%%1.4.5%%%% Release Information for hdf5-1.4.5 (02/February/03) + + +13. Release information for HDF5 version 1.4.5 +============================================================================== + + +INTRODUCTION + +This document describes the differences between HDF5-1.4.4 and +HDF5-1.4.5, and contains information on the platforms tested and +known problems in HDF5-1.4.5. For additional information check the +HISTORY.txt file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information, see the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- Bug Fixes since HDF5-1.4.4 +- Performance Improvements +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + o Configuration + ================ + * Added "unofficial support" for building with a C++ compiler (or at least + not failing badly when building with a C++ compiler). QAK - 2003/01/09 + * Added "unofficial support" for AIX 64bits. See INSTALL for configure + details. AKC - 2002/08/29 + * Added "--with-dmalloc" flag, to easily enable support for the 'dmalloc' + debugging malloc implementation. QAK - 2002/07/15 + + o Library + ========= + o General + --------- + * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 + * Added environment variable "HDF5_DISABLE_VERSION_CHECK", which disables + the version checking between the header files and the library linked + into an application if set to '1'. This should be used with caution, + mis-matched headers and library binaries can cause _serious_ problems. + QAK - 2002/10/15 + * Partially fixed space allocation inefficiencies in the file by + improving our algorithms for re-using freed space. QAK - 2002/08/27 + * API tracing has been improved. Nested API calls don't screw up the + output format; function call and return event times can be logged; + total time spent in each function can be logged. The following + HDF5_DEBUG environment variable words affect tracing: + trace -- turn on/off basic tracing + ttimes -- turn on tracing and report event times and + time spent in each API function. + ttop -- turn on tracing but display only top-level + API calls. + + o APIs + ------ + * Several missing fortran APIs have been added to the library: + + h5get_libversion_f h5tget_member_index_f h5dget_storage_size_f + h5check_version_f h5tvlen_create_f h5dvlen_get_max_len_f + h5garbage_collect_f h5dwrite_vl_f + h5dont_atexit_f h5dread_vl_f + + Functions h5dvlen_get_max_len_f, h5dwrite_vl_f, and h5dread_vl_f support + VL Length C APIs functionality for integer, real and string datatypes. + See HDF5 Reference Manual and HDF5 FORTRAN90 User's Notes for more + information and for the functions description. + + o Parallel library + ================== + * The MPI-posix virtual file driver makes gpfs_fcntl() hints to tell + the underlying GPFS file system to avoid prefetching byte range + tokens if USE_GPFS_HINTS is defined when this file is compiled. + This temporary solution is intended to be removed once the HDF5 + API supports the necessary functionality that makes it possible + for this sort of thing do be done at a higher software layer. + RPM - 2002/12/03 + * Added MPI-posix VFL driver. This VFL driver uses MPI functions to + coordinate actions, but performs I/O directly with POSIX sec(2) + (i.e. open/close/read/write/etc.) calls. This driver should _NOT_ + be used to access files that are not on a parallel filesystem. + The following API functions were added: + herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm); + herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/); + QAK - 2002/07/15 + + + + o Support for new platforms and languages + ========================================= + * C++ API now works on the Origin2000 (IRIX6.5.14.) BMR - 2002/11/14 + + + o Misc. + ========================================= + HDF5 1.4.5 works with Portland Group Compilers (pgcc, pgf90 and pgCC + version 4.0-2) on Linux 2.4 + + +Bug Fixes since HDF5-1.4.4 Release +================================== + * H5Fopen without the H5F_ACC_CREAT flag should not succeed in creating + a new file with the 'core' VFL driver. QAK - 2003/01/24 + * Corrected metadata caching bug in parallel I/O which could cause hangs + when chunked datasets were accessed with independent transfer mode. + QAK - 2003/01/23 + * Allow opening objects with unknown object header messages. + QAK - 2003/01/21 + * Added improved error assertion for nil VL strings. It return error + stack instead of a simple assertion. SLU - 2002/12/16 + * Fixed h5dump bug(cannot dump data and datatype) for VL string. + SLU - 2002/11/18 + * Fixed error condition where "none" selections were not being handled + correctly in serial & parallel. QAK - 2002/10/29 + * Fixed problem where optimized hyperslab routines were incorrectly + invoked for parallel I/O operations in collective mode. QAK - 2002/07/22 + * Fixed metadata corruption problem which could occur when many objects + are created in a file during parallel I/O. QAK - 2002/07/19 + * Fixed minor problem with configuration when users specified /usr/include + and /usr/lib for the --with-* options that some compilers can't + handle. BW - 2003/01/23 + + + +Documentation +============= + New PDF files are not available for this release. + + +Platforms Tested +================ + + AIX 5.1 (32 and 64-bit) C for AIX Compiler, Version 6 + xlf 8.1.0.2 + poe 3.2.0.11 + Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.1.3 + Cray Fortran Version 3.6.0.0.12 + Cray SV1 10.0.1. 0 Cray Standard C Version 6.6.0.1.3 + Cray Fortran Version 3.6.0.0.12 + Cray T90IEEE 10.0.1.01u Cray Standard C Version 6.4.0.2.3 + Cray Fortran Version 3.4.0.3 + FreeBSD 4.7 gcc 2.95.4 + g++ 2.95.5 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + Linux 2.4.18 gcc 3.2.1 + g++ 3.2.1 + Intel(R) C++ Version 6.0 + Intel(R) Fortran Compiler Version 6.0 + PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 + pgf90 3.2-4 + OSF1 V5.1 Compaq C V6.4-014 + Compaq Fortran X5.4A-1684 + gcc version 3.0 for C++ + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + TFLOPS r1.0.4 v4.3.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with + local modifications + IA-32 Linux 2.4.9 gcc 2.96 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 + Intel(R) C++ Version 7.0 + Intel(R) Fortran Compiler Version 7.0 + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows XP .NET + Windows NT4.0 Code Warrior 6.0 + MAC OS X Darwin 6.2 + gcc and g++ Apple Computer, Inc. GCC + version 1161, based on gcc version 3.1 + + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + + + Platform C C F90 F90 C++ Shared zlib + parallel parallel libraries (5) + Solaris2.6 y n y n y y y + Solaris2.7 64-bit y y (1) y y (1) y y y + Solaris2.7 32-bit y y (1) y y (1) y y y + Solaris2.8 64-bit y n y y (1) y y y + Solaris2.8 32-bit y n y y (1) y y y + IRIX6.5 y y (1) n n n y y + IRIX64_6.5 64-bit y y (2) y y y y y + IRIX64_6.5 32-bit y y (2) n n n y y + HPUX11.00 y y (1) y n n y y + OSF1 v5.1 y n y n y y y + T3E (6) y n y n n n y + SV1 y n y n n n y + T90 IEEE y n y n n n y + TFLOPS n y (1) n n n n y + AIX-5.1 32-bit y y y y y n y + AIX-5.1 64-bit y y y y y n y + WinXP (7) y n n n y y y + WinNT/2000 y n y n y y y + WinNT CW y n n n n n y + Mac OS X 10.2 y n n n y y y + FreeBSD y y (1) n n y y y + Linux 2.2 y y (1) y y (1) y y y + Linux 2.4 gcc (3) y y (1) y n y y y + Linux 2.4 Intel (3) y n y n n n y + Linux 2.4 PGI (3) y n y n y n y + Linux 2.4 IA32 y n y n n n y + Linux 2.4 IA64 y n y n n n y + + + Platform static- Thread- SRB GASS STREAM- + exec safe VFD + Solaris2.6 x y n n y + Solaris2.7 64-bit x y n n y + Solaris2.7 32-bit x y n n y + Solaris2.8 64-bit x n n n y + Solaris2.8 32-bit x y n n y + IRIX6.5 x n n n y + IRIX64_6.5 64-bit x y n y y + IRIX64_6.5 32-bit x y n y y + HPUX11.00 x n n n y + OSF1 v5.1 y n n n y + T3E (6) y n n n y + SV1 y n n n y + T90 IEEE y n n n y + TFLOPS y n n n n + AIX-5.1 32-bit y n n n y + AIX-5.1 64-bit y n n n y + WinXP (7) dna n n n n + WinNT/2000 dna n n n n + WinNT CW dna n n n n + Mac OS X 10.2 y n n n y + FreeBSD y y n n y + Linux 2.2 y y n n y + Linux 2.4 gcc (3) y y n n y + Linux 2.4 Intel (3) y n n n y + Linux 2.4 PGI (3) y n n n y + Linux 2.4 IA32 y n n n y + Linux 2.4 IA64 y n n n y + + Notes: (1) Using mpich 1.2.4. + (2) Using mpt and mpich 1.2.4. + (3) Linux 2.4 with GNU, Intel, and PGI compilers. + (4) No HDF4-related tools. + (5) Shared libraries are provided only for the C library, + except on Windows where they are provided for all languages. + (6) Debug mode only. + (7) Binaries only; source code for this platform is not being + released at this time. + + +Known Problems +============== + + * On Linux 2.4 IA64, Fortran test fails for h5dwrite_vl_f + for integer and real base datatypes. + + * When fortran library is built with Intel compilers, compilation + for fflush1.f90, fflush2.f90 and fortanlib_test.f90 will fail + complaining about EXEC function. Comment the call to EXEC subroutine + in each program, or get a patch for the HDF5 Fortran source code. + + * Fortran external dataset test fails on Linux 2.4 with pgf90 compiler. + + * On Windows, h5dump may abort printing if a VL string is longer than 4096 + bytes due to a compiler problem. It'll be fixed in v1.6 release. + + * Datasets or attributes which have a variable-length string datatype are + not printing correctly with h5dump and h5ls. + + * When a dataset with the variable-length datatype is overwritten, + the library can develop memory leaks that cause the file to become + unnecessarily large. This is planned to be fixed in the next release. + + * On the SV1, the h5ls test fails due to a difference between the + SV1 printf precision and the printf precision on other platforms. + + * The h5dump tests may fail to match the expected output on some + platforms (e.g. SP2 parallel, Windows) where the error messages + directed to "stderr" do not appear in the "right order" with output + from stdout. This is not an error. + + * The --enable-static-exec configure flag fails to compile for HP-UX + 11.00 platforms. + + * The executables are always dynamic on IRIX64 6.5(64 and n32) and + IRIX 6.5 even if they are configured with --enable-static-exec. + + * IRIX 6.5 fails to compile if configured with --enable-static-exec. + + * The executables are always dynamic on Solaris 2.7 ans 2.8(64 and n32) + even if they are configured with --enable-static-exec. + + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause + a hang in some cases when chunked storage is used. This is now set to + be off by default. One may turn it on by setting the environment + variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. + + * On OSF1 v5.1 and IA32 h5dumpgentst program that generates test files + for h5dump, gives segmentation fault. + + * On Windows platforms, C and Fortran tests fail with the debug DLL version + of the Library if built from all_withf90.zip file. + + * On Cray T3E (sn6606 2.0.6.08 unicosmk CRAY T3E) with Cray Standard C Version 6.6.0.1.3 + compiler optimization causes errors in many HDF5 Library tests. Use -g -h zero flags + to build HDF5 Library. + + * On Cray SV1 10.0.1. 0 datatype convertion test fails. Please check HDF FTP site + if patch is available. We will try to provide one in the nearest future. + + * For configuration, building and testing with Intel and PGI compilers see + corresponding section in INSTALL file. + + +%%%%1.4.4%%%% Release Information for hdf5-1.4.4 (02/July/02) + +12. Release information for HDF5 version 1.4.4 +============================================================================== + +INTRODUCTION + +This document describes the differences between HDF5-1.4.3 and +HDF5-1.4.4, and contains information on the platforms tested and +known problems in HDF5-1.4.4. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information, see the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- Bug Fixes since HDF5-1.4.3 +- Performance Improvements +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + o Configuration + ================ + * The H4 to H5 tools have been removed from the main source and placed + in a separate package. You can get these tools from the HDF ftp site + (ftp://hdf.ncsa.uiuc.edu/). The "--with-hdf4" command-line option + during configure is no longer valid. BW - 2002/06/25 + + o Library + ========= + o General + --------- + * Fill-value forward-compatibility with release 1.5 was added. SLU - + 2002/04/11 + * A new query function H5Tget_member_index has been added for compound + and enumeration data types. This function retrieves a member's index + by name. SLU - 2002/04/05 + * Added serial multi-gigabyte file size test. "test/big -h" shows + the help page. AKC - 2002/03/29 + + o APIs + ------ + * The F90 subroutines h5dwrite_f, h5dread_f, h5awrite_f, and h5aread_f + were overloaded with a "dims" argument of type INTEGER(HSIZE_T) to + specify the size of the array. We recommend using these subroutines + with the new type; module subroutines that accept "dims" as an i + INTEGER array of size 7 will be deprecated in release 1.6. + EIP - 2002/05/06 + + o Performance + ------------- + * Added internal "small data" aggregation, which can reduce the number of + actual I/O calls made, improving performance. QAK - 2002/06/05 + * Improved internal metadata aggregation, which can reduce the number of + actual I/O calls made, improving performance. Additionally, this can + reduce the size of files produced. QAK - 2002/06/04 + * Improved internal metadata caching, which can reduce the number of + actual I/O calls made by a substantial amount, improving + performance. QAK - 2002/06/03 + + + o Parallel library + ================== + * Fixed bug in parallel I/O routines where a collective I/O which used + MPI derived types, followed by an independent I/O would cause the library + to hang. QAK 2002/06/24 + * Added environment variable flag to control whether creating MPI derived + types is preferred or not. This can affect performance, depending on + which way the MPI-I/O library is optimized. The default is set to + prefer MPI derived types for collective raw data transfers; setting the + HDF5_MPI_PREFER_DERIVED_TYPES environment variable to "0" (i.e.: + "setenv HDF5_MPI_PREFER_DERIVED_TYPES 0") changes the preference to avoid + using them whenever possible. QAK - 2002/06/19 + * Changed MPI I/O routines to avoid creating MPI derived types (and thus + needing to set the file view) for contiguous selections within datasets. + This should result in some performance improvement for those types of + selections. QAK - 2002/06/18 + * Changed MPI type support for collective I/O to be enabled by default. + This can be disabled by setting the HDF5_MPI_OPT_TYPES environment + variable to the value "0". QAK - 2002/06/14 + * Allowed chunks in chunked datasets to be cached when parallel file is + opened for read-only access (bug #709). QAK - 2002/06/10 + * Changed method for allocating chunked dataset blocks to only allocate + blocks that don't already exist, instead of attempting to create all the + blocks all the time. This improves performance for chunked + datasets. QAK - 2002/05/17 + * Allowed the call to MPI_File_sync to be avoided when the file is going to + immediately be closed, improving performance. QAK - 2002/05/13 + * Allowed the metadata writes to be shared among all processes, easing the + burden on process 0. QAK - 2002/05/10 + + + o Tools + ======= + * h5redeploy utility was added. It updates HDF5 compiler tools + after the HDF5 software has been installed in a new location. + + + o Support for new platforms and languages + ========================================= + * Parallel Fortran Library works now on HP-UX B.11.00 Sys V. + EIP - 2002/05/06 + * Intel C++ and F90 compilers Version 6.0 are supported on Linux 2.4. + * Intel C++ compilers Version 6.0 are supported on Windows 2000. + + + o Misc. + ========================================= + * zlib has been moved out of the Windows source release. Users should go to + the ZLIB homepage(http://www.zlib.org) to download the corresponding + zlib library. + * The Windows binary release is built with the old version of the zlib + library. We expect users to use zlib 1.1.4 to build with the source + release. + * In the Windows-specific install document, we specify how to test backward + compatibility. However, in this release, we are not testing the backward + compatibility of HDF5. + + +Bug Fixes since HDF5-1.4.3 Release +================================== + * Fixed bug in chunking routines where they were using internal allocation + free routines, instead of malloc/free, preventing user filters from + working correctly. Chunks are now allocated/freed with malloc/free and + so should the chunks in user filters. QAK 2002/06/18 + * Fixed bug where regular hyperslab selection could get incorrectly + transferred when the number of elements in a row did not fit evenly + into the buffer provided. QAK 2002/06/12 + * Fixed bug (#499) which allowed an "empty" compound or enumerated datatype + (one with no members) to be used to create a dataset or to be committed + to a file. QAK - 2002/06/11 + * Fixed bug (#777) which allowed a compound datatype to be inserted into + itself. QAK - 2002/06/10 + * Fixed bug (#789) where creating 1-D dataset region reference caused the + library to go into infinite loop. QAK - 2002/06/10 + * Fixed bug (#699, fix provided by a user) where a scalar dataspace was + written to the file and then subsequently queried with the + H5Sget_simple_extent_type function; type was reported as H5S_SIMPLE + instead of H5S_SCALAR. EIP - 2002/06/04 + * Clear symbol table node "dirty" flag when flushing symbol tables to + disk, to reduce I/O calls made & improve performance. QAK - 2002/06/03 + * Fixed bug where an object's header could get corrupted in certain + obscure situations when many objects were created in the + file. QAK - 2002/05/31 + * Fixed bug where read/write intent in file IDs created with H5Freopen + was not being kept the same as the original file. QAK - 2002/05/14 + * Fixed bug where selection offsets were not being used when iterating + through point and hyperslab selections with + H5Diterate(). QAK - 2002/04/29 + * Fixed bug where the data for several level deep nested compound & + variable-length datatypes used for datasets were getting corrupted when + written to the file. QAK - 2002/04/17 + * Fixed bug where selection offset was being ignored for certain hyperslab + selections when optimized I/O was being performed. QAK - 2002/04/02 + * Fixed limitation in h5dumper with object names which reached over 1024 + characters in length. We can now handle arbitrarily larger sizes for + object names. BW - 2002/03/29 + * Fixed bug where variable-length string type did not behave as a + string. SLU - 2002/03/28 + * Fixed bug in H5Gget_objinfo() which was not setting the 'fileno' + of the H5G_stat_t struct. QAK - 2002/03/27 + * Fixed data corruption bug in hyperslab routines when contiguous + hyperslab that spans entire dimension and is larger than type + conversion buffer is attempted to be read. QAK - 2002/03/26 + + +Performance Improvements +======================== + This release of the HDF5 library has been extensively tuned to improve +performance, especially to improve parallel I/O performance. + Most of the specific information for particular performance improvements +is mentioned in the "New Features" and "Bug Fixes since HDF5-1.4.3" sections +of this document, but in general, the library should make fewer and larger +I/O requests when accessing a file. Additionally, improvements to the parallel +I/O portions of the library should have reduced the communications and barriers +used in various internal algorithms, improving the performance of the library. + However, with the extensive changes to some portions of the library that +were required for these improvements, some errors or unanticipated results may +have been introduced also. Please report any problems encountered to our +support team at hdfhelp@ncsa.uiuc.edu. + Hopefully these improvements will benefit all HDF5 applications, but if +there are particular I/O patterns that appear to be slower than necessary, +please send e-mail to hdfhelp@ncsa.uiuc.edu with a sample program showing the +problem behavior; we will look into the issue to see if it is possible to +address it. + + +Documentation +============= + * Documentation was updated for the hdf5-1.4.4 release. + * A new "HDF5 User's Guide" is under development. See + http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. + * A "Parallel HDF5 Tutorial" is available at + http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. + * The "HDF5 Tutorial" is not distributed with this release. It is + available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. + + +Platforms Tested +================ + + AIX 4.3.3.0 (IBM SP powerpc) xlc 5.0.2.0 + mpcc_r 5.0.2.0 + xlf 07.01.0000.0002 + mpxlf 07.01.0000.0002 + AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 + xlf 7.1.0.2 + poe 3.1.0.12 (includes mpi) + AIX 5.1 xlc 5.0.2.0 + xlf 07.01.0000.0002 + mpcc_r 5.0.2.0; mpxlf_r 07.01.0000.0002 + Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 + Cray Fortran Version 3.5.0.4 + Cray SV1 10.0.1.1 Cray Standard C Version 6.5.0.3 + Cray Fortran Version 3.5.0.4 + FreeBSD 4.6 gcc 2.95.4 + g++ 2.95.4 + HP-UX B.10.20 HP C HP92453-01 A.10.32.30 + HP F90 v2.3 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP MPI [not a product] (03/24/2000) B6060BA + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m + F90 MIPSpro 7.3.1.3m (64 only) + Linux 2.4.9-31smp gcc 2.95.3 + g++ 2.95.3 + Intel(R) C++ Version 6.0 + Intel(R) Fortran Compiler Version 6.0 + MPICH 1.2.2 + Linux 2.2.18smp gcc 2.95.2 + gcc 2.95.2 with mpich 1.2.1 + g++ 2.95.2 + pgf90 3.2-4 + OSF1 V5.1 Compaq C V6.4-014 + Compaq Fortran V5.5-1877-48BBF + gcc version 3.0 for C++ + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 + WorkShop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + TFLOPS r1.0.4 v4.2.2 i386 pgcc Rel 3.1-4i with mpich-1.2.3 with + local modifications + IA-32 Linux 2.4.9 cc Intel 5.0.1 + gcc 2.96 + Intel(R) C++ Version 6.0 + Intel(R) Fortran Compiler Version 6.0 + + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 + Intel(R) C++ Version 6.0 + Intel(R) Fortran Compiler Version 6.0 + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows NT4.0 MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows NT4.0 Code Warrior 6.0 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + ( ) = footnote appears below second table + + + Platform C C F90 F90 C++ Shared zlib Tools + parallel parallel libraries(5) + Solaris2.6 y n y n y y y y + Solaris2.7 64 y y (1) y n y y y y + Solaris2.7 32 y y (1) y n y y y y + Solaris2.8 64 y n y n y y y y + Solaris2.8 32 y n y n y y y y + IRIX6.5 y y (1) n n n y y y + IRIX64_6.5 64 y y (2) y y n y y y + IRIX64_6.5 n32 y y (2) n n n y y y + HPUX10.20 y n y n n y y y + HPUX11.00 y n y n n y y y + HPUX11 SysV y y y y n y y y + OSF1 v5.1 y n y n y y y y + T3E y y y y n n y y + SV1 y n y n n n y y + TFLOPS n y (1) n n n n y y (4) + AIX-4.3 y y y y y n y y + AIX-5.1 y y y y n n y y + WinNT/2000 y n y n y y y y + WinNT CW y n n n n n y y + FreeBSD y n n n y y y y + Linux 2.2 y y (1) y n y y y y + Linux 2.4 y y (1) n n y y y y + Linux 2.4 Intel(6) y n y n y n y y + Linux 2.4 IA32 y n y n n n y y + Linux 2.4 IA64 y n y n n n y y + + + Platform 1.2 static- Thread- SRB GASS STREAM- + compatibility exec safe VFD + Solaris2.6 y x y n n y + Solaris2.7 64 y x y n n y + Solaris2.7 32 y x y n n y + Solaris2.8 64 y y n n n y + Solaris2.8 32 y x y n n y + IRIX6.5 y x n n n y + IRIX64_6.5 64 y x y n y y + IRIX64_6.5 n32 y x y n y y + HPUX10.20 y y n n n y + HPUX11.00 y x n n n y + HPUX11 SysV y x n n n y + OSF1 v5.1 y y n n n y + T3E y y n n n y + SV1 y y n n n y + TFLOPS y y n n n n + AIX-4.3 y y (3) n n n y + AIX-5.1 y y n n n y + WinNT/2000 y y n n n n + WinNT CW n n n n n n + FreeBSD y y y n n y + Linux 2.2 y y y n n y + Linux 2.4 y y y n n y + Linux 2.4 Intel(6) y y n n n y + Linux 2.4 IA32 y y n n n y + Linux 2.4 IA64 y y n n n y + + + Footnotes: (1) Using mpich. + (2) Using mpt and mpich. + (3) When configured with static-exec enabled, tests fail in + serial mode. + (4) No HDF4-related tools. + (5) Shared libraries are provided only for the C library, + except on Windows where they are provided for all languages. + (6) Linux 2.4 with Intel compilers. + + +Known Problems +============== + + * Datasets or attributes which have a variable-length string datatype are + not printing correctly with h5dump and h5ls. + + * When a dataset with the variable-length datatype is overwritten, + the library can develop memory leaks that cause the file to become + unnecessarily large. This is planned to be fixed in the next release. + + * On the SV1, the h5ls test fails due to a difference between the + SV1 printf precision and the printf precision on other platforms. + + * The h5dump tests may fail to match the expected output on some + platforms (e.g. SP2 parallel, Windows) where the error messages + directed to "stderr" do not appear in the "right order" with output + from stdout. This is not an error. + + * The --enable-static-exec configure flag fails to compile for HP-UX + 11.00 platforms. + + * The executables are always dynamic on IRIX64 6.5(64 and n32) and + IRIX 6.5 even if they are configured with --enable-static-exec. + + * IRIX 6.5 fails to compile if configured with --enable-static-exec. + + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause + a hang in some cases when chunked storage is used. This is now set to + be off by default. One may turn it on by setting the environment + variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. + + * On IA32 and IA64 systems, if you use a compiler other than GCC (such as + Intel's ecc or icc compilers), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 104 + of the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + Change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + * To build the Fortran library using Intel compilers, one has to + x modify the source code in the fortran/src directory to remove the + !DEC and !MS compiler directives. + x The build will fail in the fortran/test directory and then in the + fortran/examples directory; to proceed, edit the work.pcl files in + those directories to contain two lines + + work.pc + ../src/work.pc + + * To build the Fortran library on IA64 use + setenv CC "ecc -DIA64" + setenv F9X "efc -cl,work.pcl" + before running configure and see the steps described above. + + +%%%%1.4.3%%%% Release Information for hdf5-1.4.3 (18/Februaru/02) + +11. Release information for HDF5 version 1.4.3 +============================================================================== + + +INTRODUCTION + +This document describes the differences between HDF5-1.4.2 and +HDF5-1.4.3, and contains information on the platforms tested and +known problems in HDF5-1.4.2. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- Bug Fixes since HDF5-1.4.2 +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + o Configuration + ================ + * Can use just enable-threadsafe if the C compiler has built-in pthreads + support. + + o Library + ========= + o General + --------- + * Added a new test to verify the information provided by the configure + command. + * Changed internal error handling macros to reduce code size of library by + about 10%. + + o APIs + ------ + * Changed prototype for H5Awrite from: + H5Awrite(hid_t attr_id, hid_t type_id, void *buf) + to: + H5Awrite(hid_t attr_id, hid_t type_id, const void *buf) + * The H5Pset_fapl_split() accepts raw and meta file names similar to the + syntax of H5Pset_fapl_multi() in addition to what it used to accept. + + C++ API: + * Added operator= to class PredType + * Add the overloaded member function Attribute::getName to return + the attribute name's length as in C API. Note that the current + Attribute::getName, that returns "string", is still available. + * Following the change in the C library, the corresponding C++ API + is changed from: + void Attribute::write( const DataType& mem_type, void *buf ) + to: + void Attribute::write( const DataType& mem_type, const void *buf ) + + o Performance + ------------- + * Added perform programs to test the HDF5 library performance. Programs + are installed in directory perform/. + * Improved performance of byte-swapping during data conversions. + * Improved performance of single, contiguous hyperslabs when reading or + writing. + * Added support to read/write portions of chunks directly, if they are + uncompressed and too large to cache. This should speed up I/O on chunked + datasets for a few more cases. -QAK, 1/31/02 + + o Parallel Library + ================== + * Parallel C HDF5 now works on HP-UX platforms, Compaq clusters, + Linux clusters, Cplants (alpha-linux clusters). + + o Tools + ======= + * A helper script called ``h5cc'', which helps compilation of HDF5 + programs, is now distributed with HDF5. See the reference manual + for information on how to use this feature. + * The H5Dumper can now dump comments associated with groups. -WCW 01-05-02 + + o Support for new platforms and languages + ========================================= + * HDF5 C++ Library is supported on Windows platforms (shared and static) + * HDF5 F90 shared library is supported on Windows platforms. + * HDF5 C Library is supported on IA32 and IA64 platforms. + + + +Bug Fixes since HDF5-1.4.2 Release +================================== + + * Fixed a bug when reading chunked datasets where the edge of the dataset + would be incorrectly detected and generate an assertion failure. + * Fixed a bug where reading an entire dataset wasn't being handled + optimally when the dataset had unlimited dimensions. Dataset is read + in a single low-level I/O now, instead of being broken into separate + pieces internally. + * Fixed a bug where reading or writing chunked data which needed datatype + conversion could result in data values getting corrupted. + * Fixed a bug where appending a point selection to the current selection + would not actually append the point when there were no points defined + currently. + * Fixed a bug where 'or'ing a hyperslab with a 'none' selection would + fail. Now adds that hyperslab as the first hyperlab in the selection. + * Fixed a bug in the 'big' test where quota limits weren't being detected + properly if they caused close() to fail. + * Fixed a bug in internal B-tree code where a B-tree was not being copied + correctly. + * Fixed an off-by-one error in H5Sselect_valid when hyperslab selections + which would allow hyperslab selections which overlapped the edge of the + selection by one element as valid. + * Fixed the internal macros used to encode & decode file metadata, to avoid + an unaligned access warning on IA64 machines. + * Corrected behavior of H5Tinsert to not allow compound datatype fields to + be inserted past the end of the datatype. + * Retired the DPSS virtual file driver (--with-gridstorage configure + option). + * Fixed bug where variable-length datatypes for attributes was not working + correctly. + * Fixed bug where raw data re-allocated from the free-list would sometimes + overlap with the metadata accumulator and get corrupted. QAK - 1/23/02 + * Fixed bug where a preempted chunk in the chunk data could still be + used by an internal pointer and cause an assertion failure or core + dump. QAK - 2/13/02 + * Fixed bug where non-zero fill-value was not being read correctly from + certain chunked datasets when using an "all" or contiguous hyperslab + selection. QAK - 2/14/02 + + +Documentation +============= + * Documentation was updated for the hdf5-1.4.3 release. + * A new "HDF5 User's Guide" is under development. See + http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. + * Parallel Tutorial is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/ + + +Platforms Tested +================ + + AIX 4.3.3.0 (IBM SP powerpc) xlc 5.0.2.0 + mpcc_r 5.0.2.0 + xlf 07.01.0000.0002 + mpxlf 07.01.0000.0002 + AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 + xlf 7.1.0.2 + poe 3.1.0.12 (includes mpi) + Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 + Cray Fortran Version 3.5.0.4 + Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.3 + Cray Fortran Version 3.5.0.4 + FreeBSD 4.5 gcc 2.95.3 + g++ 2.95.3 + HP-UX B.10.20 HP C HP92453-01 A.10.32.30 + HP F90 v2.3 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP MPI [not a product] (03/24/2000) B6060BA + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.2m + Linux 2.4.4 gcc 2.95.3 + g++ 2.95.3 + Linux 2.2.18smp gcc 2.95.2 + gcc 2.95.2 with mpich 1.2.1 + g++ 2.95.2 + pgf90 3.2-4 + OSF1 V5.1 Compaq C V6.3-028 + Compaq Fortran V5.4-1283 + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 + Workshop Compilers 5.0 98/10/25 + FORTRAN 90 2.0 Patch 107356-04 + SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + Patch 109503-07 2001/08/11 + Sun WorkShop 6 update 1 C++ 5.2 Patch + 109508-04 2001/07/11 + TFLOPS r1.0.4 v4.0.8 i386 pgcc Rel 3.1-4i with mpich-1.2.1 with + local modifications + IA-32 Linux 2.2.10smpx cc Intel 5.0.1 + egcs-2.91.66 + IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 + Intel(R) C++ Itanium(TM) Compiler + for the Itanium(TM)-based applications, + Version 6.0 Beta, Build 20010905 + Windows 2000 (NT5.0) MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows NT4.0 MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows NT4.0 Code Warrior 6.0 + Windows 98 MSVC++ 6.0 + DEC Visual Fortran 6.0 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + ( ) = footnote appears below second table + + + Platform C C F90 F90 C++ Shared zlib Tools + parallel parallel libraries + (5) + Solaris2.7 y y (1) y n y y y y + Solaris2.8 64 y n y n y y y y + Solaris2.8 32 y n y n y y y y + IA-64 y n n n n n y y + IRIX6.5 y y (1) n n n y y y + IRIX64_6.5 64 y y (2) y y n y y y + IRIX64_6.5 32 y y (2) n n n y y y + HPUX10.20 y n y n n y y y + HPUX11.00 y y y n n y y y + HPUX11 SysV y y y n n y y y + DECOSF y n y n y y y y + T3E y y y y n n y y + SV1 y n y n n n y y + TFLOPS y y (1) n n n n y y (4) + AIX-4.3 SP2 y y y y n n y n + AIX-4.3 SP3 y y y y y n y n + Win2000 y n y n y (6) y y y + Win98 y n y n y (6) y y y + WinNT y n y n y (6) y y y + WinNT CW y n n n n n y y + FreeBSD y n n n y y y y + Linux 2.2 y y (1) y n y y y y + Linux 2.4 y y (1) n n y y y y + + + Platform 1.2 static- Thread- SRB GASS STREAM- + compatibility exec safe VFD + Solaris2.7 n x y n n y + Solaris2.8 64 n y n n n y + Solaris2.8 32 n x n n n y + IA-64 n n n n n y + IRIX6.5 n x y n n y + IRIX64_6.5 64 n x y n y y + IRIX64_6.5 32 n x y n y y + HPUX10.20 n y n n n y + HPUX11.00 n x n n n y + HPUX11 SysV n x n n n y + DECOSF n y n n n y + T3E n y n n n y + SV1 n y n n n y + TFLOPS n y n n n n + AIX-4.3 SP2 n y (3) n n n y + AIX-4.3 SP3 n y n n n y + Win2000 n y n n n n + Win98 n y n n n n + WinNT n y n n n n + WinNT CW n n n n n n + FreeBSD n y y n n y + Linux 2.2 n y y n n y + Linux 2.4 n y y n n y + + + Footnotes: (1) Using mpich. + (2) Using mpt and mpich. + (3) When configured with static-exec enabled, tests fail + in serial mode. + (4) No HDF4-related tools. + (5) Shared libraries are provided only for the C library. + (6) Exception of (5): DLL is available for C++ API on Windows + + +Known Problems +============== + + * Datasets or attributes which have a variable-length string datatype are + not printing correctly with h5dump and h5ls. + + * When a dataset with the variable-legth datatype is overwritten, + the library can develop memory leaks that cause the file to become + unnecessarily large. This is planned to be fixed in the next release. + + * On the SV1, the h5ls test fails due to a difference between the + SV1 printf precision and the printf precision on other platforms. + + + * The h5dump tests may fail to match the expected output in some + platforms (e.g. SP2 parallel, Windows) where the error messages + directed to "stderr" do not appear in the "right order" with output + from stdout. This is not an error. + + * The --enable-static-exec configure flag fails to compile for HP-UX + 11.00 platforms. + + * The executables are always dynamic on IRIX64 6.5(64 and n32) and + IRIX 6.5 even if they are configured with --enable-static-exec. + + * IRIX 6.5 fails to compile if configured with --enable-static-exec. + + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause + a hang in some cases when chunked storage is used. This is now set to + be off by default. One may turn it on by setting environment variable + HDF5_MPI_OPT_TYPES to a non-zero value such as 1. + + * On IA64 systems one has to use -DIA64 compilation flag to compile + h4toh5 and h5toh4 utilites. After configuration step manually modify + Makefile in the tools/h4toh4 and tools/h5toh4 directories to add + -DIA64 to the compilation flags. + + * On IA32 ansd IA64 systems, if you use a compiler other than GCC + (such as Intel's ecc compiler), you will need to modify the generated + "libtool" program after configuration is finished. On or around line 102 + of the libtool file, there are lines which look like: + + # How to pass a linker flag through the compiler. + wl="" + + change the lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + +%%%%1.4.2%%%% Release Information for hdf5-1.4.2 (31/July/01) + +10. Release Information for hdf5-1.4.2 +================================================================= + + +INTRODUCTION + +This document describes the differences between HDF5-1.4.1 and +HDF5-1.4.2, and contains information on the platforms tested and +known problems in HDF5-1.4.2. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- Bug Fixes since HDF5-1.4.1 +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + + * File sizes greater than 2GB are now supported on Linux systems with + version 2.4.x or higher kernels. + * Added a global string variable H5_lib_vers_info_g which holds the + HDF5 library version information. This can be used to identify + an hdf5 library or hdf5 application binary. + Also added a verification of the consistency between H5_lib_vers_info_g + and other version information in the source code. + * Parallel HDF5 now runs on the HP V2500 and HP N4000 machines. + * F90 API: + - Added aditional parameter "dims" to the h5dread_f/h5dwrite_f and + h5aread_f/h5awrite_f subroutines. This parameter is a 1-D array + of size 7 and contains the sizes of the data buffer dimensions. + This change enables portability between Windows and UNIX platforms. + In previous versions of the F90 APIs, the data buffer parameters of + the above functions were declared as assumed-shape arrays, which + were passed to the C functions by a descriptor. There is no + portable means, however, of passing descriptors from F90 to C, + causing portability problems between Windows and UNIX and among + UNIX platforms. With this change, the data buffers are assumed- + size arrays, which can be portably passed to the C functions. + * F90 static library is available on Windows platforms. + See INSTALL_Windows_withF90.txt for details. + * F90 APIs are available on HPUX 11.00 and 10.20 and IBM SP platforms. + * H5 <-> GIF convertor has been added. This is available under + tools/gifconv. The convertor supports the ability to create animated + gifs as well. + * Verified correct operation of library on Solaris 2.8 in both 64-bit and + 32-bit compilation modes. See INSTALL document for instructions on + compiling the distribution with 64-bit support. + * Added support for the Metrowerks Code Warrior compiler for Windows. + * For H4->H5 converter utility, added a new option to choose not to convert + HDF4 specified attributes(reference number, class) into HDF5 attributes. + * Added support chunking and compression in SDS and image in H4->H5 converter. + Currently HDF5 only supports gzip compression, so by default an HDF4 file + with any other compression method will be converted into an HDF5 file in + gzip compression. + * correct the order or reading HDF4 image array in H4->H5 conversion. + * Added new parallel hdf5 tests in t_mpi. The new test checks if the + filesystem or the MPI-IO can really handle greater than 2GB files. + If it fails, it prints information message only without failing the + test. + * Added a parallel HDF5 example examples/ph5example.c to illustrate + the basic way of using parallel HDF5. + * Added a new public macro, H5_VERS_INFO, which is a string holding + the HDF5 library version information. This string is also compiled + into all HDF5 binary code which helps to identify the version information + of the binary code. One may use the Unix strings command on the binary + file and looks for the pattern "HDF5 library version". + * Added new checking in H5check_version() to verify the five HDF5 version + information macros (H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, + H5_VERS_SUBRELEASE and H5_VERS_INFO) are consistent. + + +Bug Fixes since HDF5-1.4.1 Release +================================== + + * Fixed bug with non-zero userblock sizes causing raw data to not + write correctly. + * Fixed problems with Pablo build and linking with non-standard MPI I/O. + * Fixed build on Linux systems with --enable-static-exec flag. It now + works correctly. + * IMPORTANT: Fixed file metadata corruption bug which could cause + metadata data loss in certain situations. + * The allocation by alignment (H5Pset_alignment) feature code somehow + got dropped in some 1.3.x version. Re-implemented it with "new and + improved" algorithm. It keeps track of "wasted" file-fragment in + the free-list too. + * Removed limitation that the data transfer buffer size needed to be + set for datasets whose dimensions were too large for the 'all' + selection code to handle. Any size dimensioned datasets should be + handled correctly now. + * Changed behavior of H5Tget_member_type to correctly emulate HDF5 v1.2.x + when --enable-hdf5v1_2 configure flag is enabled. + * Added --enable-linux-lfs flag to allow more control over whether to + enable or disable large file support on Linux. + * Fixed various bugs releated to SDS dimensional scale conversions in H4->H5 + converter. + * Fixed a bug to correctly convert HDF4 objects with fill value into HDF5. + * Fixed a bug of H5pubconf.h causing repeated definitions if it is included + more than once. hdf5.h now includes H5public.h which includes + H5pubconf.h. Applications should #include hdf5.h which handles multiple + inclusion correctly. + * Fixed H5FDmpio.h to be C++ friendly by making Parallel HDF5 API's to be + external to C++. + * Fixed a bug in H5FD_mpio_flush() that might result in negative file seek + if both MPIO and Split-file drivers are used together. + + + +Documentation +============= + + * The H5T_conv_t and H5T_cdata_t structures are now properly defined + in the H5Tregister entry in the "H5T" section of the "HDF5 Reference + Manual" and described in detail in section 12, "Data Conversions," in + the "Datatypes" chapter of the "HDF5 User's Guide." + * The new tools h52gif and gif2h5 have been added to the "Tools" section + of the Reference Manual. + * A "Freespace Management" section has been added to the "Performance" + chapter of the User's Guide. + * Several user-reported bugs have been fixed since Release 1.4.1. + * The "HDF5 Image and Palette Specification" (in the "HDF5 Application + Developer's Guide") has been heavily revised. Based on extensive user + feedback and input from visualization software developers, Version 1.2 + of the image specification is substantially different from prior + versions. + + +Platforms Tested +================ + + AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6.0 + mpcc_r 3.6.6.0 + xlf 07.01.0000.0002 + mpxlf 07.01.0000.0002 + AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 + xlf 7.1.0.2 + poe 2.4.0.14 (includes mpi) + Cray T3E sn6711 2.0.5.49a Cray Standard C Version 6.5.0.1 + Cray SV1 10.0.0.2 Cray Standard C Version 6.5.0.1 + Cray Fortran Version 3.5.0.1 + FreeBSD 4.3 gcc 2.95.3 + g++ 2.95.3 + HP-UX B.10.20 HP C HP92453-01 A.10.32.30 + HP F90 v2.3 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 + HP F90 v2.4 + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.2m + Linux 2.4.4 gcc 2.95.3 + g++ 2.95.3 + Linux 2.2.18smp gcc 2.95.2 + gcc 2.95.2 with mpich 1.2.1 + g++ 2.95.2 + pgf90 3.2-4 + OSF1 V4.0 DEC-V5.2-040 on Digital UNIX V4.0 (Rev 564) + Digital Fortran 90 V4.1-270 + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.6) WorkShop Compilers 5.0 98/10/25 FORTRAN 90 + 2.0 Patch 107356-04 + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 + Workshop Compilers 5.0 98/10/25 FORTRAN 90 + 2.0 Patch 107356-04 + SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + 2000/09/11 + Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 + SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 + (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 + 2000/09/11 + Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 + TFLOPS r1.0.4 v4.0.7 i386 pgcc Rel 3.1-4i with mpich-1.2.1 with + local modifications + Windows 2000 (NT5.0) MSVC++ 6.0 + Windows NT4.0 MSVC++ 6.0 + DEC Visual Fortran 6.0 + Windows NT4.0 Code Warrior 6.0 + Windows 98 MSVC++ 6.0 + DEC Visual Fortran 6.0 + + +Supported Configuration Features Summary +======================================== + + In the tables below + y = tested and supported + n = not supported or not tested in this release + x = not working in this release + ( ) = footnote appears below second table + + + Platform C C F90 F90 C++ Shared zlib Tools + parallel parallel libraries + (5) + Solaris2.6 y n y n y y y y + Solaris2.7 y y (1) y n y y y y + Solaris2.8 64 y n n n y y y y + Solaris2.8 32 y n y n y y y y + IRIX6.5 y y (1) n n n y y y + IRIX64_6.5 64 y y (2) y y n y y y + IRIX64_6.5 32 y y (2) n n n y y y + HPUX10.20 y n y n n y y y + HPUX11.00 y n y n n y y y + HPUX11 SysV y n y n n y y y + DECOSF y n y n n y y y + T3E y y y y n n y y + SV1 y n y n n n y y + TFLOPS y y (1) n n n n y y (4) + AIX-4.3 SP2 y y y y n n y n + AIX-4.3 SP3 y y y y n n y n + Win2000 y n n n n y y y + Win98 y n y n n y y y + WinNT y n y n n y y y + WinNT CW y n n n n n y y + FreeBSD y n n n y y y y + Linux 2.2 y y (1) y n y y y y + Linux 2.4 y y (1) n n y y y y + + + Platform 1.2 static- Thread- SRB GASS STREAM- + compatibility exec safe VFD + Solaris2.6 y x n n n y + Solaris2.7 y x y n n y + Solaris2.8 64 y y n n n y + Solaris2.8 32 y x n n n y + IRIX6.5 y x y n n y + IRIX64_6.5 64 y x n n n y + IRIX64_6.5 32 y x n n n y + HPUX10.20 y y n n n y + HPUX11.00 y x n n n y + HPUX11 SysV y x n n n y + DECOSF y y n n n y + T3E y y n n n y + SV1 y y n n n y + TFLOPS y y n n n n + AIX-4.3 SP2 y y (3) n n n y + AIX-4.3 SP3 y y n n n y + Win2000 y y n n n n + Win98 n y n n n n + WinNT y y n n n n + WinNT CW n n n n n n + FreeBSD y y n n n y + Linux 2.2 y y y n n y + Linux 2.4 y y y n n y + + + Footnotes: (1) Using mpich. + (2) Using mpt and mpich. + (3) When configured with static-exec enabled, tests fail + in serial mode. + (4) No HDF4-related tools. + (5) Shared libraries are provided only for the C library. + + +Known Problems +============== + + * When a dataset with the variable-legth datatype is overwritten, + the library can develop memory leaks that cause the file to become + unnecessarily large. This is planned to be fixed in the next release. + + * On the SV1, the h5ls test fails due to a difference between the + SV1 printf precision and the printf precision on other platforms. + + * The h5dump tests may fail to match the expected output in some + platforms (e.g. SP2 parallel, Windows) where the error messages + directed to "stderr" do not appear in the "right order" with output + from stdout. This is not an error. + + * The --enable-static-exec configure flag fails to compile for HP-UX + 11.00 platforms. + + * The executables are always dynamic on IRIX64 6.5(64 and n32) and + IRIX 6.5 even if they are configured with --enable-static-exec. + + * IRIX 6.5 fails to compile if configured with --enable-static-exec. + + * For 24-bit image conversion from H4->H5, the current conversion is + not consistent with HDF5 image specification. + + * In some cases, and SDS with an UNLIMITED dimension that has not + been written (current size = 0) is not converted correctly. + + * After "make install" or "make install-doc" one may need to reload + the source from the tar file before doing another build. + + * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause + a hang in some cases when chunked storage is used. This is now set to + be off by default. One may turn it on by setting environment variable + HDF5_MPI_OPT_TYPES to a non-zero value such as 1. + +%%%%1.4.1%%%% Release Information for hdf5-1.4.1 (April/01) + +9. Release Information for hdf5-1.4.1 (April/01) +===================================================================== + + + + HDF5 Release 1.4.1 + + +INTRODUCTION + +This document describes the differences between HDF5-1.4.0 and +HDF5-1.4.1, and contains information on the platforms tested and +known problems in HDF5-1.4.1. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- Bug Fixes since HDF5-1.4.0 +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + + * XML output option for h5dump utility. + + A new option --xml to output data in XML format has been added. The + XML output contains a complete description of the file, marked up in + XML. + + The XML conforms to the HDF5 Document Type Definition (DTD), which + is available at: + + http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd + + The XML output is suitable for use with other tools, including the + Java Tools: + + http://hdf.ncsa.uiuc.edu/java-hdf5-html + + +Bug Fixes since HDF5-1.4.0 Release +================================== + + * h4toh5 utility: conversion of images is fixed + + Earlier releases of the h4toh5 utility produced images that did not + correctly conform to the HDF5 Image and Palette Specification. + + http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html + + Several required HDF5 attributes are omitted, and the dataspace + is reversed (i.e., the ht. and width of the image dataset is + incorrectly described.) For more information, please see: + + http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm + + * Fixed bug with contiguous hyperslabs not being detected, causing + slower I/O than necessary. + * Fixed bug where non-aligned hyperslab I/O on chunked datasets was + causing errors during I/O + * The RCSID string in H5public.h was causing the C++ compiling problem + because when it was included multiple times, C++ did not like + multiple definitions of the same static variable. All occurance of + RCSID definition are removed since we have not used it consistently + before. + + +Documentation +============= + + PDF and Postscript versions of the following documents are available + for this release: + Document Filename + -------- -------- + Introduction to HDF5 H5-R141-Introduction.pdf + HDF5 Reference Manual H5-R141-RefManual.pdf + C++ APIs to HDF5 documents H5-R141-Cplusplus.pdf + Fortran90 APIs to HDF5 documents H5-R141-Fortran90.pdf + + PDF and Postscript files containing H5-R141-DocSet.pdf + all of the above H5-R141-DocSet.ps + + These files are not included in this distribution, but are available + via the Web or FTP at the following locations: + http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/ + ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/docs/ + + While these documents are labeled Release 1.4.1, they describe + Release 1.4.0 as well. + + +Platforms Tested +================ + +Due to the nature of this release only C, C++ libraries and tools were tested. + + AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6 + mpcc_r 3.6.6 + Cray T3E sn6711 2.0.5.47 Cray Standard C Version 6.5.0.0 + Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.0 + FreeBSD 4.3 gcc 2.95.2 + HP-UX B.10.20 HP C HP92453-01 A.10.32.30 + HP-UX B.11.00 HP C HP92453-01 A.11.01.20 + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m + Linux 2.2.18smp gcc-2.95.2 + g++ 2.95.2 + OSF1 V4.0 DEC-V5.2-040 + Digital Fortran 90 V4.1-270 + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.6) + + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 + TFLOPS r1.0.4 v4.0 mpich-1.2.1 with local changes + Windows NT4.0, 2000 (NT5.0) MSVC++ 6.0 + Windows 98 MSVC++ 6.0 + + +Supported Configuration Features Summary +======================================== + + * See "Supported Configuration Features Summary" section for the HDF5 + 1.4.0 release in the HISTORY.txt file. + +Known Problems +============== + + * The h5dump tests may fail to match the expected output in some + platforms (e.g. SP2 parallel, Windows) where the error messages + directed to "stderr" do not appear in the "right order" with output + from stdout. This is not an error. + + * The --enable-static-exec configure flag fails to compile for HP-UX + 11.00 platforms. + + * The executable are always dynamic on IRIX64 6.5(64 and n32) and + IRIX 6.5 even if they are configured with --enable-static-exec. + + * The shared library failed compilation on IRIX 6.5. + + * After "make install" or "make install-doc" one may need to reload the source + from the tar file before doing another build. + + * See "Known problems" section for the HDF5 1.4.0 release in the + HISTORY.txt file. + +%%%%1.4.0%%%% Release Information for hdf5-1.4.0 (2/22/01) + +8. Release Information for hdf5-1.4.0 +=================================================================== + + HDF5 Release 1.4.0 + + +INTRODUCTION + +This document describes the differences between HDF5-1.2.0 and +HDF5-1.4.0, and contains information on the platforms tested and +known problems in HDF5-1.4.0. For more details check the HISTORY.txt +file in the HDF5 source. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- New Features +- h4toh5 Utility +- F90 Support +- C++ Support +- Pablo Support +- Bug Fixes since HDF5-1.2.0 +- Bug Fixes since HDF5-1.4.0-beta2 +- Bug Fixes since HDF5-1.4.0 +- Documentation +- Platforms Tested +- Supported Configuration Features +- Known Problems + + +New Features +============ + * The Virtual File Layer, VFL, was added to replace the old file + drivers. It also provides an API for user defined file drivers. + * New features added to snapshots. Use 'snapshot help' to see a + complete list of features. + * Improved configure to detect if MPIO routines are available when + parallel mode is requested. + * Added Thread-Safe support. Phase I implemented. See: + + http://hdf.ncsa.uiuc.edu/HDF5/papers/mthdf/MTHDFpaper.htm + + for more details. + * Added data sieve buffering to raw data I/O path. This is enabled + for all VFL drivers except the mpio & core drivers. Setting the + sieve buffer size is controlled with the new API function, + H5Pset_sieve_buf_size(), and retrieved with H5Pget_sieve_buf_size(). + * Added new Virtual File Driver, Stream VFD, to send/receive entire + HDF5 files via socket connections. + * As parts of VFL, HDF-GASS and HDF-SRB are also added to this + release. To find out details, please read INSTALL_VFL file. + * Increased maximum number of dimensions for a dataset (H5S_MAX_RANK) + from 31 to 32 to align with HDF4 & netCDF. + * Added 'query' function to VFL drivers. Also added 'type' parameter to + VFL 'read' & 'write' calls, so they are aware of the type of data + being accessed in the file. Updated the VFL document also. + * A new h4toh5 utility, to convert HDF4 files to analogous HDF5 files. + * Added a new array datatype to the datatypes which can be created. + Removed "array fields" from compound datatypes (use an array datatype + instead). + * Parallel HDF5 works correctly with mpich-1.2.1 on Solaris, SGI, Linux. + * You can now install the HDF5 documentation using the + ``make install-doc'' command. The documentation is installed in the + $(prefix)/doc directory where $(prefix) is the prefix specified by + the (optional) ``--prefix'' flag during configuration. + * HDF5 can operate correctly in the OpenMP environment in a limited way. + Check doc/html/TechNotes/openmp-hdf5.html for details. + + +h4toh5 Utility +============== + The h4toh5 utility is a new utility that converts an HDF4 file to an + HDF5 file. For details, see the document, "Mapping HDF4 Objects to + HDF5 Objects": + http://hdf.ncsa.uiuc.edu/HDF5/papers/H4-H5MappingGuidelines.pdf + + Known Bugs: + + The h4toh5 utility produces images that do not correctly conform + to the HDF5 Image and Palette Specification. + + http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html + + Several required HDF5 attributes are omitted, and the dataspace + is reversed (i.e., the ht. and width of the image dataset is + incorrectly described.) For more information, please see: + + http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.html + + This bug has been fixed for the snapshot of hdf5 1.4 release. March 12th,2001 + + Known Limitations of the h4toh5 release + --------------------------------------------- + + 1. Error handlings + + h4toh5 utility will print out an error message when an error occurs. + + 2. String Datatype + + HDF4 has no 'string' type. String valued data are usually defined as + an array of 'char' in HDF4. The h4toh5 utility will generally map + these to HDF5 'String' types rather than array of char, with the + following additional rules: + + * For the data of an HDF4 SDS, image, and palette, if the data is + declared 'DFNT_CHAR8' it will be assumed to be integer and will + be an H5T_INTEGER type. + * For attributes of any HDF4 object, data of type 'DFNT_CHAR8' + will be converted to an HDF5 'H5T_STRING' type. + * For an HDF4 Vdata, it is difficult to determine whether data + of type 'DFNT_CHAR8' is intended to be bytes or characters. The + h4toh5 utility will consider them to be C characters, and will + convert them to an HDF5 'H5T_STRING' type. + + + 3. Compression, Chunking and External Storage + + Chunking is supported, but compression and external storage is not. + + An HDF4 object that uses chunking will be converted to an HDF5 file + with analogous chunked storage. + + An HDF4 object that uses compression will be converted to an + uncompressed HDF5 object. + + An HDF4 object that uses external storage will be converted to an + HDF5 object without external storage. + + 4. Memory Use + + This version of the h4toh5 utility copies data from HDF4 objects + in a single read followed by a single write to the HDF5 object. For + large objects, this requires a very large amount of memory, which may + be extremely slow or fail on some platforms. + + Note that a dataset that has only been partly written will + be read completely, including uninitialized data, and all the + data will be written to the HDF5 object. + + 5. Platforms + + The h4toh5 utility requires HDF5-1.4.0 and HDF4r1.4 + + h4toh5 utility has been tested on all platforms listed below (see + section "Platforms Tested") except TFLOPS. + + +F90 Support +=========== + This is the first release of the HDF5 Library with fully integrated + F90 API support. The Fortran Library is created when the + --enable-fortran flag is specified during configuration. + + Not all F90 subroutines are implemented. Please refer to the HDF5 + Reference Manual for more details. + + F90 APIs are available for the Solaris 2.6 and 2.7, Linux, DEC UNIX, + T3E, SV1 and O2K (64 bit option only) platforms. The Parallel version of + the HDF5 F90 Library is supported on the O2K and T3E platforms. + + Changes since the last prototype release (July 2000) + ---------------------------------------------------- + * h5open_f and h5close_f must be called instead of h5init_types and + h5close_types. + + * The following subroutines are no longer available: + + h5pset_xfer_f + h5pget_xfer_f + h5pset_mpi_f + h5pget_mpi_f + h5pset_stdio_f + h5pget_stdio_f + h5pset_sec2_f + h5pget_sec2_f + h5pset_core_f + h5pget_core_f + h5pset_family_f + h5pget_family_f + + * The following functions have been added: + + h5pset_fapl_mpio_f + h5pget_fapl_mpio_f + h5pset_dxpl_mpio_f + h5pget_dxpl_mpio_f + + * In the previous HDF5 F90 releases, the implementation of object + references and dataset region references was not portable. This + release introduces a portable implementation, but it also introduces + changes to the read/write APIs that handle references. If object or + dataset region references are written or read to/from an HDF5 file, + h5dwrite_f and h5dread_f must use the extra parameter, n, for the + buffer size: + + h5dwrite(read)_f(dset_id, mem_type_id, buf, n, hdferr, & + ^^^ + mem_space_id, file_space_id, xfer_prp) + + For other datatypes the APIs were not changed. + + +C++ Support +=========== + This is the first release of the HDF5 Library with fully integrated + C++ API support. The HDF5 C++ library is built when the --enable-cxx + flag is specified during configuration. + + Check the HDF5 Reference Manual for available C++ documentation. + + C++ APIs are available for Solaris 2.6 and 2.7, Linux, and FreeBSD. + + +Pablo Support +============= + This version does not allow proper building of the Pablo-instrumented + version of the library. A version supporting the pablo build is + available on the Pablo Website at + www-pablo.cs.uiuc.edu/pub/Pablo.Release.5/HDFLibrary/hdf5_v1.4.tar.gz + + +Bug Fixes since HDF5-1.2.0 +========================== + +Library +------- + * The function H5Pset_mpi is renamed as H5Pset_fapl_mpio. + * Corrected a floating point number conversion error for the Cray J90 + platform. The error did not convert the value 0.0 correctly. + * Error was fixed which was not allowing dataset region references to + have their regions retrieved correctly. + * Corrected a bug that caused non-parallel file drivers to fail in + the parallel version. + * Added internal free-lists to reduce memory required by the library + and H5garbage_collect API function + * Fixed error in H5Giterate which was not updating the "index" + parameter correctly. + * Fixed error in hyperslab iteration which was not walking through the + correct sequence of array elements if hyperslabs were staggered in a + certain pattern + * Fixed several other problems in hyperslab iteration code. + * Fixed another H5Giterate bug which was causes groups with large + numbers of objects in them to misbehave when the callback function + returned non-zero values. + * Changed return type of H5Aiterate and H5A_operator_t typedef to be + herr_t, to align them with the dataset and group iterator functions. + * Changed H5Screate_simple and H5Sset_extent_simple to not allow + dimensions of size 0 with out the same dimension being unlimited. + * QAK - 4/19/00 - Improved metadata hashing & caching algorithms to + avoid many hash flushes and also remove some redundant I/O when + moving metadata blocks in the file. + * The "struct(opt)" type conversion function which gets invoked for + certain compound datatype conversions was fixed for nested compound + types. This required a small change in the datatype conversion + function API. + * Re-wrote lots of the hyperslab code to speed it up quite a bit. + * Added bounded garbage collection for the free lists when they run + out of memory and also added H5set_free_list_limits API call to + allow users to put an upper limit on the amount of memory used for + free lists. + * Checked for non-existent or deleted objects when dereferencing one + with object or region references and disallow dereference. + * "Time" datatypes (H5T_UNIX_D*) were not being stored and retrieved + from object headers correctly, fixed now. + * Fixed H5Dread or H5Dwrite calls with H5FD_MPIO_COLLECTIVE requests + that may hang because not all processes are transfer the same amount + of data. (A.K.A. prematured collective return when zero amount data + requested.) Collective calls that may cause hanging is done via the + corresponding MPI-IO independent calls. + * If configure with --enable-debug=all, couple functions would issue + warning messages to "stderr" that the operation is expensive time-wise. + This messed up applications (like testings) that did not expect the + extra output. It is changed so that the warning will be printed only + if the corresponding Debug key is set. + +Configuration +------------- + * The hdf5.h include file was fixed to allow the HDF5 Library to be + compiled with other libraries/applications that use GNU autoconf. + * Configuration for parallel HDF5 was improved. Configure now attempts + to link with libmpi.a and/or libmpio.a as the MPI libraries by + default. It also uses "mpirun" to launch MPI tests by default. It + tests to link MPIO routines during the configuration stage, rather + than failing later as before. One can just do "./configure + --enable-parallel" if the MPI library is in the system library. + * Added support for pthread library and thread-safe option. + * The libhdf5.settings file shows the correct machine byte-sex. + * Added option "--enable-stream-vfd" to configure w/o the Stream VFD. + For Solaris, added -lsocket to the LIBS list of libraries. + +Tools +----- + * h5dump now accepts both short and long command-line parameters: + -h, --help Print a usage message and exit + -B, --bootblock Print the content of the boot block + -H, --header Print the header only; no data is displayed + -i, --object-ids Print the object ids + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -t T, --datatype=T Print the specified named data type + -w #, --width=# Set the number of columns + + P - is the full path from the root group to the object. + T - is the name of the data type. + F - is a filename. + # - is an integer greater than 1. + * A change from the old way command line parameters were interpreted + is that multiple attributes, datasets, groups, soft-links, and + object-ids cannot be specified with just one flag but you have to + use a flag with each object. I.e., instead of doing this: + + h5dump -a /attr1 /attr2 foo.h5 + + do this: + + h5dump -a /attr1 -a /attr2 foo.h5 + + The cases are similar for the other object types. + * h5dump correctly displays compound datatypes. + * Corrected an error in h5toh4 which did not convert the 32bits + int from HDF5 to HDF4 correctly for the T3E platform. + * h5dump correctly displays the committed copy of predefined types + correctly. + * Added an option, -V, to show the version information of h5dump. + * Fixed a core dumping bug of h5toh4 when executed on platforms like + TFLOPS. + * The test script for h5toh4 used to not able to detect the hdp + dumper command was not valid. It now detects and reports the + failure of hdp execution. + * Merged the tools with the 1.2.2 branch. Required adding new + macros, VERSION12 and VERSION13, used in conditional compilation. + Updated the Windows project files for the tools. + * h5dump displays opaque and bitfield data correctly. + * h5dump and h5ls can browse files created with the Stream VFD + (eg. "h5ls :"). + * h5dump has a new feature "-o " which outputs the raw data + of the dataset into ascii text file . + * h5toh4 used to converts hdf5 strings type to hdf4 DFNT_INT8 type. + Corrected to produce hdf4 DFNT_CHAR type instead. + * h5dump and h5ls displays array data correctly. + + +Bug Fixes since HDF5-1.4.0-beta2 +================================ + * Fixed a bug in the conversion from a little endian double to a big + endian float in some special cases. + * Corrected configuration error which was not including compression + support correctly. + * Cleaned up lots of warnings. + * Changed a few h5dump command line switches and added long versions of + the switches. + * Changed parameters for H5Tconvert, H5Pset_bufer and H5Pget_buffer from + size_t to hsize_t + * Fixed fairly obscure bug in hyperslab I/O which could (in rare cases) + not copy all the data during a transfer. + * Removed ragged array code from library. + * F90 library and module files are installed properly now on all supported + platforms. + + +Bug Fixes since HDF5-1.4.0 Release +================================== + + * Fixed bug with contiguous hyperslabs not being detected, causing + slower I/O than necessary. + * Fixed bug where non-aligned hyperslab I/O on chunked datasets was + causing errors during I/O + * Implemented XML support in h5dump. + + +Documentation +============= + * A new document summarizing the changes in the library leading up to + the current release has been added: + HDF5 Software Changes from Release to Release + This document is in the Application Developer's Guide and is of + particular interest to developers who must keep an application + synchronized with the library. + * The documentation for the Fortran90 and C++ APIs is linked to the + opening page of the Reference Manual. Fortran90 functions are + individually referenced from the corresponding C functions through- + out the Reference Manual. + * User's Guide and Reference Manual were updated to reflect changed + function syntax and to fix reported bugs. + * Functions that are new at this release were added to the Reference + Manual. + * Functions that have been removed from the library were removed from + the User's Guide and the Reference Manual. + * PostScript and PDF versions of the Release 1.4 document set are + not available at the time of Release 1.4.0. + + +Platforms Tested +================ + AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6 + mpcc_r 3.6.6 + Cray T3E sn6711 2.0.5.45 Cray Standard C Version 6.4.0.0 + Cray Fortran Version 3.4.0.2 + Cray SV1 sn9605 10.0.0.7 Cray Standard C Version 6.4.0.0 + Cray Fortran Version 3.4.0.2 + FreeBSD 4.2 gcc 2.95.2 + g++ 2.95.2 + HP-UX B.10.20 HP C HP92453-01 A.10.32.30 + HP-UX B.11.00 HP C HP92453-01 A.11.00.13 + IRIX 6.5 MIPSpro cc 7.30 + mpich-1.2.1 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m + mpt.1.4.0.2 + mpich-1.2.1 + Linux 2.2.16-3smp gcc-2.95.2 + g++ 2.95.2 + pgf90 3.1-3 + mpich-1.2.1 + OSF1 V4.0 DEC-V5.2-040 + Digital Fortran 90 V4.1-270 + SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.6) WorkShop Compilers 5.0 99/10/25 Fortran 90 + 2.0 Patch 107356-04 + Workshop Compilers 5.0 98/12/15 C++ 5.0 + SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 + (Solaris 2.7) WorkShop Compilers 5.0 99/10/25 Fortran 90 + 2.0 Patch 107356-04 + Workshop Compilers 5.0 98/12/15 C++ 5.0 + mpich-1.2.1 + SunOS 5.5.1 gcc-2.7.2 + (Solaris 2.5.1 (x86)) + TFLOPS r1.0.4 v4.0 mpich-1.2.1 with local changes + Windows NT4.0, 2000 (NT5.0) MSVC++ 6.0 + Windows 98 MSVC++ 6.0 + + +Supported Configuration Features Summary +======================================== + In the tables below + y = tested and supported + n = not supported or not working in this release + ( ) = footnote appears below table + + Platform C C F90 F90 C++ Shared zlib Tools + parallel parallel libraries + Solaris2.6 y n y n y y y y + Solaris2.7 y y (1) y n y y y y + Solarisx86 y n n n n y y y + IRIX6.5 y y (1) n n n n y y + IRIX64_6.5 64 y y (2) y y n y y y + IRIX64_6.5 32 y y (2) n n n y y y + HPUX10.20 y n n n n y y y + DECOSF y n y n n y y y + T3E y y y y n n y y + SV1 y n y n n n y y + TFLOPS y y (1) n n n n y y (4) + AIX-4.3 y y n n n n y n + Win2000 y n n n n y y y + Win98 y n n n n y y y + WinNT y n n n n y y y + FreeBSD y n n n y y y y + Linux y y (1) y n y y y y + + + Platform 1.2 static- Thread- SRB GASS STREAM- + compatibility exec safe VFD + Solaris2.6 y n n n n y + Solaris2.7 y n y n n y + Solarisx86 y n n n n y + IRIX6.5 y n y n n y + IRIX64_6.5 64 y n n n n y + IRIX64_6.5 32 y n n n n y + HPUX10.20 y y n n n y + DECOSF y y n n n y + T3E y y n n n y + SV1 y y n n n y + TFLOPS y y n n n n + AIX-4.3 y y (3) n n n y + Win2000 y y n n n n + Win98 y y n n n n + WinNT y y n n n n + FreeBSD y y n n n y + Linux y n y n n y + + Footnotes: (1) Using mpich. + (2) Using mpt and mpich. + (3) When configured with static-exec enabled, tests fail + in serial mode. + (4) No HDF4-related tools. + + +Known Problems +============== + * The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + + * The --enable-static-exec configure flag fails to compile for Solaris + platforms. This is due to the fact that not all of the system + libraries on Solaris are available in a static format. + + The --enable-static-exec configure flag also fails to correctly compile + on Linux platforms using the gcc-2.95.2 compiler. + + The --enable-static-exec configure flag also fails to correctly compile + on IBM SP2 platform for the serial mode. The parallel mode works fine + with this option. + + The compilation fails if configured with --enable-static-exec on IRIX 6.5. + + The executable files in hdf5/bin are dynamic-linked for IRIX64 6.5(64 and + n32 modes) and IRIX 6.5, even though they are compiled with static library. + + It is suggested that you don't use this option on these platforms + during configuration. + + * testhdf5 got bus error with configuration options --prefix and --with-hdf4 + on IRIX 6.5. + + * With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + + * SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will + fail if library is compiled using optimization of any level. + + * When building hdf5 tools and applications on windows platform, a linking + warning: defaultlib "LIBC" conflicts with use of other libs will appear + on debug version when running VC++6.0. This warning doesn't affect building + and testing hdf5 applications. We will continue investigating this. + + * h5toh4 converter fails two cases(tstr.h5 and tmany.h5) for release dll + version on windows 2000 and NT. The reason is possibly due to Windows NT + DLL convention on freeing memory. It seems that memory cannot be freed + across library or DLL. It is still under investigation. + + * HDF-GASS testings and testhdf5 in the test directory will get bus error if + the configured with --with-gass. + + * HDF-SRB testing got segmentation error on Solaris 2.7. + + * The Stream VFD was not tested yet under Windows. + It is not supported in the TFLOPS machine. + + * Shared library option is broken for IBM SP and some Origin 2000 platforms. + One needs to run ./configure with '--disable-shared --enable-static'. + + * The ./dsets tests failed in the TFLOPS machine if the test program, + dsets.c, is compiled with the -O option. The hdf5 library still works + correctly with the -O option. The test program works fine if it is + compiled with -O1 or -O0. Only -O (same as -O2) causes the test + program to fail. + + * Certain platforms give false negatives when testing h5ls: + - Solaris x86 2.5.1, Cray T3E and Cray J90 give errors during testing + when displaying object references in certain files. These are benign + differences due to the difference in sizes of the objects created on + those platforms. h5ls appears to be dumping object references + correctly. + - Cray J90 give errors during testing when displaying + some floating-point values. These are benign differences due to the + different precision in the values displayed and h5ls appears to be + dumping floating-point numbers correctly. + + * Before building HDF5 F90 Library from source on Crays (T3E and SV1) + replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src + subdirectory in the top level directory with the Cray-specific files from + the ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/hdf5-1.4.0/src/crayf90/ directory. + + * The h4toh5 utility produces images that do not correctly conform + to the HDF5 Image and Palette Specification. + + http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html + + Several required HDF5 attributes are omitted, and the dataspace + is reversed (i.e., the ht. and width of the image dataset is + incorrectly described.) For more information, please see: + + http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm + +%%%%1.2.2%%%% Release Information for hdf5-1.2.2 (6/23/00) + +7. Release Information for hdf5-1.2.2 +================================================================= +INTRODUCTION + +This document describes the differences between HDF5-1.2.1 and +HDF5-1.2.2, and contains information on the platforms where HDF5-1.2.2 +was tested and known problems in HDF5-1.2.2. + +The HDF5 documentation can be found on the NCSA ftp server +(ftp.ncsa.uiuc.edu) in the directory: + + /HDF/HDF5/docs/ + +For more information look at the HDF5 home page at: + + http://hdf.ncsa.uiuc.edu/HDF5/ + +If you have any questions or comments, please send them to: + + hdfhelp@ncsa.uiuc.edu + + +CONTENTS + +- Features Added since HDF5-1.2.1 +- Bug Fixes since HDF5-1.2.1 +- Known Problems +- Platforms Tested + + +Features Added since HDF5-1.2.1 +=============================== + * Added internal free-lists to reduce memory required by the library and + H5garbage_collect API function. + * h5dump displays opaque and bitfield types. + * New features added to snapshots. Use 'snapshot help' to see a + complete list of features. + * Improved configure to detect if MPIO routines are available when + parallel mode is requested. + +Bug Fixes since HDF5-1.2.1 +========================== + * h5dump correctly displays compound datatypes, including simple and + nested compound types. + * h5dump correctly displays the committed copy of predefined types. + * Corrected an error in h5toh4 which did not convert the 32-bit + int from HDF5 to HDF4 correctly for the T3E platform. + * Corrected a floating point number conversion error for the + Cray J90 platform. The error did not convert the value 0.0 + correctly. + * Fixed error in H5Giterate which was not updating the "index" parameter + correctly. + * Fixed error in hyperslab iteration which was not walking through the + correct sequence of array elements if hyperslabs were staggered in a + certain pattern. + * Fixed several other problems in hyperslab iteration code. + * Fixed another H5Giterate bug which caused groups with large numbers + of objects in them to misbehave when the callback function returned + non-zero values. + * Changed return type of H5Aiterate and H5A_operator_t typedef to be + herr_t, to align them with the dataset and group iterator functions. + * Changed H5Screate_simple and H5Sset_extent_simple to not allow dimensions + of size 0 without the same dimension being unlimited. + * Improved metadata hashing & caching algorithms to avoid + many hash flushes and also removed some redundant I/O when moving metadata + blocks in the file. + * The libhdf5.settings file shows the correct machine byte-sex. + * The "struct(opt)" type conversion function which gets invoked for + certain compound datatype conversions was fixed for nested compound + types. This required a small change in the datatype conversion + function API. + +Known Problems +============== + +o SunOS 5.6 with C WorkShop Compilers 4.2: hyperslab selections will + fail if library is compiled using optimization of any level. +o TFLOPS: dsets test fails if compiled with optimization turned on. +o J90: tools fail to dispay data for the datasets with a compound datatype. + +Platforms Tested +================ + + AIX 4.3.3 (IBM SP) 3.6.6 | binaries + mpicc using mpich 1.1.2 | are not + mpicc_r using IBM MPI-IO prototype | available + AIX 4.3.2.0 (IBM SP) xlc 5.0.1.0 + Cray J90 10.0.0.7 cc 6.3.0.2 + Cray T3E 2.0.5.29 cc 6.3.0.2 + mpt.1.3 + FreeBSD 4.0 gcc 2.95.2 + HP-UX B.10.20 HP C HP92453-01 A.10.32 + HP-UX B.11.00 HP92453-01 A.11.00.13 HP C Compiler + (static library only, h5toh4 tool is not available) + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m + mpt.1.4 + + Linux 2.2.10 SMP gcc 2.95.1 + mpicc(gcc-2.95.1) + gcc (egcs-2.91.66) + mpicc (egcs-2.91.66) + Linux 2.2.16 (RedHat 6.2) gcc 2.95.2 + + OSF1 V4.0 DEC-V5.2-040 + SunOS 5.6 cc WorkShop Compilers 5.0 no optimization + SunOS 5.7 cc WorkShop Compilers 5.0 + SolarisX86 SunOS 5.5.1 gcc version 2.7.2 with --disable-hsizet + TFLOPS 3.2.1 pgcc Rel 3.1-3i + mpich-1.1.2 with local changes + Windows NT4.0 sp5 MSVC++ 6.0 + Windows 98 MSVC++ 6.0 + Windows 2000 MSVC++ 6.0 + + + +%%%%1.2.1%%%% Release Information for hdf5-1.2.1 + +6. Release Information for hdf5-1.2.1 +================================================================ + + +Bug fixes since HDF5-1.2.0 +========================== + +Configuration +------------- + + * The hdf5.h include file was fixed to allow the HDF5 Library to be compiled + with other libraries/applications that use GNU autoconf. + * Configuration for parallel HDF5 was improved. Configure now attempts to + link with libmpi.a and/or libmpio.a as the MPI libraries by default. + It also uses "mpirun" to launch MPI tests by default. It tests to + link MPIO routines during the configuration stage, rather than failing + later as before. One can just do "./configure --enable-parallel" + if the MPI library is in the system library. + +Library +------- + + * Error was fixed which was not allowing dataset region references to have + their regions retrieved correctly. + * Added internal free-lists to reduce memory required by the library and + H5garbage_collect API function + * Fixed error in H5Giterate which was not updating the "index" parameter + correctly. + * Fixed error in hyperslab iteration which was not walking through the + correct sequence of array elements if hyperslabs were staggered in a + certain pattern + * Fixed several other problems in hyperslab iteration code. + +Tests +------ + + * Added additional tests for group and attribute iteration. + * Added additional test for staggered hyperslab iteration. + * Added additional test for random 5-D hyperslab selection. + +Tools +------ + + * Added an option, -V, to show the version information of h5dump. + * Fixed a core dumping bug of h5toh4 when executed on platforms like + TFLOPS. + * The test script for h5toh4 used to not able to detect the hdp + dumper command was not valid. It now detects and reports the + failure of hdp execution. + +Documentation +------------- + + * User's Guide and Reference Manual were updated. + See doc/html/PSandPDF/index.html for more details. + + +Platforms Tested: +================ +Note: Due to the nature of bug fixes, only static versions of the library and tools were tested. + + + AIX 4.3.2 (IBM SP) 3.6.6 + Cray T3E 2.0.4.81 cc 6.3.0.1 + mpt.1.3 + FreeBSD 3.3-STABLE gcc 2.95.2 + HP-UX B.10.20 HP C HP92453-01 A.10.32 + IRIX 6.5 MIPSpro cc 7.30 + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m + mpt.1.3 (SGI MPI 3.2.0.0) + + Linux 2.2.10 SuSE egcs-2.91.66 configured with + (i686-pc-linux-gnu) --disable-hsizet + mpich-1.2.0 egcs-2.91.66 19990314/Linux + + OSF1 V4.0 DEC-V5.2-040 + SunOS 5.6 cc WorkShop Compilers 4.2 no optimization + SunOS 5.7 cc WorkShop Compilers 5.0 + TFLOPS 2.8 cicc (pgcc Rel 3.0-5i) + mpich-1.1.2 with local changes + Windows NT4.0 sp5 MSVC++ 6.0 + +Known Problems: +============== + +o SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will + fail if library is compiled using optimization of any level. + + + +%%%%1.2.0%%%% Release Information for hdf5-1.2.0 + +5. Release Information for hdf5-1.2.0 +=================================================================== + +A. Platforms Supported + ------------------- + +Operating systems listed below with compiler information and MPI library, if +applicable, are systems that HDF5 1.2.0 was tested on. + + Compiler & libraries + Platform Information Comment + -------- ---------- -------- + + AIX 4.3.2 (IBM SP) 3.6.6 + + Cray J90 10.0.0.6 cc 6.3.0.0 + + Cray T3E 2.0.4.61 cc 6.2.1.0 + mpt.1.3 + + FreeBSD 3.2 gcc 2.95.1 + + HP-UX B.10.20 HP C HP92453-01 A.10.32 + gcc 2.8.1 + + IRIX 6.5 MIPSpro cc 7.30 + + IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m + mpt.1.3 (SGI MPI 3.2.0.0) + + Linux 2.2.10 egcs-2.91.66 configured with + --disable-hsizet + lbraries: glibc2 + + OSF1 V4.0 DEC-V5.2-040 + + SunOS 5.6 cc WorkShop Compilers 4.2 + no optimization + gcc 2.8.1 + + SunOS 5.7 cc WorkShop Compilers 5.0 + gcc 2.8.1 + + TFLOPS 2.7.1 cicc (pgcc Rel 3.0-4i) + mpich-1.1.2 with local changes + + Windows NT4.0 intel MSVC++ 5.0 and 6.0 + + Windows NT alpha 4.0 MSVC++ 5.0 + + Windows 98 MSVC++ 5.0 + + +B. Known Problems + -------------- + +* NT alpha 4.0 + Dumper utiliy h5dump fails if linked with DLL. + +* SunOS 5.6 with C WorkShop Compilers 4.2 + Hyperslab selections will fail if library is compiled using optimization + of any level. + + +C. Changes Since Version 1.0.1 + --------------------------- + +1. Documentation + ------------- + +* More examples + +* Updated user guide, reference manual, and format specification. + +* Self-contained documentation for installations isolated from the + Internet. + +* HDF5 Tutorial was added to the documentation + +2. Configuration + ------------- + +* Better detection and support for MPI-IO. + +* Recognition of compilers with known code generation problems. + +* Support for various compilers on a single architecture (e.g., the + native compiler and the GNU compilers). + +* Ability to build from read-only media and with different compilers + and/or options concurrently. + +* Added a libhdf5.settings file which summarizes the configuration + information and is installed along with the library. + +* Builds a shared library on most systems that support it. + +* Support for Cray T3E, J90 and Windows/NT. + +3. Debugging + --------- + +* Improved control and redirection of debugging and tracing messages. + +4. Datatypes + --------- + +* Optimizations to compound datatype conversions and I/O operations. + +* Added nearly 100 optimized conversion functions for native datatypes + including support for non-aligned data. + +* Added support for bitfield, opaque, and enumeration types. + +* Added distinctions between signed and unsigned char types to the + list of predefined native hdf5 datatypes. + +* Added HDF5 type definitions for C9x types like int32_t. + +* Application-defined type conversion functions can handle non-packed + data. + +* Changed the H5Tunregister() function to use wildcards when matching + conversion functions. H5Tregister_hard() and H5Tregister_soft() + were combined into H5Tregister(). + +* Support for variable-length datatypes (arrays of varying length per + dataset element). Variable length strings currently supported only + as variable length arrays of 1-byte integers. + +5. Dataspaces + ---------- + +* New query functions for selections. + +* I/O operations bypass the stripmining loop and go directly to + storage for certain contiguous selections in the absense of type + conversions. In other cases the stripmining buffers are used more + effectively. + +* Reduced the number of I/O requests under certain circumstances, + improving performance on systems with high I/O latency. + +6. Persistent Pointers + ------------------- + +* Object (serial and parallel) and dataset region (serial only) + references are implemented. + +7. Parallel Support + ---------------- + +* Improved parallel I/O performance. + +* Supported new platforms: Cray T3E, Linux, DEC Cluster. + +* Use vendor supported version of MPIO on SGI O2K and Cray platforms. + +* Improved the algorithm that translates an HDF5 hyperslab selection + into an MPI type for better collective I/O performance. + +8. New API functions + ----------------- + + a. Property List Interface: + ------------------------ + + H5Pset_xfer - set data transfer properties + H5Pset_preserve - set dataset transfer property list status + H5Pget_preserve - get dataset transfer property list status + H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O + H5Pget_hyper_cache - returns information regarding the caching of + hyperslab blocks during I/O + H5Pget_btree_ratios - sets B-tree split ratios for a dataset + transfer property list + H5Pset_btree_ratios - gets B-tree split ratios for a dataset + transfer property list + H5Pset_vlen_mem_manager - sets the memory manager for variable-length + datatype allocation + H5Pget_vlen_mem_manager - sets the memory manager for variable-length + datatype allocation + + b. Dataset Interface: + ------------------ + + H5Diterate - iterate over all selected elements in a dataspace + H5Dget_storage_size - return the amount of storage required for a dataset + H5Dvlen_reclaim - reclaim VL datatype memory buffers + + c. Dataspace Interface: + -------------------- + H5Sget_select_hyper_nblocks - get number of hyperslab blocks + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks + currently selected + H5Sget_select_elem_npoints - get the number of element points + in the current selection + H5Sget_select_elem_pointlist - get the list of element points + currently selected + H5Sget_select_bounds - gets the bounding box containing + the current selection + + d. Datatype Interface: + ------------------- + H5Tget_super - return the base datatype from which a + datatype is derived + H5Tvlen_create - creates a new variable-length dataype + H5Tenum_create - creates a new enumeration datatype + H5Tenum_insert - inserts a new enumeration datatype member + H5Tenum_nameof - returns the symbol name corresponding to a + specified member of an enumeration datatype + H5Tvalueof - return the value corresponding to a + specified member of an enumeration datatype + H5Tget_member_value - return the value of an enumeration datatype member + H5Tset_tag - tags an opaque datatype + H5Tget_tag - gets the tag associated with an opaque datatype + + e. Identifier Interface: + --------------------- + H5Iget_type - retrieve the type of an object + + f. Reference Interface: + -------------------- + H5Rcreate - creates a reference + H5Rdereference - open the HDF5 object referenced + H5Rget_region - retrieve a dataspace with the specified region selected + H5Rget_object_type - retrieve the type of object that an + object reference points to + + g. Ragged Arrays (alpha) (names of those API functions were changed): + ------------------------------------------------------------------ + H5RAcreate - create a new ragged array (old name was H5Rcreate) + H5RAopen - open an existing array (old name was H5Ropen) + H5RAclose - close a ragged array (old name was H5Rclose) + H5RAwrite - write to an array (old name was H5Rwrite) + H5RAread - read from an array (old name was H5Rread) + + +9. Tools + ----- + +* Enhancements to the h5ls tool including the ability to list objects + from more than one file, to display raw hexadecimal data, to + show file addresses for raw data, to format output more reasonably, + to show object attributes, and to perform a recursive listing, + +* Enhancements to h5dump: support new data types added since previous + versions. + +* h5toh4: An hdf5 to hdf4 converter. + + + +%%%%1.0.1%%%% Release Information for hdf5-1.0.1 + +4. Changes from Release 1.0.0 to Release 1.0.1 +===================================================================== + +* [Improvement]: configure sets up the Makefile in the parallel tests + suit (testpar/) correctly. + +* [Bug-Fix]: Configure failed for all IRIX versions other than 6.3. + It now configures correctly for all IRIX 6.x version. + +* Released Parallel HDF5 + + Supported Features: + ------------------ + + HDF5 files are accessed according to the communicator and INFO + object defined in the property list set by H5Pset_mpi. + + Independent read and write accesses to fixed and extendable dimension + datasets. + + Collective read and write accesses to fixed dimension datasets. + + Supported Platforms: + ------------------- + + Intel Red + IBM SP2 + SGI Origin 2000 + + Changes In This Release: + ----------------------- + + o Support of Access to Extendable Dimension Datasets. + Extendable dimension datasets must use chunked storage methods. + A new function, H5Dextend, is created to extend the current + dimensions of a dataset. The current release requires the + MPI application must make a collective call to extend the + dimensions of an extendable dataset before writing to the + newly extended area. (The serial does not require the + call of H5Dextend. The dimensions of an extendable + dataset is increased when data is written to beyond the + current dimensions but within the maximum dimensions.) + The required collective call of H5Dextend may be relaxed + in future release. + + This release only support independent read and write accesses + to extendable datasets. Collective accesses to extendable + datasets will be implemented in future releases. + + o Collective access to fixed dimension datasets. + Collective access to a dataset can be specified in the transfer + property list argument in H5Dread and H5Dwrite. The current + release supports collective access to fixed dimension datasets. + Collective access to extendable datasets will be implemented in + future releases. + + o HDF5 files are opened according to Communicator and INFO object. + H5Dopen now records the communicator and INFO setup by H5Pset_mmpi + and pass them to the corresponding MPIO open file calls for + processing. + + o This release has been tested on IBM SP2, Intel Red and SGI Origin 2000 + systems. It uses the ROMIO version of MPIO interface for parallel + I/O supports. + + + +%%%%1.0.0%%%% Release Information for hdf5-1.0.0 + +3. Changes from the Beta 1.0.0 Release to Release 1.0.0 +==================================================================== + +* Added fill values for datasets. For contiguous datasets fill value + performance may be quite poor since the fill value is written to the + entire dataset when the dataset is created. This will be remedied + in a future version. Chunked datasets using fill values do not + incur any additional overhead. See H5Pset_fill_value(). + +* Multiple hdf5 files can be "mounted" on one another to create a + larger virtual file. See H5Fmount(). + +* Object names can be removed or changed but objects are never + actually removed from the file yet. See H5Gunlink() and H5Gmove(). + +* Added a tuning mechanism for B-trees to insure that sequential + writes to chunked datasets use less overhead. See H5Pset_btree_ratios(). + +* Various optimizations and bug fixes. + + + +%%%%1.0.0 Beta%%%% Release Information for hdf5-1.0.0 Beta + +2. Changes from the Second Alpha 1.0.0 Release to the Beta 1.0.0 Release +========================================================================= + +* Strided hyperslab selections in dataspaces now working. + +* The compression API has been replaced with a more general filter + API. See doc/html/Filters.html for details. + +* Alpha-quality 2d ragged arrays are implemented as a layer built on + top of other hdf5 objects. The API and storage format will almost + certainly change. + +* More debugging support including API tracing. See Debugging.html. + +* C and Fortran style 8-bit fixed-length character string types are + supported with space or null padding or null termination and + translations between them. + +* Added function H5Fflush() to write all cached data immediately to + the file. + +* Datasets maintain a modification time which can be retrieved with + H5Gstat(). + +* The h5ls tool can display much more information, including all the + values of a dataset. + + + +%%%%1.0.0 Alpha 2%%%% Release Information for hdf5-1.0.0 Alpha 2 + +1. Changes from the First Alpha 1.0.0 Release to + the Second Alpha 1.0.0 Release +===================================================================== + +* Two of the packages have been renamed. The data space API has been + renamed from `H5P' to `H5S' and the property list (template) API has + been renamed from `H5C' to `H5P'. + +* The new attribute API `H5A' has been added. An attribute is a small + dataset which can be attached to some other object (for instance, a + 4x4 transformation matrix attached to a 3-dimensional dataset, or an + English abstract attached to a group). + +* The error handling API `H5E' has been completed. By default, when an + API function returns failure an error stack is displayed on the + standard error stream. The H5Eset_auto() controls the automatic + printing and H5E_BEGIN_TRY/H5E_END_TRY macros can temporarily + disable the automatic error printing. + +* Support for large files and datasets (>2GB) has been added. There + is an html document that describes how it works. Some of the types + for function arguments have changed to support this: all arguments + pertaining to sizes of memory objects are `size_t' and all arguments + pertaining to file sizes are `hsize_t'. + +* More data type conversions have been added although none of them are + fine tuned for performance. There are new converters from integer + to integer and float to float, but not between integers and floating + points. A bug has been fixed in the converter between compound + types. + +* The numbered types have been removed from the API: int8, uint8, + int16, uint16, int32, uint32, int64, uint64, float32, and float64. + Use standard C types instead. Similarly, the numbered types were + removed from the H5T_NATIVE_* architecture; use unnumbered types + which correspond to the standard C types like H5T_NATIVE_INT. + +* More debugging support was added. If tracing is enabled at + configuration time (the default) and the HDF5_TRACE environment + variable is set to a file descriptor then all API calls will emit + the function name, argument names and values, and return value on + that file number. There is an html document that describes this. + If appropriate debugging options are enabled at configuration time, + some packages will display performance information on stderr. + +* Data types can be stored in the file as independent objects and + multiple datasets can share a data type. + +* The raw data I/O stream has been implemented and the application can + control meta and raw data caches, so I/O performance should be + improved from the first alpha release. + +* Group and attribute query functions have been implemented so it is + now possible to find out the contents of a file with no prior + knowledge. + +* External raw data storage allows datasets to be written by other + applications or I/O libraries and described and accessed through + HDF5. + +* Hard and soft (symbolic) links are implemented which allow groups to + share objects. Dangling and recursive symbolic links are supported. + +* User-defined data compression is implemented although we may + generalize the interface to allow arbitrary user-defined filters + which can be used for compression, checksums, encryption, + performance monitoring, etc. The publicly-available `deflate' + method is predefined if the GNU libz.a can be found at configuration + time. + +* The configuration scripts have been modified to make it easier to + build debugging vs. production versions of the library. + +* The library automatically checks that the application was compiled + with the correct version of header files. + + + Parallel HDF5 Changes + +* Parallel support for fixed dimension datasets with contiguous or + chunked storages. Also, support unlimited dimension datasets which + must use chunk storage. No parallel support for compressed datasets. + +* Collective data transfer for H5Dread/H5Dwrite. Collective access + support for datasets with contiguous storage only, thus only fixed + dimension datasets for now. + +* H5Pset_mpi and H5Pget_mpi no longer have the access_mode + argument. It is taken over by the data-transfer property list + of H5Dread/H5Dwrite. + +* New functions H5Pset_xfer and H5Pget_xfer to handle the + specification of independent or collective data transfer_mode + in the dataset transfer properties list. The properties + list can be used to specify data transfer mode in the H5Dwrite + and H5Dread function calls. + +* Added parallel support for datasets with chunked storage layout. + When a dataset is extend in a PHDF5 file, all processes that open + the file must collectively call H5Dextend with identical new dimension + sizes. + + + LIST OF API FUNCTIONS + +The following functions are implemented. Errors are returned if an +attempt is made to use some feature which is not implemented and +printing the error stack will show `not implemented yet'. + +Library + H5check - check that lib version matches header version + H5open - initialize library (happens automatically) + H5close - shut down the library (happens automatically) + H5dont_atexit - don't call H5close on exit + H5get_libversion - retrieve library version info + H5check_version - check for specific library version + +Property Lists + H5Pclose - release template resources + H5Pcopy - copy a template + H5Pcreate - create a new template + H5Pget_chunk - get chunked storage properties + H5Pset_chunk - set chunked storage properties + H5Pget_class - get template class + H5Pget_istore_k - get chunked storage properties + H5Pset_istore_k - set chunked storage properties + H5Pget_layout - get raw data layout class + H5Pset_layout - set raw data layout class + H5Pget_sizes - get address and size sizes + H5Pset_sizes - set address and size sizes + H5Pget_sym_k - get symbol table storage properties + H5Pset_sym_k - set symbol table storage properties + H5Pget_userblock - get user-block size + H5Pset_userblock - set user-block size + H5Pget_version - get file version numbers + H5Pget_alignment - get data alignment properties + H5Pset_alignment - set data alignment properties + H5Pget_external_count- get count of external data files + H5Pget_external - get information about an external data file + H5Pset_external - add a new external data file to the list + H5Pget_driver - get low-level file driver class + H5Pget_stdio - get properties for stdio low-level driver + H5Pset_stdio - set properties for stdio low-level driver + H5Pget_sec2 - get properties for sec2 low-level driver + H5Pset_sec2 - set properties for sec2 low-level driver + H5Pget_core - get properties for core low-level driver + H5Pset_core - set properties for core low-level driver + H5Pget_split - get properties for split low-level driver + H5Pset_split - set properties for split low-level driver + H5P_get_family - get properties for family low-level driver + H5P_set_family - set properties for family low-level driver + H5Pget_cache - get meta- and raw-data caching properties + H5Pset_cache - set meta- and raw-data caching properties + H5Pget_buffer - get raw-data I/O pipe buffer properties + H5Pset_buffer - set raw-data I/O pipe buffer properties + H5Pget_preserve - get type conversion preservation properties + H5Pset_preserve - set type conversion preservation properties + H5Pget_nfilters - get number of raw data filters + H5Pget_filter - get raw data filter properties + H5Pset_filter - set raw data filter properties + H5Pset_deflate - set deflate compression filter properties + H5Pget_mpi - get MPI-IO properties + H5Pset_mpi - set MPI-IO properties + H5Pget_xfer - get data transfer properties + + H5Pset_xfer - set data transfer properties + + H5Pset_preserve - set dataset transfer property list status + + H5Pget_preserve - get dataset transfer property list status + + H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O + + H5Pget_hyper_cache - returns information regarding the caching of + hyperslab blocks during I/O + + H5Pget_btree_ratios - sets B-tree split ratios for a dataset + transfer property list + + H5Pset_btree_ratios - gets B-tree split ratios for a dataset + transfer property list + + H5Pset_vlen_mem_manager - sets the memory manager for variable-length + datatype allocation + + H5Pget_vlen_mem_manager - sets the memory manager for variable-length + datatype allocation + +Datasets + H5Dclose - release dataset resources + H5Dcreate - create a new dataset + H5Dget_space - get data space + H5Dget_type - get data type + H5Dget_create_plist - get dataset creation properties + H5Dopen - open an existing dataset + H5Dread - read raw data + H5Dwrite - write raw data + H5Dextend - extend a dataset + + H5Diterate - iterate over all selected elements in a dataspace + + H5Dget_storage_size - return the amount of storage required for a dataset + + H5Dvlen_reclaim - reclaim VL datatype memory buffers + +Attributes + H5Acreate - create a new attribute + H5Aopen_name - open an attribute by name + H5Aopen_idx - open an attribute by number + H5Awrite - write values into an attribute + H5Aread - read values from an attribute + H5Aget_space - get attribute data space + H5Aget_type - get attribute data type + H5Aget_name - get attribute name + H5Anum_attrs - return the number of attributes for an object + H5Aiterate - iterate over an object's attributes + H5Adelete - delete an attribute + H5Aclose - close an attribute + +Errors + H5Eclear - clear the error stack + H5Eprint - print an error stack + H5Eget_auto - get automatic error reporting settings + H5Eset_auto - set automatic error reporting + H5Ewalk - iterate over the error stack + H5Ewalk_cb - the default error stack iterator function + H5Eget_major - get the message for the major error number + H5Eget_minor - get the message for the minor error number + +Files + H5Fclose - close a file and release resources + H5Fcreate - create a new file + H5Fget_create_plist - get file creation property list + H5Fget_access_plist - get file access property list + H5Fis_hdf5 - determine if a file is an hdf5 file + H5Fopen - open an existing file + H5Freopen - reopen an HDF5 file + H5Fmount - mount a file + H5Funmount - unmount a file + H5Fflush - flush all buffers associated with a file to disk + +Groups + H5Gclose - close a group and release resources + H5Gcreate - create a new group + H5Gopen - open an existing group + H5Giterate - iterate over the contents of a group + H5Gmove - change the name of some object + H5Glink - create a hard or soft link to an object + H5Gunlink - break the link between a name and an object + H5Gget_objinfo - get information about a group entry + H5Gget_linkval - get the value of a soft link + H5Gget_comment - get the comment string for an object + H5Gset_comment - set the comment string for an object + +Dataspaces + H5Screate - create a new data space + H5Scopy - copy a data space + H5Sclose - release data space + H5Screate_simple - create a new simple data space + H5Sset_space - set simple data space extents + H5Sis_simple - determine if data space is simple + H5Sset_extent_simple - set simple data space dimensionality and size + H5Sget_simple_extent_npoints - get number of points in simple extent + H5Sget_simple_extent_ndims - get simple data space dimensionality + H5Sget_simple_extent_dims - get simple data space size + H5Sget_simple_extent_type - get type of simple extent + H5Sset_extent_none - reset extent to be empty + H5Sextent_copy - copy the extent from one data space to another + H5Sget_select_npoints - get number of points selected for I/O + H5Sselect_hyperslab - set hyperslab dataspace selection + H5Sselect_elements - set element sequence dataspace selection + H5Sselect_all - select entire extent for I/O + H5Sselect_none - deselect all elements of extent + H5Soffset_simple - set selection offset + H5Sselect_valid - determine if selection is valid for extent + + H5Sget_select_hyper_nblocks - get number of hyperslab blocks + + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks + currently selected + + H5Sget_select_elem_npoints - get the number of element points + in the current selection + + H5Sget_select_elem_pointlist - get the list of element points + currently selected + + H5Sget_select_bounds - gets the bounding box containing + the current selection + +Datatypes + H5Tclose - release data type resources + H5Topen - open a named data type + H5Tcommit - name a data type + H5Tcommitted - determine if a type is named + H5Tcopy - copy a data type + H5Tcreate - create a new data type + H5Tequal - compare two data types + H5Tlock - lock type to prevent changes + H5Tfind - find a data type conversion function + H5Tconvert - convert data from one type to another + H5Tregister - register a conversion function + H5Tunregister - remove a conversion function + H5Tget_overflow - get function that handles overflow conv. cases + H5Tset_overflow - set function to handle overflow conversion cases + H5Tget_class - get data type class + H5Tget_cset - get character set + H5Tget_ebias - get exponent bias + H5Tget_fields - get floating point fields + H5Tget_inpad - get inter-field padding + H5Tget_member_dims - get struct member dimensions + H5Tget_member_name - get struct member name + H5Tget_member_offset - get struct member byte offset + H5Tget_member_type - get struct member type + H5Tget_nmembers - get number of struct members + H5Tget_norm - get floating point normalization + H5Tget_offset - get bit offset within type + H5Tget_order - get byte order + H5Tget_pad - get padding type + H5Tget_precision - get precision in bits + H5Tget_sign - get integer sign type + H5Tget_size - get size in bytes + H5Tget_strpad - get string padding + H5Tinsert - insert scalar struct member + H5Tinsert_array - insert array struct member + H5Tpack - pack struct members + H5Tset_cset - set character set + H5Tset_ebias - set exponent bias + H5Tset_fields - set floating point fields + H5Tset_inpad - set inter-field padding + H5Tset_norm - set floating point normalization + H5Tset_offset - set bit offset within type + H5Tset_order - set byte order + H5Tset_pad - set padding type + H5Tset_precision - set precision in bits + H5Tset_sign - set integer sign type + H5Tset_size - set size in bytes + H5Tset_strpad - set string padding + + H5Tget_super - return the base datatype from which a + datatype is derived + + H5Tvlen_create - creates a new variable-length dataype + + H5Tenum_create - creates a new enumeration datatype + + H5Tenum_insert - inserts a new enumeration datatype member + + H5Tenum_nameof - returns the symbol name corresponding to a + specified member of an enumeration datatype + + H5Tvalueof - return the value corresponding to a + specified member of an enumeration datatype + + H5Tget_member_value - return the value of an enumeration datatype member + + H5Tset_tag - tags an opaque datatype + + H5Tget_tag - gets the tag associated with an opaque datatype + + - H5Tregister_hard - register specific type conversion function + - H5Tregister_soft - register general type conversion function + +Filters + H5Tregister - register a conversion function + +Compression + H5Zregister - register new compression and uncompression + functions for a method specified by a method number + +Identifiers + + H5Iget_type - retrieve the type of an object + +References + + H5Rcreate - creates a reference + + H5Rdereference - open the HDF5 object referenced + + H5Rget_region - retrieve a dataspace with the specified region selected + + H5Rget_object_type - retrieve the type of object that an + object reference points to + +Ragged Arrays (alpha) + H5RAcreate - create a new ragged array + H5RAopen - open an existing array + H5RAclose - close a ragged array + H5RAwrite - write to an array + H5RAread - read from an array + + diff --git a/release_docs/HISTORY-1_9.txt b/release_docs/HISTORY-1_9.txt new file mode 100644 index 0000000..8e7648a --- /dev/null +++ b/release_docs/HISTORY-1_9.txt @@ -0,0 +1,6 @@ + HDF5 HISTORY + ============ + This file contains history of the HDF5 1.9 branch + + CONTENTS + diff --git a/release_docs/HISTORY.txt b/release_docs/HISTORY.txt deleted file mode 100644 index 1327827..0000000 --- a/release_docs/HISTORY.txt +++ /dev/null @@ -1,6437 +0,0 @@ -HDF5 HISTORY -============ -This file contains history of the HDF5 libraries releases - -CONTENTS - -19. Release Information for hdf5-1.6.5 -18. Release Information for hdf5-1.6.4 -17. Release Information for hdf5-1.6.3 -16. Release Information for hdf5-1.6.2 -15. Release Information for hdf5-1.6.1 -14. Release Information for hdf5-1.6.0 -13. Release Information for hdf5-1.4.5 -12. Release Information for hdf5-1.4.4 -11. Release Information for hdf5-1.4.3 -10. Release Information for hdf5-1.4.2 -9. Release Information for hdf5-1.4.1 -8. Release Information for hdf5-1.4.0 -7. Release Information for hdf5-1.2.2 -6. Release Information for hdf5-1.2.1 -5. Release Information for hdf5-1.2.0 -4. Changes from Release 1.0.0 to Release 1.0.1 -3. Changes from the Beta 1.0.0 Release to Release 1.0.0 -2. Changes from the Second Alpha 1.0.0 Release to the Beta 1.0.0 Release -1. Changes from the First Alpha 1.0.0 Release to the - Second Alpha 1.0.0 Release - -[Search on the string '%%%%' for per-release section breaks.] - -%%%%1.6.5%%%% Release Information for hdf5-1.6.5 (10/November/05) - - -HDF5 version 1.6.5 released on Thu Nov 10 18:17:53 CST 2005 -================================================================================ - -INTRODUCTION -============ -This document describes the differences between HDF5-1.6.4 and -HDF5-1.6.5. It contains information on the platforms tested and -known problems in HDF5-1.6.5. For more details, check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -Documentation for the current release is also on the HDF web site: - - http://hdf.ncsa.uiuc.edu/HDF5/doc/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS -======== -- New Features -- Support for New Platforms, Languages and Compilers -- Bug Fixes since HDF5-1.6.4 -- Documentation -- Platforms Tested -- Supported Configuration Features Summary -- Known Problems - - -New Features -============ - Configuration: - ------------------------- - - Added yodconfigure, a configure tool, that patches up the configure - file to allow configure to launch executable via the proper - launching command like "yod -sz 1". AKC - 2005/11/10 - - Configure now recognizes the TR variable as the location of the - tr utility. JML 2005/10/20 - - Source code distribution: - ------------------------- - - Added g95 as a testing "platform" informally. AKC - 2005/10/04. - - Added MD5 checksumming to snapshot releases. Releases will now - produce an .md5 file as well as a .tar archive. md5sum can be - used to verify the arvhice with the .md5 checksum. -JL 2005/09/06 - - Library: - -------- - - Added HSYS_ERROR which retrieves the system error message and pushes - it to the error stack. This provides more information regarding the - failed system call. AKC - 2005/08/04 - - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to - allow querying for objects in a file that was opened with a particular - file ID, instead of all objects opened in the file with any file ID. - QAK - 2005/06/01 - - Parallel Library: - ----------------- - - Added mpich2 as a testing "platform" informally. AKC - 2005/10/04. - - HDF5 supports collective MPI-IO for irregular selection with HDF5 - dataset. Irregular selection is when users use API H5Sselect_hyperslab - more than once for the same dataset. - Currently, not all MPI-IO packages support the complicated - MPI derived datatypes used in the implementation of irregular - selections INSIDE HDF5. - 1) DEC 5.x wdoes not support complicated derived datatypes. - 2) For AIX 5.1: - If your poe version number is 3.2.0.20 or lower, - please edit powerpc-ibm-aix5.x in the directory hdf5/config/. - Find the line with - << hdf5_mpi_complex_derived_datatype_works >> - and UNCOMMENT this line before the configure. - check poe version with the following command: - lpp -l all | grep ppe.poe - 3) For Linux cluster,: - If mpich version is 1.2.5 or lower, collective irregular selection - IO is not supported; internally independent IO is used. - 4) For IRIX 6.5: - if C compiler version is 7.3 or lower, collective irregular - selection IO is not supported; internally independent IO is used. - 5) For platforms which internally used mpich: - If the mpich version is 1.2.5 or lower, please find the - corresponding config (in hdf5/config) file and add - hdf5_mpi_complex_derived_datatype_works='no' - at the end of the configuration file. For example, on the - NCSA SGI Altix, the internal mpich library is 1.2.5. So - hdf5_mpi_complex_derived_datatype_works='no' - should be added at the end of the config file ia64-linux-gnu. - KY - 2005/09/12 - - Tools: - ------ - - Removed obsolete pdb2hdf tool. JML - 2005/10/28 - - Sped up h5dump on files with large numbers of objects. - QAK - 2005/08/25 - - F90 API: - -------- - - Added missing h5tget_member_class_f function - EIP 2005/04/06 - C++ API: - -------- - - Added missing member functions: - H5::CompType::getMemberArrayType - H5::CompType::getMemberVarLenType - H5::AbstractDs::getArrayType - H5::AbstractDs::getVarLenType - H5::CommonFG::openArrayType - H5::CommonFG::openVarLenType - H5::PropList::copyProp -- this will replace the current - H5::PropList::copyProp in later releases due - to incorrect prototype. - BMR - 2005/07/27 - - -Support for New Platforms, Languages and Compilers -================================================== - - Added support for RedStorm platform (serial only.) AKC 2005/11/10 - - Added support for BG/L platform (serial only.) LA 2005/11/10 - - Added support for HPUX 11.23 (IA64); only C and C++ are supported - with the +DD64 flag - EIP 2005/10/05 - - - Configuration - ------------- - - Added support for Cray X1. JML 2005/10/03 - - -Bug Fixes since HDF5-1.6.4 Release -================================== - - Library - ------- - - Fixed collective IO in chunking-storage. HDF5 may have called the - wrong routine when the shape of the dataspace in the file and in - the bufferred chunk were different. This bug was fixed to make sure - the correct routine is called. KY - 2005/10/19 - - Fixed core dump when closing root groups opened through two different - file handles that operate on the same actual file. QAK - 2005/10/02 - - The ./dsets tests used to fail in the TFLOPS machine if the - test program, dsets.c, was compiled with the -O option. - The HDF5 library still worked correctly with the -O option. Only - the ./dsets failed. It is fixed. AKC - 2005/09/14 - - Corrected errors when performing various operations on a group opened - by dereferencing an object reference. QAK - 2005/07/30 - - Fixed a bug with named datatypes where a copy of a named datatype - used to create a dataset would accidentally use the original - named datatype for the dataset's datatype. QAK - 2005/07/23 - - Made H5Fget_name() to be consistent and always return name of actual - file the ID is in. (Instead of the name of the top file in a - file mounting hierarchy). QAK - 2005/07/19 - - Reworked internal file mounting semantics to hopefully eliminate - mounting problems. We now require that files that are mounting - together all have the same "file close degree". QAK - 2005/07/19 - - More bug fixes on holding open files that are mounted and have - IDs open. QAK - 2005/07/14 - - Dataset sieve buffer cache was inadvertantly disabled; it has been - re-enabled. QAK - 2005/07/08 - - Don't unmount child files until the parent file actually closes. - (Previously, if an object was holding open a file, the child files - would get unmounted too early). QAK - 2005/07/05 - - Fixed bug where unmounted files could cause the library to go into - an infinite loop when shutting down. QAK - 2005/06/30 - - Fixed bug with hyperslab selections that use selection offsets and - operate on chunked datasets going into infinite loop or dumping - core. QAK - 2005/06/17 - - Corrected memory leak and possible corruption when opening a group. - QAK - 2005/06/17 - - Added check for opaque datatype tags being too long (check against - H5T_OPAQUE_TAG_MAX, currently set to 256). QAK - 2005/06/14 - - Fixed various errors in maintaining names for open objects in the - face of unusual mount & unmount operations. QAK - 2005/06/08 - - "SEMI" and "STRONG" file close degree settings now apply only to the - particular file ID being closed, instead of operating on all open - file IDs for a given file. QAK - 2005/06/01 - - Fixed error in opening object in a group that was opened in a mounted - file which has been unmounted. QAK - 2005/03/17 - - Configuration - ------------- - - Configure can recognize -lmpich as a form of MPI library. -AKC- - 2005/9/28. - - Changed default C++ compiler for the IA64 platform from icc to - icpc which is the preferred compiler for Intel Compiler version - 8. AKC - 2005/09/02 - - Performance - ------------- - - Optimized I/O for enumerated datatypes that are a superset of a - source enumerated datatype. QAK - 2005/03/19 - - Tools - ----- - - Documentation - ------------- - - F90 API - ------- - - h5pget_driver_f was returning information that could not be - interpreted by a Fortran application program; fixed. EIP - 2005/04/10 - - C++ API - ------- - - Several member functions' prototype changed due to the - "int -> unsigned" change in the main library. They are: - H5::CompType::getMemberDataType(unsigned member_num) - H5::CompType::getMemberCompType(unsigned member_num) - H5::CompType::getMemberEnumType(unsigned member_num) - H5::CompType::getMemberIntType(unsigned member_num) - H5::CompType::getMemberFloatType(unsigned member_num) - H5::CompType::getMemberStrType(unsigned member_num) - BMR - 2005/07/27 - - - - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 - xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 - mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - AIX 5.2 (32/64 bit) xlc 6.0.0.8 - xlC 6.0.0.9 - xlf 8.1.1.7 - mpcc_r 6.0.0.8 - mpxlf_r 8.1.1.7 - AIX 5.2 (32/64 bit, LLNL frost) xlc 6.0.0.8 - xlC 6.0.0.8 - xlf 8.1.1.7 - mpcc_r 6.0.0.8 - mpxlf_r 8.1.1.7 - AIX 5.3 (32/64 bit) xlc 7.0.0.0 - xlC 7.0. - xlf 9.1.0.3 - Cray X1 water 3.0.35 Cray Standard C Version 5.4.0.7.4 - Cray Fortran 5.4.0.7.3 - Cray C++ 5.4.0.7.4 - FreeBSD 4.11 gcc 2.95.4 - g++ 2.95.4 - gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.00 - HP F90 v2.9 - HP aC++/ANSI C B3910B A.06.00 - IRIX64 6.5 (tesla -64) MIPSpro cc 7.4.2m - F90 MIPSpro 7.4.2m - C++ MIPSpro cc 7.4.2m - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - C++ MIPSpro cc 7.3.1.3m - mpt 1.6 - Linux 2.4.20-28.7 gcc 2.96 - (eirene, verbena) gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) - version 5.2-1 - Absoft Fortran compiler v9.0 - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 - MPIch 1.2.6 - Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) - (mir) PGI 5.2-1 C and F90 (with k3-32) - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 - Linux 2.4.21-sgi306rp21 Altix - SMP ia64 Intel(R) C++ Version 8.1 - (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 - SGI MPI - OSF1 V5.1 (QSC) Compaq C V6.5-011 - HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 - MPIX200_64_r13.4 - OSF1 V5.1 (PSC) Compaq C V6.5-303 - HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 - SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - SunOS 5.9 32,64 Sun C 5.6 2004/07/15 - (Solaris 2.9) Sun Fortran 95 8.0 2004/07/15 - Sun C++ 5.6 2004/07/15 - SunOS 5.10 Sun WorkShop 6 update 2 C 5.3 - Sun WorkShop 6 update 2 Fortran 95 6.2 - Sun WorkShop 6 update 2 C++ 5.3 - Patch 111685-13 - Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre - (tungsten) Intel(R) C++ Version 9.0 - Intel(R) Fortran Compiler Version 9.0 - IA-64 Linux 2.4.21.SuSE_292.til1 ia64 - (NCSA tg-login) Intel(R) C++ Version 8.0 - Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..10-intel-r2 - Windows XP MSVC++.NET - MSVC++ 6.0 - Intel 8.1 C++ - MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC - version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 - Absoft Fortran compiler v8.2 - - -Supported Configuration Features Summary -======================================== - -Key: y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C F90 F90 C++ zlib SZIP - parallel parallel -IBM BG/L (16) n n n n y y -Solaris2.8 64-bit y y y(1) y y y -Solaris2.8 32-bit y y y(1) y y y -Solaris2.9 64-bit y(1) y y(1) y y y -Solaris2.9 32-bit y(1) y y(1) y y y -Solaris2.10 64-bit y(1) y n y y y -Solaris2.10 32-bit y(1) y n y y y -IRIX64_6.5 64-bit y(2) y y y y y -IRIX64_6.5 32-bit y(2) n n n y y -HPUX11.00 y(1) y y y y y -HPUX11.23-32bit n y n y y y -HPUX11.23-64bit n n n y y y -OSF1 v5.1 y y y y y y -X1 y y y y y n -AIX-5.1, 5.2 & 5.3 32-bit y y y y y y -AIX-5.1, 5.2 & 5.3 64-bit y y y y y y -WinXP Visual Studio 6.0 n n(9) n y y y -WinXP .Net n n n y(8) y y -Mac OS X 10.3 n y(10) n y y y -FreeBSD 4.11 n n n y y y -RedHat 7.3 W (3) y(1) y(11) n y y y -RedHat 7.3 W Intel (3) n y n y y y -RedHat 7.3 W PGI (3) n y n y y y -RedStorm (16) n y n y y n -SuSe x86_64 gcc (3,13) n y(12) n y y y -SuSe x86_64 icc (3,13) n y(14) n y y y -Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y y -Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y -Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y - - -Platform Shared static- Thread- STREAM- - libraries(4) exec safe VFD -IBM BG/L n y n n -Solaris2.8 64-bit y x y y -Solaris2.8 32-bit y x y y -Solaris2.9 64-bit y x y y -Solaris2.9 32-bit y x y y -Solaris2.10 64-bit y x y y -Solaris2.10 32-bit y x y y -IRIX64_6.5 64-bit y y y y -IRIX64_6.5 32-bit y y y y -HPUX11.00 y x n y -HPUX11.23 y y n y -OSF1 v5.1 y y n y -X1 n y n y -AIX-5.1, 5.2 & 5.3 32-bit n y n y -AIX-5.1, 5.2 & 5.3 64-bit n y n y -WinXP Visual Studio 6.0 y y n n -WinXP .Net y y n n -Mac OS X 10.3 y y n y -FreeBSD 4.11 y y y y -RedHat 7.3 W (3) y y y y -RedHat 7.3 W Intel (3) n y n y -RedHat 7.3 W PGI (3) n y n y -RedStorm n y n y -SuSe x86_64 gcc (3,13) n y n y -SuSe x86_64 icc (3,13) y y(15) n y -Linux 2.4 Xeon C Lustre Intel (3,6) y y n y -Linux 2.4 SuSE ia64 C Intel (3,7) y y n n -Linux 2.4 SGI Altix ia64 Intel (3) y y n y - - -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, -compilers used are the system compilers. - -Footnotes: (1) Using mpich 1.2.6 - (2) Using mpt and mpich 1.2.6. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. - W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, - except on Windows where they are provided for C and C++. - (5) Using mpt. - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp-perfctr-lustre - and Intel compilers - (7) Linux 2.4.21, SuSE_292.til1. Ia64 cluster with Intel compilers - (8) Intel 8.1 - (9) One test of this release failed with Compaq Visual Fortran 6.6c. - No binary fortran release will be provided. Users should build - the library by themselves and use it at their own risk. - We recommend that users use HDF5 1.7 instead - or use Compaq Visual Fortran 6.0. - (10) IBM XLF and Absoft - (11) PGI, Absoft. No shared libraries with Absoft; - use '--disable-shared'. - (12) PGI and Intel compilers for both C and Fortran - (13) AMD Opteron x86_64 - (14) ifort - (15) Yes with C and Fortran, but not with C++ - (16) Only serial is ported. PFS does not work for PHDF5 yet. - FMB/EIP - 2005/11/10 - - -Known Problems -============== -* Intel Compilers for Linux x86_86 platforms (EM64T-based, v8.1) has - optimization error in the data types conversion code. Before running - configure, edit the file config/intel-flags by changing the setting of - PROD_CFLAGS from -O3 to -O0, then run configure. AKC - 2005/11/10. - -* Fortran testing and compiling failures on windows XP - 1. Compaq visual fortran 6.6c with VS 6.0 - The Fortran tests failed for both release, release dll, debug and debug - dll. The failure is a random one. We won't provide fortran libraries. The - same test passed with the 1.7.51 snapshot. You may find the 1.7.51 - snapshot under ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/snapshots/. - 2. Intel fortran 8.1 under .Net environment - The fortran library cannot even be compiled. Some users have pointed this - to intel forum. - -* When testing parallel HDF5 with the C compiler version MIPSpro 7.4.3 at IRIX - 6.5, set enviroment variable MPI_TYPE_MAX to be a bigger number, for example - 120000, in order to pass the complicated collective IO tests inside parallel - HDF5 library. This is not a problem inside parallel HDF5 library. You can - always set a bigger number in your system. - KY - 2005/10/6 - -* A contiguous or chunked dataset created by a sequential version may - not be modified with a parallel version of the library. - Use the H5Pset_alloc_time function with H5D_ALLOC_TIME_EARLY to set up the - dataset creation property list to avoid the problem. - EIP - 2005/09/09 - -* The dataset created or rewritten with the v1.6.3 library or after can't - be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is - enabled. There was a bug in the calculating code of the Fletcher32 - checksum in the library before v1.6.3. The checksum value wasn't consistent - between big-endian and little-endian systems. This bug was fixed in - Release 1.6.3. However, after fixing the bug, the checksum value is no - longer the same as before on little-endian system. The library release - after 1.6.4 can still read the dataset created or rewritten with the library - of v1.6.2 or before. SLU - 2005/7/8 - -* For version 6 (6.02 and 6.04) of the Portland Group compiler on AMD Opteron - processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests but all related to multi driver. The problem has - been reported to the vendor. - -* test/big fails sometimes with the message "Possible overlap with another - region." The test selects regions randomly, and this error occurs when - two regions overlap each other; it is a bug in the test and not in - HDF5. Since the error is triggered by a random situation, it will - usually disappear if the test is re-run. - -* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but it - has a "guard" statement in stdint.h that will #error and skip the rest - of the header file if C99 option is not used explicitly. Hardset - $CC to c99 will resolve the problem. AKC - 2004/12/13 - -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command poe. - Set the environment variable MP_INFOLEVEL to 0 to minimize the messages - and run the tests again. - The tests may fail with messages like "The socket name is already - in use". HDF5 does not use sockets (except for stream-VFD). This is - due to problems of the poe command trying to set up the debug socket. - Check if there are many old /tmp/s.pedb.* staying around. These are - sockets used by the poe command and left behind due to failed commands. - Ask your system administrator to clean them out. Lastly, request IBM - to provide a means to run poe without the debug socket. - -* Two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) - failed on windows xp with .NET for debug and debug dll. Release and - Release dll work fine. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - The --enable-static-exec configure flag also fails to correctly compile - on the HPUX 11.00. - - It is suggested that you don't use this option on these platforms - during configuration. - -* The Stream VFD was not tested yet under Windows. - - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ - -* Use --disable-shared configure flag if building with Absoft Fortran - compiler. - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8. - -* In LANL QSC, the new cc compiler has problems converting small values of - long long (absolute values less than 1**-308) to double. This triggers - the test/dtypes to report failure in the - Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. - If -ieee is not used, the converted double values are mostly 0.0 but - occasionally as 1**-308. This has been reported to the system staff. - All other tests have passed. - -* Fortran release DLL randomly failed with Compaq Visual Fortran 6.6c on - Windows. - -* Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, - Building Fortran static library with Intel 8.1 in .NET environment - requires manually setting the project file. - Please contact to hdfhelp@ncsa.uiuc.edu if you need to build - Fortran static library with Intel 8.1 with .NET environment. - -* On at least one system, SDSC DataStar, the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scripts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However, on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - - In such cases, you will have to include the regular prefix in your - filter script. - -%%%%1.6.4%%%% Release Information for hdf5-1.6.4 (15/March/05) - - -HDF5 version 1.6.4 released on Tue Mar 15 20:38:48 CST 2005 -================================================================================ - -INTRODUCTION -============ -This document describes the differences between HDF5-1.6.3 and -HDF5-1.6.4, and contains information on the platforms tested and -known problems in HDF5-1.6.4. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS -======== -- New Features -- Support for new platforms and languages -- Bug Fixes since HDF5-1.6.3 -- Documentation -- Platforms Tested -- Supported Configuration Features Summary -- Known Problems - - -New Features -============ - Source code distribution: - ------------------------- - - The High-Level (HL) C APIs were added to the source code distribution. - For HL documentation, see - http://hdf.ncsa.uiuc.edu/HDF5/hdf5_hl/doc/RM_hdf5hl.html. - - The HL library, libhdf5_hl.a(so), is built and installed by default. - Use --disable-hl configure flag to disable the HL library. - - Library: - -------- - - We recommend you to use SZIP v2.0 with this release. - For more information see - http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/ - - The compound datatype has been enhanced with a new feature of size - adjustment. The size can be increased and decreased (without - cutting the last member). No API change is involved. SLU - - 2004/10/1 - - Removed PABLO support. 2005/01/20 EIP - - Parallel Library: - ----------------- - - Allow compressed, chunked datasets to be read in parallel. - QAK - 2004/10/04 - - Tools: - ------ - - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 - - F90 API: - -------- - No new features in this release. - - C++ API: - -------- - - Started using C library's reference counting in place of the class - RefCounter, which existed before the C mechanism was available. - As a result, RefCounter has been removed. 2005/03/12 BMR - - -Support for new platforms, languages and compilers. -======================================= - - Configuration - ------------- - - Upgraded from GNU autoconf 2.53 to autoconf 2.59. JML - 2005/01/31 - - -Bug Fixes since HDF5-1.6.3 release -================================== - - Library - ------- - - Fixed a racing condition in MPIPOSIX virtual file drive close - function. Now all processes must completed the close before any - of them is returned. This prevents some "faster" processes start - accessing the file for another purpose (e.g., open with truncate) - while other "slower" processes have not closed the same file with - the previous purpose. AKC - 2005/03/01 - - H5Tget_member_value calls for enum datatype didn't return correct - value if H5Tenum_valueof was called first. It's fixed. SLU - - 2005/02/08 - - For variable-length string, H5Tget_class returned H5T_STRING as its - class. But H5Tdetect_class and H5Tget_member_class considered it - as H5T_VLEN. This is fixed to let all these 3 functions treat it - as H5T_STRING. SLU - 2005/02/08 - - The byte order of all 1-byte integer types was fixed as - little-endian even on a big-endian machine. It's corrected. - SLU - 2005/02/07 - - Fixed segmentation fault when calling H5Fflush with an attribute that - hasn't had a value written to it open. QAK - 2004/10/18 - - Backed out support for bitfield and time types in H5Tget_native_type. - Leave it to future support. The function simply returns error - message of "not support" for bitfield and time types. SLU - 2004/10/5 - - Fixed address check in Core VFL driver to avoid spurious address/size - overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - - Fixed problem where chunked datasets were not able to be deleted - from a file under certain circumstances. QAK - 2004/09/27/ - - Configuration - ------------- - - IRIX64 MIPSpro compiler of 7.4.x supports C99 features. Default - to use the 'c99' compiler if available. AKC - 2004/12/13 - - Intel v8.0 compiler would infinite loop when compiling some test - code with -O3 option. Changed enable-production default compiler - option to -O2. AKC - 2004/12/06 - - Long double is assumed to be a supported C data type. It is a - standard C89 type. AKC - 2004/10/22 - - Performance - ------------- - Many changes were made to the library to improve performance, - especially for the variable-length datatypes and metadata cache. - - Tools - ----- - - h5fc and h5c++ work correctly when -c compiler flag - is used. EIP - 2005/03/14 - - Fixed h5dump to print attributes data in ASCII if -r option is used. - AKC - 2004/11/18 - - Fixed space utilization reported in h5ls to correct error - in formula used. QAK - 2004/10/22 - - Documentation - ------------- - - F90 API - ------- - - On windows, previously Fortran DLL built and tested failed. - Now Fortran DLL has been built and tested successfully - with Dec Fortran 6.6c or Dec Fortran 6.0. - - C++ API - ------- - - -Documentation -============= - - HDF5 Library documentation - -------------------------- - No substantive changes to the structure or types of content in the - HDF5 Library documentation. - - Windows installation documentation - ---------------------------------- - 1. On Windows zlib has been updated to 1.2.2. You may find the binary at - either http://www.zlib.net/zlib122-dll.zip or - ftp://hdf.ncsa.uiuc.edu/lib-external/zlib/bin/windows - - 2. Only DLLs of external libraries (zlib and szip) are linked with the - HDF5 Library. We will no longer provide binary to link static library - with HDF5. For details, please check INSTALL_Windows in this directory. - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 - xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 - mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - AIX 5.2 (32/64 bit) xlc 6.0.0.8 - xlC 6.0.0.9 - xlf 8.1.1.7 - mpcc_r 6.0.0.8 - mpxlf_r 8.1.1.7 - AIX 5.2 (32/64 bit, LLNL frost) xlc 6.0.0.8 - xlC 6.0.0.8 - xlf 8.1.1.7 - mpcc_r 6.0.0.8 - mpxlf_r 8.1.1.7 - Cray T90 sn7001 10.0.0md Cray Standard C Version 6.4.0.3 - Cray Fortran Version 3.4.0.0 - Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.3.6 - Cray Fortran Version 3.6.0.3.1 - FreeBSD 4.9 gcc 2.95.4 - g++ 2.95.4 - gcc 3.2.3, 3.3.6, 3.4.4, 4.0.0 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - MPIch 1.2.4 - IRIX64 6.5 (tesla -64) MIPSpro cc 7.4.2m - F90 MIPSpro 7.4.2m - C++ MIPSpro cc 7.4.2m - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - C++ MIPSpro cc 7.3.1.3m - mpt 1.6 - Linux 2.4.20-28.7 gcc 2.96 - (eirene, verbena) gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) - version 5.2-1 - Absoft Fortran compiler v9.0 - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 - MPIch 1.2.6 - Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) - (mir) PGI 5.2-1 C and F90 (with k3-32) - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 - Linux 2.4.21-sgi303r2 Altix - SMP ia64 Intel(R) C++ Version 8.1 - (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 - SGI MPI - OSF1 V5.1 (QSC) Compaq C V6.5-011 - HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 - MPIX200_64_r13.4 - OSF1 V5.1 (PSC) Compaq C V6.5-303 - HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 - MPIX200_64_r13.4 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - SunOS 5.9 32,64 Sun C 5.6 2004/07/15 - (Solaris 2.9) Sun Fortran 95 8.0 2004/07/15 - Sun C++ 5.6 2004/07/15 - TFLOPS r1.0.4 v4.5.2 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - Xeon Linux 2.4.20-31.9smp_perfctr_lustre - (tungsten) Intel(R) C++ Version 8.0 - Intel(R) Fortran Compiler Version 8.0 - IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 - (NCSA tg-login) Intel(R) C++ Version 8.0 - Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..intel - Windows XP MSVC++.NET - MSVC++ 6.0 - Compaq Visual Fortran 6.6C - Intel 8.1 C++ - MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC - version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 - Absoft Fortran compiler v8.2 - - -Supported Configuration Features Summary -======================================== - -Key: y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C F90 F90 C++ zlib SZIP - parallel parallel -Solaris2.8 64-bit y y y(1) y y y -Solaris2.8 32-bit y y y(1) y y y -Solaris2.9 64-bit y(1) y y(1) y y y -Solaris2.9 32-bit y(1) y y(1) y y y -IRIX64_6.5 64-bit y(2) y y y y y -IRIX64_6.5 32-bit y(2) n n n y y -HPUX11.00 y(1) y y y y y -OSF1 v5.1 y y y y y y -T90 IEEE n y n n y n -SV1 y(5) y y(5) n y n -TFLOPS y(1) n n n y n -AIX-5.1 & 5.2 32-bit y y y y y y -AIX-5.1 & 5.2 64-bit y y y y y y -WinXP Visual Studio 6.0 n y(9) n y y y -WinXP .Net n n n y(8) y y -Mac OS X 10.3 n y(10) n y y y -FreeBSD 4.9 y(1) n n y y y -RedHat 7.3 W (3) y(1) y(11) n y y y -RedHat 7.3 W Intel (3) n y n y y y -RedHat 7.3 W PGI (3) n y n y y y -SuSe x86_64 gcc (3,13) n y(12) n y y y -SuSe x86_64 icc (3,13) n y(14) n y y y -Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y y -Linux 2.4 SuSE ia64 C Intel (3,7) y y y y y y -Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y - - -Platform Shared static- Thread- STREAM- - libraries(4) exec safe VFD -Solaris2.8 64-bit y x y y -Solaris2.8 32-bit y x y y -Solaris2.9 64-bit y x y y -Solaris2.9 32-bit y x y y -IRIX64_6.5 64-bit y y y y -IRIX64_6.5 32-bit y y y y -HPUX11.00 y x n y -OSF1 v5.1 y y n y -T90 IEEE n y n y -SV1 n y n y -TFLOPS n y n n -AIX-5.1 & 5.2 32-bit n y n y -AIX-5.1 & 5.2 64-bit n y n y -WinXP Visual Studio 6.0 y y n n -WinXP .Net y y n n -Mac OS X 10.3 y y n y -FreeBSD 4.9 y y y y -RedHat 7.3 W (3) y y y y -RedHat 7.3 W Intel (3) n y n y -RedHat 7.3 W PGI (3) n y n y -SuSe x86_64 gcc (3,13) n y n y -SuSe x86_64 icc (3,13) y y(15) n y -Linux 2.4 Xeon C Lustre Intel (3,6) y y n y -Linux 2.4 SuSE ia64 C Intel (3,7) y y n n -Linux 2.4 SGI Altix ia64 Intel (3) y y n y - - -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, -compilers used are the system compilers. - -Footnotes: (1) Using mpich 1.2.6 - (2) Using mpt and mpich 1.2.6. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. - W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, - except on Windows where they are provided for C and C++. - (5) Using mpt. - (6) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre - and Intel compilers - (7) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers - (8) Intel 8.1 - (9) Compaq Visual Fortran 6.6C - (10) IBM XLF and Absoft - (11) PGI, Absoft. No shared libraries with Absoft; - use '--disable-shared'. - (12) PGI and Intel compilers for both C and Fortran - (13) AMD Opteron x86_64 - (14) ifort - (15) Yes with C and Fortran, but not with C++ - FMB/EIP - 2005/03/15 - - -Known Problems -============== -* test/big fails sometimes with the message "Possible overlap with another - region." The test selects regions randomly, and this error occurs when - two regions overlap each other; it is an bug in the test and not in - HDF5. Since the error is triggered by a random situation, it will - usually disappear if the test is re-run. - -* Cray SV1 fails to correctly convert between floating-point and "long double" - for software conversion. Problem is being investigated. SLU - 2005/03/04 - -* Newer SGI MIPSpro compilers (version 7.4.x) support C99 features but it - has a "guard" statement in stdint.h that will #error and skip the rest - of the header file if C99 option is not used explicitly. Hardset - $CC to c99 will resolve the problem. AKC - 2004/12/13 - -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command poe. - Set the environment variable MP_INFOLEVEL to 0 to minimize the messages - and run the tests again. - The tests may fail with messages like "The socket name is already - in use". HDF5 does not use sockets (except for stream-VFD). This is - due to problems of the poe command trying to set up the debug socket. - Check if there are many old /tmp/s.pedb.* staying around. These are - sockets used by the poe command and left behind due to failed commands. - Ask your system administrator to clean them out. Lastly, request IBM - to provide a mean to run poe without the debug socket. - -* Fortran subroutine h5pget_driver_f doesn't return a correct driver - information. - -* There are two h5dump xml tests(h5dump --xml thlink.h5 and - h5dump --xml tmany.h5) failed on windows xp with .NET for debug and - debug dll. Release and Release dll work fine. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - It is suggested that you don't use this option on these platforms - during configuration. - -* The Stream VFD was not tested yet under Windows. It is not supported - in the TFLOPS machine. - -* The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - -* Certain platforms give false negatives when testing h5ls: - - Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed. - h5ls appears to be dumping floating-point numbers correctly. - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ - -* On some platforms that use Intel and Absoft compilers to build HDF5 fortran - library, compilation may fail for fortranlib_test.f90, fflush1.f90 and - fflush2.f90 complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* Use --disable-shared configure flag if building with Absoft Fortran - compiler - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* In LANL QSC, the new cc compiler has problems converting small values of - long long (absolute values less than 1**-308) to double. This triggers - the test/dtypes to report failure in the - Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. - If -ieee is not used, the converted double values are mostly 0.0 but - occasionally as 1**-308. This has been reported to the system staff. - All other tests have passed. - -* The C++ library's tests fails when compiling with PGI C++ compiler. The - workaround until the problem is correctly handled is to use the - flag "--instantiate=local" prior to the configure and build steps, as: - setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher - setenv CXX "pgCC -tlocal" for others - -* Fortran release DLL randomly failed with compaq visual fortran 6.6c on - windows. - -* Fortran DLL built with Intel 8.1 in .NET environment crushed the compiler, - To build Fortran Static library with Intel 8.1 in .NET environment - needs manually setting the project file, - please contact to hdfhelp@ncsa.uiuc.edu if you need to build - fortran static library with Intel 8.1 with .NET environment. - -* On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scripts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - can prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - - In such cases, you will have to include the regular prefix in your - filter script. - - -%%%%1.6.3%%%% Release Information for hdf5-1.6.3 (22/September/04) - -HDF5 version 1.6.3 released on Wed Sep 22 11:30:11 CDT 2004 -================================================================================ - - -INTRODUCTION - -This document describes the differences between HDF5-1.6.2 and -HDF5-1.6.3, and contains information on the platforms tested and -known problems in HDF5-1.6.3. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - -CONTENTS - -- New Features -- Support for new platforms and languages -- Bug Fixes since HDF5-1.6.2 -- Documentation -- Platforms Tested -- Supported Configuration Features Summary -- Known Problems - - -New Features -============ - - Configuration: - -------------- - - Added some initial support for making purify (or similar memory - checking products) happier by initializing buffers to zero and - disabling the internal free list code. To take advantage of this, - define 'H5_USING_PURIFY' in your CFLAGS when building the library. - QAK - 2004/07/23 - - - WINDOWS building,testing and installing improvements - - - On Windows, FORTRAN,C++ and C projects are merged into one zip file, - users can choose an option to build either FORTRAN or C++ or both - with basic C library.For detailed information, - please read INSTALL_Windows.txt. - - - On Windows, szip compression library with or without encoder can be easily - turned off or on when building HDF5. For detailed information, - please read INSTALL_Windows.txt, especially section V. - - - On Windows, an optional procedure for building,testing and installing - HDF5 from command line is provided. This procedure is supposed to be - convenient for experienced users, please read - INSTALL_windows_From_Command_Line.txt for details. - - - On Windows, an alternative short instruction document for building, - testing and installing HDF5 is provided. This instruction is supposed to - be convenient for general users, please read - INSTALL_Windows_Short.txt for details. - - - On Windows, h5repack,h5diff,h5ls and h5import tool tests have been added. - KY - 2004/9/16 - - - Library: - -------- - - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for - SZIP compression. Now there is no restriction on the size and shape of the - chunk except that the total number of elements in the chunk cannot be - bigger than 'pixels_per_block' parameter provided by the user. - EIP - 2004/07/21 - - HDF5 can now link to SZIP with or without szip's encoder. - The new API function H5Zget_filter_info can be used to check - szip's status. Attempting to assign szip to a dataset property - list or attempting to write with szip will generate an error if - szip's encoder is disabled. JL/NF - 2004/6/30 - - SZIP always uses K13 compression. This flag no longer needs to - be set when calling H5Pset_szip. If the flag for CHIP - compression is set, it will be ignored (since the two are mutually - exclusive). JL/NF - 2004/6/30 - - A new API function H5Fget_name was added. It returns the name - of the file by object(file, group, data set, named data type, - attribute) ID. SLU - 2004/06/29 - - A new API function H5Fget_filesize was added. It returns the - actual file size of the opened file. SLU - 2004/06/24 - - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, - will suppress all library version mismatch warning messages. - AKC - 2004/4/14 - - Parallel Library: - ----------------- - - Tools: - ------ - - h5repack was added to the tools suite. h5repack regenerates an HDF5 file - from another HDF5 file, optionally applying HDF5 filters (compression) - and/or chunking to the copied file. The filters options are read from - the command line. See /doc/html/Tools.html for more details. - PVN - 2004/9/13 - - - h5dump includes new features: - 1) Printing of dataset filters, storage layout and fill value information. - 2) Print a list of the file contents. - 3) Escape non printing characters. - 4) Print the content of the boot block. - 5) Print array indices with the data (the default). - These options are all switch controlled. See /doc/html/Tools.html for more details. - PVN - 2004/9/13 - - - F90 API: - -------- - - added new subroutines: - h5fget_filesize_f - h5iget_file_id_f - h5premove_filter_f - h5zget_filter_info_f - EIP 2004/9/21 - - - added new h5fget_name_f and h5fget_filesize_f subroutines - EIP 2004/07/08 - - C++ API: - -------- - - Added wrappers for array and variable length datatypes APIs - - Added wrappers for newly added APIs from H5T, H5F, and H5I - - Added many wrappers that were missing from the H5P API - - Added the ability to reference HDF5 objects to these classes: - DataSet, DataType, Group, and H5File (wrappers for H5R APIs) - BMR 2004/08/04 - - -Support for new platforms, languages and compilers. -======================================= - - Added PGI Fortran support for Linux64 (x86_64) systems - EIP - 2004/08/19 - - Absoft compiler f95 v9.0 is supported on Linux 2.4 32bit - EIP - 2004/07/29 - - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran - compiler version 8.1. This is a default compiler. - - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler - version 8.2; set F9X environment variable to f95, for example - setenv F9X f95 - Use --disable-shared --enable-static configure flags when Absoft - compiler is used. - EIP - 2004/07/27 - -Bug Fixes since HDF5-1.6.2 release -================================== - - Library - ------- - - Fixed parallel bug in which some processes attempted collective - I/O while others did independent I/O. Bug appeared when some - processes used point selections, and others didn't. JRM - 2004/9/15 - - Corrected error where dataset region references were written in an - incorrect way on Cray machines. PVN & QAK - 2004/09/13 - - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting - an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - - Changed H5Dread() to not overwrite data in an application's buffer - with garbage when accessing a chunked dataset with an undefined fill - value and an unwritten chunk is uncountered. QAK - 2004/08/25 - - Fixed error which could cause a core dump when a type conversion - routine was registered after a compound datatype had been - converted and then an equivalent compound datatype was converted - again. QAK - 2004/08/07 - - Fixed memory overwrite when encoding "multi" file driver information - for file's superblock. QAK - 2004/08/05 - - Fixed obscure bug where a filter which failed during chunk allocation - could allow library to write uncompressed data to disk but think - the data was compressed. QAK - 2004/07/29 - - Fixed bug where I/O to an extendible chunked dataset with zero-sized - dimensions would cause library to fail an assertion. - QAK - 2004/07/27 - - Fixed bug where chunked datasets which have filters defined, - allocation time set to "late" and whose chunks don't align with - the dataspace bounds could have incorrect data stored when - overwriting the entire dataset on the first write. QAK - 2004/07/27 - - Added check to ensure that dataspaces have extents set. JML-2004/07/26 - - Fixed bug on some Solaris systems where HDF5 would try to use - gettimeofday() when that function didn't work properly. - JML - 2004/07/23 - - Fixed bug in H5Sset_extent_simple where setting maximum size to - non-zero, then to zero would cause an error. JML - 2004/07/20 - - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite - when not writing data ("none" selection or hyperslab or point - selection with no elements defined). QAK - 2004/07/20 - - Calling H5Gcreate() on "/" or "." throws an error instead of - failing quietly. JML - 2004/07/19 - - Fixed bug where setting file address size to be very small could - trigger an assert if the file grew to more than 64 KB. Now throws - an error and data can be recovered. JL/NF - 2004/07/14 - - Fixed bug where "resurrecting" a dataset was failing. - QAK - 2004/07/14 - - Fixed bug where incorrect data could be read from a chunked dataset - after it was extended. QAK - 2004/07/12 - - After compound datatype with variable-length string in the fields - is committed to file, the size is messed up when it's read back. - Fixed. SLU - 2004/06/11 - - Fixed potential file corruption bug when a block of metadata could - overlap the end of the internal metadata accumulator buffer and - the buffer would be extended correctly, but would incorrectly - change it's starting address. QAK - 2004/06/09 - - Opaque datatype with no tag failed for some operations. Fixed. - SLU - 2004/6/3 - - Fixed potential file corruption bug where dimensions that were - too large (a value greater than could be represented in 32-bits) - could cause the incorrect amount of space to be allocated in a - file for the raw data for the dataset. QAK - 2004/06/01 - - Fixed dtypes "sw long double -> double" failure in QSC class - machines. AKC - 2004/4/16 - - Configuration - ------------- - - Fixed the long compile time of H5detect.c when v7.x Intel Compiler - is used with optimization NOT off. AKC - 2004/05/20 - - Performance - ------------- - - Tools - ----- - - On SGI h5dump displayed only part of the data due to the bug - in the system printf; fixed. - EIP - 2004/09/21 - Documentation - ------------- - - Several descriptive errors have been fixed throughout the - documentation, particularly in the reference manual (RM). - A selection particularly worthy of note would be these: - - The H5Pset_szip description in the RM has been expanded and - corrected to facilitate use of SZIP compression. - - A note has been added to the H5Dcreate description that an - unexplained failure is likely to be due to a property list error - that is detected only at the time of dataset creation. - - - FMB - 2004/09/21 - - F90 API - ------- - - Fortran functions h5dwrite/read_f and h5awrite/read_f do not - accept dims parameter of INTEGER type anymore. Code was removed. - 2004/04/15 - C++ API - ------- - - H5::Exception's and its subclasses' constructors that were - overloaded to take char pointers are removed and constructors - that passed in reference of 'string' are changed to pass - by value. In addition, the default value of the data member - H5::Exception::detailMessage is changed from 0/NULL to - DEFAULT_MSG ("No detailed information provided".) - - Prototype for DSetCreatPropList::setLayout is changed: 1st parameter - is removed because it was there only by mistake. - BMR 2004/08/04 - -Documentation -============= - HDF5 Library documentation - -------------------------- - - HDF5 C++ API Reference Manual - This document has been added to the HDF5 document set. - The predecessor document, "HDF5 C++ Interfaces," has been removed. - - HDF5 C++ API Design Specification - A first draft of this document has been added to the HDF5 document - set. The draft has been posted on the HDF5 website and a link - has been added to the HDF5 documents index (index.html at the top - level of the document set). - - Parallel HDF5 - In prior releases, the HDF5 document set included two parallel - HDF5 documents. Those documents have been deleted and the - HDF5 documents index (index.html) now links to a "Parallel HDF5" - page on the HDF5 website (http://hdf.ncsa.uiuc.edu/HDF5/PHDF5/). - - HDF5 High Level APIs - Links to the HDF5 High Level APIs and to the HDF5 High Level - Reference Manual have been added to the HDF5 documents index - (index.html). - - HDF5 Reference Manual - Tools: h5repack -- A description of the new h5repack tool has been - added to the Tools page. - Tools: h5dump -- Several new options have been added to h5dump. - New functions -- All new functions have been added to the RM. - API changes -- Relevant function descriptions have been updated in - instances where programming interfaces have changed. - FMB - 2004/09/21 - - Windows installation documentation - ---------------------------------- - - INSTALL_Windows.txt has been enhanced to include instructions building - HDF5 with FORTRAN and C++. - - Two optional installation documents have been added. They are - INSTALL_Windows_Short.txt and INSTALL_Windows_From_Command_Line.txt. - INSTALL_Windows_Short.txt is supposed to help general users who - only want to build,test and install HDF5 in a quick way. - INSTALL_Windows_From_Command_Line.txt is supposed to help users who - would like to compile,test and install HDF5 in command line environment. - - INSTALL_Windows_withcpp.txt and INSTALL_Windows_withF90.txt became - obsolete. Files are deleted from the release_docs directory. - KY 2004/09/16, EIP 2004/9/21 - - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 - xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 - mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - AIX 5.2 xlc 6.0.0.8 - xlC 6.0.0.8 - xlf 8.1.1.6 - mpcc_r 6.0.0.8 - mpxlf_r 8.1.1.6 - Cray T90 sn7001 10.0.0md Cray Standard C Version 6.4.0.3 - Cray Fortran Version 3.4.0.0 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.3 - Cray Fortran Version 3.6.0.3 - Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.3.6 - Cray Fortran Version 3.6.0.3.1 - FreeBSD 4.9 gcc 2.95.4 - g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - MPIch 1.2.4 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - C++ MIPSpro cc 7.3.1.3m - mpt 1.6 - Linux 2.4.18 gcc 2.96, 3.3.2 - g++ 3.3.2 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 - MPIch 1.2.4 - Absoft Fortran compiler v9.0 - Linux 2.4.20-8 gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 - MPIch 1.2.4 - Linux 2.4.21-2.9.5ws #3 gcc 3.2.3 (Red Hat Linux 3.2.3-16) - SMP x86_64 g++ 3.2.3 - Linux 2.4.21-4.ELsmp Intel(R) C++ 32-bit Version 8.0 - Intel(R) Fortran 32-bit Version 8.0 - gcc 3.4.0 - MPICH 1..5.2 Inmel 8.0 - Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) - g++ 3.2.2 - Linux 2.6.4-52smp x86_64 gcc 3.3.3 (SuSE Linux 9.1 AMD64)) - PGI 5.2-1 C and F90 - - Linux 2.4.21-sgi Altix - SMP ia64 Intel(R) C++ Version 8.0 - Intel(R) Fortran Itanium(R) Version 8.0 - SGI MPI - OSF1 V5.1 Compaq C V6.5-303 - HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 - MPI_64bit_R13 - SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - TFLOPS r1.0.4 v4.4.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - IA-32 Linux 2.4.18 gcc 2.96 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - - Xeon Linux 2.4.20-31.9smp_perfctr_lustre - Intel(R) C++ Version 8.0 - Intel(R) Fortran Compiler Version 8.0 - - IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - - IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 - Intel(R) C++ Version 8.0 - Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..intel - - Windows 2000 (NT5.0) MSVC++ 6.0 - MSVC++ .NET - DEC Visual Fortran 6.0 - Intel C and F90 compilers version 7.1 - Code Warrior 8.0 - Windows XP MSVC++.NET - MSVC++ 6.0 - DEC Visual Fortran 6.0 - - MAC OS X Darwin 7.5 - gcc and g++ Apple Computer, Inc. GCC - version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 - Absoft Fortran compiler v8.2 - - - -Supported Configuration Features Summary -======================================== - -Key: y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C F90 F90 C++ zlib SZIP - parallel parallel -Solaris2.7 64-bit y (1) y y (1) y y y -Solaris2.7 32-bit y (1) y y (1) y y y -Solaris2.8 64-bit y (1) y y (1) y y y -Solaris2.8 32-bit y y y (1) y y y -IRIX64_6.5 64-bit y (2) y y y y y -IRIX64_6.5 32-bit y (2) n n n y y -HPUX11.00 y (1) y y y y y -OSF1 v5.1 y y y y y y -T90 IEEE n y n n y n -T3E y (5) y y (5) n y n -SV1 y (5) y y (5) n y n -TFLOPS y (1) n n n y n -AIX-5.1 & 5.2 32-bit y y y y y y -AIX-5.1 & 5.2 64-bit y y y y y y -WinXP Visual Studio 6.0 n y (9) n y y y -WinXP .Net n n n y y y -WinXP Code Warrior n n n n y y -Win2000 Visual Studio 6.0 n y (10) n y y y -Win2000 Visual Studio Intel (6) n y n y y y -Win2000 .Net n n n y y y -Mac OS X 10.3 n y (11) n y y y -FreeBSD 4.9 y (1) n n y y y -RedHat 7 W (3) y (1) y (12) n y y y -RedHat 7.3 W Intel (3) n y n y y y -RedHat 7.3 W PGI (3) n y n y y y -RedHat 8 & SuSe x86_64 gcc (3) n y (13) n y y y -Linux 2.4 Xeon C Lustre Intel (3,7) n y n y y y -Linux 2.4 SuSE ia64 C Intel (3,8) y y y y y y -Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y - - -Platform Shared static- Thread- STREAM- - libraries (4) exec safe VFD -Solaris2.7 64-bit y x y y -Solaris2.7 32-bit y x y y -Solaris2.8 64-bit y x y y -Solaris2.8 32-bit y x y y -IRIX64_6.5 64-bit y y y y -IRIX64_6.5 32-bit y y y y -HPUX11.00 y x n y -OSF1 v5.1 y y n y -T90 IEEE n y n y -T3E n y n y -SV1 n y n y -TFLOPS n y n n -AIX-5.1 & 5.2 32-bit n y n y -AIX-5.1 & 5.2 64-bit n y n y -WinXP Visual Studio 6.0 y y n n -WinXP .Net y y n n -WinXP Code Warrior n y n n -Win2000 Visual Studio 6.0 y y n n -Win2000 Visual Studio Intel (6) y y n n -Win2000 .Net y y n n -Mac OS X 10.3 y y n y -FreeBSD 4.9 y y y y -RedHat 7 W (3) y y y y -RedHat 7.3 W Intel (3) n y n y -RedHat 7.3 W PGI (3) n y n y -RedHat 8 & SuSe x86_64 gcc (3) n y n y -Linux 2.4 Xeon C Lustre Intel (3,7) y y n y -Linux 2.4 SuSE ia64 C Intel (3,8) y y n n -Linux 2.4 SGI Altix ia64 Intel (3) y y n y - - - -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, -compilers used are the system compilers. - -Footnotes: (1) Using mpich 1.2.4 - (2) Using mpt and mpich 1.2.4 - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated - W or C indicates workstation or cluster, respectively - (4) Shared libraries are provided only for the C library, - except on Windows where they are provided for C and C++ - (5) Using mpt - (6) Intel 7.1 compilers in Visual Studio 6.0 environment - (7) Linux 2.4.20-31.9. Xeon cluster with smp_perfctr_lustre - and Intel compilers - (8) Linux 2.4.21, SuSE_128.befl. Ia64 cluster with Intel compilers - (9) DEC Visual Fortran 6.0 and Intel 7.1 - (10) DEC Visual Fortran 6.0 - (11) IBM XLF and Absoft - (12) PGI, Absoft - (13) PGI - FMB/EIP - 2004/09/21 - - - -Known Problems -============== -* h5fc and h5c++ compilation scripts have a bug: object files (*.o) cannot be - created when source code is compiled using h5fc or h5c++. We will provide - a fix. Please check ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ - for the patches. - -* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. - -* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) - failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - It is suggested that you don't use this option on these platforms - during configuration. - -* The Stream VFD was not tested yet under Windows. It is not supported - in the TFLOPS machine. - -* The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/src/patches/ - -* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 of - the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. However, if - you still experience a problem, you may want to check this line in the - libtool file and make sure that it has the correct value. - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* In LANL QSC, the new cc compiler has problems converting small values of - long long (absolute values less than 1**-308) to double. This triggers - the test/dtypes to report failure in the - Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. - If -ieee is not used, the converted double values are mostly 0.0 but - occasionally as 1**-308. This has been reported to the system staff. - All other tests have passed. - -* On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scripts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - can prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - - In such cases, you will have to include the regular prefix in your - filter script. - -%%%%1.6.2%%%% Release Information for hdf5-1.6.2 (12/February/04) - -HDF5 version 1.6.2 released on Thu Feb 12 14:18:13 CST 2004 -================================================================================ - - -INTRODUCTION - -This document describes the differences between HDF5-1.6.1 and -HDF5-1.6.2, and contains information on the platforms tested and -known problems in HDF5-1.6.2. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - -CONTENTS - -- New Features -- Support for new platforms and languages -- Bug Fixes since HDF5-1.6.1 -- Documentation -- Platforms Tested -- Supported Configuration Features Summary -- Known Problems - - -New Features -============ - - Configuration: - -------------- - - Default of $prefix is changed to $PWD/hdf5 so that multiple - builds using --srcdir is possible in the same machine. - AKC - 2003/12/1 - - Library: - -------- - - Added H5Iget_ref, H5Iinc_ref and H5Idec_ref routines to the C - library and the FORTRAN wrapper. See the reference manual for a - full description of these new routines. QAK - 2003/12/11 - - Parallel Library: - ----------------- - - The parallel tests in testpar/ now provides different levels of - verbosity via the '-v' option. The default is less verbose - than before. AKC - 2004/01/23 - - Added parallel test, test_mpio_1wMr, which tests if the - underlaying parallel I/O system is conforming to the POSIX - write/read requirement. This version includes options of using - atomicity and file-sync. AKC - 2003/11/27 - - Tools: - ------ - - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). - AKC - 2004/01/08 - - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" - respectively if library is built in parallel mode. AKC - 2004/01/07 - - Added metadata benchmark (perform/perf_meta). SLU - 2003/10/03 - - C++ API: - -------- - - -Support for new platforms, languages and compilers. -======================================= - - HDF5 Fortran APIs are supported on MAC OSX with IBM XL Fortran compiler - version 8.1 Beta - Use --disbale-shared --enable-static flags with configure when - building HDF5 Fortran Library on MAC OSX. - - C and C++ Libraries are available for Linux64 RH8 - - C, C++ and Fortran sequential Libraries, and C and Fortran parallel - Libraries are available for Altix (Linux ia64) - -Bug Fixes since HDF5-1.6.1 release -================================== - - Library - ------- - - Fixed problem with H5Tget_native_type() not handling opaque fields - correctly. QAK - 2004/01/31 - - Fixed several errors in B-tree deletion code which could cause a - B-tree (used with groups and chunked datasets) to become corrupt - with the right sequence of deleted objects. QAK - 2004/01/19 - - Fixed small internal memory leaks of fill-value information. - QAK - 2004/01/13 - - Fixed bug that caused variable-length datatypes (strings or sequences) - used for datasets in files with objects that were unlinked to - fail to be read/written to a file. QAK - 2004/01/13 - - Detect situation where szip 'pixels per block' is larger than the - fastest changing dimension of a dataset's chunk size and disallow - this (due to limits in szip library). QAK - 2003/12/31 - - Fixed bug with flattened hyperslab selections that would generate - incorrect hyperslab information with certain high-dimensionality - combinations of start/stride/count/block information. - QAK - 2003/12/31 - - Fixed bug with variable-length datatypes used in compound datatypes. - SLU - 2003/12/29 - - Fixed bug in parallel I/O routines that would cause reads from - "short datasets" (datasets which were only partially written out) - to return invalid data. QAK & AKC - 2003/12/19 - - Fixed bug where scalar dataspaces for attributes were reporting as - simple dataspaces. QAK - 2003/12/13 - - Fixed problem with selection offsets of hyperslab selections in - chunked datasets causing the library to go into an infinite loop. - QAK - 2003/12/13 - - Fixed H5Giterate to avoid re-using index parameter after iteration - callback has been called (allows iteration callback to modify the - index parameter itself). QAK - 2003/12/06 - - Fixed various floating-point conversion problems, including a - change which could corrupt data when converting from double->float. - QAK - 2003/11/24 - - Changed "single process" metadata writing in library to collective - I/O by all processes, in order to guarantee correct data being - written with MPI-I/O. QAK - 2003/11/20 - - Fixed problems with fill values and variable-length types and also - I/O on VL values that were set to NULL. QAK - 2003/11/08 - - Fixed problems with MPI datatypes that caused ASCI Q machine to - hang. QAK - 2003/10/28 - - Removed HDF5_MPI_PREFER_DERIVED_TYPES environment variable support, - since it had no benefit. QAK - 2003/10/28 - - Single hyperslab selections (which were set with only one call to - H5Sselect_hyperslab) that had dimensions that could be "flattened" - but were interspersed with dimensions that could not be flattened - were not correctly handled, causing core dumps. QAK - 2003/10/25 - - Avoid metadata cache from preempting current dataset object header - when looking up information about the named datatype that the - dataset uses. QAK - 2003/10/20 - - Configuration - ------------- - - Parallel I/O with the MPI-I/O driver will no longer work if the - filesystem is not POSIX compliant. The "HDF5_MPI_1_METAWRITE" - environment variable has been removed. QAK - 2004/01/30 - - Performance - ------------- - - More optimizations to inner loops of datatype conversions for - integers and floats which give a 10-50% speedup. QAK - 2003/11/07 - - Hoisted invariant 'if/else's out of inner datatype conversion loop for - integer and floating-point values, giving about a 20% speedup. - QAK - 2003/10/20 - - Tools - ----- - - Fixed h5redeploy which sometimes complain too many argument for the - test command. (The complain did not hinder the h5redploy to proceed - correctly.) AKC - 2003/11/03 - - Documentation - ------------- - - -Documentation -============= - - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 - xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - poe 3.2.0.10 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 - Cray Fortran Version 3.6.0.2 - Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 - Cray Fortran Version 3.6.0.2 - Cray T90IEEE 10.0.0md Cray Standard C Version 6.4.0.3 - Cray Fortran Version 3.4.0.0 - FreeBSD 4.9 gcc 2.95.4 - g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - MPIch 1.2.4 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - C++ MIPSpro cc 7.3.1.3m - Linux 2.4.18 gcc 2.96, 3.3.2 - g++ 3.3.2 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 - MPIch 1.2.4 - Linux 2.4.20-8 gcc 3.3.2 - PGI compilers (pgcc, pgf90, pgCC) version 5.0-2 - MPIch 1.2.4 - Linux 2.4.21-2.9.5ws #3 gcc 3.2.3 (Red Hat Linux 3.2.3-16) - SMP x86_64 g++ 3.2.3 - Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) - g++ 3.2.2 - - Linux 2.4.21-sgi Altix - SMP ia64 Intel(R) C++ Version 7.1 - Intel(R) Fortran Itanium(R) Version 7.1 - SGI MPI - OSF1 V5.1 Compaq C V6.4-014 - Compaq Fortran V5.5-2602 - Compaq Fortran V5.5-1877 - Compaq C++ V6.5-033 - Compaq C++ V6.5-030 - MPI_64bit_R13 - SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - TFLOPS r1.0.4 v4.4.2 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - IA-32 Linux 2.4.18 gcc 2.96 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - - IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - - IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - mpich-gm-1.2.5..intel - - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Intel C and F90 compilers version 7.1 - Code Warrior 8.0 - Windows XP MSVC++.NET - MAC OS X Darwin 7.2 - gcc and g++ Apple Computer, Inc. GCC - version 1175, based on gcc version 3.3.2 - IBM XL Fortran version 8.1 Beta - - - -Supported Configuration Features Summary -======================================== - -Key: y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C C F90 F90 C++ Shared zlib - parallel parallel libraries (4) -Solaris2.7 64-bit y y (1) y y (1) y y y -Solaris2.7 32-bit y y (1) y y (1) y y y -Solaris2.8 64-bit y y (1) y y (1) y y y -Solaris2.8 32-bit y y y y (1) y y y -IRIX64_6.5 64-bit y y (2) y y y y y -IRIX64_6.5 32-bit y y (2) n n n y y -HPUX11.00 y y (1) y y y y y -OSF1 v5.1 y y y y y y y -T3E y y (5) y y (5) n n y -SV1 y y (5) y y (5) n n y -T90 IEEE y y (5) y y (5) n n y -TFLOPS n y (1) n n n n y -AIX-5.1 32-bit y y y y y n y -AIX-5.1 64-bit y y y y y n y -WinXP Visual Studio (7) y n n n y y y -WinXP Intel y n n n y y y -WinXP CW y n n n n n y -Win2000 Visual Studio y n y n y y y -Win2000 Intel y n y n y y y -Mac OS X 10.3 y n y n y y y -FreeBSD 4.9 y y (1) n n y y y -RedHat 7, 8 & 9 ia32 y y (1) y(PGI) n y y y - W gcc (3) -RedHat 7.3 ia32 W Intel (3) y n y n y n y -RedHat 7.3 ia32 W PGI (3) y n y n y n y -RedHat 7 ia32 C Intel (3) y n y n y n y -RedHat 7.1 ia64 C Intel (3) y n y n y n y -RedHat 8 & SuSe x86_64 y n n n y n y - gcc (3) -Linux 2.4 SGI Altix ia64 y n y n y y y - Intel (3) - - -Platform static- Thread- SZIP GASS STREAM- High- H4/H5 - exec safe VFD level tools - APIs (6) -Solaris2.7 64-bit x y y n y y n -Solaris2.7 32-bit x y y n y y y -Solaris2.8 64-bit x y y n y y n -Solaris2.8 32-bit x y y n y y y -IRIX64_6.5 64-bit x y y y y y y -IRIX64_6.5 32-bit x y y y y y y -HPUX11.00 x n y n y y y -OSF1 v5.1 y n y n y y y -T3E y n n n y y y -SV1 y n n n y y y -T90 IEEE y n n n y y n -TFLOPS y n n n n n n -AIX-5.1 32-bit y n y n y y y -AIX-5.1 64-bit y n y n y y y -WinXP Visual Studio y n y n n y y -WinXP Intel y n y n n y y -WinXP CW y n y n n y y -Win2000 Visual Studio y n y n n y y -Win2000 Intel y n y n n y y -Mac OS X 10.3 y n y n y y n -FreeBSD 4.9 y y y n y y y -RedHat 7, 8 & 9 ia32 y y y n y y y - W gcc (3) -RedHat 7.3 ia32 W Intel (3) y n y n y n n -RedHat 7.3 ia32 W PGI (3) y n y n y n n -RedHat 7 ia32 C Intel (3) y n y n y y y -RedHat 7.1 ia64 C Intel (3) y n y n y y y -RedHat 8 & SuSe x86_64 y n y n y y y - gcc (3) -Linux 2.4 SGI Altix ia64 y n y n y y y - Intel (3) - - -Compiler versions for each platform are listed in the "Platforms Tested" -table found elsewhere in this file (RELEASE.txt). Unless otherwise noted, -compilers used are the system compilers. - -Footnotes: (1) Using mpich 1.2.4. - (2) Using mpt and mpich 1.2.4. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, as indicated. - W or C indicates workstation or cluster, respectively. - (4) Shared libraries are provided only for the C library, - except on Windows where they are provided for C and C++. - (5) Using mpt. - (6) Includes the H4toH5 Library and the h4toh5 and h5toh4 - utilities. - - -Known Problems -============== -* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. - -* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) - failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - It is suggested that you don't use this option on these platforms - during configuration. - -* The Stream VFD was not tested yet under Windows. It is not supported - in the TFLOPS machine. - - -* The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.2/F90_source_for_Crays - -* On some platforms that use Intel compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 of - the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. However, if - you still experience a problem, you may want to check this line in the - libtool file and make sure that it has the correct value. - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* In LANL QSC, the new cc compiler has problems converting small values of - long long (absolute values less than 1**-308) to double. This triggers - the test/dtypes to report failure in the - Testing random sw long double -> double conversions - If -ieee is used, the converted doubles spread over the range 0.0 to 1**-308. - If -ieee is not used, the converted double values are mostly 0.0 but - occassionaly as 1**-308. This has been reported to the system staff. - All other tests have passed. - -* On AIX 5.1 when 64-bit parallel C Library is built with zlib configured in, - compilation fails for H5Zdeflate.c. To bypass the problem, remove "const" - definition in front of H5Z_DEFLATE in H5Zpkg.h line 29. - -%%%%1.6.1%%%% Release Information for hdf5-1.6.1 (16/October/03) - -15. Release information for HDF5 version 1.6.1 -================================================ - -INTRODUCTION - -This document describes the differences between HDF5-1.6.0 and -HDF5-1.6.1, and contains information on the platforms tested and -known problems in HDF5-1.6.1. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - -CONTENTS - -- New Features -- Support for new platforms and languages -- Bug Fixes since HDF5-1.6.0 -- Documentation -- Platforms Tested -- Known Problems - - -New Features -============ - - Configuration: - -------------- - - Library: - -------- - - Added new fields to the H5G_stat_t for more information about an - object's object header. QAK 2003/10/06 - - Added new H5Fget_freespace() routine to query the free space in a - given file. QAK 2003/10/06 - - Parallel Library: - ----------------- - - Tools: - ------ - - C++ API: - -------- - - Added overloaded functions read and write to H5::Attribute. - BMR - 2003/04/21 - - Added an overloaded constructor H5::StrType so the need to separately - set the length of the string type can be eliminated. BMR - 2003/04/21 - - Added overloaded functions read and write to H5::DataSet. - BMR - 2003/04/27 - - The following items were added but not documented in previous releases: - - - On windows, any application, that uses the C++ API dll, must - include the name HDF5CPP_USEDLL in its project setting. (Feb 17, 2002) - BMR - 2003/10/10 - - Added missing default constructor H5::H5File. (Apr 26, 2002) - BMR - 2003/10/10 - - Added new member function H5::DataSet::fillMemBuf per the new C - API H5Dfill, which fills the elements in a selection for a memory - buffer with a fill value. (May 16, 2002) BMR - 2003/10/10 - - Added the new member function getMemberIndex to H5::EnumType - and H5::CompType to match the new C API H5Tget_member_index. Given - the name of a member of an enumeration or compound datatype, this - new function queries the index of the member. (May 16, 2002) - BMR - 2003/10/10 - - Added these member functions to H5::Group per the new C functions - H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx: - + getNumObjs: Returns the number of objects in the group. - + getObjnameByIdx: Retrieves the name of an object in a group, - given an index - + getObjTypeByIdx: Returns the type of an object in a group, - given an index - (Jan 20, 2003) BMR - 2003/10/10 - - -Support for new platforms, languages and compilers. -======================================= - - gcc 3.3.1 is supported on Linux. - - -Bug Fixes since HDF5-1.6.0 release -================================== - - Library - ------- - - Fixed incorrect datatype of the third parameter to the Fortran90 - h5pset(get)_cache_f functions (INTEGER to INTEGER(SIZE_T)) EIP - 2003/10/13 - - Fixed problems with accessing variable-length data datatypes on - Crays. QAK - 2003/10/10 - - Fixed potential file corruption bug when too many object header - messages (probably attributes, from a user perspective) were - inserted into an object header and certain other conditions were - met. QAK - 2003/10/08 - - Changed implementation of internal ID searching algorithm to avoid - O(n) behavior for many common cases. QAK - 2003/10/06 - - Allow partial parallel writing to compact datasets. QAK - 2003/10/06 - - Correctly create reference to shared datatype in attribute, instead - of making a copy of the shared datatype in the attribute. - QAK - 2003/10/01 - - Revert changes which caused files >2GB to fail when created with - MPI-I/O file driver on certain platforms. QAK - 2003/09/16 - - Allow compound datatypes to grow in size. SLU - 2003/09/10 - - Detect if a type is already packed before attempting to pack it - again or check if it is locked. SLU - 2003/09/10 - - Corrected bug when opening a file twice with read-only permission - for one open and then closing the read-only access file ID would - generate an error. QAK - 2003/09/10 - - Corrected bug in repeated calls to H5Pget_access_plist() which would - incorrectly manage reference counts of internal information and - eventually blow up. QAK - 2003/09/02 - - Return rank of the array datatype on successful call to - H5Tget_array_dims(). QAK - 2003/08/30 - - Corrected bug in H5Tdetect_class which was not correctly detecting - datatype classes of fields in nested compound datatypes in some - circumstances. QAK - 2003/08/30 - - Corrected bug in sieve buffer code which could cause loss of data - when a small dataset was created and deleted in quick succession. - QAK - 2003/08/27 - - Corrected bug in H5Gget_objname_by_idx which was not allowing NULL - for the name when just querying for the object name's length. - QAK - 2003/08/25 - - Corrected bug in variable-length string handling which could - generate a core dump on writing variable-length strings as part - of a compound datatype on certain architectures. QAK - 2003/08/25 - - Corrected bug in H5Tget_native_type which would incorrectly compute - the size of certain compound datatypes and also incorrectly - compute the offset of the last field for those compound datatypes. - QAK - 2003/08/25 - - Corrected bug in H5Tget_native_type which would drop string datatype - metadata (padding, etc.) QAK - 2003/08/25 - - Corrected bugs in H5Gget_num_objs, H5Gget_objname_by_idx and - H5Gget_objtype_by_idx to allow them to accept location IDs, not just - group IDs. QAK - 2003/08/21 - - Corrected bug when using scalar dataspace for memory selection and - operating on chunked dataset. QAK - 2003/08/18 - - Corrected bugs with multiple '/' characters in names for H5Glink - and H5Gunlink. QAK - 2003/08/16 - - Corrected bug with user blocks that didn't allow a user block to - be inserted in front of a file after the file was created. - QAK - 2003/08/13 - - Corrected errors with using point selections to access data in - chunked datasets. QAK - 2003/07/23 - - Corrected error with variable-length datatypes and chunked datasets - which caused H5Dwrite to fail sometimes. QAK - 2003/07/19 - - Modified library and file format to support storing indexed storage - (chunked dataset) B-tree's with non-default internal 'K' values. - QAK - 2003/07/15 - - Returned H5T_BKG_TEMP support to library after it was accidentally - removed. QAK - 2003/07/14 - - Configuration - ------------- - - Fixed the error that caused "make install" to fail because of the - macro definition syntax of "prefix?=..." AKC - 2003/07/22 - - Performance - ------------- - - Tools - ----- - - Fixed a segmentation fault of h5diff when percentage option is used. - AKC - 2003/08/27 - - Switched away from tools using internal "fixtype" function(s) to use - H5Tget_native_type() internally. QAK - 2003/08/25 - - Documentation - ------------- - - Added two missing Fortran APIs (h5pget_fapl_mpiposix_f and - h5pset_fapl_mpiposix_f) to the reference manual. - FMB - 2003/10/15 - - Corrected the reference manual descriptions of H5open/h5open_f and - H5close/h5close_f to indicate that these calls are required in - Fortran90 applications. FMB - 2003/10/15 - - -Documentation -============= - - Fortran90 APIs are being integrated into the main body of the - HDF5 Reference Manual (RM). This process is complete in all RM sections - except H5P. - - A PDF version of the RM will be posted on the HDF5 website - (at http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/) approximately one week - after the release. - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 - xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - poe 3.2.0.10 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 - Cray Fortran Version 3.6.0.2 - Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 - Cray Fortran Version 3.6.0.2 - Cray T90IEEE 10.0.1.01y Cray Standard C Version 6.4.0.2.3 - Cray Fortran Version 3.4.0.3 - FreeBSD 4.9 gcc 2.95.4 - g++ 2.95.4 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - HP MPI 01.07.00.00 - IRIX 6.5 MIPSpro cc 7.3.1.2m - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - MPIch 1.2.4 - Linux 2.4.18 gcc 2.96, 3.2.2, 3.3.1 - g++ 3.2.2, 3.2.3 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 - MPIch 1.2.4 - Linux 2.4.20-8 gcc 3.2.2 - OSF1 V5.1 Compaq C V6.4-014 - Compaq C V6.3-027 - Compaq Fortran V5.5-2602 - Compaq C++ V6.5-030 - MPI_64bit_R5 - g++ version 3.0 for C++ - SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8(32 and 64 bit) Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - TFLOPS r1.0.4 v4.4.0 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - IA-32 Linux 2.4.9 gcc 2.96 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - - IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Intel C and F90 compilers version 7.1 - Code Warrior 8.0 - Windows XP MSVC++.NET - MAC OS X Darwin 6.8 - gcc and g++ Apple Computer, Inc. GCC - version 1175, based on gcc version 3.1 - - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C C F90 F90 C++ Shared zlib - parallel parallel libraries (4) -Solaris2.7 64-bit y y (1) y y (1) y y y -Solaris2.7 32-bit y y (1) y y (1) y y y -Solaris2.8 64-bit y y (1) y y (1) y y y -Solaris2.8 32-bit y y y y (1) y y y -IRIX6.5 y y (1) n n n y y -IRIX64_6.5 64-bit y y (2) y y y y y -IRIX64_6.5 32-bit y y (2) n n n y y -HPUX11.00 y y (1) y y y y y -OSF1 v5.1 y y y y y y y -T3E y y (5) y y (5) n n y -SV1 y y (5) y y (5) n n y -T90 IEEE y y (5) y y (5) n n y -TFLOPS n y (1) n n n n y -AIX-5.1 32-bit y y y y y n y -AIX-5.1 64-bit y y y y y n y -WinXP (6) y n n n y y y -WinXP Intel y n n n y y y -Win2000 y n y n y y y -Win2000 Intel y n y n y y y -WinNT CW y n n n n n y -Mac OS X 10.2 y n n n y y y -FreeBSD y y (1) n n y y y -Linux 2.4 gcc (3) y y (1) y (PGI) n y y y -Linux 2.4 Intel (3) y n y n y n y -Linux 2.4 PGI (3) y n y n y n y -Linux 2.4 IA32 Intel y n y n y n y -Linux 2.4 IA64 Intel y n y n y n y - - -ASCII Table 2 -- for RELEASE.txt - -Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 - exec safe VFD APIs tools (7) -Solaris2.7 64-bit x y y n y y n -Solaris2.7 32-bit x y y n y y y -Solaris2.8 64-bit x y y n y y n -Solaris2.8 32-bit x y y n y y y -IRIX6.5 x n y n y y y -IRIX64_6.5 64-bit x y y y y y y -IRIX64_6.5 32-bit x y y y y y y -HPUX11.00 x n y n y y y -OSF1 v5.1 y n y n y y y -T3E y n n n y y y -SV1 y n n n y y y -T90 IEEE y n n n y y n -TFLOPS y n n n n n n -AIX-5.1 32-bit y n y n y y y -AIX-5.1 64-bit y n y n y y y -WinXP (6) y n y n n y y -WinXP Intel y n y n n y y -Win2000 y n y n n y y -Win2000 Intel y n y n n y y -WinNT CW y n y n n y y -Mac OS X 10.2 y n y n y y n -FreeBSD y y y n y y y -Linux 2.4 gcc (3) y y y n y y y -Linux 2.4 Intel (3) y n y n y n n -Linux 2.4 PGI (3) y n y n y n n -Linux 2.4 IA32 Intel y n y n y y y -Linux 2.4 IA64 Intel y n y n y y y - - Notes: (1) Using mpich 1.2.4. - (2) Using mpt and mpich 1.2.4. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. - (4) Shared libraries are provided only for the C library, except - on Windows where they are provided for C and C++. - (5) Using mpt. - (6) Binaries only; source code for this platform is not being - released at this time. - (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 - utilities. - Compiler versions for each platform are listed in the preceding - "Platforms Tested" table. - - - -Known Problems -============== -* Fortran subroutine h5pget_driver_f doesn't return a correct driver information. - The fix willl be available in the 1.6.2 release. -* There are two h5dump xml tests(h5dump --xml thlink.h5 and h5dump --xml tmany.h5) - failed on windows xp with .NET for debug and debug dll. Release and Release - dll work fine. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - It is suggested that you don't use this option on these platforms - during configuration. - -* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - - -* The Stream VFD was not tested yet under Windows. It is not supported - in the TFLOPS machine. - - -* The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - -* On some platforms that use Intel compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - - ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays - -* On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 of - the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. However, if - you still experience a problem, you may want to check this line in the - libtool file and make sure that it has the correct value. - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 -%%%%1.6.0%%%% Release Information for hdf5-1.6.0 (03/July/03) - -14. Release information for HDF5 version 1.6.0 -================================================ - - -INTRODUCTION - -This document describes the differences between HDF5-1.4.* and -HDF5-1.6.0, and contains information on the platforms tested and -known problems in HDF5-1.6.0. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - -CONTENTS - -- New Features -- Support for new platforms and languages -- Bug Fixes since HDF5-1.4.0 -- Platforms Tested -- Known Problems - - -New Features -============ - -Configuration: --------------- -The following flags have been added to the configuration script: ---enable-hdf5v1_4 Compile the HDF5 v1.4 compatibility interface ---enable-filters=all Turn on all internal I/O filters. One may also - specify a comma-separated list of filters or the - word no. The default is all internal I/O filters. ---with-mpe=DIR Use MPE instrumentation [default=no] ---with-szlib=DIR Use szlib library for external szlib I/O filter - [default=no] - -Library: --------- - Summary: This release has the following new features that are not - available in 1.4.* releases - - 1. Generic properties to give application more control on I/O pipeline - 2. Time allocation and fill value properties - 3. New filters: external compression filter szip - internal shuffling and checksum filters - 4. Compact storage layout for datasets - 5. Redesigned I/O pipeline for better performance. - - For more information see - http://hdf.ncsa.uiuc.edu/HDF5/doc_resource/SZIP/index.html - http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide.html - http://hdf.ncsa.uiuc.edu/HDF5/doc/ADGuide/Changes.html - - Complete list of changes: - - * Changed dataset modification time to _not_ be updated when raw data is - written to a dataset. The modification time is only updated when the - dataset's metadata is modified. QAK - 2003/06/10 - * Changed H5Sget_select_bounds to use 'hssize_t *' for start and end - parameters, instead of 'hsize_t *', to better match other parts of the - dataspace API. QAK - 2003/06/04 - * Changed raw data I/O to only access each chunk once, improving performance - in many situations with hyperslabs and large chunks or chunks with - filters. These improvements are currently limited to serial I/O, with - similar parallel I/O improvements forthcoming sometime in the future. - QAK - 2003/05/07 - * Added parameter to the MPI/POSIX driver. If GPFS is enabled (by - modifying the H5FDmpiposix.c file to uncomment the USE_GPFS_HINTS - macro), then this extra parameter will turn GPFS hints on and off - during runtime. BW - 2003/05/05 - * Added option to print 1-byte integer datasets as ASCII to h5dump. BW - - 2003/04/30 - * Added a new utility "h5fc". It can be used to compile easily Fortran - programs which use HDF5. It automatically uses the compiler the HDF5 - library was built with and links in any libraries HDF5 requires. - BW - 2003/04/10 - * Added new dataset creation property list functions for working with - I/O filters: H5Pmodify_filter, H5Pget_filter_by_id and - H5Pall_filters_avail. Also changed H5Zregister to use new method - of registering filters with library. QAK - 2003/04/08 - * The first version of szip compression support were implemented. - User should have static szlib library installed. Using function - H5Pset_szip to pass the szip parameters to the HDF5 library. - More detailed decription of the process will be followed. - KY-2003/04/01 - * Added Fletcher32 checksum as a filter in pipeline. It only works in - chunked dataset. SLU - 2003/2/11 - * MPICH/MPE instrumentation feature added. Use --with-mpe[=DIR] to configure - it. AKC - 2003/1/3 - * New functions H5Gget_num_objs, H5Gget_objname_by_idx and H5Gget_objtype_by_idx - are added to the library. SLU - 2002/11/25 - * H5Dget_offset is added to return the offset of a dataset's data relative - to the beginning of the file. SLU - 2002/11/7 - * Functions H5Tget_native_type and H5Tis_variable_str are added. The first - one reconstructs a datatype based on native memory datatype. The second - one checks if a datatype is variable string. SLU - 2002/11/6 - * Added environment variable "HDF5_DISABLE_VERSION_CHECK", which disables - the version checking between the header files and the library linked into - an application if set to '1'. This should be used with caution, mis- - matched headers and library binaries can cause _serious_ problems. - QAK - 2002/10/15 - * Added new API function to get the name of an object in a file, using - an open ID (hid_t). QAK - 2002/10/14 - * Added API functions to return pointer to low-level file handle - (H5Fget_vfd_handle and H5FDget_vfd_handle) and related property list - setting functions(H5Pset_family_offset and H5Pset_multi_type). - SLU - 2002/09/30 - * Changed "H5P[set|get]_space_time" functions to "H5P[set|get]_alloc_time" - Unify all symbolic names for these functions to use "alloc time" instead - of other names. QAK - 2002/09/13 - * Added "H5D_SPACE_ALLOC_INCR" setting to H5D_SPACE_ALLOC_EARLY and - H5D_SPACE_ALLOC_LATE for H5Dset_space_time(). This allows chunked - datasets to be incrementally allocated as in the 1.4.x branch. - QAK - 2002/08/27 - * Compact dataset is added to the library. The data will be stored in - the header message of dataset layout. Space allocation time has to be - EARLY. No hyperslab is supported for parallel collective write. There - is no API changes except activating H5Pset_layout and H5Pget_layout for - compact dataset. -SLU, 2002/8/20 - * Added 'closing' parameter to VFL 'flush' callback function and H5FDflush. - This allows the library to indicate that the file will be closed - immediately following the call to 'flush' and can be used to avoid actions - that are duplicated in the VFL 'close' callback function. QAK - 2002/05/20 - * Added feature to parallel chunk allocation routine to not write fill - values to chunks allocated if the user has set the "fill time" to never. - This can improve parallel I/O performance for chunked - datasets. QAK - 2002/05/17 - * New functions H5Glink2 and H5Gmove2 were added to allow link and move to - be in different locations in the same file. The old functions H5Glink - and H5Gmove remain valid. SLU - 2002/04/26 - * Fill-value's behaviors for contiguous dataset have been redefined. - Basicly, dataset won't allocate space until it's necessary. Full details - are available at http://hdf.ncsa.uiuc.edu/RFC/Fill_Value, at this moment. - SLU - 2002/04/11 - * Added new routine "H5Dfill" to fill a selection with a particular value - in memory. QAK - 2002/04/09 - * Improved performance of "regular" hyperslab I/O when using MPI-IO and the - datatype conversion is unneccessary. QAK - 2002/04/02 - * Improved performance of single hyperslab I/O when datatype conversion is - unneccessary. QAK - 2002/04/02 - * Added new "H5Sget_select_type" API function to determine which type of - selection is defined for a dataspace ("all", "none", "hyperslab" or - "point"). QAK - 2002/02/07 - * Added support to read/write portions of chunks directly, if they are - uncompressed and too large to cache. This should speed up I/O on chunked - datasets for a few more cases. QAK - 2002/01/31 - * Added H5Rget_obj_type() API function, which performs the same functionality - as H5Rget_object_type(), but requires the reference type as a parameter - in order to correctly handle dataset region references. Moved - H5Rget_object_type() to be only compiled into the library when v1.4 - compatibility is enabled. - * Added a new file access property, file close degree, to control file - close behavior. It has four values, H5F_CLOSE_WEAK, H5F_CLOSE_SEMI, - H5F_CLOSE_STRONG, and H5F_CLOSE_DEFAULT. Two correspont functions - H5Pset_fclose_degree and H5Pget_fclose_degree are also provided. Two - new functions H5Fget_obj_count and H5Fget_obj_ids are offerted to assist - this new feature. For full details, please refer to the reference - manual under the description of H5Fcreate, H5Fopen, H5Fclose and the - functions mentioned above. - * Removed H5P(get|set)_hyper_cache API function, since the property is no - longer used. - * Improved performance of non-contiguous hyperslabs (built up with - several hyperslab selection calls). - * Improved performance of single, contiguous hyperslabs when reading or - writing. - * As part of the transition to using generic properties everywhere, the - parameter of H5Pcreate changed from H5P_class_t to hid_t, as well - the return type of H5Pget_class changed from H5P_class_t to hid_t. - Further changes are still necessary and will be documented here as they - are made. - * Improved regular hyperslab I/O by about a factor of 6 or so. - * Modified the Pablo build procedure to permit building of the instrumented - library to link either with the Trace libraries as before or with the - Pablo Performance Caputure Facility. - * Added new F90 APIs for generic properties, new filters, and - time/space allocation properties. - * C++ API: - - Added two new member functions: Exception::getFuncName() and - Exception::getCFuncName() to provide the name of the member - function, where an exception is thrown. - - IdComponent::operator= becomes a virtual function because - DataType, DataSpace, and PropList provide their own - implementation. The new operator= functions invoke H5Tcopy, - H5Scopy, and H5Pcopy to make a copy of a datatype, dataspace, - and property list, respectively. - -Parallel Library: ------------------ - -Tools: ------- - * When the "-S" option for "simple" output is chosen, h5ls now displays - modification times of datasets in UTC instead of local time. - QAK - 2003/06/06 - * h5diff to compare two HDF5 files was added - * h5import to import ascii and binary data to an HDF5 file was added. - Old h5import tool in the tools/misc directory was renamed to - h5createU8 to reflect its purpose. h5createU8 will be deleted in - 1.6.1 release. - * Two new scripts h5fc and h5c++ were added to compile F90 and C++ - HDF5 applications. - -Support for new platforms, languages and compilers. -======================================= - * Added C++ API support on HPUX11.00. BMR - 2003/03/19 - * Absoft compiler is supported for Fortran HDF5 Library. - When building with Absoft compiler, add -DH5_ABSOFT to - C compilation flags to get correct names of C functions - called by Fortran APIs. - - -Bug Fixes since HDF5-1.4.0 release -================================== - -Library -------- - * Don't attempt to perform collective I/O on chunked datasets with - parallel I/O. QAK - 2003/06/05 - * The library now correctly reuses space when objects are deleted in the - file. This should be handled correctly for every situation, except - datasets with variable-length datatypes are not returning the space they - use in the global heap currently. QAK - 2003/04/13 - * Fixed error in B-tree deletion routine which could cause groups to be - corrupted when objects are removed from them. - QAK - 2003/04/11 - * Fixed error in file space freeing code which could cause metadata to - fail to be written to the file. - QAK - 2003/04/11 - * -O caused errors in AIX 5.x platforms. Removed it from - --enable-production mode. AKC - 2003/03/31 - * Corrected memory/resource leaks in per-thread key information when - thread-safe operation was enabled. QAK - 2003/02/07 - * Improved error assertion for nil VL strings, making it fails with error - stack instead of just assertion failure. SLU - 2002/12/16 - * Added two new API functions: H5Zunregister & H5Zfilter_avail. - QAK - 2002/11/16 - * Add data shuffle filter(source code H5Zshuffle.c), the combination of the - shuffling and compression can make data compression better without suffering - much encoding and decoding CPU time for many application datasets(especially - for floating point data). This adds a new API function: H5Pset_shuffle. - KY - 2002/11/13 - * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 - * New functions H5Gget_comment(modification), H5Aget_storage_size, - H5Arename. SLU - 2002/10/29 - * Fixed an assertion of H5S_select_iterate that did not account for scalar - type that has no dimension sizes. AKC - 2002/10/15 - * Partially fixed space allocation inefficiencies in the file by - improving our algorithms for re-using freed space. QAK - 2002/08/27 - * Fixed data corruption problem which could occur when fill values were - written to a contiguously stored dataset in parallel. QAK - 2002/08/27 - * Fixed VL memory leak when data is overwritten. The heap objects holding - old data are freed. If the fill value writting time is set to - H5D_FILL_TIME_NEVER, the library prohibits user to create VL type dataset. - The library free all the heap objects storing VL type if there is nested - VL type(a VL type contains another VL type). SLU - 2002/07/10 - * Tweaked a few API functions to use 'size_t' instead of 'unsigned' or - 'hsize_t', which may cause errors in some cases. - - -Configuration -------------- - * Included the both the examples of fortran and c++ "make check-install" - testing. This tests the correctness of the h5fc command. AKC - 2003/04/22 - * When using gcc 3.x, we use -std=c99 instead of -ansi for compiling. - QAK - 2003/04/11 - * IA64 platform has its own configure setting and use Intel Compilers as - the default compilers (were gcc and pgf90 before.) This also eliminated - the segmentation fault in the fortran test. The missing reference of - "exit" is fixed too. AKC - 2003/04/02 - -Performance -------------- - * Improved dataset creation time by about 30% (relative to the 1.4.x - branch). - -Tools ------ - - * Added a -force option to h5redeploy. AKC - 2003/03/04 - * The VL string bug(data and datatype cannot be shown) in h5dump is fixed. - -SLU - 2002/11/18 - * Fixed segfault if h5dump was invoked with some options but no file - (e.g., h5dump -H). -AKC, 2002/10/15 - * Fixed so that the "-i" flag works correctly with the h5dumper. - * Fixed segfault when "-v" flag was used with the h5dumper. - - -Documentation -------------- - - - - - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 - xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 - poe 3.2.0.10 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 - Cray Fortran Version 3.6.0.0.2 - mpt 2.2.0.0 - Cray SV1 sn9617 10.0.1.2 Cray Standard C Version 6.6.0.2 - mpt 2.2.0.0 - Cray Fortran Version 3.6.0.0.2 - Cray T90IEEE 10.0.1.01y Cray Standard C Version 6.4.0.2.3 - Cray Fortran Version 3.4.0.3 - mpt 2.1.0.0 - FreeBSD 4.7 gcc 2.95.4 - g++ 2.95.5 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP ANSI C++ B3910B A.03.13 - MPIch 1.2.4 - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - MPIch 1.2.4 - Linux 2.4.18 gcc 2.96, 3.2.2, 3.2.3 - g++ 3.2.2, 3.2.3 - Intel(R) C++ Version 7.1 - Intel(R) Fortran Compiler Version 7.1 - PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 - MPIch 1.2.4 - OSF1 V5.1 Compaq C V6.4-014 - Compaq C V6.3-027 - Compaq Fortran V5.5-1877 - Compaq C++ V6.5-014 - MPI_64bit_R5 - g++ version 3.0 for C++ - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8/32 Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - SunOS 5.8/64 Sun WorkShop 6 update 2 C 5.3 - (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 - Sun WorkShop 6 update 2 C++ 5.3 - TFLOPS r1.0.4 v4.3.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - IA-32 Linux 2.4.9 gcc 2.96 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - - IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Intel C and F90 compilers version 7.1 - Code Warrior 8.0 - Windows XP MSVC++.NET - MAC OS X Darwin 6.5 - gcc and g++ Apple Computer, Inc. GCC - version 1161, based on gcc version 3.1 - - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - -Platform C C F90 F90 C++ Shared zlib - parallel parallel libraries (4) -Solaris2.7 64-bit y y (1) y y (1) y y y -Solaris2.7 32-bit y y (1) y y (1) y y y -Solaris2.8 64-bit y y (1) y y (1) y y y -Solaris2.8 32-bit y y y y (1) y y y -IRIX6.5 y y (1) n n n y y -IRIX64_6.5 64-bit y y (2) y y y y y -IRIX64_6.5 32-bit y y (2) n n n y y -HPUX11.00 y y (1) y y y y y -OSF1 v5.1 y y y y y y y -T3E y y (5) y y (5) n n y -SV1 y y (5) y y (5) n n y -T90 IEEE y y (5) y y (5) n n y -TFLOPS n y (1) n n n n y -AIX-5.1 32-bit y y y y y n y -AIX-5.1 64-bit y y y y y n y -WinXP (6) y n n n y y y -WinXP Intel y n n n y y y -Win2000 y n y n y y y -Win2000 Intel y n y n y y y -WinNT CW y n n n n n y -Mac OS X 10.2 y n n n y y y -FreeBSD y y (1) n n y y y -Linux 2.4 gcc (3) y y (1) y (PGI) n y y y -Linux 2.4 Intel (3) y n y n y n y -Linux 2.4 PGI (3) y n y n y n y -Linux 2.4 IA32 Intel y n y n y n y -Linux 2.4 IA64 Intel y n y n y n y - - -ASCII Table 2 -- for RELEASE.txt - -Platform static- Thread- SZIP GASS STREAM- High-level H4/H5 - exec safe VFD APIs tools (7) -Solaris2.7 64-bit x y y n y y n -Solaris2.7 32-bit x y y n y y y -Solaris2.8 64-bit x y y n y y n -Solaris2.8 32-bit x y y n y y y -IRIX6.5 x n y n y y y -IRIX64_6.5 64-bit x y y y y y y -IRIX64_6.5 32-bit x y y y y y y -HPUX11.00 x n y n y y y -OSF1 v5.1 y n y n y y y -T3E y n n n y y y -SV1 y n n n y y y -T90 IEEE y n n n y y n -TFLOPS y n n n n n n -AIX-5.1 32-bit y n y n y y y -AIX-5.1 64-bit y n y n y y y -WinXP (6) y n y n n y y -WinXP Intel y n y n n y y -Win2000 y n y n n y y -Win2000 Intel y n y n n y y -WinNT CW y n y n n y y -Mac OS X 10.2 y n y n y y n -FreeBSD y y y n y y y -Linux 2.4 gcc (3) y y y n y y y -Linux 2.4 Intel (3) y n y n y n n -Linux 2.4 PGI (3) y n y n y n n -Linux 2.4 IA32 Intel y n y n y y y -Linux 2.4 IA64 Intel y n y n y y y - - Notes: (1) Using mpich 1.2.4. - (2) Using mpt and mpich 1.2.4. - (3) Linux 2.4 with GNU, Intel, and PGI compilers, respectively. - (4) Shared libraries are provided only for the C library, except - on Windows where they are provided for C and C++. - (5) Using mpt. - (6) Binaries only; source code for this platform is not being - released at this time. - (7) Includes the H4toH5 Library and the h4toh5 and h5toh4 - utilities. - Compiler versions for each platform are listed in the preceding - "Platforms Tested" table. - - - -Known Problems -============== - -* PGI C++ compiler fails when compiling the C++ library's tests. - Therefore, we cannot verify that the C++ library built with the PGI C++ - compiler is correct. - -* The h5dump tests may fail to match the expected output on some platforms - (e.g. parallel jobs, Windows) where the error messages directed to - "stderr" do not appear in the "right order" with output from stdout. - This is not an error. - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - It is suggested that you don't use this option on these platforms - during configuration. - -* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - - -* The Stream VFD was not tested yet under Windows. It is not supported - in the TFLOPS machine. - - -* The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from the site: - -* On some platforms that use Intel compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - - ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/hdf5-1.6.0/F90_source_for_Crays - -* On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 of - the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. However, if - you still experience a problem, you may want to check this line in the - libtool file and make sure that it has the correct value. - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 ------------------------------------------------------------------------ -%%%%1.4.5%%%% Release Information for hdf5-1.4.5 (02/February/03) - - -13. Release information for HDF5 version 1.4.5 -============================================================================== - - -INTRODUCTION - -This document describes the differences between HDF5-1.4.4 and -HDF5-1.4.5, and contains information on the platforms tested and -known problems in HDF5-1.4.5. For additional information check the -HISTORY.txt file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information, see the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- Bug Fixes since HDF5-1.4.4 -- Performance Improvements -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - o Configuration - ================ - * Added "unofficial support" for building with a C++ compiler (or at least - not failing badly when building with a C++ compiler). QAK - 2003/01/09 - * Added "unofficial support" for AIX 64bits. See INSTALL for configure - details. AKC - 2002/08/29 - * Added "--with-dmalloc" flag, to easily enable support for the 'dmalloc' - debugging malloc implementation. QAK - 2002/07/15 - - o Library - ========= - o General - --------- - * Allow scalar dataspaces to be used for parallel I/O. QAK - 2002/11/05 - * Added environment variable "HDF5_DISABLE_VERSION_CHECK", which disables - the version checking between the header files and the library linked - into an application if set to '1'. This should be used with caution, - mis-matched headers and library binaries can cause _serious_ problems. - QAK - 2002/10/15 - * Partially fixed space allocation inefficiencies in the file by - improving our algorithms for re-using freed space. QAK - 2002/08/27 - * API tracing has been improved. Nested API calls don't screw up the - output format; function call and return event times can be logged; - total time spent in each function can be logged. The following - HDF5_DEBUG environment variable words affect tracing: - trace -- turn on/off basic tracing - ttimes -- turn on tracing and report event times and - time spent in each API function. - ttop -- turn on tracing but display only top-level - API calls. - - o APIs - ------ - * Several missing fortran APIs have been added to the library: - - h5get_libversion_f h5tget_member_index_f h5dget_storage_size_f - h5check_version_f h5tvlen_create_f h5dvlen_get_max_len_f - h5garbage_collect_f h5dwrite_vl_f - h5dont_atexit_f h5dread_vl_f - - Functions h5dvlen_get_max_len_f, h5dwrite_vl_f, and h5dread_vl_f support - VL Length C APIs functionality for integer, real and string datatypes. - See HDF5 Reference Manual and HDF5 FORTRAN90 User's Notes for more - information and for the functions description. - - o Parallel library - ================== - * The MPI-posix virtual file driver makes gpfs_fcntl() hints to tell - the underlying GPFS file system to avoid prefetching byte range - tokens if USE_GPFS_HINTS is defined when this file is compiled. - This temporary solution is intended to be removed once the HDF5 - API supports the necessary functionality that makes it possible - for this sort of thing do be done at a higher software layer. - RPM - 2002/12/03 - * Added MPI-posix VFL driver. This VFL driver uses MPI functions to - coordinate actions, but performs I/O directly with POSIX sec(2) - (i.e. open/close/read/write/etc.) calls. This driver should _NOT_ - be used to access files that are not on a parallel filesystem. - The following API functions were added: - herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm); - herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/); - QAK - 2002/07/15 - - - - o Support for new platforms and languages - ========================================= - * C++ API now works on the Origin2000 (IRIX6.5.14.) BMR - 2002/11/14 - - - o Misc. - ========================================= - HDF5 1.4.5 works with Portland Group Compilers (pgcc, pgf90 and pgCC - version 4.0-2) on Linux 2.4 - - -Bug Fixes since HDF5-1.4.4 Release -================================== - * H5Fopen without the H5F_ACC_CREAT flag should not succeed in creating - a new file with the 'core' VFL driver. QAK - 2003/01/24 - * Corrected metadata caching bug in parallel I/O which could cause hangs - when chunked datasets were accessed with independent transfer mode. - QAK - 2003/01/23 - * Allow opening objects with unknown object header messages. - QAK - 2003/01/21 - * Added improved error assertion for nil VL strings. It return error - stack instead of a simple assertion. SLU - 2002/12/16 - * Fixed h5dump bug(cannot dump data and datatype) for VL string. - SLU - 2002/11/18 - * Fixed error condition where "none" selections were not being handled - correctly in serial & parallel. QAK - 2002/10/29 - * Fixed problem where optimized hyperslab routines were incorrectly - invoked for parallel I/O operations in collective mode. QAK - 2002/07/22 - * Fixed metadata corruption problem which could occur when many objects - are created in a file during parallel I/O. QAK - 2002/07/19 - * Fixed minor problem with configuration when users specified /usr/include - and /usr/lib for the --with-* options that some compilers can't - handle. BW - 2003/01/23 - - - -Documentation -============= - New PDF files are not available for this release. - - -Platforms Tested -================ - - AIX 5.1 (32 and 64-bit) C for AIX Compiler, Version 6 - xlf 8.1.0.2 - poe 3.2.0.11 - Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.1.3 - Cray Fortran Version 3.6.0.0.12 - Cray SV1 10.0.1. 0 Cray Standard C Version 6.6.0.1.3 - Cray Fortran Version 3.6.0.0.12 - Cray T90IEEE 10.0.1.01u Cray Standard C Version 6.4.0.2.3 - Cray Fortran Version 3.4.0.3 - FreeBSD 4.7 gcc 2.95.4 - g++ 2.95.5 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - Linux 2.4.18 gcc 3.2.1 - g++ 3.2.1 - Intel(R) C++ Version 6.0 - Intel(R) Fortran Compiler Version 6.0 - PGI compilers (pgcc, pgf90, pgCC) version 4.0-2 - pgf90 3.2-4 - OSF1 V5.1 Compaq C V6.4-014 - Compaq Fortran X5.4A-1684 - gcc version 3.0 for C++ - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - TFLOPS r1.0.4 v4.3.3 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with - local modifications - IA-32 Linux 2.4.9 gcc 2.96 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - - IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Version 7.0 - Intel(R) Fortran Compiler Version 7.0 - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows XP .NET - Windows NT4.0 Code Warrior 6.0 - MAC OS X Darwin 6.2 - gcc and g++ Apple Computer, Inc. GCC - version 1161, based on gcc version 3.1 - - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - dna = does not apply - ( ) = footnote appears below second table - - - Platform C C F90 F90 C++ Shared zlib - parallel parallel libraries (5) - Solaris2.6 y n y n y y y - Solaris2.7 64-bit y y (1) y y (1) y y y - Solaris2.7 32-bit y y (1) y y (1) y y y - Solaris2.8 64-bit y n y y (1) y y y - Solaris2.8 32-bit y n y y (1) y y y - IRIX6.5 y y (1) n n n y y - IRIX64_6.5 64-bit y y (2) y y y y y - IRIX64_6.5 32-bit y y (2) n n n y y - HPUX11.00 y y (1) y n n y y - OSF1 v5.1 y n y n y y y - T3E (6) y n y n n n y - SV1 y n y n n n y - T90 IEEE y n y n n n y - TFLOPS n y (1) n n n n y - AIX-5.1 32-bit y y y y y n y - AIX-5.1 64-bit y y y y y n y - WinXP (7) y n n n y y y - WinNT/2000 y n y n y y y - WinNT CW y n n n n n y - Mac OS X 10.2 y n n n y y y - FreeBSD y y (1) n n y y y - Linux 2.2 y y (1) y y (1) y y y - Linux 2.4 gcc (3) y y (1) y n y y y - Linux 2.4 Intel (3) y n y n n n y - Linux 2.4 PGI (3) y n y n y n y - Linux 2.4 IA32 y n y n n n y - Linux 2.4 IA64 y n y n n n y - - - Platform static- Thread- SRB GASS STREAM- - exec safe VFD - Solaris2.6 x y n n y - Solaris2.7 64-bit x y n n y - Solaris2.7 32-bit x y n n y - Solaris2.8 64-bit x n n n y - Solaris2.8 32-bit x y n n y - IRIX6.5 x n n n y - IRIX64_6.5 64-bit x y n y y - IRIX64_6.5 32-bit x y n y y - HPUX11.00 x n n n y - OSF1 v5.1 y n n n y - T3E (6) y n n n y - SV1 y n n n y - T90 IEEE y n n n y - TFLOPS y n n n n - AIX-5.1 32-bit y n n n y - AIX-5.1 64-bit y n n n y - WinXP (7) dna n n n n - WinNT/2000 dna n n n n - WinNT CW dna n n n n - Mac OS X 10.2 y n n n y - FreeBSD y y n n y - Linux 2.2 y y n n y - Linux 2.4 gcc (3) y y n n y - Linux 2.4 Intel (3) y n n n y - Linux 2.4 PGI (3) y n n n y - Linux 2.4 IA32 y n n n y - Linux 2.4 IA64 y n n n y - - Notes: (1) Using mpich 1.2.4. - (2) Using mpt and mpich 1.2.4. - (3) Linux 2.4 with GNU, Intel, and PGI compilers. - (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library, - except on Windows where they are provided for all languages. - (6) Debug mode only. - (7) Binaries only; source code for this platform is not being - released at this time. - - -Known Problems -============== - - * On Linux 2.4 IA64, Fortran test fails for h5dwrite_vl_f - for integer and real base datatypes. - - * When fortran library is built with Intel compilers, compilation - for fflush1.f90, fflush2.f90 and fortanlib_test.f90 will fail - complaining about EXEC function. Comment the call to EXEC subroutine - in each program, or get a patch for the HDF5 Fortran source code. - - * Fortran external dataset test fails on Linux 2.4 with pgf90 compiler. - - * On Windows, h5dump may abort printing if a VL string is longer than 4096 - bytes due to a compiler problem. It'll be fixed in v1.6 release. - - * Datasets or attributes which have a variable-length string datatype are - not printing correctly with h5dump and h5ls. - - * When a dataset with the variable-length datatype is overwritten, - the library can develop memory leaks that cause the file to become - unnecessarily large. This is planned to be fixed in the next release. - - * On the SV1, the h5ls test fails due to a difference between the - SV1 printf precision and the printf precision on other platforms. - - * The h5dump tests may fail to match the expected output on some - platforms (e.g. SP2 parallel, Windows) where the error messages - directed to "stderr" do not appear in the "right order" with output - from stdout. This is not an error. - - * The --enable-static-exec configure flag fails to compile for HP-UX - 11.00 platforms. - - * The executables are always dynamic on IRIX64 6.5(64 and n32) and - IRIX 6.5 even if they are configured with --enable-static-exec. - - * IRIX 6.5 fails to compile if configured with --enable-static-exec. - - * The executables are always dynamic on Solaris 2.7 ans 2.8(64 and n32) - even if they are configured with --enable-static-exec. - - * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause - a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting the environment - variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. - - * On OSF1 v5.1 and IA32 h5dumpgentst program that generates test files - for h5dump, gives segmentation fault. - - * On Windows platforms, C and Fortran tests fail with the debug DLL version - of the Library if built from all_withf90.zip file. - - * On Cray T3E (sn6606 2.0.6.08 unicosmk CRAY T3E) with Cray Standard C Version 6.6.0.1.3 - compiler optimization causes errors in many HDF5 Library tests. Use -g -h zero flags - to build HDF5 Library. - - * On Cray SV1 10.0.1. 0 datatype convertion test fails. Please check HDF FTP site - if patch is available. We will try to provide one in the nearest future. - - * For configuration, building and testing with Intel and PGI compilers see - corresponding section in INSTALL file. - - -%%%%1.4.4%%%% Release Information for hdf5-1.4.4 (02/July/02) - -12. Release information for HDF5 version 1.4.4 -============================================================================== - -INTRODUCTION - -This document describes the differences between HDF5-1.4.3 and -HDF5-1.4.4, and contains information on the platforms tested and -known problems in HDF5-1.4.4. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information, see the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- Bug Fixes since HDF5-1.4.3 -- Performance Improvements -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - o Configuration - ================ - * The H4 to H5 tools have been removed from the main source and placed - in a separate package. You can get these tools from the HDF ftp site - (ftp://hdf.ncsa.uiuc.edu/). The "--with-hdf4" command-line option - during configure is no longer valid. BW - 2002/06/25 - - o Library - ========= - o General - --------- - * Fill-value forward-compatibility with release 1.5 was added. SLU - - 2002/04/11 - * A new query function H5Tget_member_index has been added for compound - and enumeration data types. This function retrieves a member's index - by name. SLU - 2002/04/05 - * Added serial multi-gigabyte file size test. "test/big -h" shows - the help page. AKC - 2002/03/29 - - o APIs - ------ - * The F90 subroutines h5dwrite_f, h5dread_f, h5awrite_f, and h5aread_f - were overloaded with a "dims" argument of type INTEGER(HSIZE_T) to - specify the size of the array. We recommend using these subroutines - with the new type; module subroutines that accept "dims" as an i - INTEGER array of size 7 will be deprecated in release 1.6. - EIP - 2002/05/06 - - o Performance - ------------- - * Added internal "small data" aggregation, which can reduce the number of - actual I/O calls made, improving performance. QAK - 2002/06/05 - * Improved internal metadata aggregation, which can reduce the number of - actual I/O calls made, improving performance. Additionally, this can - reduce the size of files produced. QAK - 2002/06/04 - * Improved internal metadata caching, which can reduce the number of - actual I/O calls made by a substantial amount, improving - performance. QAK - 2002/06/03 - - - o Parallel library - ================== - * Fixed bug in parallel I/O routines where a collective I/O which used - MPI derived types, followed by an independent I/O would cause the library - to hang. QAK 2002/06/24 - * Added environment variable flag to control whether creating MPI derived - types is preferred or not. This can affect performance, depending on - which way the MPI-I/O library is optimized. The default is set to - prefer MPI derived types for collective raw data transfers; setting the - HDF5_MPI_PREFER_DERIVED_TYPES environment variable to "0" (i.e.: - "setenv HDF5_MPI_PREFER_DERIVED_TYPES 0") changes the preference to avoid - using them whenever possible. QAK - 2002/06/19 - * Changed MPI I/O routines to avoid creating MPI derived types (and thus - needing to set the file view) for contiguous selections within datasets. - This should result in some performance improvement for those types of - selections. QAK - 2002/06/18 - * Changed MPI type support for collective I/O to be enabled by default. - This can be disabled by setting the HDF5_MPI_OPT_TYPES environment - variable to the value "0". QAK - 2002/06/14 - * Allowed chunks in chunked datasets to be cached when parallel file is - opened for read-only access (bug #709). QAK - 2002/06/10 - * Changed method for allocating chunked dataset blocks to only allocate - blocks that don't already exist, instead of attempting to create all the - blocks all the time. This improves performance for chunked - datasets. QAK - 2002/05/17 - * Allowed the call to MPI_File_sync to be avoided when the file is going to - immediately be closed, improving performance. QAK - 2002/05/13 - * Allowed the metadata writes to be shared among all processes, easing the - burden on process 0. QAK - 2002/05/10 - - - o Tools - ======= - * h5redeploy utility was added. It updates HDF5 compiler tools - after the HDF5 software has been installed in a new location. - - - o Support for new platforms and languages - ========================================= - * Parallel Fortran Library works now on HP-UX B.11.00 Sys V. - EIP - 2002/05/06 - * Intel C++ and F90 compilers Version 6.0 are supported on Linux 2.4. - * Intel C++ compilers Version 6.0 are supported on Windows 2000. - - - o Misc. - ========================================= - * zlib has been moved out of the Windows source release. Users should go to - the ZLIB homepage(http://www.zlib.org) to download the corresponding - zlib library. - * The Windows binary release is built with the old version of the zlib - library. We expect users to use zlib 1.1.4 to build with the source - release. - * In the Windows-specific install document, we specify how to test backward - compatibility. However, in this release, we are not testing the backward - compatibility of HDF5. - - -Bug Fixes since HDF5-1.4.3 Release -================================== - * Fixed bug in chunking routines where they were using internal allocation - free routines, instead of malloc/free, preventing user filters from - working correctly. Chunks are now allocated/freed with malloc/free and - so should the chunks in user filters. QAK 2002/06/18 - * Fixed bug where regular hyperslab selection could get incorrectly - transferred when the number of elements in a row did not fit evenly - into the buffer provided. QAK 2002/06/12 - * Fixed bug (#499) which allowed an "empty" compound or enumerated datatype - (one with no members) to be used to create a dataset or to be committed - to a file. QAK - 2002/06/11 - * Fixed bug (#777) which allowed a compound datatype to be inserted into - itself. QAK - 2002/06/10 - * Fixed bug (#789) where creating 1-D dataset region reference caused the - library to go into infinite loop. QAK - 2002/06/10 - * Fixed bug (#699, fix provided by a user) where a scalar dataspace was - written to the file and then subsequently queried with the - H5Sget_simple_extent_type function; type was reported as H5S_SIMPLE - instead of H5S_SCALAR. EIP - 2002/06/04 - * Clear symbol table node "dirty" flag when flushing symbol tables to - disk, to reduce I/O calls made & improve performance. QAK - 2002/06/03 - * Fixed bug where an object's header could get corrupted in certain - obscure situations when many objects were created in the - file. QAK - 2002/05/31 - * Fixed bug where read/write intent in file IDs created with H5Freopen - was not being kept the same as the original file. QAK - 2002/05/14 - * Fixed bug where selection offsets were not being used when iterating - through point and hyperslab selections with - H5Diterate(). QAK - 2002/04/29 - * Fixed bug where the data for several level deep nested compound & - variable-length datatypes used for datasets were getting corrupted when - written to the file. QAK - 2002/04/17 - * Fixed bug where selection offset was being ignored for certain hyperslab - selections when optimized I/O was being performed. QAK - 2002/04/02 - * Fixed limitation in h5dumper with object names which reached over 1024 - characters in length. We can now handle arbitrarily larger sizes for - object names. BW - 2002/03/29 - * Fixed bug where variable-length string type did not behave as a - string. SLU - 2002/03/28 - * Fixed bug in H5Gget_objinfo() which was not setting the 'fileno' - of the H5G_stat_t struct. QAK - 2002/03/27 - * Fixed data corruption bug in hyperslab routines when contiguous - hyperslab that spans entire dimension and is larger than type - conversion buffer is attempted to be read. QAK - 2002/03/26 - - -Performance Improvements -======================== - This release of the HDF5 library has been extensively tuned to improve -performance, especially to improve parallel I/O performance. - Most of the specific information for particular performance improvements -is mentioned in the "New Features" and "Bug Fixes since HDF5-1.4.3" sections -of this document, but in general, the library should make fewer and larger -I/O requests when accessing a file. Additionally, improvements to the parallel -I/O portions of the library should have reduced the communications and barriers -used in various internal algorithms, improving the performance of the library. - However, with the extensive changes to some portions of the library that -were required for these improvements, some errors or unanticipated results may -have been introduced also. Please report any problems encountered to our -support team at hdfhelp@ncsa.uiuc.edu. - Hopefully these improvements will benefit all HDF5 applications, but if -there are particular I/O patterns that appear to be slower than necessary, -please send e-mail to hdfhelp@ncsa.uiuc.edu with a sample program showing the -problem behavior; we will look into the issue to see if it is possible to -address it. - - -Documentation -============= - * Documentation was updated for the hdf5-1.4.4 release. - * A new "HDF5 User's Guide" is under development. See - http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. - * A "Parallel HDF5 Tutorial" is available at - http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. - * The "HDF5 Tutorial" is not distributed with this release. It is - available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/. - - -Platforms Tested -================ - - AIX 4.3.3.0 (IBM SP powerpc) xlc 5.0.2.0 - mpcc_r 5.0.2.0 - xlf 07.01.0000.0002 - mpxlf 07.01.0000.0002 - AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 - xlf 7.1.0.2 - poe 3.1.0.12 (includes mpi) - AIX 5.1 xlc 5.0.2.0 - xlf 07.01.0000.0002 - mpcc_r 5.0.2.0; mpxlf_r 07.01.0000.0002 - Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 - Cray Fortran Version 3.5.0.4 - Cray SV1 10.0.1.1 Cray Standard C Version 6.5.0.3 - Cray Fortran Version 3.5.0.4 - FreeBSD 4.6 gcc 2.95.4 - g++ 2.95.4 - HP-UX B.10.20 HP C HP92453-01 A.10.32.30 - HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP MPI [not a product] (03/24/2000) B6060BA - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m - F90 MIPSpro 7.3.1.3m (64 only) - Linux 2.4.9-31smp gcc 2.95.3 - g++ 2.95.3 - Intel(R) C++ Version 6.0 - Intel(R) Fortran Compiler Version 6.0 - MPICH 1.2.2 - Linux 2.2.18smp gcc 2.95.2 - gcc 2.95.2 with mpich 1.2.1 - g++ 2.95.2 - pgf90 3.2-4 - OSF1 V5.1 Compaq C V6.4-014 - Compaq Fortran V5.5-1877-48BBF - gcc version 3.0 for C++ - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 - WorkShop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - TFLOPS r1.0.4 v4.2.2 i386 pgcc Rel 3.1-4i with mpich-1.2.3 with - local modifications - IA-32 Linux 2.4.9 cc Intel 5.0.1 - gcc 2.96 - Intel(R) C++ Version 6.0 - Intel(R) Fortran Compiler Version 6.0 - - IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Version 6.0 - Intel(R) Fortran Compiler Version 6.0 - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows NT4.0 MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows NT4.0 Code Warrior 6.0 - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - ( ) = footnote appears below second table - - - Platform C C F90 F90 C++ Shared zlib Tools - parallel parallel libraries(5) - Solaris2.6 y n y n y y y y - Solaris2.7 64 y y (1) y n y y y y - Solaris2.7 32 y y (1) y n y y y y - Solaris2.8 64 y n y n y y y y - Solaris2.8 32 y n y n y y y y - IRIX6.5 y y (1) n n n y y y - IRIX64_6.5 64 y y (2) y y n y y y - IRIX64_6.5 n32 y y (2) n n n y y y - HPUX10.20 y n y n n y y y - HPUX11.00 y n y n n y y y - HPUX11 SysV y y y y n y y y - OSF1 v5.1 y n y n y y y y - T3E y y y y n n y y - SV1 y n y n n n y y - TFLOPS n y (1) n n n n y y (4) - AIX-4.3 y y y y y n y y - AIX-5.1 y y y y n n y y - WinNT/2000 y n y n y y y y - WinNT CW y n n n n n y y - FreeBSD y n n n y y y y - Linux 2.2 y y (1) y n y y y y - Linux 2.4 y y (1) n n y y y y - Linux 2.4 Intel(6) y n y n y n y y - Linux 2.4 IA32 y n y n n n y y - Linux 2.4 IA64 y n y n n n y y - - - Platform 1.2 static- Thread- SRB GASS STREAM- - compatibility exec safe VFD - Solaris2.6 y x y n n y - Solaris2.7 64 y x y n n y - Solaris2.7 32 y x y n n y - Solaris2.8 64 y y n n n y - Solaris2.8 32 y x y n n y - IRIX6.5 y x n n n y - IRIX64_6.5 64 y x y n y y - IRIX64_6.5 n32 y x y n y y - HPUX10.20 y y n n n y - HPUX11.00 y x n n n y - HPUX11 SysV y x n n n y - OSF1 v5.1 y y n n n y - T3E y y n n n y - SV1 y y n n n y - TFLOPS y y n n n n - AIX-4.3 y y (3) n n n y - AIX-5.1 y y n n n y - WinNT/2000 y y n n n n - WinNT CW n n n n n n - FreeBSD y y y n n y - Linux 2.2 y y y n n y - Linux 2.4 y y y n n y - Linux 2.4 Intel(6) y y n n n y - Linux 2.4 IA32 y y n n n y - Linux 2.4 IA64 y y n n n y - - - Footnotes: (1) Using mpich. - (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail in - serial mode. - (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library, - except on Windows where they are provided for all languages. - (6) Linux 2.4 with Intel compilers. - - -Known Problems -============== - - * Datasets or attributes which have a variable-length string datatype are - not printing correctly with h5dump and h5ls. - - * When a dataset with the variable-length datatype is overwritten, - the library can develop memory leaks that cause the file to become - unnecessarily large. This is planned to be fixed in the next release. - - * On the SV1, the h5ls test fails due to a difference between the - SV1 printf precision and the printf precision on other platforms. - - * The h5dump tests may fail to match the expected output on some - platforms (e.g. SP2 parallel, Windows) where the error messages - directed to "stderr" do not appear in the "right order" with output - from stdout. This is not an error. - - * The --enable-static-exec configure flag fails to compile for HP-UX - 11.00 platforms. - - * The executables are always dynamic on IRIX64 6.5(64 and n32) and - IRIX 6.5 even if they are configured with --enable-static-exec. - - * IRIX 6.5 fails to compile if configured with --enable-static-exec. - - * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause - a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting the environment - variable HDF5_MPI_OPT_TYPES to a non-zero value such as 1. - - * On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 - of the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - Change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - * To build the Fortran library using Intel compilers, one has to - x modify the source code in the fortran/src directory to remove the - !DEC and !MS compiler directives. - x The build will fail in the fortran/test directory and then in the - fortran/examples directory; to proceed, edit the work.pcl files in - those directories to contain two lines - - work.pc - ../src/work.pc - - * To build the Fortran library on IA64 use - setenv CC "ecc -DIA64" - setenv F9X "efc -cl,work.pcl" - before running configure and see the steps described above. - - -%%%%1.4.3%%%% Release Information for hdf5-1.4.3 (18/Februaru/02) - -11. Release information for HDF5 version 1.4.3 -============================================================================== - - -INTRODUCTION - -This document describes the differences between HDF5-1.4.2 and -HDF5-1.4.3, and contains information on the platforms tested and -known problems in HDF5-1.4.2. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- Bug Fixes since HDF5-1.4.2 -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - o Configuration - ================ - * Can use just enable-threadsafe if the C compiler has built-in pthreads - support. - - o Library - ========= - o General - --------- - * Added a new test to verify the information provided by the configure - command. - * Changed internal error handling macros to reduce code size of library by - about 10%. - - o APIs - ------ - * Changed prototype for H5Awrite from: - H5Awrite(hid_t attr_id, hid_t type_id, void *buf) - to: - H5Awrite(hid_t attr_id, hid_t type_id, const void *buf) - * The H5Pset_fapl_split() accepts raw and meta file names similar to the - syntax of H5Pset_fapl_multi() in addition to what it used to accept. - - C++ API: - * Added operator= to class PredType - * Add the overloaded member function Attribute::getName to return - the attribute name's length as in C API. Note that the current - Attribute::getName, that returns "string", is still available. - * Following the change in the C library, the corresponding C++ API - is changed from: - void Attribute::write( const DataType& mem_type, void *buf ) - to: - void Attribute::write( const DataType& mem_type, const void *buf ) - - o Performance - ------------- - * Added perform programs to test the HDF5 library performance. Programs - are installed in directory perform/. - * Improved performance of byte-swapping during data conversions. - * Improved performance of single, contiguous hyperslabs when reading or - writing. - * Added support to read/write portions of chunks directly, if they are - uncompressed and too large to cache. This should speed up I/O on chunked - datasets for a few more cases. -QAK, 1/31/02 - - o Parallel Library - ================== - * Parallel C HDF5 now works on HP-UX platforms, Compaq clusters, - Linux clusters, Cplants (alpha-linux clusters). - - o Tools - ======= - * A helper script called ``h5cc'', which helps compilation of HDF5 - programs, is now distributed with HDF5. See the reference manual - for information on how to use this feature. - * The H5Dumper can now dump comments associated with groups. -WCW 01-05-02 - - o Support for new platforms and languages - ========================================= - * HDF5 C++ Library is supported on Windows platforms (shared and static) - * HDF5 F90 shared library is supported on Windows platforms. - * HDF5 C Library is supported on IA32 and IA64 platforms. - - - -Bug Fixes since HDF5-1.4.2 Release -================================== - - * Fixed a bug when reading chunked datasets where the edge of the dataset - would be incorrectly detected and generate an assertion failure. - * Fixed a bug where reading an entire dataset wasn't being handled - optimally when the dataset had unlimited dimensions. Dataset is read - in a single low-level I/O now, instead of being broken into separate - pieces internally. - * Fixed a bug where reading or writing chunked data which needed datatype - conversion could result in data values getting corrupted. - * Fixed a bug where appending a point selection to the current selection - would not actually append the point when there were no points defined - currently. - * Fixed a bug where 'or'ing a hyperslab with a 'none' selection would - fail. Now adds that hyperslab as the first hyperlab in the selection. - * Fixed a bug in the 'big' test where quota limits weren't being detected - properly if they caused close() to fail. - * Fixed a bug in internal B-tree code where a B-tree was not being copied - correctly. - * Fixed an off-by-one error in H5Sselect_valid when hyperslab selections - which would allow hyperslab selections which overlapped the edge of the - selection by one element as valid. - * Fixed the internal macros used to encode & decode file metadata, to avoid - an unaligned access warning on IA64 machines. - * Corrected behavior of H5Tinsert to not allow compound datatype fields to - be inserted past the end of the datatype. - * Retired the DPSS virtual file driver (--with-gridstorage configure - option). - * Fixed bug where variable-length datatypes for attributes was not working - correctly. - * Fixed bug where raw data re-allocated from the free-list would sometimes - overlap with the metadata accumulator and get corrupted. QAK - 1/23/02 - * Fixed bug where a preempted chunk in the chunk data could still be - used by an internal pointer and cause an assertion failure or core - dump. QAK - 2/13/02 - * Fixed bug where non-zero fill-value was not being read correctly from - certain chunked datasets when using an "all" or contiguous hyperslab - selection. QAK - 2/14/02 - - -Documentation -============= - * Documentation was updated for the hdf5-1.4.3 release. - * A new "HDF5 User's Guide" is under development. See - http://hdf.ncsa.uiuc.edu/HDF5/doc_dev_snapshot/H5_NewUG/current/. - * Parallel Tutorial is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/Tutor/ - - -Platforms Tested -================ - - AIX 4.3.3.0 (IBM SP powerpc) xlc 5.0.2.0 - mpcc_r 5.0.2.0 - xlf 07.01.0000.0002 - mpxlf 07.01.0000.0002 - AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 - xlf 7.1.0.2 - poe 3.1.0.12 (includes mpi) - Cray T3E sn6711 2.0.5.57 Cray Standard C Version 6.5.0.3 - Cray Fortran Version 3.5.0.4 - Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.3 - Cray Fortran Version 3.5.0.4 - FreeBSD 4.5 gcc 2.95.3 - g++ 2.95.3 - HP-UX B.10.20 HP C HP92453-01 A.10.32.30 - HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP MPI [not a product] (03/24/2000) B6060BA - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.2m - Linux 2.4.4 gcc 2.95.3 - g++ 2.95.3 - Linux 2.2.18smp gcc 2.95.2 - gcc 2.95.2 with mpich 1.2.1 - g++ 2.95.2 - pgf90 3.2-4 - OSF1 V5.1 Compaq C V6.3-028 - Compaq Fortran V5.4-1283 - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 - Workshop Compilers 5.0 98/10/25 - FORTRAN 90 2.0 Patch 107356-04 - SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - Patch 109503-07 2001/08/11 - Sun WorkShop 6 update 1 C++ 5.2 Patch - 109508-04 2001/07/11 - TFLOPS r1.0.4 v4.0.8 i386 pgcc Rel 3.1-4i with mpich-1.2.1 with - local modifications - IA-32 Linux 2.2.10smpx cc Intel 5.0.1 - egcs-2.91.66 - IA-64 Linux 2.4.16 ia64 gcc version 2.96 20000731 - Intel(R) C++ Itanium(TM) Compiler - for the Itanium(TM)-based applications, - Version 6.0 Beta, Build 20010905 - Windows 2000 (NT5.0) MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows NT4.0 MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows NT4.0 Code Warrior 6.0 - Windows 98 MSVC++ 6.0 - DEC Visual Fortran 6.0 - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - ( ) = footnote appears below second table - - - Platform C C F90 F90 C++ Shared zlib Tools - parallel parallel libraries - (5) - Solaris2.7 y y (1) y n y y y y - Solaris2.8 64 y n y n y y y y - Solaris2.8 32 y n y n y y y y - IA-64 y n n n n n y y - IRIX6.5 y y (1) n n n y y y - IRIX64_6.5 64 y y (2) y y n y y y - IRIX64_6.5 32 y y (2) n n n y y y - HPUX10.20 y n y n n y y y - HPUX11.00 y y y n n y y y - HPUX11 SysV y y y n n y y y - DECOSF y n y n y y y y - T3E y y y y n n y y - SV1 y n y n n n y y - TFLOPS y y (1) n n n n y y (4) - AIX-4.3 SP2 y y y y n n y n - AIX-4.3 SP3 y y y y y n y n - Win2000 y n y n y (6) y y y - Win98 y n y n y (6) y y y - WinNT y n y n y (6) y y y - WinNT CW y n n n n n y y - FreeBSD y n n n y y y y - Linux 2.2 y y (1) y n y y y y - Linux 2.4 y y (1) n n y y y y - - - Platform 1.2 static- Thread- SRB GASS STREAM- - compatibility exec safe VFD - Solaris2.7 n x y n n y - Solaris2.8 64 n y n n n y - Solaris2.8 32 n x n n n y - IA-64 n n n n n y - IRIX6.5 n x y n n y - IRIX64_6.5 64 n x y n y y - IRIX64_6.5 32 n x y n y y - HPUX10.20 n y n n n y - HPUX11.00 n x n n n y - HPUX11 SysV n x n n n y - DECOSF n y n n n y - T3E n y n n n y - SV1 n y n n n y - TFLOPS n y n n n n - AIX-4.3 SP2 n y (3) n n n y - AIX-4.3 SP3 n y n n n y - Win2000 n y n n n n - Win98 n y n n n n - WinNT n y n n n n - WinNT CW n n n n n n - FreeBSD n y y n n y - Linux 2.2 n y y n n y - Linux 2.4 n y y n n y - - - Footnotes: (1) Using mpich. - (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail - in serial mode. - (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library. - (6) Exception of (5): DLL is available for C++ API on Windows - - -Known Problems -============== - - * Datasets or attributes which have a variable-length string datatype are - not printing correctly with h5dump and h5ls. - - * When a dataset with the variable-legth datatype is overwritten, - the library can develop memory leaks that cause the file to become - unnecessarily large. This is planned to be fixed in the next release. - - * On the SV1, the h5ls test fails due to a difference between the - SV1 printf precision and the printf precision on other platforms. - - - * The h5dump tests may fail to match the expected output in some - platforms (e.g. SP2 parallel, Windows) where the error messages - directed to "stderr" do not appear in the "right order" with output - from stdout. This is not an error. - - * The --enable-static-exec configure flag fails to compile for HP-UX - 11.00 platforms. - - * The executables are always dynamic on IRIX64 6.5(64 and n32) and - IRIX 6.5 even if they are configured with --enable-static-exec. - - * IRIX 6.5 fails to compile if configured with --enable-static-exec. - - * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause - a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting environment variable - HDF5_MPI_OPT_TYPES to a non-zero value such as 1. - - * On IA64 systems one has to use -DIA64 compilation flag to compile - h4toh5 and h5toh4 utilites. After configuration step manually modify - Makefile in the tools/h4toh4 and tools/h5toh4 directories to add - -DIA64 to the compilation flags. - - * On IA32 ansd IA64 systems, if you use a compiler other than GCC - (such as Intel's ecc compiler), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 102 - of the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change the lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - -%%%%1.4.2%%%% Release Information for hdf5-1.4.2 (31/July/01) - -10. Release Information for hdf5-1.4.2 -================================================================= - - -INTRODUCTION - -This document describes the differences between HDF5-1.4.1 and -HDF5-1.4.2, and contains information on the platforms tested and -known problems in HDF5-1.4.2. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- Bug Fixes since HDF5-1.4.1 -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - - * File sizes greater than 2GB are now supported on Linux systems with - version 2.4.x or higher kernels. - * Added a global string variable H5_lib_vers_info_g which holds the - HDF5 library version information. This can be used to identify - an hdf5 library or hdf5 application binary. - Also added a verification of the consistency between H5_lib_vers_info_g - and other version information in the source code. - * Parallel HDF5 now runs on the HP V2500 and HP N4000 machines. - * F90 API: - - Added aditional parameter "dims" to the h5dread_f/h5dwrite_f and - h5aread_f/h5awrite_f subroutines. This parameter is a 1-D array - of size 7 and contains the sizes of the data buffer dimensions. - This change enables portability between Windows and UNIX platforms. - In previous versions of the F90 APIs, the data buffer parameters of - the above functions were declared as assumed-shape arrays, which - were passed to the C functions by a descriptor. There is no - portable means, however, of passing descriptors from F90 to C, - causing portability problems between Windows and UNIX and among - UNIX platforms. With this change, the data buffers are assumed- - size arrays, which can be portably passed to the C functions. - * F90 static library is available on Windows platforms. - See INSTALL_Windows_withF90.txt for details. - * F90 APIs are available on HPUX 11.00 and 10.20 and IBM SP platforms. - * H5 <-> GIF convertor has been added. This is available under - tools/gifconv. The convertor supports the ability to create animated - gifs as well. - * Verified correct operation of library on Solaris 2.8 in both 64-bit and - 32-bit compilation modes. See INSTALL document for instructions on - compiling the distribution with 64-bit support. - * Added support for the Metrowerks Code Warrior compiler for Windows. - * For H4->H5 converter utility, added a new option to choose not to convert - HDF4 specified attributes(reference number, class) into HDF5 attributes. - * Added support chunking and compression in SDS and image in H4->H5 converter. - Currently HDF5 only supports gzip compression, so by default an HDF4 file - with any other compression method will be converted into an HDF5 file in - gzip compression. - * correct the order or reading HDF4 image array in H4->H5 conversion. - * Added new parallel hdf5 tests in t_mpi. The new test checks if the - filesystem or the MPI-IO can really handle greater than 2GB files. - If it fails, it prints information message only without failing the - test. - * Added a parallel HDF5 example examples/ph5example.c to illustrate - the basic way of using parallel HDF5. - * Added a new public macro, H5_VERS_INFO, which is a string holding - the HDF5 library version information. This string is also compiled - into all HDF5 binary code which helps to identify the version information - of the binary code. One may use the Unix strings command on the binary - file and looks for the pattern "HDF5 library version". - * Added new checking in H5check_version() to verify the five HDF5 version - information macros (H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, - H5_VERS_SUBRELEASE and H5_VERS_INFO) are consistent. - - -Bug Fixes since HDF5-1.4.1 Release -================================== - - * Fixed bug with non-zero userblock sizes causing raw data to not - write correctly. - * Fixed problems with Pablo build and linking with non-standard MPI I/O. - * Fixed build on Linux systems with --enable-static-exec flag. It now - works correctly. - * IMPORTANT: Fixed file metadata corruption bug which could cause - metadata data loss in certain situations. - * The allocation by alignment (H5Pset_alignment) feature code somehow - got dropped in some 1.3.x version. Re-implemented it with "new and - improved" algorithm. It keeps track of "wasted" file-fragment in - the free-list too. - * Removed limitation that the data transfer buffer size needed to be - set for datasets whose dimensions were too large for the 'all' - selection code to handle. Any size dimensioned datasets should be - handled correctly now. - * Changed behavior of H5Tget_member_type to correctly emulate HDF5 v1.2.x - when --enable-hdf5v1_2 configure flag is enabled. - * Added --enable-linux-lfs flag to allow more control over whether to - enable or disable large file support on Linux. - * Fixed various bugs releated to SDS dimensional scale conversions in H4->H5 - converter. - * Fixed a bug to correctly convert HDF4 objects with fill value into HDF5. - * Fixed a bug of H5pubconf.h causing repeated definitions if it is included - more than once. hdf5.h now includes H5public.h which includes - H5pubconf.h. Applications should #include hdf5.h which handles multiple - inclusion correctly. - * Fixed H5FDmpio.h to be C++ friendly by making Parallel HDF5 API's to be - external to C++. - * Fixed a bug in H5FD_mpio_flush() that might result in negative file seek - if both MPIO and Split-file drivers are used together. - - - -Documentation -============= - - * The H5T_conv_t and H5T_cdata_t structures are now properly defined - in the H5Tregister entry in the "H5T" section of the "HDF5 Reference - Manual" and described in detail in section 12, "Data Conversions," in - the "Datatypes" chapter of the "HDF5 User's Guide." - * The new tools h52gif and gif2h5 have been added to the "Tools" section - of the Reference Manual. - * A "Freespace Management" section has been added to the "Performance" - chapter of the User's Guide. - * Several user-reported bugs have been fixed since Release 1.4.1. - * The "HDF5 Image and Palette Specification" (in the "HDF5 Application - Developer's Guide") has been heavily revised. Based on extensive user - feedback and input from visualization software developers, Version 1.2 - of the image specification is substantially different from prior - versions. - - -Platforms Tested -================ - - AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6.0 - mpcc_r 3.6.6.0 - xlf 07.01.0000.0002 - mpxlf 07.01.0000.0002 - AIX 4.3 (IBM SP RS6000) C for AIX Compiler, Version 5.0.2.0 - xlf 7.1.0.2 - poe 2.4.0.14 (includes mpi) - Cray T3E sn6711 2.0.5.49a Cray Standard C Version 6.5.0.1 - Cray SV1 10.0.0.2 Cray Standard C Version 6.5.0.1 - Cray Fortran Version 3.5.0.1 - FreeBSD 4.3 gcc 2.95.3 - g++ 2.95.3 - HP-UX B.10.20 HP C HP92453-01 A.10.32.30 - HP F90 v2.3 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - HP-UX B.11.00 SysV HP C HP92453-01 A.11.01.20 - HP F90 v2.4 - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.2m - Linux 2.4.4 gcc 2.95.3 - g++ 2.95.3 - Linux 2.2.18smp gcc 2.95.2 - gcc 2.95.2 with mpich 1.2.1 - g++ 2.95.2 - pgf90 3.2-4 - OSF1 V4.0 DEC-V5.2-040 on Digital UNIX V4.0 (Rev 564) - Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.6) WorkShop Compilers 5.0 98/10/25 FORTRAN 90 - 2.0 Patch 107356-04 - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 - Workshop Compilers 5.0 98/10/25 FORTRAN 90 - 2.0 Patch 107356-04 - SunOS 5.8/32 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - 2000/09/11 - Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 - SunOS 5.8/64 Sun WorkShop 6 update 1 C 5.2 2000/09/11 - (Solaris 2.8) Sun WorkShop 6 update 1 Fortran 95 6.1 - 2000/09/11 - Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 - TFLOPS r1.0.4 v4.0.7 i386 pgcc Rel 3.1-4i with mpich-1.2.1 with - local modifications - Windows 2000 (NT5.0) MSVC++ 6.0 - Windows NT4.0 MSVC++ 6.0 - DEC Visual Fortran 6.0 - Windows NT4.0 Code Warrior 6.0 - Windows 98 MSVC++ 6.0 - DEC Visual Fortran 6.0 - - -Supported Configuration Features Summary -======================================== - - In the tables below - y = tested and supported - n = not supported or not tested in this release - x = not working in this release - ( ) = footnote appears below second table - - - Platform C C F90 F90 C++ Shared zlib Tools - parallel parallel libraries - (5) - Solaris2.6 y n y n y y y y - Solaris2.7 y y (1) y n y y y y - Solaris2.8 64 y n n n y y y y - Solaris2.8 32 y n y n y y y y - IRIX6.5 y y (1) n n n y y y - IRIX64_6.5 64 y y (2) y y n y y y - IRIX64_6.5 32 y y (2) n n n y y y - HPUX10.20 y n y n n y y y - HPUX11.00 y n y n n y y y - HPUX11 SysV y n y n n y y y - DECOSF y n y n n y y y - T3E y y y y n n y y - SV1 y n y n n n y y - TFLOPS y y (1) n n n n y y (4) - AIX-4.3 SP2 y y y y n n y n - AIX-4.3 SP3 y y y y n n y n - Win2000 y n n n n y y y - Win98 y n y n n y y y - WinNT y n y n n y y y - WinNT CW y n n n n n y y - FreeBSD y n n n y y y y - Linux 2.2 y y (1) y n y y y y - Linux 2.4 y y (1) n n y y y y - - - Platform 1.2 static- Thread- SRB GASS STREAM- - compatibility exec safe VFD - Solaris2.6 y x n n n y - Solaris2.7 y x y n n y - Solaris2.8 64 y y n n n y - Solaris2.8 32 y x n n n y - IRIX6.5 y x y n n y - IRIX64_6.5 64 y x n n n y - IRIX64_6.5 32 y x n n n y - HPUX10.20 y y n n n y - HPUX11.00 y x n n n y - HPUX11 SysV y x n n n y - DECOSF y y n n n y - T3E y y n n n y - SV1 y y n n n y - TFLOPS y y n n n n - AIX-4.3 SP2 y y (3) n n n y - AIX-4.3 SP3 y y n n n y - Win2000 y y n n n n - Win98 n y n n n n - WinNT y y n n n n - WinNT CW n n n n n n - FreeBSD y y n n n y - Linux 2.2 y y y n n y - Linux 2.4 y y y n n y - - - Footnotes: (1) Using mpich. - (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail - in serial mode. - (4) No HDF4-related tools. - (5) Shared libraries are provided only for the C library. - - -Known Problems -============== - - * When a dataset with the variable-legth datatype is overwritten, - the library can develop memory leaks that cause the file to become - unnecessarily large. This is planned to be fixed in the next release. - - * On the SV1, the h5ls test fails due to a difference between the - SV1 printf precision and the printf precision on other platforms. - - * The h5dump tests may fail to match the expected output in some - platforms (e.g. SP2 parallel, Windows) where the error messages - directed to "stderr" do not appear in the "right order" with output - from stdout. This is not an error. - - * The --enable-static-exec configure flag fails to compile for HP-UX - 11.00 platforms. - - * The executables are always dynamic on IRIX64 6.5(64 and n32) and - IRIX 6.5 even if they are configured with --enable-static-exec. - - * IRIX 6.5 fails to compile if configured with --enable-static-exec. - - * For 24-bit image conversion from H4->H5, the current conversion is - not consistent with HDF5 image specification. - - * In some cases, and SDS with an UNLIMITED dimension that has not - been written (current size = 0) is not converted correctly. - - * After "make install" or "make install-doc" one may need to reload - the source from the tar file before doing another build. - - * The HDF5_MPI_OPT_TYPES optimization code in the parallel HDF5 will cause - a hang in some cases when chunked storage is used. This is now set to - be off by default. One may turn it on by setting environment variable - HDF5_MPI_OPT_TYPES to a non-zero value such as 1. - -%%%%1.4.1%%%% Release Information for hdf5-1.4.1 (April/01) - -9. Release Information for hdf5-1.4.1 (April/01) -===================================================================== - - - - HDF5 Release 1.4.1 - - -INTRODUCTION - -This document describes the differences between HDF5-1.4.0 and -HDF5-1.4.1, and contains information on the platforms tested and -known problems in HDF5-1.4.1. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- Bug Fixes since HDF5-1.4.0 -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - - * XML output option for h5dump utility. - - A new option --xml to output data in XML format has been added. The - XML output contains a complete description of the file, marked up in - XML. - - The XML conforms to the HDF5 Document Type Definition (DTD), which - is available at: - - http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd - - The XML output is suitable for use with other tools, including the - Java Tools: - - http://hdf.ncsa.uiuc.edu/java-hdf5-html - - -Bug Fixes since HDF5-1.4.0 Release -================================== - - * h4toh5 utility: conversion of images is fixed - - Earlier releases of the h4toh5 utility produced images that did not - correctly conform to the HDF5 Image and Palette Specification. - - http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html - - Several required HDF5 attributes are omitted, and the dataspace - is reversed (i.e., the ht. and width of the image dataset is - incorrectly described.) For more information, please see: - - http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm - - * Fixed bug with contiguous hyperslabs not being detected, causing - slower I/O than necessary. - * Fixed bug where non-aligned hyperslab I/O on chunked datasets was - causing errors during I/O - * The RCSID string in H5public.h was causing the C++ compiling problem - because when it was included multiple times, C++ did not like - multiple definitions of the same static variable. All occurance of - RCSID definition are removed since we have not used it consistently - before. - - -Documentation -============= - - PDF and Postscript versions of the following documents are available - for this release: - Document Filename - -------- -------- - Introduction to HDF5 H5-R141-Introduction.pdf - HDF5 Reference Manual H5-R141-RefManual.pdf - C++ APIs to HDF5 documents H5-R141-Cplusplus.pdf - Fortran90 APIs to HDF5 documents H5-R141-Fortran90.pdf - - PDF and Postscript files containing H5-R141-DocSet.pdf - all of the above H5-R141-DocSet.ps - - These files are not included in this distribution, but are available - via the Web or FTP at the following locations: - http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/ - ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/docs/ - - While these documents are labeled Release 1.4.1, they describe - Release 1.4.0 as well. - - -Platforms Tested -================ - -Due to the nature of this release only C, C++ libraries and tools were tested. - - AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6 - mpcc_r 3.6.6 - Cray T3E sn6711 2.0.5.47 Cray Standard C Version 6.5.0.0 - Cray SV1 10.0.0.8 Cray Standard C Version 6.5.0.0 - FreeBSD 4.3 gcc 2.95.2 - HP-UX B.10.20 HP C HP92453-01 A.10.32.30 - HP-UX B.11.00 HP C HP92453-01 A.11.01.20 - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - Linux 2.2.18smp gcc-2.95.2 - g++ 2.95.2 - OSF1 V4.0 DEC-V5.2-040 - Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.6) - - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) Workshop Compilers 5.0 98/12/15 C++ 5.0 - TFLOPS r1.0.4 v4.0 mpich-1.2.1 with local changes - Windows NT4.0, 2000 (NT5.0) MSVC++ 6.0 - Windows 98 MSVC++ 6.0 - - -Supported Configuration Features Summary -======================================== - - * See "Supported Configuration Features Summary" section for the HDF5 - 1.4.0 release in the HISTORY.txt file. - -Known Problems -============== - - * The h5dump tests may fail to match the expected output in some - platforms (e.g. SP2 parallel, Windows) where the error messages - directed to "stderr" do not appear in the "right order" with output - from stdout. This is not an error. - - * The --enable-static-exec configure flag fails to compile for HP-UX - 11.00 platforms. - - * The executable are always dynamic on IRIX64 6.5(64 and n32) and - IRIX 6.5 even if they are configured with --enable-static-exec. - - * The shared library failed compilation on IRIX 6.5. - - * After "make install" or "make install-doc" one may need to reload the source - from the tar file before doing another build. - - * See "Known problems" section for the HDF5 1.4.0 release in the - HISTORY.txt file. - -%%%%1.4.0%%%% Release Information for hdf5-1.4.0 (2/22/01) - -8. Release Information for hdf5-1.4.0 -=================================================================== - - HDF5 Release 1.4.0 - - -INTRODUCTION - -This document describes the differences between HDF5-1.2.0 and -HDF5-1.4.0, and contains information on the platforms tested and -known problems in HDF5-1.4.0. For more details check the HISTORY.txt -file in the HDF5 source. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- New Features -- h4toh5 Utility -- F90 Support -- C++ Support -- Pablo Support -- Bug Fixes since HDF5-1.2.0 -- Bug Fixes since HDF5-1.4.0-beta2 -- Bug Fixes since HDF5-1.4.0 -- Documentation -- Platforms Tested -- Supported Configuration Features -- Known Problems - - -New Features -============ - * The Virtual File Layer, VFL, was added to replace the old file - drivers. It also provides an API for user defined file drivers. - * New features added to snapshots. Use 'snapshot help' to see a - complete list of features. - * Improved configure to detect if MPIO routines are available when - parallel mode is requested. - * Added Thread-Safe support. Phase I implemented. See: - - http://hdf.ncsa.uiuc.edu/HDF5/papers/mthdf/MTHDFpaper.htm - - for more details. - * Added data sieve buffering to raw data I/O path. This is enabled - for all VFL drivers except the mpio & core drivers. Setting the - sieve buffer size is controlled with the new API function, - H5Pset_sieve_buf_size(), and retrieved with H5Pget_sieve_buf_size(). - * Added new Virtual File Driver, Stream VFD, to send/receive entire - HDF5 files via socket connections. - * As parts of VFL, HDF-GASS and HDF-SRB are also added to this - release. To find out details, please read INSTALL_VFL file. - * Increased maximum number of dimensions for a dataset (H5S_MAX_RANK) - from 31 to 32 to align with HDF4 & netCDF. - * Added 'query' function to VFL drivers. Also added 'type' parameter to - VFL 'read' & 'write' calls, so they are aware of the type of data - being accessed in the file. Updated the VFL document also. - * A new h4toh5 utility, to convert HDF4 files to analogous HDF5 files. - * Added a new array datatype to the datatypes which can be created. - Removed "array fields" from compound datatypes (use an array datatype - instead). - * Parallel HDF5 works correctly with mpich-1.2.1 on Solaris, SGI, Linux. - * You can now install the HDF5 documentation using the - ``make install-doc'' command. The documentation is installed in the - $(prefix)/doc directory where $(prefix) is the prefix specified by - the (optional) ``--prefix'' flag during configuration. - * HDF5 can operate correctly in the OpenMP environment in a limited way. - Check doc/html/TechNotes/openmp-hdf5.html for details. - - -h4toh5 Utility -============== - The h4toh5 utility is a new utility that converts an HDF4 file to an - HDF5 file. For details, see the document, "Mapping HDF4 Objects to - HDF5 Objects": - http://hdf.ncsa.uiuc.edu/HDF5/papers/H4-H5MappingGuidelines.pdf - - Known Bugs: - - The h4toh5 utility produces images that do not correctly conform - to the HDF5 Image and Palette Specification. - - http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html - - Several required HDF5 attributes are omitted, and the dataspace - is reversed (i.e., the ht. and width of the image dataset is - incorrectly described.) For more information, please see: - - http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.html - - This bug has been fixed for the snapshot of hdf5 1.4 release. March 12th,2001 - - Known Limitations of the h4toh5 release - --------------------------------------------- - - 1. Error handlings - - h4toh5 utility will print out an error message when an error occurs. - - 2. String Datatype - - HDF4 has no 'string' type. String valued data are usually defined as - an array of 'char' in HDF4. The h4toh5 utility will generally map - these to HDF5 'String' types rather than array of char, with the - following additional rules: - - * For the data of an HDF4 SDS, image, and palette, if the data is - declared 'DFNT_CHAR8' it will be assumed to be integer and will - be an H5T_INTEGER type. - * For attributes of any HDF4 object, data of type 'DFNT_CHAR8' - will be converted to an HDF5 'H5T_STRING' type. - * For an HDF4 Vdata, it is difficult to determine whether data - of type 'DFNT_CHAR8' is intended to be bytes or characters. The - h4toh5 utility will consider them to be C characters, and will - convert them to an HDF5 'H5T_STRING' type. - - - 3. Compression, Chunking and External Storage - - Chunking is supported, but compression and external storage is not. - - An HDF4 object that uses chunking will be converted to an HDF5 file - with analogous chunked storage. - - An HDF4 object that uses compression will be converted to an - uncompressed HDF5 object. - - An HDF4 object that uses external storage will be converted to an - HDF5 object without external storage. - - 4. Memory Use - - This version of the h4toh5 utility copies data from HDF4 objects - in a single read followed by a single write to the HDF5 object. For - large objects, this requires a very large amount of memory, which may - be extremely slow or fail on some platforms. - - Note that a dataset that has only been partly written will - be read completely, including uninitialized data, and all the - data will be written to the HDF5 object. - - 5. Platforms - - The h4toh5 utility requires HDF5-1.4.0 and HDF4r1.4 - - h4toh5 utility has been tested on all platforms listed below (see - section "Platforms Tested") except TFLOPS. - - -F90 Support -=========== - This is the first release of the HDF5 Library with fully integrated - F90 API support. The Fortran Library is created when the - --enable-fortran flag is specified during configuration. - - Not all F90 subroutines are implemented. Please refer to the HDF5 - Reference Manual for more details. - - F90 APIs are available for the Solaris 2.6 and 2.7, Linux, DEC UNIX, - T3E, SV1 and O2K (64 bit option only) platforms. The Parallel version of - the HDF5 F90 Library is supported on the O2K and T3E platforms. - - Changes since the last prototype release (July 2000) - ---------------------------------------------------- - * h5open_f and h5close_f must be called instead of h5init_types and - h5close_types. - - * The following subroutines are no longer available: - - h5pset_xfer_f - h5pget_xfer_f - h5pset_mpi_f - h5pget_mpi_f - h5pset_stdio_f - h5pget_stdio_f - h5pset_sec2_f - h5pget_sec2_f - h5pset_core_f - h5pget_core_f - h5pset_family_f - h5pget_family_f - - * The following functions have been added: - - h5pset_fapl_mpio_f - h5pget_fapl_mpio_f - h5pset_dxpl_mpio_f - h5pget_dxpl_mpio_f - - * In the previous HDF5 F90 releases, the implementation of object - references and dataset region references was not portable. This - release introduces a portable implementation, but it also introduces - changes to the read/write APIs that handle references. If object or - dataset region references are written or read to/from an HDF5 file, - h5dwrite_f and h5dread_f must use the extra parameter, n, for the - buffer size: - - h5dwrite(read)_f(dset_id, mem_type_id, buf, n, hdferr, & - ^^^ - mem_space_id, file_space_id, xfer_prp) - - For other datatypes the APIs were not changed. - - -C++ Support -=========== - This is the first release of the HDF5 Library with fully integrated - C++ API support. The HDF5 C++ library is built when the --enable-cxx - flag is specified during configuration. - - Check the HDF5 Reference Manual for available C++ documentation. - - C++ APIs are available for Solaris 2.6 and 2.7, Linux, and FreeBSD. - - -Pablo Support -============= - This version does not allow proper building of the Pablo-instrumented - version of the library. A version supporting the pablo build is - available on the Pablo Website at - www-pablo.cs.uiuc.edu/pub/Pablo.Release.5/HDFLibrary/hdf5_v1.4.tar.gz - - -Bug Fixes since HDF5-1.2.0 -========================== - -Library -------- - * The function H5Pset_mpi is renamed as H5Pset_fapl_mpio. - * Corrected a floating point number conversion error for the Cray J90 - platform. The error did not convert the value 0.0 correctly. - * Error was fixed which was not allowing dataset region references to - have their regions retrieved correctly. - * Corrected a bug that caused non-parallel file drivers to fail in - the parallel version. - * Added internal free-lists to reduce memory required by the library - and H5garbage_collect API function - * Fixed error in H5Giterate which was not updating the "index" - parameter correctly. - * Fixed error in hyperslab iteration which was not walking through the - correct sequence of array elements if hyperslabs were staggered in a - certain pattern - * Fixed several other problems in hyperslab iteration code. - * Fixed another H5Giterate bug which was causes groups with large - numbers of objects in them to misbehave when the callback function - returned non-zero values. - * Changed return type of H5Aiterate and H5A_operator_t typedef to be - herr_t, to align them with the dataset and group iterator functions. - * Changed H5Screate_simple and H5Sset_extent_simple to not allow - dimensions of size 0 with out the same dimension being unlimited. - * QAK - 4/19/00 - Improved metadata hashing & caching algorithms to - avoid many hash flushes and also remove some redundant I/O when - moving metadata blocks in the file. - * The "struct(opt)" type conversion function which gets invoked for - certain compound datatype conversions was fixed for nested compound - types. This required a small change in the datatype conversion - function API. - * Re-wrote lots of the hyperslab code to speed it up quite a bit. - * Added bounded garbage collection for the free lists when they run - out of memory and also added H5set_free_list_limits API call to - allow users to put an upper limit on the amount of memory used for - free lists. - * Checked for non-existent or deleted objects when dereferencing one - with object or region references and disallow dereference. - * "Time" datatypes (H5T_UNIX_D*) were not being stored and retrieved - from object headers correctly, fixed now. - * Fixed H5Dread or H5Dwrite calls with H5FD_MPIO_COLLECTIVE requests - that may hang because not all processes are transfer the same amount - of data. (A.K.A. prematured collective return when zero amount data - requested.) Collective calls that may cause hanging is done via the - corresponding MPI-IO independent calls. - * If configure with --enable-debug=all, couple functions would issue - warning messages to "stderr" that the operation is expensive time-wise. - This messed up applications (like testings) that did not expect the - extra output. It is changed so that the warning will be printed only - if the corresponding Debug key is set. - -Configuration -------------- - * The hdf5.h include file was fixed to allow the HDF5 Library to be - compiled with other libraries/applications that use GNU autoconf. - * Configuration for parallel HDF5 was improved. Configure now attempts - to link with libmpi.a and/or libmpio.a as the MPI libraries by - default. It also uses "mpirun" to launch MPI tests by default. It - tests to link MPIO routines during the configuration stage, rather - than failing later as before. One can just do "./configure - --enable-parallel" if the MPI library is in the system library. - * Added support for pthread library and thread-safe option. - * The libhdf5.settings file shows the correct machine byte-sex. - * Added option "--enable-stream-vfd" to configure w/o the Stream VFD. - For Solaris, added -lsocket to the LIBS list of libraries. - -Tools ------ - * h5dump now accepts both short and long command-line parameters: - -h, --help Print a usage message and exit - -B, --bootblock Print the content of the boot block - -H, --header Print the header only; no data is displayed - -i, --object-ids Print the object ids - -V, --version Print version number and exit - -a P, --attribute=P Print the specified attribute - -d P, --dataset=P Print the specified dataset - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -t T, --datatype=T Print the specified named data type - -w #, --width=# Set the number of columns - - P - is the full path from the root group to the object. - T - is the name of the data type. - F - is a filename. - # - is an integer greater than 1. - * A change from the old way command line parameters were interpreted - is that multiple attributes, datasets, groups, soft-links, and - object-ids cannot be specified with just one flag but you have to - use a flag with each object. I.e., instead of doing this: - - h5dump -a /attr1 /attr2 foo.h5 - - do this: - - h5dump -a /attr1 -a /attr2 foo.h5 - - The cases are similar for the other object types. - * h5dump correctly displays compound datatypes. - * Corrected an error in h5toh4 which did not convert the 32bits - int from HDF5 to HDF4 correctly for the T3E platform. - * h5dump correctly displays the committed copy of predefined types - correctly. - * Added an option, -V, to show the version information of h5dump. - * Fixed a core dumping bug of h5toh4 when executed on platforms like - TFLOPS. - * The test script for h5toh4 used to not able to detect the hdp - dumper command was not valid. It now detects and reports the - failure of hdp execution. - * Merged the tools with the 1.2.2 branch. Required adding new - macros, VERSION12 and VERSION13, used in conditional compilation. - Updated the Windows project files for the tools. - * h5dump displays opaque and bitfield data correctly. - * h5dump and h5ls can browse files created with the Stream VFD - (eg. "h5ls :"). - * h5dump has a new feature "-o " which outputs the raw data - of the dataset into ascii text file . - * h5toh4 used to converts hdf5 strings type to hdf4 DFNT_INT8 type. - Corrected to produce hdf4 DFNT_CHAR type instead. - * h5dump and h5ls displays array data correctly. - - -Bug Fixes since HDF5-1.4.0-beta2 -================================ - * Fixed a bug in the conversion from a little endian double to a big - endian float in some special cases. - * Corrected configuration error which was not including compression - support correctly. - * Cleaned up lots of warnings. - * Changed a few h5dump command line switches and added long versions of - the switches. - * Changed parameters for H5Tconvert, H5Pset_bufer and H5Pget_buffer from - size_t to hsize_t - * Fixed fairly obscure bug in hyperslab I/O which could (in rare cases) - not copy all the data during a transfer. - * Removed ragged array code from library. - * F90 library and module files are installed properly now on all supported - platforms. - - -Bug Fixes since HDF5-1.4.0 Release -================================== - - * Fixed bug with contiguous hyperslabs not being detected, causing - slower I/O than necessary. - * Fixed bug where non-aligned hyperslab I/O on chunked datasets was - causing errors during I/O - * Implemented XML support in h5dump. - - -Documentation -============= - * A new document summarizing the changes in the library leading up to - the current release has been added: - HDF5 Software Changes from Release to Release - This document is in the Application Developer's Guide and is of - particular interest to developers who must keep an application - synchronized with the library. - * The documentation for the Fortran90 and C++ APIs is linked to the - opening page of the Reference Manual. Fortran90 functions are - individually referenced from the corresponding C functions through- - out the Reference Manual. - * User's Guide and Reference Manual were updated to reflect changed - function syntax and to fix reported bugs. - * Functions that are new at this release were added to the Reference - Manual. - * Functions that have been removed from the library were removed from - the User's Guide and the Reference Manual. - * PostScript and PDF versions of the Release 1.4 document set are - not available at the time of Release 1.4.0. - - -Platforms Tested -================ - AIX 4.3.3.0 (IBM SP powerpc) xlc 3.6.6 - mpcc_r 3.6.6 - Cray T3E sn6711 2.0.5.45 Cray Standard C Version 6.4.0.0 - Cray Fortran Version 3.4.0.2 - Cray SV1 sn9605 10.0.0.7 Cray Standard C Version 6.4.0.0 - Cray Fortran Version 3.4.0.2 - FreeBSD 4.2 gcc 2.95.2 - g++ 2.95.2 - HP-UX B.10.20 HP C HP92453-01 A.10.32.30 - HP-UX B.11.00 HP C HP92453-01 A.11.00.13 - IRIX 6.5 MIPSpro cc 7.30 - mpich-1.2.1 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - mpt.1.4.0.2 - mpich-1.2.1 - Linux 2.2.16-3smp gcc-2.95.2 - g++ 2.95.2 - pgf90 3.1-3 - mpich-1.2.1 - OSF1 V4.0 DEC-V5.2-040 - Digital Fortran 90 V4.1-270 - SunOS 5.6 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.6) WorkShop Compilers 5.0 99/10/25 Fortran 90 - 2.0 Patch 107356-04 - Workshop Compilers 5.0 98/12/15 C++ 5.0 - SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 - (Solaris 2.7) WorkShop Compilers 5.0 99/10/25 Fortran 90 - 2.0 Patch 107356-04 - Workshop Compilers 5.0 98/12/15 C++ 5.0 - mpich-1.2.1 - SunOS 5.5.1 gcc-2.7.2 - (Solaris 2.5.1 (x86)) - TFLOPS r1.0.4 v4.0 mpich-1.2.1 with local changes - Windows NT4.0, 2000 (NT5.0) MSVC++ 6.0 - Windows 98 MSVC++ 6.0 - - -Supported Configuration Features Summary -======================================== - In the tables below - y = tested and supported - n = not supported or not working in this release - ( ) = footnote appears below table - - Platform C C F90 F90 C++ Shared zlib Tools - parallel parallel libraries - Solaris2.6 y n y n y y y y - Solaris2.7 y y (1) y n y y y y - Solarisx86 y n n n n y y y - IRIX6.5 y y (1) n n n n y y - IRIX64_6.5 64 y y (2) y y n y y y - IRIX64_6.5 32 y y (2) n n n y y y - HPUX10.20 y n n n n y y y - DECOSF y n y n n y y y - T3E y y y y n n y y - SV1 y n y n n n y y - TFLOPS y y (1) n n n n y y (4) - AIX-4.3 y y n n n n y n - Win2000 y n n n n y y y - Win98 y n n n n y y y - WinNT y n n n n y y y - FreeBSD y n n n y y y y - Linux y y (1) y n y y y y - - - Platform 1.2 static- Thread- SRB GASS STREAM- - compatibility exec safe VFD - Solaris2.6 y n n n n y - Solaris2.7 y n y n n y - Solarisx86 y n n n n y - IRIX6.5 y n y n n y - IRIX64_6.5 64 y n n n n y - IRIX64_6.5 32 y n n n n y - HPUX10.20 y y n n n y - DECOSF y y n n n y - T3E y y n n n y - SV1 y y n n n y - TFLOPS y y n n n n - AIX-4.3 y y (3) n n n y - Win2000 y y n n n n - Win98 y y n n n n - WinNT y y n n n n - FreeBSD y y n n n y - Linux y n y n n y - - Footnotes: (1) Using mpich. - (2) Using mpt and mpich. - (3) When configured with static-exec enabled, tests fail - in serial mode. - (4) No HDF4-related tools. - - -Known Problems -============== - * The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - - * The --enable-static-exec configure flag fails to compile for Solaris - platforms. This is due to the fact that not all of the system - libraries on Solaris are available in a static format. - - The --enable-static-exec configure flag also fails to correctly compile - on Linux platforms using the gcc-2.95.2 compiler. - - The --enable-static-exec configure flag also fails to correctly compile - on IBM SP2 platform for the serial mode. The parallel mode works fine - with this option. - - The compilation fails if configured with --enable-static-exec on IRIX 6.5. - - The executable files in hdf5/bin are dynamic-linked for IRIX64 6.5(64 and - n32 modes) and IRIX 6.5, even though they are compiled with static library. - - It is suggested that you don't use this option on these platforms - during configuration. - - * testhdf5 got bus error with configuration options --prefix and --with-hdf4 - on IRIX 6.5. - - * With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - - * SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will - fail if library is compiled using optimization of any level. - - * When building hdf5 tools and applications on windows platform, a linking - warning: defaultlib "LIBC" conflicts with use of other libs will appear - on debug version when running VC++6.0. This warning doesn't affect building - and testing hdf5 applications. We will continue investigating this. - - * h5toh4 converter fails two cases(tstr.h5 and tmany.h5) for release dll - version on windows 2000 and NT. The reason is possibly due to Windows NT - DLL convention on freeing memory. It seems that memory cannot be freed - across library or DLL. It is still under investigation. - - * HDF-GASS testings and testhdf5 in the test directory will get bus error if - the configured with --with-gass. - - * HDF-SRB testing got segmentation error on Solaris 2.7. - - * The Stream VFD was not tested yet under Windows. - It is not supported in the TFLOPS machine. - - * Shared library option is broken for IBM SP and some Origin 2000 platforms. - One needs to run ./configure with '--disable-shared --enable-static'. - - * The ./dsets tests failed in the TFLOPS machine if the test program, - dsets.c, is compiled with the -O option. The hdf5 library still works - correctly with the -O option. The test program works fine if it is - compiled with -O1 or -O0. Only -O (same as -O2) causes the test - program to fail. - - * Certain platforms give false negatives when testing h5ls: - - Solaris x86 2.5.1, Cray T3E and Cray J90 give errors during testing - when displaying object references in certain files. These are benign - differences due to the difference in sizes of the objects created on - those platforms. h5ls appears to be dumping object references - correctly. - - Cray J90 give errors during testing when displaying - some floating-point values. These are benign differences due to the - different precision in the values displayed and h5ls appears to be - dumping floating-point numbers correctly. - - * Before building HDF5 F90 Library from source on Crays (T3E and SV1) - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files from - the ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/hdf5-1.4.0/src/crayf90/ directory. - - * The h4toh5 utility produces images that do not correctly conform - to the HDF5 Image and Palette Specification. - - http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html - - Several required HDF5 attributes are omitted, and the dataspace - is reversed (i.e., the ht. and width of the image dataset is - incorrectly described.) For more information, please see: - - http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageDetails.htm - -%%%%1.2.2%%%% Release Information for hdf5-1.2.2 (6/23/00) - -7. Release Information for hdf5-1.2.2 -================================================================= -INTRODUCTION - -This document describes the differences between HDF5-1.2.1 and -HDF5-1.2.2, and contains information on the platforms where HDF5-1.2.2 -was tested and known problems in HDF5-1.2.2. - -The HDF5 documentation can be found on the NCSA ftp server -(ftp.ncsa.uiuc.edu) in the directory: - - /HDF/HDF5/docs/ - -For more information look at the HDF5 home page at: - - http://hdf.ncsa.uiuc.edu/HDF5/ - -If you have any questions or comments, please send them to: - - hdfhelp@ncsa.uiuc.edu - - -CONTENTS - -- Features Added since HDF5-1.2.1 -- Bug Fixes since HDF5-1.2.1 -- Known Problems -- Platforms Tested - - -Features Added since HDF5-1.2.1 -=============================== - * Added internal free-lists to reduce memory required by the library and - H5garbage_collect API function. - * h5dump displays opaque and bitfield types. - * New features added to snapshots. Use 'snapshot help' to see a - complete list of features. - * Improved configure to detect if MPIO routines are available when - parallel mode is requested. - -Bug Fixes since HDF5-1.2.1 -========================== - * h5dump correctly displays compound datatypes, including simple and - nested compound types. - * h5dump correctly displays the committed copy of predefined types. - * Corrected an error in h5toh4 which did not convert the 32-bit - int from HDF5 to HDF4 correctly for the T3E platform. - * Corrected a floating point number conversion error for the - Cray J90 platform. The error did not convert the value 0.0 - correctly. - * Fixed error in H5Giterate which was not updating the "index" parameter - correctly. - * Fixed error in hyperslab iteration which was not walking through the - correct sequence of array elements if hyperslabs were staggered in a - certain pattern. - * Fixed several other problems in hyperslab iteration code. - * Fixed another H5Giterate bug which caused groups with large numbers - of objects in them to misbehave when the callback function returned - non-zero values. - * Changed return type of H5Aiterate and H5A_operator_t typedef to be - herr_t, to align them with the dataset and group iterator functions. - * Changed H5Screate_simple and H5Sset_extent_simple to not allow dimensions - of size 0 without the same dimension being unlimited. - * Improved metadata hashing & caching algorithms to avoid - many hash flushes and also removed some redundant I/O when moving metadata - blocks in the file. - * The libhdf5.settings file shows the correct machine byte-sex. - * The "struct(opt)" type conversion function which gets invoked for - certain compound datatype conversions was fixed for nested compound - types. This required a small change in the datatype conversion - function API. - -Known Problems -============== - -o SunOS 5.6 with C WorkShop Compilers 4.2: hyperslab selections will - fail if library is compiled using optimization of any level. -o TFLOPS: dsets test fails if compiled with optimization turned on. -o J90: tools fail to dispay data for the datasets with a compound datatype. - -Platforms Tested -================ - - AIX 4.3.3 (IBM SP) 3.6.6 | binaries - mpicc using mpich 1.1.2 | are not - mpicc_r using IBM MPI-IO prototype | available - AIX 4.3.2.0 (IBM SP) xlc 5.0.1.0 - Cray J90 10.0.0.7 cc 6.3.0.2 - Cray T3E 2.0.5.29 cc 6.3.0.2 - mpt.1.3 - FreeBSD 4.0 gcc 2.95.2 - HP-UX B.10.20 HP C HP92453-01 A.10.32 - HP-UX B.11.00 HP92453-01 A.11.00.13 HP C Compiler - (static library only, h5toh4 tool is not available) - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - mpt.1.4 - - Linux 2.2.10 SMP gcc 2.95.1 - mpicc(gcc-2.95.1) - gcc (egcs-2.91.66) - mpicc (egcs-2.91.66) - Linux 2.2.16 (RedHat 6.2) gcc 2.95.2 - - OSF1 V4.0 DEC-V5.2-040 - SunOS 5.6 cc WorkShop Compilers 5.0 no optimization - SunOS 5.7 cc WorkShop Compilers 5.0 - SolarisX86 SunOS 5.5.1 gcc version 2.7.2 with --disable-hsizet - TFLOPS 3.2.1 pgcc Rel 3.1-3i - mpich-1.1.2 with local changes - Windows NT4.0 sp5 MSVC++ 6.0 - Windows 98 MSVC++ 6.0 - Windows 2000 MSVC++ 6.0 - - - -%%%%1.2.1%%%% Release Information for hdf5-1.2.1 - -6. Release Information for hdf5-1.2.1 -================================================================ - - -Bug fixes since HDF5-1.2.0 -========================== - -Configuration -------------- - - * The hdf5.h include file was fixed to allow the HDF5 Library to be compiled - with other libraries/applications that use GNU autoconf. - * Configuration for parallel HDF5 was improved. Configure now attempts to - link with libmpi.a and/or libmpio.a as the MPI libraries by default. - It also uses "mpirun" to launch MPI tests by default. It tests to - link MPIO routines during the configuration stage, rather than failing - later as before. One can just do "./configure --enable-parallel" - if the MPI library is in the system library. - -Library -------- - - * Error was fixed which was not allowing dataset region references to have - their regions retrieved correctly. - * Added internal free-lists to reduce memory required by the library and - H5garbage_collect API function - * Fixed error in H5Giterate which was not updating the "index" parameter - correctly. - * Fixed error in hyperslab iteration which was not walking through the - correct sequence of array elements if hyperslabs were staggered in a - certain pattern - * Fixed several other problems in hyperslab iteration code. - -Tests ------- - - * Added additional tests for group and attribute iteration. - * Added additional test for staggered hyperslab iteration. - * Added additional test for random 5-D hyperslab selection. - -Tools ------- - - * Added an option, -V, to show the version information of h5dump. - * Fixed a core dumping bug of h5toh4 when executed on platforms like - TFLOPS. - * The test script for h5toh4 used to not able to detect the hdp - dumper command was not valid. It now detects and reports the - failure of hdp execution. - -Documentation -------------- - - * User's Guide and Reference Manual were updated. - See doc/html/PSandPDF/index.html for more details. - - -Platforms Tested: -================ -Note: Due to the nature of bug fixes, only static versions of the library and tools were tested. - - - AIX 4.3.2 (IBM SP) 3.6.6 - Cray T3E 2.0.4.81 cc 6.3.0.1 - mpt.1.3 - FreeBSD 3.3-STABLE gcc 2.95.2 - HP-UX B.10.20 HP C HP92453-01 A.10.32 - IRIX 6.5 MIPSpro cc 7.30 - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - mpt.1.3 (SGI MPI 3.2.0.0) - - Linux 2.2.10 SuSE egcs-2.91.66 configured with - (i686-pc-linux-gnu) --disable-hsizet - mpich-1.2.0 egcs-2.91.66 19990314/Linux - - OSF1 V4.0 DEC-V5.2-040 - SunOS 5.6 cc WorkShop Compilers 4.2 no optimization - SunOS 5.7 cc WorkShop Compilers 5.0 - TFLOPS 2.8 cicc (pgcc Rel 3.0-5i) - mpich-1.1.2 with local changes - Windows NT4.0 sp5 MSVC++ 6.0 - -Known Problems: -============== - -o SunOS 5.6 with C WorkShop Compilers 4.2: Hyperslab selections will - fail if library is compiled using optimization of any level. - - - -%%%%1.2.0%%%% Release Information for hdf5-1.2.0 - -5. Release Information for hdf5-1.2.0 -=================================================================== - -A. Platforms Supported - ------------------- - -Operating systems listed below with compiler information and MPI library, if -applicable, are systems that HDF5 1.2.0 was tested on. - - Compiler & libraries - Platform Information Comment - -------- ---------- -------- - - AIX 4.3.2 (IBM SP) 3.6.6 - - Cray J90 10.0.0.6 cc 6.3.0.0 - - Cray T3E 2.0.4.61 cc 6.2.1.0 - mpt.1.3 - - FreeBSD 3.2 gcc 2.95.1 - - HP-UX B.10.20 HP C HP92453-01 A.10.32 - gcc 2.8.1 - - IRIX 6.5 MIPSpro cc 7.30 - - IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - mpt.1.3 (SGI MPI 3.2.0.0) - - Linux 2.2.10 egcs-2.91.66 configured with - --disable-hsizet - lbraries: glibc2 - - OSF1 V4.0 DEC-V5.2-040 - - SunOS 5.6 cc WorkShop Compilers 4.2 - no optimization - gcc 2.8.1 - - SunOS 5.7 cc WorkShop Compilers 5.0 - gcc 2.8.1 - - TFLOPS 2.7.1 cicc (pgcc Rel 3.0-4i) - mpich-1.1.2 with local changes - - Windows NT4.0 intel MSVC++ 5.0 and 6.0 - - Windows NT alpha 4.0 MSVC++ 5.0 - - Windows 98 MSVC++ 5.0 - - -B. Known Problems - -------------- - -* NT alpha 4.0 - Dumper utiliy h5dump fails if linked with DLL. - -* SunOS 5.6 with C WorkShop Compilers 4.2 - Hyperslab selections will fail if library is compiled using optimization - of any level. - - -C. Changes Since Version 1.0.1 - --------------------------- - -1. Documentation - ------------- - -* More examples - -* Updated user guide, reference manual, and format specification. - -* Self-contained documentation for installations isolated from the - Internet. - -* HDF5 Tutorial was added to the documentation - -2. Configuration - ------------- - -* Better detection and support for MPI-IO. - -* Recognition of compilers with known code generation problems. - -* Support for various compilers on a single architecture (e.g., the - native compiler and the GNU compilers). - -* Ability to build from read-only media and with different compilers - and/or options concurrently. - -* Added a libhdf5.settings file which summarizes the configuration - information and is installed along with the library. - -* Builds a shared library on most systems that support it. - -* Support for Cray T3E, J90 and Windows/NT. - -3. Debugging - --------- - -* Improved control and redirection of debugging and tracing messages. - -4. Datatypes - --------- - -* Optimizations to compound datatype conversions and I/O operations. - -* Added nearly 100 optimized conversion functions for native datatypes - including support for non-aligned data. - -* Added support for bitfield, opaque, and enumeration types. - -* Added distinctions between signed and unsigned char types to the - list of predefined native hdf5 datatypes. - -* Added HDF5 type definitions for C9x types like int32_t. - -* Application-defined type conversion functions can handle non-packed - data. - -* Changed the H5Tunregister() function to use wildcards when matching - conversion functions. H5Tregister_hard() and H5Tregister_soft() - were combined into H5Tregister(). - -* Support for variable-length datatypes (arrays of varying length per - dataset element). Variable length strings currently supported only - as variable length arrays of 1-byte integers. - -5. Dataspaces - ---------- - -* New query functions for selections. - -* I/O operations bypass the stripmining loop and go directly to - storage for certain contiguous selections in the absense of type - conversions. In other cases the stripmining buffers are used more - effectively. - -* Reduced the number of I/O requests under certain circumstances, - improving performance on systems with high I/O latency. - -6. Persistent Pointers - ------------------- - -* Object (serial and parallel) and dataset region (serial only) - references are implemented. - -7. Parallel Support - ---------------- - -* Improved parallel I/O performance. - -* Supported new platforms: Cray T3E, Linux, DEC Cluster. - -* Use vendor supported version of MPIO on SGI O2K and Cray platforms. - -* Improved the algorithm that translates an HDF5 hyperslab selection - into an MPI type for better collective I/O performance. - -8. New API functions - ----------------- - - a. Property List Interface: - ------------------------ - - H5Pset_xfer - set data transfer properties - H5Pset_preserve - set dataset transfer property list status - H5Pget_preserve - get dataset transfer property list status - H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O - H5Pget_hyper_cache - returns information regarding the caching of - hyperslab blocks during I/O - H5Pget_btree_ratios - sets B-tree split ratios for a dataset - transfer property list - H5Pset_btree_ratios - gets B-tree split ratios for a dataset - transfer property list - H5Pset_vlen_mem_manager - sets the memory manager for variable-length - datatype allocation - H5Pget_vlen_mem_manager - sets the memory manager for variable-length - datatype allocation - - b. Dataset Interface: - ------------------ - - H5Diterate - iterate over all selected elements in a dataspace - H5Dget_storage_size - return the amount of storage required for a dataset - H5Dvlen_reclaim - reclaim VL datatype memory buffers - - c. Dataspace Interface: - -------------------- - H5Sget_select_hyper_nblocks - get number of hyperslab blocks - H5Sget_select_hyper_blocklist - get the list of hyperslab blocks - currently selected - H5Sget_select_elem_npoints - get the number of element points - in the current selection - H5Sget_select_elem_pointlist - get the list of element points - currently selected - H5Sget_select_bounds - gets the bounding box containing - the current selection - - d. Datatype Interface: - ------------------- - H5Tget_super - return the base datatype from which a - datatype is derived - H5Tvlen_create - creates a new variable-length dataype - H5Tenum_create - creates a new enumeration datatype - H5Tenum_insert - inserts a new enumeration datatype member - H5Tenum_nameof - returns the symbol name corresponding to a - specified member of an enumeration datatype - H5Tvalueof - return the value corresponding to a - specified member of an enumeration datatype - H5Tget_member_value - return the value of an enumeration datatype member - H5Tset_tag - tags an opaque datatype - H5Tget_tag - gets the tag associated with an opaque datatype - - e. Identifier Interface: - --------------------- - H5Iget_type - retrieve the type of an object - - f. Reference Interface: - -------------------- - H5Rcreate - creates a reference - H5Rdereference - open the HDF5 object referenced - H5Rget_region - retrieve a dataspace with the specified region selected - H5Rget_object_type - retrieve the type of object that an - object reference points to - - g. Ragged Arrays (alpha) (names of those API functions were changed): - ------------------------------------------------------------------ - H5RAcreate - create a new ragged array (old name was H5Rcreate) - H5RAopen - open an existing array (old name was H5Ropen) - H5RAclose - close a ragged array (old name was H5Rclose) - H5RAwrite - write to an array (old name was H5Rwrite) - H5RAread - read from an array (old name was H5Rread) - - -9. Tools - ----- - -* Enhancements to the h5ls tool including the ability to list objects - from more than one file, to display raw hexadecimal data, to - show file addresses for raw data, to format output more reasonably, - to show object attributes, and to perform a recursive listing, - -* Enhancements to h5dump: support new data types added since previous - versions. - -* h5toh4: An hdf5 to hdf4 converter. - - - -%%%%1.0.1%%%% Release Information for hdf5-1.0.1 - -4. Changes from Release 1.0.0 to Release 1.0.1 -===================================================================== - -* [Improvement]: configure sets up the Makefile in the parallel tests - suit (testpar/) correctly. - -* [Bug-Fix]: Configure failed for all IRIX versions other than 6.3. - It now configures correctly for all IRIX 6.x version. - -* Released Parallel HDF5 - - Supported Features: - ------------------ - - HDF5 files are accessed according to the communicator and INFO - object defined in the property list set by H5Pset_mpi. - - Independent read and write accesses to fixed and extendable dimension - datasets. - - Collective read and write accesses to fixed dimension datasets. - - Supported Platforms: - ------------------- - - Intel Red - IBM SP2 - SGI Origin 2000 - - Changes In This Release: - ----------------------- - - o Support of Access to Extendable Dimension Datasets. - Extendable dimension datasets must use chunked storage methods. - A new function, H5Dextend, is created to extend the current - dimensions of a dataset. The current release requires the - MPI application must make a collective call to extend the - dimensions of an extendable dataset before writing to the - newly extended area. (The serial does not require the - call of H5Dextend. The dimensions of an extendable - dataset is increased when data is written to beyond the - current dimensions but within the maximum dimensions.) - The required collective call of H5Dextend may be relaxed - in future release. - - This release only support independent read and write accesses - to extendable datasets. Collective accesses to extendable - datasets will be implemented in future releases. - - o Collective access to fixed dimension datasets. - Collective access to a dataset can be specified in the transfer - property list argument in H5Dread and H5Dwrite. The current - release supports collective access to fixed dimension datasets. - Collective access to extendable datasets will be implemented in - future releases. - - o HDF5 files are opened according to Communicator and INFO object. - H5Dopen now records the communicator and INFO setup by H5Pset_mmpi - and pass them to the corresponding MPIO open file calls for - processing. - - o This release has been tested on IBM SP2, Intel Red and SGI Origin 2000 - systems. It uses the ROMIO version of MPIO interface for parallel - I/O supports. - - - -%%%%1.0.0%%%% Release Information for hdf5-1.0.0 - -3. Changes from the Beta 1.0.0 Release to Release 1.0.0 -==================================================================== - -* Added fill values for datasets. For contiguous datasets fill value - performance may be quite poor since the fill value is written to the - entire dataset when the dataset is created. This will be remedied - in a future version. Chunked datasets using fill values do not - incur any additional overhead. See H5Pset_fill_value(). - -* Multiple hdf5 files can be "mounted" on one another to create a - larger virtual file. See H5Fmount(). - -* Object names can be removed or changed but objects are never - actually removed from the file yet. See H5Gunlink() and H5Gmove(). - -* Added a tuning mechanism for B-trees to insure that sequential - writes to chunked datasets use less overhead. See H5Pset_btree_ratios(). - -* Various optimizations and bug fixes. - - - -%%%%1.0.0 Beta%%%% Release Information for hdf5-1.0.0 Beta - -2. Changes from the Second Alpha 1.0.0 Release to the Beta 1.0.0 Release -========================================================================= - -* Strided hyperslab selections in dataspaces now working. - -* The compression API has been replaced with a more general filter - API. See doc/html/Filters.html for details. - -* Alpha-quality 2d ragged arrays are implemented as a layer built on - top of other hdf5 objects. The API and storage format will almost - certainly change. - -* More debugging support including API tracing. See Debugging.html. - -* C and Fortran style 8-bit fixed-length character string types are - supported with space or null padding or null termination and - translations between them. - -* Added function H5Fflush() to write all cached data immediately to - the file. - -* Datasets maintain a modification time which can be retrieved with - H5Gstat(). - -* The h5ls tool can display much more information, including all the - values of a dataset. - - - -%%%%1.0.0 Alpha 2%%%% Release Information for hdf5-1.0.0 Alpha 2 - -1. Changes from the First Alpha 1.0.0 Release to - the Second Alpha 1.0.0 Release -===================================================================== - -* Two of the packages have been renamed. The data space API has been - renamed from `H5P' to `H5S' and the property list (template) API has - been renamed from `H5C' to `H5P'. - -* The new attribute API `H5A' has been added. An attribute is a small - dataset which can be attached to some other object (for instance, a - 4x4 transformation matrix attached to a 3-dimensional dataset, or an - English abstract attached to a group). - -* The error handling API `H5E' has been completed. By default, when an - API function returns failure an error stack is displayed on the - standard error stream. The H5Eset_auto() controls the automatic - printing and H5E_BEGIN_TRY/H5E_END_TRY macros can temporarily - disable the automatic error printing. - -* Support for large files and datasets (>2GB) has been added. There - is an html document that describes how it works. Some of the types - for function arguments have changed to support this: all arguments - pertaining to sizes of memory objects are `size_t' and all arguments - pertaining to file sizes are `hsize_t'. - -* More data type conversions have been added although none of them are - fine tuned for performance. There are new converters from integer - to integer and float to float, but not between integers and floating - points. A bug has been fixed in the converter between compound - types. - -* The numbered types have been removed from the API: int8, uint8, - int16, uint16, int32, uint32, int64, uint64, float32, and float64. - Use standard C types instead. Similarly, the numbered types were - removed from the H5T_NATIVE_* architecture; use unnumbered types - which correspond to the standard C types like H5T_NATIVE_INT. - -* More debugging support was added. If tracing is enabled at - configuration time (the default) and the HDF5_TRACE environment - variable is set to a file descriptor then all API calls will emit - the function name, argument names and values, and return value on - that file number. There is an html document that describes this. - If appropriate debugging options are enabled at configuration time, - some packages will display performance information on stderr. - -* Data types can be stored in the file as independent objects and - multiple datasets can share a data type. - -* The raw data I/O stream has been implemented and the application can - control meta and raw data caches, so I/O performance should be - improved from the first alpha release. - -* Group and attribute query functions have been implemented so it is - now possible to find out the contents of a file with no prior - knowledge. - -* External raw data storage allows datasets to be written by other - applications or I/O libraries and described and accessed through - HDF5. - -* Hard and soft (symbolic) links are implemented which allow groups to - share objects. Dangling and recursive symbolic links are supported. - -* User-defined data compression is implemented although we may - generalize the interface to allow arbitrary user-defined filters - which can be used for compression, checksums, encryption, - performance monitoring, etc. The publicly-available `deflate' - method is predefined if the GNU libz.a can be found at configuration - time. - -* The configuration scripts have been modified to make it easier to - build debugging vs. production versions of the library. - -* The library automatically checks that the application was compiled - with the correct version of header files. - - - Parallel HDF5 Changes - -* Parallel support for fixed dimension datasets with contiguous or - chunked storages. Also, support unlimited dimension datasets which - must use chunk storage. No parallel support for compressed datasets. - -* Collective data transfer for H5Dread/H5Dwrite. Collective access - support for datasets with contiguous storage only, thus only fixed - dimension datasets for now. - -* H5Pset_mpi and H5Pget_mpi no longer have the access_mode - argument. It is taken over by the data-transfer property list - of H5Dread/H5Dwrite. - -* New functions H5Pset_xfer and H5Pget_xfer to handle the - specification of independent or collective data transfer_mode - in the dataset transfer properties list. The properties - list can be used to specify data transfer mode in the H5Dwrite - and H5Dread function calls. - -* Added parallel support for datasets with chunked storage layout. - When a dataset is extend in a PHDF5 file, all processes that open - the file must collectively call H5Dextend with identical new dimension - sizes. - - - LIST OF API FUNCTIONS - -The following functions are implemented. Errors are returned if an -attempt is made to use some feature which is not implemented and -printing the error stack will show `not implemented yet'. - -Library - H5check - check that lib version matches header version - H5open - initialize library (happens automatically) - H5close - shut down the library (happens automatically) - H5dont_atexit - don't call H5close on exit - H5get_libversion - retrieve library version info - H5check_version - check for specific library version - -Property Lists - H5Pclose - release template resources - H5Pcopy - copy a template - H5Pcreate - create a new template - H5Pget_chunk - get chunked storage properties - H5Pset_chunk - set chunked storage properties - H5Pget_class - get template class - H5Pget_istore_k - get chunked storage properties - H5Pset_istore_k - set chunked storage properties - H5Pget_layout - get raw data layout class - H5Pset_layout - set raw data layout class - H5Pget_sizes - get address and size sizes - H5Pset_sizes - set address and size sizes - H5Pget_sym_k - get symbol table storage properties - H5Pset_sym_k - set symbol table storage properties - H5Pget_userblock - get user-block size - H5Pset_userblock - set user-block size - H5Pget_version - get file version numbers - H5Pget_alignment - get data alignment properties - H5Pset_alignment - set data alignment properties - H5Pget_external_count- get count of external data files - H5Pget_external - get information about an external data file - H5Pset_external - add a new external data file to the list - H5Pget_driver - get low-level file driver class - H5Pget_stdio - get properties for stdio low-level driver - H5Pset_stdio - set properties for stdio low-level driver - H5Pget_sec2 - get properties for sec2 low-level driver - H5Pset_sec2 - set properties for sec2 low-level driver - H5Pget_core - get properties for core low-level driver - H5Pset_core - set properties for core low-level driver - H5Pget_split - get properties for split low-level driver - H5Pset_split - set properties for split low-level driver - H5P_get_family - get properties for family low-level driver - H5P_set_family - set properties for family low-level driver - H5Pget_cache - get meta- and raw-data caching properties - H5Pset_cache - set meta- and raw-data caching properties - H5Pget_buffer - get raw-data I/O pipe buffer properties - H5Pset_buffer - set raw-data I/O pipe buffer properties - H5Pget_preserve - get type conversion preservation properties - H5Pset_preserve - set type conversion preservation properties - H5Pget_nfilters - get number of raw data filters - H5Pget_filter - get raw data filter properties - H5Pset_filter - set raw data filter properties - H5Pset_deflate - set deflate compression filter properties - H5Pget_mpi - get MPI-IO properties - H5Pset_mpi - set MPI-IO properties - H5Pget_xfer - get data transfer properties - + H5Pset_xfer - set data transfer properties - + H5Pset_preserve - set dataset transfer property list status - + H5Pget_preserve - get dataset transfer property list status - + H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O - + H5Pget_hyper_cache - returns information regarding the caching of - hyperslab blocks during I/O - + H5Pget_btree_ratios - sets B-tree split ratios for a dataset - transfer property list - + H5Pset_btree_ratios - gets B-tree split ratios for a dataset - transfer property list - + H5Pset_vlen_mem_manager - sets the memory manager for variable-length - datatype allocation - + H5Pget_vlen_mem_manager - sets the memory manager for variable-length - datatype allocation - -Datasets - H5Dclose - release dataset resources - H5Dcreate - create a new dataset - H5Dget_space - get data space - H5Dget_type - get data type - H5Dget_create_plist - get dataset creation properties - H5Dopen - open an existing dataset - H5Dread - read raw data - H5Dwrite - write raw data - H5Dextend - extend a dataset - + H5Diterate - iterate over all selected elements in a dataspace - + H5Dget_storage_size - return the amount of storage required for a dataset - + H5Dvlen_reclaim - reclaim VL datatype memory buffers - -Attributes - H5Acreate - create a new attribute - H5Aopen_name - open an attribute by name - H5Aopen_idx - open an attribute by number - H5Awrite - write values into an attribute - H5Aread - read values from an attribute - H5Aget_space - get attribute data space - H5Aget_type - get attribute data type - H5Aget_name - get attribute name - H5Anum_attrs - return the number of attributes for an object - H5Aiterate - iterate over an object's attributes - H5Adelete - delete an attribute - H5Aclose - close an attribute - -Errors - H5Eclear - clear the error stack - H5Eprint - print an error stack - H5Eget_auto - get automatic error reporting settings - H5Eset_auto - set automatic error reporting - H5Ewalk - iterate over the error stack - H5Ewalk_cb - the default error stack iterator function - H5Eget_major - get the message for the major error number - H5Eget_minor - get the message for the minor error number - -Files - H5Fclose - close a file and release resources - H5Fcreate - create a new file - H5Fget_create_plist - get file creation property list - H5Fget_access_plist - get file access property list - H5Fis_hdf5 - determine if a file is an hdf5 file - H5Fopen - open an existing file - H5Freopen - reopen an HDF5 file - H5Fmount - mount a file - H5Funmount - unmount a file - H5Fflush - flush all buffers associated with a file to disk - -Groups - H5Gclose - close a group and release resources - H5Gcreate - create a new group - H5Gopen - open an existing group - H5Giterate - iterate over the contents of a group - H5Gmove - change the name of some object - H5Glink - create a hard or soft link to an object - H5Gunlink - break the link between a name and an object - H5Gget_objinfo - get information about a group entry - H5Gget_linkval - get the value of a soft link - H5Gget_comment - get the comment string for an object - H5Gset_comment - set the comment string for an object - -Dataspaces - H5Screate - create a new data space - H5Scopy - copy a data space - H5Sclose - release data space - H5Screate_simple - create a new simple data space - H5Sset_space - set simple data space extents - H5Sis_simple - determine if data space is simple - H5Sset_extent_simple - set simple data space dimensionality and size - H5Sget_simple_extent_npoints - get number of points in simple extent - H5Sget_simple_extent_ndims - get simple data space dimensionality - H5Sget_simple_extent_dims - get simple data space size - H5Sget_simple_extent_type - get type of simple extent - H5Sset_extent_none - reset extent to be empty - H5Sextent_copy - copy the extent from one data space to another - H5Sget_select_npoints - get number of points selected for I/O - H5Sselect_hyperslab - set hyperslab dataspace selection - H5Sselect_elements - set element sequence dataspace selection - H5Sselect_all - select entire extent for I/O - H5Sselect_none - deselect all elements of extent - H5Soffset_simple - set selection offset - H5Sselect_valid - determine if selection is valid for extent - + H5Sget_select_hyper_nblocks - get number of hyperslab blocks - + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks - currently selected - + H5Sget_select_elem_npoints - get the number of element points - in the current selection - + H5Sget_select_elem_pointlist - get the list of element points - currently selected - + H5Sget_select_bounds - gets the bounding box containing - the current selection - -Datatypes - H5Tclose - release data type resources - H5Topen - open a named data type - H5Tcommit - name a data type - H5Tcommitted - determine if a type is named - H5Tcopy - copy a data type - H5Tcreate - create a new data type - H5Tequal - compare two data types - H5Tlock - lock type to prevent changes - H5Tfind - find a data type conversion function - H5Tconvert - convert data from one type to another - H5Tregister - register a conversion function - H5Tunregister - remove a conversion function - H5Tget_overflow - get function that handles overflow conv. cases - H5Tset_overflow - set function to handle overflow conversion cases - H5Tget_class - get data type class - H5Tget_cset - get character set - H5Tget_ebias - get exponent bias - H5Tget_fields - get floating point fields - H5Tget_inpad - get inter-field padding - H5Tget_member_dims - get struct member dimensions - H5Tget_member_name - get struct member name - H5Tget_member_offset - get struct member byte offset - H5Tget_member_type - get struct member type - H5Tget_nmembers - get number of struct members - H5Tget_norm - get floating point normalization - H5Tget_offset - get bit offset within type - H5Tget_order - get byte order - H5Tget_pad - get padding type - H5Tget_precision - get precision in bits - H5Tget_sign - get integer sign type - H5Tget_size - get size in bytes - H5Tget_strpad - get string padding - H5Tinsert - insert scalar struct member - H5Tinsert_array - insert array struct member - H5Tpack - pack struct members - H5Tset_cset - set character set - H5Tset_ebias - set exponent bias - H5Tset_fields - set floating point fields - H5Tset_inpad - set inter-field padding - H5Tset_norm - set floating point normalization - H5Tset_offset - set bit offset within type - H5Tset_order - set byte order - H5Tset_pad - set padding type - H5Tset_precision - set precision in bits - H5Tset_sign - set integer sign type - H5Tset_size - set size in bytes - H5Tset_strpad - set string padding - + H5Tget_super - return the base datatype from which a - datatype is derived - + H5Tvlen_create - creates a new variable-length dataype - + H5Tenum_create - creates a new enumeration datatype - + H5Tenum_insert - inserts a new enumeration datatype member - + H5Tenum_nameof - returns the symbol name corresponding to a - specified member of an enumeration datatype - + H5Tvalueof - return the value corresponding to a - specified member of an enumeration datatype - + H5Tget_member_value - return the value of an enumeration datatype member - + H5Tset_tag - tags an opaque datatype - + H5Tget_tag - gets the tag associated with an opaque datatype - - - H5Tregister_hard - register specific type conversion function - - H5Tregister_soft - register general type conversion function - -Filters - H5Tregister - register a conversion function - -Compression - H5Zregister - register new compression and uncompression - functions for a method specified by a method number - -Identifiers - + H5Iget_type - retrieve the type of an object - -References - + H5Rcreate - creates a reference - + H5Rdereference - open the HDF5 object referenced - + H5Rget_region - retrieve a dataspace with the specified region selected - + H5Rget_object_type - retrieve the type of object that an - object reference points to - -Ragged Arrays (alpha) - H5RAcreate - create a new ragged array - H5RAopen - open an existing array - H5RAclose - close a ragged array - H5RAwrite - write to an array - H5RAread - read from an array - - diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 1444bf2..4a9a567 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -1,674 +1,733 @@ - Instructions for the Installation of HDF5 Software - ================================================== - -WARNING: This file was not updated for the 1.8.0-beta* releases. If you have any problems with the HDF5 - installation please contact help@hdfgroup.org - - CONTENTS - -------- - 1. Obtaining HDF5 - - 2. Warnings about compilers - 2.1. GNU (Intel platforms) - 2.2. DEC - 2.3. SGI (Irix64 6.2) - 2.4. Windows/NT - - 3. Quick installation - 3.1. Windows - 3.2. RedStorm (Cray XT3) - - 4. HDF5 dependencies - 4.1. Zlib - 4.2 Szip - 4.3. MPI and MPI-IO - - 5. Full installation instructions for source distributions - 5.1. Unpacking the distribution - 5.1.1. Non-compressed tar archive (*.tar) - 5.1.2. Compressed tar archive (*.tar.Z) - 5.1.3. Gzip'd tar archive (*.tar.gz) - 5.1.4. Bzip'd tar archive (*.tar.bz2) - 5.2. Source vs. Build Directories - 5.3. Configuring - 5.3.1. Specifying the installation directories - 5.3.2. Using an alternate C compiler - 5.3.3. Configuring for 64-bit support - 5.3.4. Additional compilation flags - 5.3.5. Compiling HDF5 wrapper libraries - 5.3.6. Specifying other programs - 5.3.7. Specifying other libraries and headers - 5.3.8. Static versus shared linking - 5.3.9. Optimization versus symbolic debugging - 5.3.10. Large (>2GB) vs. small (<2GB) file capability - 5.3.11. Parallel vs. serial library - 5.3.12. Threadsafe capability - 5.3.13. Backward compatibility - 5.3.14. Network stream capability - 5.4. Building - 5.5. Testing - 5.6. Installing - 5.7 Building and testing with Intel compilers - 5.8 Building and testing with PGI compilers - - 6. Using the Library - - 7. Support +Instructions for the Installation of HDF5 Software +================================================== + +This file provides instructions for installing the HDF5 software. +If you have any problems with the installation, please see The HDF Group's +support page at the following location: + + http://www.hdfgroup.org/services/support.html + +CONTENTS +-------- + 1. Obtaining HDF5 + + 2. Quick installation + 2.1. Windows + 2.2. RedStorm (Cray XT3) + + 3. HDF5 dependencies + 3.1. Zlib + 3.2 Szip (optional) + 3.3. MPI and MPI-IO + + 4. Full installation instructions for source distributions + 4.1. Unpacking the distribution + 4.1.1. Non-compressed tar archive (*.tar) + 4.1.2. Compressed tar archive (*.tar.Z) + 4.1.3. Gzip'd tar archive (*.tar.gz) + 4.1.4. Bzip'd tar archive (*.tar.bz2) + 4.2. Source versus build directories + 4.3. Configuring + 4.3.1. Specifying the installation directories + 4.3.2. Using an alternate C compiler + 4.3.3. Configuring for 64-bit support + 4.3.4. Additional compilation flags + 4.3.5. Compiling HDF5 wrapper libraries + 4.3.6. Specifying other programs + 4.3.7. Specifying other libraries and headers + 4.3.8. Static versus shared linking + 4.3.9. Optimization versus symbolic debugging + 4.3.10. Parallel versus serial library + 4.3.11. Threadsafe capability + 4.3.12. Backward compatibility + 4.4. Building + 4.5. Testing + 4.6. Installing HDF5 + + 5. Using the Library + + 6. Support + + A. Warnings about compilers + A.1. GNU (Intel platforms) + A.2. DEC + A.3. SGI (Irix64 6.2) + A.4. Windows/NT + + B. Large (>2GB) versus small (<2GB) file capability + + C. Building and testing with other compilers + C.1. Building and testing with Intel compilers + C.2. Building and testing with PGI compilers ***************************************************************************** 1. Obtaining HDF5 - The latest supported public release of HDF5 is available from - ftp://hdf.ncsa.uiuc.edu/HDF5/current/src. For Unix platforms, it is - available in tar format compressed with gzip. For Microsoft Windows, - it is in ZIP format. - - The HDF team also makes snapshots of the source code available on - a regular basis. These snapshots are unsupported (that is, the - HDF team will not release a bug-fix on a particular snapshot; - rather any bug fixes will be rolled into the next snapshot). - Furthermore, the snapshots have only been tested on a few - machines and may not test correctly for parallel applications. - Snapshots can be found at - ftp://hdf.ncsa.uiuc.edu/pub/outgoing/hdf5/snapshots in a limited - number of formats. - - -2. Warnings about compilers - OUTPUT FROM THE FOLLOWING COMPILERS SHOULD BE EXTREMELY SUSPECT - WHEN USED TO COMPILE THE HDF5 LIBRARY, ESPECIALLY IF - OPTIMIZATIONS ARE ENABLED. IN ALL CASES, HDF5 ATTEMPTS TO WORK - AROUND THE COMPILER BUGS BUT THE HDF5 DEVELOPMENT TEAM MAKES NO - GUARANTEES THAT THERE ARE OTHER CODE GENERATION PROBLEMS. - -2.1. GNU (Intel platforms) - Versions before 2.8.1 have serious problems allocating registers - when functions contain operations on `long long' data types. - Supplying the `--disable-hsizet' switch to configure (documented - below) will prevent hdf5 from using `long long' data types in - situations that are known not to work, but it limits the hdf5 - address space to 2GB. - -2.2. COMPAQ/DEC - The V5.2-038 compiler (and possibly others) occasionally - generates incorrect code for memcpy() calls when optimizations - are enabled, resulting in unaligned access faults. HDF5 works - around the problem by casting the second argument to `char *'. - The fortran module (5.4.1a) fails in compiling some fortran - programs. Need to use 5.5.0 or more. - -2.3. SGI (Irix64 6.2) - The Mongoose 7.00 compiler has serious optimization bugs and - should be upgraded to MIPSpro 7.2.1.2m. Patches are available - from SGI. - -2.4. Windows/NT - The MicroSoft Win32 5.0 compiler is unable to cast unsigned long - long values to doubles. HDF5 works around this bug by first - casting to signed long long and then to double. - - A link warning: defaultlib "LIBC" conflicts with use of other libs - appears for debug version of VC++ 6.0. This warning will not affect - building and testing hdf5 libraries. - - -3. Quick installation - For those that don't like to read ;-) the following steps can be - used to configure, build, test, and install the HDF5 library, - header files, and support programs. - - $ gunzip < hdf5-1.6.0.tar.gz | tar xf - - $ cd hdf5-1.6.0 - $ make check - $ make install - -3.1. Windows - Users of Microsoft Windows should see the INSTALL_Windows for - detailed instructions. - -3.2. RedStorm (Cray Xt3) - Users of the Red Storm machine, after reading this file, should read - the Red Storm section in the INSTALL_parallel file for specific - instructions for the Red Storm machine. The same instructions would - probably work for other Cray XT3 systems but they have not been - verified. - - -4. HDF5 dependencies -4.1. Zlib - The HDF5 library has a predefined compression filter that uses - the "deflate" method for chunked datatsets. If zlib-1.1.2 or - later is found then HDF5 will use it, otherwise HDF5's predefined - compression method will degenerate to a no-op (the compression - filter will succeed but the data will not be compressed). - -4.2. Szip - The HDF5 library has a predefined compression filter that uses - the extended-Rice lossless compression algorithm for chunked - datatsets. For more information about Szip compression and license terms - see http://hdf.ncsa.uiuc.edu/HDF5/doc_resource/SZIP/index.html. - Precompiled szip binaries for each supported platform and source tar ball - file can be found at ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/ - -4.3. MPI and MPI-IO - The parallel version of the library is built upon the foundation - provided by MPI and MPI-IO. If these libraries are not available - when HDF5 is configured then only a serial version of HDF5 can be - built. - - -5. Full installation instructions for source distributions -5.1. Unpacking the distribution - The HDF5 source code is distributed in a variety of formats which - can be unpacked with the following commands, each of which - creates an `hdf5-1.6.0' directory. - -5.1.1. Non-compressed tar archive (*.tar) - - $ tar xf hdf5-1.6.0.tar - -5.1.2. Compressed tar archive (*.tar.Z) - - $ uncompress -c < hdf5-1.6.0.tar.Z | tar xf - - -5.1.3. Gzip'd tar archive (*.tar.gz) - - $ gunzip < hdf5-1.6.0.tar.gz | tar xf - - -5.1.4. Bzip'd tar archive (*.tar.bz2) - - $ bunzip2 < hdf5-1.6.0.tar.bz2 | tar xf - - -5.2. Source vs. Build Directories - On most systems the build can occur in a directory other than the - source directory, allowing multiple concurrent builds and/or - read-only source code. In order to accomplish this, one should - create a build directory, cd into that directory, and run the - `configure' script found in the source directory (configure - details are below). - - Unfortunately, this does not work on recent Irix platforms (6.5? - and later) because that `make' doesn't understand the VPATH - variable. However, hdf5 also supports Irix `pmake' which has a - .PATH target which serves a similar purpose. Here's what the man - pages say about VPATH, which is the facility used by HDF5 - makefiles for this feature: - - The VPATH facility is a derivation of the undocumented - VPATH feature in the System V Release 3 version of make. - System V Release 4 has a new VPATH implementation, much - like the pmake(1) .PATH feature. This new feature is also - undocumented in the standard System V Release 4 manual - pages. For this reason it is not available in the IRIX - version of make. The VPATH facility should not be used - with the new parallel make option. - -5.3. Configuring - HDF5 uses the GNU autoconf system for configuration, which - detects various features of the host system and creates the - Makefiles. On most systems it should be sufficient to say: - - $ ./configure OR - $ sh configure - - The configuration process can be controlled through environment - variables, command-line switches, and host configuration files. - For a complete list of switches type: - - $ ./configure --help - - The host configuration files are located in the `config' - directory and are based on architecture name, vendor name, and/or - operating system which are displayed near the beginning of the - `configure' output. The host config file influences the behavior - of configure by setting or augmenting shell variables. - -5.3.1. Specifying the installation directories - Typing `make install' will install the HDF5 library, header - files, examples, and support programs in /usr/local/lib, - /usr/local/include, /usr/local/doc/hdf5/examples, and - /usr/local/bin. To use a path other than - /usr/local specify the path with the `--prefix=PATH' switch: - - $ ./configure --prefix=$HOME - - If shared libraries are being built (the default) then the final - home of the shared library must be specified with this switch - before the library and executables are built. - - HDF5 can be installed into a different location than the prefix - specified at configure time; see the section on Installing HDF5 - for more details. - -5.3.2. Using an alternate C compiler - By default, configure will look for the C compiler by trying - `gcc' and `cc'. However, if the environment variable "CC" is set - then its value is used as the C compiler (users of csh and - derivatives will need to prefix the commands below with `env'). - For instance, to use the native C compiler on a system which also - has the GNU gcc compiler: - - $ CC=cc ./configure - - A parallel version of hdf5 can be built by specifying `mpicc' - as the C compiler (the `--enable-parallel' flag documented - below is optional in this case). Using the `mpicc' compiler - will insure that the correct MPI and MPI-IO header files and - libraries are used. - - $ CC=/usr/local/mpi/bin/mpicc ./configure - -5.3.3. Configuring for 64-bit support - Several machine architectures support 32-bit or 64-bit binaries. - The options below describe how to enable support for different options. - - On Irix64 the default compiler is `cc'. To use an alternate - compiler specify it with the CC variable: - - $ CC='cc -n32' ./configure - - Similarly, users compiling on a Solaris machine and desiring to - build the distribution with 64-bit support should specify the - correct flags with the CC variable: - - $ CC='cc -xarch=v9' ./configure - - To configure AIX 64-bit support including fortran API and C++, - (Note: need to set $AR to 'ar -X 64'.) - Serial: - $ CFLAGS=-q64 FFLAGS=-q64 CXXFLAGS=-q64 AR='ar -X 64'\ - $ ./configure --enable-fortran - Parallel: (C++ not supported with parallel) - $ CFLAGS=-q64 FFLAGS=-q64 AR='ar -X 64'\ - $ ./configure --enable-fortran - -5.3.4. Additional compilation flags - If addtional flags must be passed to the compilation commands - then specify those flags with the CFLAGS variable. For instance, - to enable symbolic debugging of a production version of HDF5 one - might say: - - $ CFLAGS=-g ./configure --enable-production - -5.3.5. Compiling HDF5 wrapper libraries - One can optionally build the Fortran and/or C++ interface to the - HDF5 C library. By default, both options are disabled. To build - them, specify `--enable-fortran' and `--enable-cxx' respectively. - - $ ./configure --enable-fortran - $ ./configure --enable-cxx - - Configuration will halt if a working Fortran 90 or 95 compiler or - C++ compiler is not found. Currently, the Fortran configure tests - for these compilers in order: f90, pgf90, f95. To use an - alternative compiler specify it with the F9X variable: - - $ F9X=/usr/local/bin/g95 ./configure --enable-fortran - - Note: The Fortran and C++ interfaces are not supported on all the - platforms the main HDF5 library supports. Also, the Fortran - interface supports parallel HDF5 while the C++ interface does - not. - - Note: On Cray T3Es the following files should be modified before - building the Fortran Library: - fortran/src/H5Dff.f90 - fortran/src/H5Aff.f90 - fortran/src/H5Pff.f90 - Check for "Comment if on T3E ..." comment and comment out - specified lines or use a patch from HDF FTP server - ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/ - - Note: See sections 5.7 and 5.8 for how to build Fortran Library with - PGI or Intel compilers. - -5.3.6. Specifying other programs - The build system has been tuned for use with GNU make but works - also with other versions of make. If the `make' command runs a - non-GNU version but a GNU version is available under a different - name (perhaps `gmake') then HDF5 can be configured to use it by - setting the MAKE variable. Note that whatever value is used for - MAKE must also be used as the make command when building the - library: - - $ MAKE=gmake ./configure - $ gmake - - The `AR' and `RANLIB' variables can also be set to the names of - the `ar' and `ranlib' (or `:') commands to override values - detected by configure. - - The HDF5 library, include files, and utilities are installed - during `make install' (described below) with a BSD-compatible - install program detected automatically by configure. If none is - found then the shell script bin/install-sh is used. Configure - doesn't check that the install script actually works, but if a - bad install is detected on your system (e.g., on the ASCI blue - machine as of March 2, 1999) you have two choices: - - 1. Copy the bin/install-sh program to your $HOME/bin - directory, name it `install', and make sure that $HOME/bin - is searched before the system bin directories. - - 2. Specify the full path name of the `install-sh' program - as the value of the INSTALL environment variable. Note: do - not use `cp' or some other program in place of install - because the HDF5 makefiles also use the install program to - also change file ownership and/or access permissions. - -5.3.7. Specifying other libraries and headers - Configure searches the standard places (those places known by the - systems compiler) for include files and header files. However, - additional directories can be specified by using the CPPFLAGS - and/or LDFLAGS variables: - - $ CPPFLAGS=-I/home/robb/include \ + The latest supported public release of HDF5 is available from + ftp://ftp.hdfgroup.org/HDF5/current/src. For Unix and UNIX-like + platforms, it is available in tar format compressed with gzip. + For Microsoft Windows, it is in ZIP format. + + The HDF team also makes snapshots of the source code available on + a regular basis. These snapshots are unsupported (that is, the + HDF team will not release a bug-fix on a particular snapshot; + rather any bug fixes will be rolled into the next snapshot). + Furthermore, the snapshots have only been tested on a few + machines and may not test correctly for parallel applications. + Snapshots, in a limited number of formats, can be found on THG's + development FTP server: + + ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots + + +2. Quick installation + For those who don't like to read ;-) the following steps can be used + to configure, build, test, and install the HDF5 Library, header files, + and support programs. For example, to install HDF5 version X.Y.Z at + location /usr/local/hdf5, use the following steps. + + $ gunzip < hdf5-X.Y.Z.tar.gz | tar xf - + $ cd hdf5-X.Y.Z + $ ./configure --prefix=/usr/local/hdf5 + $ make + $ make check # run test suite. + $ make install + $ make check-install # verify installation. + + Some versions of the tar command support the -z option. In such cases, + the first step above can be simplified to the following: + + $ tar zxf hdf5-X.Y.Z.tar.gz + + above refers to the configure flags appropriate + to your installation. For example, to install HDF5 with the + Fortran and C++ interfaces and with SZIP compression, the + configure line might read as follows: + + $ ./configure --prefix=/usr/local/hdf5 --enable-fortran \ + --enable-cxx --with-szlib=PATH_TO_SZIP + + In this case, PATH_TO_SZIP would be replaced with the path to the + installed location of the SZIP library. + +2.1. Windows + Users of Microsoft Windows should see the INSTALL_Windows files for + detailed instructions. + +2.2. RedStorm (Cray XT3) + Users of the Red Storm machine, after reading this file, should read + the Red Storm section in the INSTALL_parallel file for specific + instructions for the Red Storm machine. The same instructions would + probably work for other Cray XT3 systems, but they have not been + verified. + + +3. HDF5 dependencies +3.1. Zlib + The HDF5 Library includes a predefined compression filter that + uses the "deflate" method for chunked datasets. If zlib-1.1.2 or + later is found, HDF5 will use it. Otherwise, HDF5's predefined + compression method will degenerate to a no-op; the compression + filter will succeed but the data will not be compressed. + +3.2. Szip (optional) + The HDF5 Library includes a predefined compression filter that + uses the extended-Rice lossless compression algorithm for chunked + datasets. For more information about Szip compression and license + terms, see http://hdfgroup.org/doc_resource/SZIP/. + + Precompiled Szip binaries for each supported platform and a source + tar file can be found at ftp://ftp.hdfgroup.org/lib-external/szip/. + + To configure the HDF5 Library with the Szip compression filter, use + the '--enable-szlib=/PATH_TO_SZIP' flag. For more information, see + section 4.3.7, "Specifying other libraries and headers." + + Starting with release 1.6.3, Szip library binaries are distributed + with the encoder enabled (a license may be required to use this binary) + and with the encoder disabled (freely usable without a license). + If the encoder enabled binary is used, Szip compression encoding is + available for an HDF5 application; if the encoder disabled binary is + used, Szip compression is not available. Szip decoding is always + available for applications (i.e., an HDF5 application can always read + Szip-compressed data) if the Szip filter is present, regardless of the + binary used. + +3.3. MPI and MPI-IO + The parallel version of the library is built upon the foundation + provided by MPI and MPI-IO. If these libraries are not available + when HDF5 is configured, only a serial version of HDF5 can be built. + + +4. Full installation instructions for source distributions + +4.1. Unpacking the distribution + The HDF5 source code is distributed in a variety of formats which + can be unpacked with the following commands, each of which creates an + 'hdf5-X.Y.Z' directory, where X.Y.Z is the HDF5 version numbers. + +4.1.1. Non-compressed tar archive (*.tar) + + $ tar xf hdf5-X.Y.Z.tar + +4.1.2. Compressed tar archive (*.tar.Z) + + $ uncompress -c < hdf5-X.Y.Z.tar.Z | tar xf - + Or + $ tar Zxf hdf5-X.Y.Z.tar.Z + +4.1.3. Gzip'd tar archive (*.tar.gz) + + $ gunzip < hdf5-X.Y.Z.tar.gz | tar xf - + Or + $ tar zxf hdf5-X.Y.Z.tar.gz + +4.1.4. Bzip'd tar archive (*.tar.bz2) + + $ bunzip2 < hdf5-X.Y.Z.tar.bz2 | tar xf - + Or + $ tar jxf hdf5-X.Y.Z.tar.bz2 + +4.2. Source versus build directories + On most systems the build can occur in a directory other than the + source directory, allowing multiple concurrent builds and/or + read-only source code. In order to accomplish this, one should + create a build directory, cd into that directory, and run the + `configure' script found in the source directory (configure + details are below). For example, + $ mkdir built-fortran + $ cd build-fortran + $ ../hdf5-X.Y.Z/configure --enable-fortran ... + + Unfortunately, this does not work on recent Irix platforms (6.5? + and later) because that `make' does not understand the VPATH variable. + However, HDF5 also supports Irix `pmake' which has a .PATH target + which serves a similar purpose. Here's what the Irix man pages say + about VPATH, the facility used by HDF5 makefiles for this feature: + + The VPATH facility is a derivation of the undocumented + VPATH feature in the System V Release 3 version of make. + System V Release 4 has a new VPATH implementation, much + like the pmake(1) .PATH feature. This new feature is also + undocumented in the standard System V Release 4 manual + pages. For this reason it is not available in the IRIX + version of make. The VPATH facility should not be used + with the new parallel make option. + +4.3. Configuring + HDF5 uses the GNU autoconf system for configuration, which + detects various features of the host system and creates the + Makefiles. On most systems it should be sufficient to say: + + $ ./configure + Or + $ sh configure + + The configuration process can be controlled through environment + variables, command-line switches, and host configuration files. + For a complete list of switches type: + + $ ./configure --help + + The host configuration files are located in the `config' + directory and are based on architecture name, vendor name, and/or + operating system which are displayed near the beginning of the + `configure' output. The host config file influences the behavior + of configure by setting or augmenting shell variables. + +4.3.1. Specifying the installation directories + The default installation location is the HDF5 directory created in + the build directory. Typing `make install' will install the HDF5 + Library, header files, examples, and support programs in hdf5/lib, + hdf5/include, hdf5/doc/hdf5/examples, and hdf5/bin. To use a path + other than hdf5, specify the path with the `--prefix=PATH' switch: + + $ ./configure --prefix=/usr/local + + If shared libraries are being built (the default), the final + home of the shared library must be specified with this switch + before the library and executables are built. + + HDF5 can be installed into a different location than the prefix + specified at configure time; see section 4.6, "Installing HDF5," + for more details. + +4.3.2. Using an alternate C compiler + By default, configure will look for the C compiler by trying + `gcc' and `cc'. However, if the environment variable "CC" is set + then its value is used as the C compiler. For instance, one would + use the following line to specify the native C compiler on a system + that also has the GNU gcc compiler (users of csh and derivatives + will need to prefix the commands below with `env'): + + $ CC=cc ./configure + + A parallel version of HDF5 can be built by specifying `mpicc' + as the C compiler. (The `--enable-parallel' flag documented + below is optional in this case.) Using the `mpicc' compiler + will insure that the correct MPI and MPI-IO header files and + libraries are used. + + $ CC=/usr/local/mpi/bin/mpicc ./configure + +4.3.3. Configuring for 64-bit support + Several machine architectures support 32-bit or 64-bit binaries. + The options below describe how to enable support for different options. + + On Irix64, the default compiler is `cc'. To use an alternate compiler, + specify it with the CC variable: + + $ CC='cc -n32' ./configure + + Similarly, users compiling on a Solaris machine and desiring to + build the distribution with 64-bit support should specify the + correct flags with the CC variable: + + $ CC='cc -xarch=v9' ./configure + + To configure AIX 64-bit support including the Fortran and C++ APIs, + (Note: need to set $AR to 'ar -X 64'.) + Serial: + $ CFLAGS=-q64 FFLAGS=-q64 CXXFLAGS=-q64 AR='ar -X 64'\ + ./configure --enable-fortran + Parallel: (C++ not supported with parallel) + $ CFLAGS=-q64 FFLAGS=-q64 AR='ar -X 64'\ + ./configure --enable-fortran + +4.3.4. Additional compilation flags + If addtional flags must be passed to the compilation commands, + specify those flags with the CFLAGS variable. For instance, + to enable symbolic debugging of a production version of HDF5, one + might say: + + $ CFLAGS=-g ./configure --enable-production + +4.3.5. Compiling HDF5 wrapper libraries + One can optionally build the Fortran and/or C++ interfaces to the + HDF5 C library. By default, both options are disabled. To build + them, specify `--enable-fortran' and `--enable-cxx', respectively. + + $ ./configure --enable-fortran + $ ./configure --enable-cxx + + Configuration will halt if a working Fortran 90 or 95 compiler or + C++ compiler is not found. Currently, the Fortran configure tests + for these compilers in order: f90, pgf90, f95. To use an + alternate compiler specify it with the FC variable: + + $ FC=/usr/local/bin/g95 ./configure --enable-fortran + + Note: The Fortran and C++ interfaces are not supported on all the + platforms the main HDF5 Library supports. Also, the Fortran + interface supports parallel HDF5 while the C++ interface does + not. + + Note: See sections 4.7 and 4.8 for building the Fortran library with + Intel or PGI compilers. + +4.3.6. Specifying other programs + The build system has been tuned for use with GNU make but also + works with other versions of make. If the `make' command runs a + non-GNU version but a GNU version is available under a different + name (perhaps `gmake'), then HDF5 can be configured to use it by + setting the MAKE variable. Note that whatever value is used for + MAKE must also be used as the make command when building the + library: + + $ MAKE=gmake ./configure + $ gmake + + The `AR' and `RANLIB' variables can also be set to the names of + the `ar' and `ranlib' (or `:') commands to override values + detected by configure. + + The HDF5 Library, include files, and utilities are installed + during `make install' (described below) with a BSD-compatible + install program detected automatically by configure. If none is + found, the shell script bin/install-sh is used. Configure does not + check that the install script actually works; if a bad install is + detected on your system (e.g., on the ASCI blue machine as of + March 2, 1999) you have two choices: + + 1. Copy the bin/install-sh program to your $HOME/bin + directory, name it `install', and make sure that $HOME/bin + is searched before the system bin directories. + + 2. Specify the full path name of the `install-sh' program + as the value of the INSTALL environment variable. Note: do + not use `cp' or some other program in place of install + because the HDF5 makefiles also use the install program to + change file ownership and/or access permissions. + +4.3.7. Specifying other libraries and headers + Configure searches the standard places (those places known by the + systems compiler) for include files and header files. However, + additional directories can be specified by using the CPPFLAGS + and/or LDFLAGS variables: + + $ CPPFLAGS=-I/home/robb/include \ LDFLAGS=-L/home/robb/lib \ - ./configure - - HDF5 uses the zlib library for two purposes: it provides support - for the HDF5 deflate data compression filter, and it is used by - the h5toh4 converter and the h4toh5 converter in support of - HDF4. Configure searches the standard places (plus those - specified above with CPPFLAGS and LDFLAGS variables) for the zlib - headers and library. The search can be disabled by specifying - `--without-zlib' or alternate directories can be specified with - `--with-zlib=INCDIR,LIBDIR' or through the CPPFLAGS and LDFLAGS - variables: - - $ ./configure --with-zlib=/usr/unsup/include,/usr/unsup/lib - - $ CPPFLAGS=-I/usr/unsup/include \ - LDFLAGS=-L/usr/unsup/lib \ - ./configure - - The HDF5-to-HDF4 and HDF4-to-HDF5 conversion tool requires the - HDF4 library and header files which are detected the same way as - zlib. The switch to give to configure is `--with-hdf4'. Note - that HDF5 requires a newer version of zlib than the one shipped - with some versions of HDF4. Also, unless you have the "correct" - version of hdf4 the confidence testing will fail in the tools - directory. - - HDF5 has Szip predefined compression method (see 4.2). To enable - Szip compression, HDF5 library has to be configured and build using - Szip Library - - $ ./configure --with-szlib=/Szip_Install_Directory - -5.3.8. Static versus shared linking - The build process will create static libraries on all systems and - shared libraries on systems that support dynamic linking to a - sufficient degree. Either form of library may be suppressed by - saying `--disable-static' or `--disable-shared'. - - $ ./configure --disable-shared - - Shared C++ and Fortran libraries will be built if shared libraries - are enabled. - - To build only statically linked executables on platforms which - support shared libraries, use the `--enable-static-exec' flag. - - $ ./configure --enable-static-exec - -5.3.9. Optimization versus symbolic debugging - The library can be compiled to provide symbolic debugging support - so it can be debugged with gdb, dbx, ddd, etc or it can be - compiled with various optimizations. To compile for symbolic - debugging (the default for snapshots) say `--disable-production'; - to compile with optimizations (the default for supported public - releases) say `--enable-production'. On some systems the library - can also be compiled for profiling with gprof by saying - `--enable-production=profile'. - - $ ./configure --disable-production #symbolic debugging - $ ./configure --enable-production #optimized code - $ ./configure --enable-production=profile #for use with gprof - - Regardless of whether support for symbolic debugging is enabled, - the library also is able to perform runtime debugging of certain - packages (such as type conversion execution times, and extensive - invariant condition checking). To enable this debugging supply a - comma-separated list of package names to to the `--enable-debug' - switch (see Debugging.html for a list of package names). - Debugging can be disabled by saying `--disable-debug'. The - default debugging level for snapshots is a subset of the - available packages; the default for supported releases is no - debugging (debugging can incur a significant runtime penalty). - - $ ./configure --enable-debug=s,t #debug only H5S and H5T - $ ./configure --enable-debug #debug normal packages - $ ./configure --enable-debug=all #debug all packages - $ ./configure --disable-debug #no debugging - - HDF5 is also able to print a trace of all API function calls, - their arguments, and the return values. To enable or disable the - ability to trace the API say `--enable-trace' (the default for - snapthots) or `--disable-trace' (the default for public - releases). The tracing must also be enabled at runtime to see any - output (see Debugging.html). - -5.3.10. Large (>2GB) vs. small (<2GB) file capability - In order to read or write files that could potentially be larger - than 2GB it is necessary to use the non-ANSI `long long' data - type on some platforms. However, some compilers (e.g., GNU gcc - versions before 2.8.1 on Intel platforms) are unable to produce - correct machine code for this data type. To disable use of the - `long long' type on these machines say: - - $ ./configure --disable-hsizet - -5.3.11. Parallel vs. serial library - The HDF5 library can be configured to use MPI and MPI-IO for - parallelizm on a distributed multi-processor system. Read the - file INSTALL_parallel for detailed explanations. - -5.3.12. Threadsafe capability - The HDF5 library can be configured to be thread-safe (on a very - large scale) with the with the `--enable-threadsafe' flag to - the configure script. Some platforms may also require the - '-with-pthread=INC,LIB' (or '--with-pthread=DIR') flag to the configure - script as well. Read the file doc/TechNotes/ThreadSafeLibrary.html - for further details. - -5.3.13. Backward compatibility - The 1.8 version of the HDF5 library can be configured to operate - identically to the v1.6 library with the `--enable-hdf5v1_6' - configure flag. This allows existing code to be compiled with the - v1.8 library without requiring immediate changes to the - application source code. This flag will only be supported in the - v1.8 branch of the library, it will not be available in v1.9+. - -5.3.14. Network stream capability - The HDF5 library can be configured with a network stream file - driver with the `--enable-stream-vfd' configure flag. This option - compiles the "stream" Virtual File Driver into the main library. - See the documentation on the Virtual File Layer for more details - about the use of this driver. The network stream capability is - enabled by default, except for use in parallel or with a parallel - compiler, where it is disabled. Explicitly enabling Stream-VFD - will allow for its use in parallel. - -5.4. Building - The library, confidence tests, and programs can be build by - saying just: - - $ make - - Note that if you supplied some other make command via the MAKE - variable during the configuration step then that same command - must be used here. - - When using GNU make you can add `-j -l6' to the make command to - compile in parallel on SMP machines. Do not give a number after - th `-j' since GNU make will turn it off for recursive invocations - of make. - - $ make -j -l6 - -5.5. Testing - HDF5 comes with various test suites, all of which can be run by - saying - - $ make check - - To run only the tests for the library change to the `test' - directory before issuing the command. Similarly, tests for the - parallel aspects of the library are in `testpar' and tests for - the support programs are in `tools'. - - Temporary files will be deleted by each test when it complets, - but may continue to exist in an incomplete state if the test - fails. To prevent deletion of the files define the HDF5_NOCLEANUP - environment variable. - - The HDF5 tests can take a long time to run on some systems. To - perform a faster (but less thorough) test, set the HDF5TestExpress - environment variable to 2 or 3 (with 3 being the shortest run). - To perform a longer test, set HDF5TestExpress to 0. 1 is the default. - -5.6. Installing - The HDF5 library, include files, and support programs can be - installed in a (semi-)public place by saying `make install'. The - files are installed under the directory specified with - `--prefix=DIR' (or '/usr/local') in directories named `lib', - `include', and `bin'. The prefix directory must exist prior to - `make install', but its subdirectories are created automatically. - - If `make install' fails because the install command at your site - somehow fails, you may use the install-sh that comes with the - source. You need to run ./configure again. + ./configure + + HDF5 uses the zlib library for two purposes: it provides support + for the HDF5 deflate data compression filter, and it is used by + the h5toh4 converter and the h4toh5 converter in support of + HDF4. Configure searches the standard places (plus those specified + above with the CPPFLAGS and LDFLAGS variables) for the zlib + headers and library. The search can be disabled by specifying + `--without-zlib' or alternate directories can be specified with + `--with-zlib=INCDIR,LIBDIR' or through the CPPFLAGS and LDFLAGS + variables: + + $ ./configure --with-zlib=/usr/unsup/include,/usr/unsup/lib + + $ CPPFLAGS=-I/usr/unsup/include \ + LDFLAGS=-L/usr/unsup/lib \ + ./configure + + The HDF5-to-HDF4 and HDF4-to-HDF5 conversion tool requires the + HDF4 library and header files, which are detected the same way as + zlib. The switch to give to configure is `--with-hdf4'. Note + that HDF5 requires a newer version of zlib than the one shipped + with some versions of HDF4. Also, unless you have the "correct" + version of HDF4, the confidence testing will fail in the tools + directory. + + HDF5 includes Szip as a predefined compression method (see 3.2). + To enable Szip compression, the HDF5 Library must be configured + and built using the Szip Library: + + $ ./configure --with-szlib=/Szip_Install_Directory + +4.3.8. Static versus shared linking + The build process will create static libraries on all systems and + shared libraries on systems that support dynamic linking to a + sufficient degree. Either form of the library may be suppressed by + saying `--disable-static' or `--disable-shared'. + + $ ./configure --disable-shared + + Shared C++ and Fortran libraries will be built if shared libraries + are enabled. + + To build only statically linked executables on platforms which + support shared libraries, use the `--enable-static-exec' flag. + + $ ./configure --enable-static-exec + +4.3.9. Optimization versus symbolic debugging + The library can be compiled to provide symbolic debugging support + so it can be debugged with gdb, dbx, ddd, etc., or it can be + compiled with various optimizations. To compile for symbolic + debugging (the default for snapshots), say `--disable-production'; + to compile with optimizations (the default for supported public + releases), say `--enable-production'. On some systems the library + can also be compiled for profiling with gprof by saying + `--enable-production=profile'. + + $ ./configure --disable-production #symbolic debugging + $ ./configure --enable-production #optimized code + $ ./configure --enable-production=profile #for use with gprof + + Regardless of whether support for symbolic debugging is enabled, + the library can also perform runtime debugging of certain packages + (such as type conversion execution times and extensive invariant + condition checking). To enable this debugging, supply a + comma-separated list of package names to to the `--enable-debug' + switch. See "Debugging HDF5 Applications" for a list of package + names: + + http://www.hdfgroup.org/HDF5/doc/H5.user/Debugging.html + + Debugging can be disabled by saying `--disable-debug'. + The default debugging level for snapshots is a subset of the + available packages; the default for supported releases is no + debugging (debugging can incur a significant runtime penalty). + + $ ./configure --enable-debug=s,t #debug only H5S and H5T + $ ./configure --enable-debug #debug normal packages + $ ./configure --enable-debug=all #debug all packages + $ ./configure --disable-debug #no debugging + + HDF5 can also print a trace of all API function calls, their + arguments, and the return values. To enable or disable the + ability to trace the API say `--enable-trace' (the default for + snapthots) or `--disable-trace' (the default for public releases). + The tracing must also be enabled at runtime to see any output + (see "Debugging HDF5 Applications," reference above). + +4.3.10. Parallel versus serial library + The HDF5 Library can be configured to use MPI and MPI-IO for + parallelism on a distributed multi-processor system. Read the + file INSTALL_parallel for detailed explanations. + +4.3.11. Threadsafe capability + The HDF5 Library can be configured to be thread-safe (on a very + large scale) with the `--enable-threadsafe' flag to the configure + script. Some platforms may also require the '-with-pthread=INC,LIB' + (or '--with-pthread=DIR') flag to the configure script. + For further details, see "HDF5 Thread Safe Library": + + http://www.hdfgroup.org/HDF5/doc/TechNotes/ThreadSafeLibrary.html + +4.3.12. Backward compatibility + The 1.8 version of the HDF5 Library can be configured to operate + identically to the v1.6 library with the + --with-default-api-version=v16 + configure flag. This allows existing code to be compiled with the + v1.8 library without requiring immediate changes to the application + source code. For addtional configuration options and other details, + see "API Compatibility Macros in HDF5": + + http://www.hdfgroup.org/HDF5/doc/RM/APICompatMacros.html + +4.4. Building + The library, confidence tests, and programs can be built by + saying just: + + $ make + + Note that if you have supplied some other make command via the MAKE + variable during the configuration step, that same command must be + used here. + + When using GNU make, you can add `-j -l6' to the make command to + compile in parallel on SMP machines. Do not give a number after + the `-j' since GNU make will turn it off for recursive invocations + of make. + + $ make -j -l6 + +4.5. Testing + HDF5 comes with various test suites, all of which can be run by + saying + + $ make check + + To run only the tests for the library, change to the `test' + directory before issuing the command. Similarly, tests for the + parallel aspects of the library are in `testpar' and tests for + the support programs are in `tools'. + + The `check' consists of two sub-tests, check-s and check-p, which + are for serial and parallel tests, respectively. Since serial tests + and parallel tests must be run with single and multiple processes + respectively, the two sub-tests work nicely for batch systems in + which the number of processes is fixed per batch job. One may submit + one batch job, requesting 1 process, to run all the serial tests by + "make check-s"; and submit another batch job, requesting multiple + processes, to run all the parallel tests by "make check-p". + + Temporary files will be deleted by each test when it completes, + but may continue to exist in an incomplete state if the test + fails. To prevent deletion of the files, define the HDF5_NOCLEANUP + environment variable. + + The HDF5 tests can take a long time to run on some systems. To perform + a faster (but less thorough) test, set the HDF5TestExpress environment + variable to 2 or 3 (with 3 being the shortest run). To perform a + longer test, set HDF5TestExpress to 0. 1 is the default. + +4.6. Installing HDF5 + The HDF5 Library, include files, and support programs can be + installed in a (semi-)public place by saying `make install'. The + files are installed under the directory specified with + `--prefix=DIR' (default is 'hdf5') in directories named `lib', + `include', and `bin'. The directories, if not existing, will be + created automatically, provided the mkdir command supports the -p + option. + + If `make install' fails because the install command at your site + somehow fails, you may use the install-sh that comes with the + source. You will need to run ./configure again. $ INSTALL="$PWD/bin/install-sh -c" ./configure ... $ make install - If you want to install HDF5 in a location other than the location - specified by the `--prefix=DIR' flag during configuration (or - instead of the default location, `/usr/local'), you can do that - by running the deploy script: + If you want to install HDF5 in a location other than the location + specified by the `--prefix=DIR' flag during configuration (or + instead of the default location, `hdf5'), you can do that + by running the deploy script: $ bin/deploy NEW_DIR - This will install hdf5 in NEW_DIR. Alternately, you can do this - manually by issuing the command: + This will install HDF5 in NEW_DIR. Alternately, you can do this + manually by issuing the command: - $ make install prefix=NEW_DIR + $ make install prefix=NEW_DIR - where NEW_DIR is the new directory you wish to install HDF5. If - you do not use the deploy script, you should run h5redeploy in - NEW_DIR/bin directory. This utility will fix h5cc, h5fc and - h5c++ scripts to reflect the new NEW_DIR location. + where NEW_DIR is the new directory where you wish to install HDF5. + If you do not use the deploy script, you should run h5redeploy in + NEW_DIR/bin directory. This utility will fix the h5cc, h5fc and + h5c++ scripts to reflect the new NEW_DIR location. - The library can be used without installing it by pointing the - compiler at the `src' and 'src/.libs' directory for include files and - libraries. However, the minimum which must be installed to make - the library publically available is: + The library can be used without installing it by pointing the + compiler at the `src' and 'src/.libs' directory for include files and + libraries. However, the minimum which must be installed to make + the library publicly available is: - The library: - ./src/.libs/libhdf5.a + The library: + ./src/.libs/libhdf5.a - The public header files: - ./src/H5*public.h, ./src/H5public.h + The public header files: + ./src/H5*public.h, ./src/H5public.h ./src/H5FD*.h except ./src/H5FDprivate.h, ./src/H5api_adpt.h - The main header file: - ./src/hdf5.h + The main header file: + ./src/hdf5.h + + The configuration information: + ./src/H5pubconf.h + + The support programs that are useful are: + ./tools/h5ls/h5ls (list file contents) + ./tools/h5dump/h5dump (dump file contents) + ./tools/misc/h5repart (repartition file families) + ./tools/misc/h5debug (low-level file debugging) + ./tools/h5import/h5import (imports data to HDF5 file) + ./tools/h5diff/h5diff (compares two HDF5 files) + ./tools/gifconv/h52gif (HDF5 to GIF converter) + ./tools/gifconv/gif2h5 (GIF to HDF5 converter) - The configuration information: - ./src/H5pubconf.h - - The support programs that are useful are: - ./tools/h5ls/h5ls (list file contents) - ./tools/h5dump/h5dump (dump file contents) - ./tools/misc/h5repart (repartition file families) - ./tools/misc/h5debug (low-level file debugging) - ./tools/h5import/h5import (imports data to HDF5 file) - ./tools/h5diff/h5diff (compares two HDF5 files) - ./tools/gifconv/h52gif (HDF5 to GIF converter) - ./tools/gifconv/gif2h5 (GIF to HDF5 converter) -5.7 Building and testing with Intel compilers +5. Using the Library + Please see the "HDF5 User's Guide" and the "HDF5 Reference Manual": + http://www.hdfgroup.org/HDF5/doc/ - When Intel compilers are used (icc or ecc), you will need to - modify the generated "libtool" program after configuration is finished. - On or around line 104 of the libtool file, there are lines which - look like: + Most programs will include and link with -lhdf5. + Additional libraries may also be necessary depending on whether + support for compression, etc., was compiled into the HDF5 Library. - # How to pass a linker flag through the compiler. - wl="" + A summary of the HDF5 installation can be found in the + libhdf5.settings file in the same directory as the static and/or + shared HDF5 Libraries. - Change these lines to this: - # How to pass a linker flag through the compiler. - wl="-Wl," +6. Support + Support is described in the README file. - UPDATE: This is now done automatically by the configure script. However, - if you still experience a problem, you may want to check this line in - the libtool file and make sure that it has the correct value. - * To build the Fortran library using Intel compiler on Linux 2.4, one has to - x Use -fpp -DDEC$=DEC_ -DMS$=MS_ compiler flags to disable - DEC and MS compiler directives in source files in fortran/src, fortran/test - and fortran/examples directories. - e.g., setenv F9X 'ifc -fpp -DDEC$=DEC_ -DMS$=MS_' - (do not use double quotes since $ is interpreted in them.) +***************************************************************************** + APPENDIX +***************************************************************************** - x If Version 6.0 of Fortran compiler is used, build fails in - the fortran/test directory and then in the - fortran/examples directory; to proceed, edit the work.pcl files in - those directories to contain two lines +A. Warnings about compilers + Output from the following compilers should be extremely suspected + when used to compile the HDF5 Library, especially if optimizations are + enabled. In all cases, HDF5 attempts to work around the compiler bugs. + +A.1. GNU (Intel platforms) + Versions before 2.8.1 have serious problems allocating registers + when functions contain operations on `long long' datatypes. + Supplying the `--disable-hsizet' switch to configure (documented + in Appendix B, "Large (>2GB) versus small (<2GB) file capability,") + will prevent HDF5 from using `long long' datatypes in + situations that are known not to work, but it limits the HDF5 + address space to 2GB. + +A.2. COMPAQ/DEC + The V5.2-038 compiler (and possibly others) occasionally + generates incorrect code for memcpy() calls when optimizations + are enabled, resulting in unaligned access faults. HDF5 works + around the problem by casting the second argument to `char *'. + The Fortran module (5.4.1a) fails in compiling some Fortran + programs. Use 5.5.0 or higher. + +A.3. SGI (Irix64 6.2) + The Mongoose 7.00 compiler has serious optimization bugs and + should be upgraded to MIPSpro 7.2.1.2m. Patches are available + from SGI. + +A.4. Windows/NT + The Microsoft Win32 5.0 compiler is unable to cast unsigned long + long values to doubles. HDF5 works around this bug by first + casting to signed long long and then to double. + + A link warning: defaultlib "LIBC" conflicts with use of other libs + appears for debug version of VC++ 6.0. This warning will not affect + building and testing HDF5 Libraries. + + +B. Large (>2GB) versus small (<2GB) file capability + In order to read or write files that could potentially be larger + than 2GB, it is necessary to use the non-ANSI `long long' data + type on some platforms. However, some compilers (e.g., GNU gcc + versions before 2.8.1 on Intel platforms) are unable to produce + correct machine code for this datatype. To disable use of the + `long long' type on these machines, say: + + $ ./configure --disable-hsizet + +C. Building and testing with other compilers +C.1. Building and testing with Intel compilers + When Intel compilers are used (icc or ecc), you will need to modify + the generated "libtool" program after configuration is finished. + On or around line 104 of the libtool file, there are lines which + look like: + + # How to pass a linker flag through the compiler. + wl="" + + Change these lines to this: + + # How to pass a linker flag through the compiler. + wl="-Wl," + + UPDATE: This is now done automatically by the configure script. + However, if you still experience a problem, you may want to check this + line in the libtool file and make sure that it has the correct value. + + * To build the Fortran library using Intel compiler on Linux 2.4, + one has to perform the following steps: + x Use the -fpp -DDEC$=DEC_ -DMS$=MS_ compiler flags to disable + DEC and MS compiler directives in source files in the fortran/src, + fortran/test, and fortran/examples directories. + E.g., setenv F9X 'ifc -fpp -DDEC$=DEC_ -DMS$=MS_' + Do not use double quotes since $ is interpreted in them. + + x If Version 6.0 of Fortran compiler is used, the build fails in + the fortran/test directory and then in the fortran/examples + directory. To proceed, edit the work.pcl files in those + directories to contain two lines: work.pc ../src/work.pc - x Do the same in fortran/examples directory - x Problem with work.pc files was resolved for newest version of the compiler (7.0) - - * To build the Fortran Library on IA32 follow step described above, except - that DEC and MS compiler directives should be removed manually or - use a patch from HDF FTP server ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/ - - -5.8 Building and testing with PGI compilers - - When PGI C and C++ compilers are used (pgcc or pgCC), you will need to - modify the generated "libtool" program after configuration is finished. - On or around line 104 of the libtool file, there are lines which - look like: + x Do the same in the fortran/examples directory. - # How to pass a linker flag through the compiler. - wl="" + x A problem with work.pc files was resolved for the newest version + of the compiler (7.0). - Change these lines to this: + * To build the Fortran library on IA32, follow the steps described + above, except that the DEC and MS compiler directives should be + removed manually or use a patch from HDF FTP server: - # How to pass a linker flag through the compiler. - wl="-Wl," + ftp://ftp.hdfgroup.org/HDF5/current/ - UPDATE: This is now done automatically by the configure script. However, - if you still experience a problem, you may want to check this line in - the libtool file and make sure that it has the correct value. - To build HDF5 C++ Library with pgCC (version 4.0 and later), set - environment variable CXX to "pgCC -tlocal" - setenv CXX "pgCC -tlocal" - before running the configure script. +C.2. Building and testing with PGI compilers + When PGI C and C++ compilers are used (pgcc or pgCC), you will need to + modify the generated "libtool" program after configuration is finished. + On or around line 104 of the libtool file, there are lines which + look like this: + # How to pass a linker flag through the compiler. + wl="" -6. Using the Library - Please see the User Manual in the doc/html directory. + Change these lines to this: - Most programs will include and link with -lhdf5. - Additional libraries may also be necessary depending on whether - support for compression, etc. was compiled into the hdf5 library. + # How to pass a linker flag through the compiler. + wl="-Wl," - A summary of the hdf5 installation can be found in the - libhdf5.settings file in the same directory as the static and/or - shared hdf5 libraries. + UPDATE: This is now done automatically by the configure script. However, + if you still experience a problem, you may want to check this line in + the libtool file and make sure that it has the correct value. + To build the HDF5 C++ Library with pgCC (version 4.0 and later), set + the environment variable CXX to "pgCC -tlocal" + setenv CXX "pgCC -tlocal" + before running the configure script. -7. Support - Support is described in the README file. diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt index 0cb0968..b63d294 100644 --- a/release_docs/INSTALL_Cygwin.txt +++ b/release_docs/INSTALL_Cygwin.txt @@ -98,29 +98,7 @@ Install HDF5 on Cygwin $ bunzip2 < hdf5-1.8.0.tar.bz2 | tar xf - -3. Setup environment - - In the latest version of the Cygwin DLL, a bug was introduced - relating to the 'timezone' global variable and C99 support. As - work-around, we must use a special compiler flag. - - 3.1. In the command prompt you plan to build from, run the - command: - - export CFLAGS="-ansi ${CFLAGS}" - - 3.2 (Optional) If you plan to build C++ libraries, also - run the command: - - export CXXFLAGS="-ansi ${CXXFLAGS}" - - 3.3 (Optional) If you plan to build Fortran libraries, also - run the command: - - export FCFLAGS="-ansi ${FCFLAGS}" - - -4. Configuring +3. Configuring Notes: See detailed information in hdf5/release_docs/INSTALL, part 5. Full installation instructions for source @@ -134,19 +112,19 @@ Install HDF5 on Cygwin In short, - 4.1 To configure HDF5 C Library, using + 3.1 To configure HDF5 C Library, using $ ./configure - 4.2 To configure HDF5 C/C++ Library, using + 3.2 To configure HDF5 C/C++ Library, using $ ./configure --enable-cxx - 4.3 To configure HDF5 C/Fortran Library, using + 3.3 To configure HDF5 C/Fortran Library, using $ ./configure --enable-fortran - 4.4 To configure HDF5 C with Szip library, using + 3.4 To configure HDF5 C with Szip library, using $ ./configure --with-szlib="path to szlib" @@ -157,15 +135,15 @@ Install HDF5 on Cygwin $ ./configure --with-szlib=/cygdrive/c/szip - 4.5 To configure HDF5 C without Zlib, + 3.5 To configure HDF5 C without Zlib, To disable zlib, using $ ./configure --without-zlib - 4.6 Two ways to configure HDF5 C with specified Zlib + 3.6 Two ways to configure HDF5 C with specified Zlib - 4.6.1 Using + 3.6.1 Using $ ./configure --with-zlib=INCDIR,LIBDIR @@ -175,7 +153,7 @@ Install HDF5 on Cygwin $ ./configure --with-zlib=/cygdrive/c/usr/include,/cygdrive/c/usr/lib - 4.6.2 Through the CPPFLAGS and LDFLAGS Variables + 3.6.2 Through the CPPFLAGS and LDFLAGS Variables For example, if zlib was installed in the directory /cygdrive/c/usr then using the following command to configure @@ -185,7 +163,7 @@ Install HDF5 on Cygwin $ LDFLAGS=-L/cygdrive/c/usr/lib \ $ ./configure - 4.7 To specify the installation directories, using + 3.7 To specify the installation directories, using $ ./configure --prefix="path for installation" @@ -196,7 +174,7 @@ Install HDF5 on Cygwin the path with the `--prefix=PATH' switch as in the above command. - 4.8 Combination of Switches + 3.8 Combination of Switches All of the above switches can be combined together. For example, if users want to configure HDF5 C/C++/Fortran @@ -231,7 +209,7 @@ Install HDF5 on Cygwin --enable-fortran <"If no more switches, then hit Enter"> -5. Make and Make Check +4. Make and Make Check After configuration is done successfully, run the following series of commands to build, test and install HDF5 @@ -242,23 +220,20 @@ Install HDF5 on Cygwin Before run "make install", check output file for "make check", there should be no failures at all. -6. Make Install +5. Make Install $ make install > "output file name" -7. Check installed HDF5 library +6. Check installed HDF5 library After step 4, go to your installation directory, there should be three subdirectories: "bin" "include" and "lib". -8. Known Problems +7. Known Problems Shared libraries can not be built on Cygwin In release 1.8.0. - There are issues linking with the latest Cygwin DLL. As a work-around, - make sure to follow the steps described in step 3 above. - ----------------------------------------------------------------------- Need Further assistance, email help@hdfgroup.org diff --git a/release_docs/INSTALL_VMS.txt b/release_docs/INSTALL_VMS.txt index fd997c5..0245024 100644 --- a/release_docs/INSTALL_VMS.txt +++ b/release_docs/INSTALL_VMS.txt @@ -1,6 +1,6 @@ Building and installation instructions for Alpha Open VMS HDF5 1.8.0 release - January 2008 + February 12, 2008 diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index daedadd..1facd81 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -829,20 +829,14 @@ To build and test HDF5 High Level C examples: Select "Build" -> "Build Solution" or "Rebuild Solution" to build release version of project "allhlcexamples". - When the debug and release build is done, there should be the following - subdirectories in c:\MyHDFstuff\hdf5\examples\ - - allhlcexamples - ex_images - ex_imagesdll - ex_lite - ex_litedll - ex_table - ex_tabledll - ex_ds - ex_dsdll - ex_packet - ex_packetdll + When the debug and release build is done, binaries will be built in the + following subdirectories of c:\MyHDFstuff\hdf5\examples\ + + ex_image[1-2](dll) + ex_lite1(dll) + ex_table[01-12](dll) + ex_ds1(dll) + ptExample[FL+VL](dll) 3. Invoke a command prompt and run the batch file Install_hlcexamples.bat which resides in the top level directory (c:\MyHDFstuff\hdf5). This file diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index b0e0a86..e8f8bad 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -61,7 +61,7 @@ The "--enable-parallel" is optional in this case. Make sure your environment variables are set correctly to compile and execute a single process mpi applications for the SP machine. Unfortunately, the setting varies from machine to machine. E.g., the following works for the -Blue machine of LLNL. +IBM SP machine at LLNL. setenv MP_PROCS 1 setenv MP_NODES 1 @@ -102,7 +102,7 @@ This allows for >2GB sized files on Linux systems and is only available with Linux kernels 2.4 and greater. -2.4. Red Storm (Cray XT3) (for v1.8 only) +2.4. Red Storm (Cray XT3) (for v1.8 and later) ------------------------- The following steps are for building the Parallel HDF5 for the Red Storm compute nodes. They would probably work for other Cray XT3 systems but have @@ -180,15 +180,28 @@ environment variable at the time `make check' is run (or the value 3). 4. Parallel test suite ---------------------- -The testpar/ directory contains tests for Parallel HDF5 and MPI-IO. The t_mpi -tests the basic functionalities of some MPI-IO features used by Parallel HDF5. -It usually exits with non-zero code if a required MPI-IO feature does not -succeed as expected. One exception is the testing of accessing files larger -than 2GB. If the underlying filesystem or if the MPI-IO library fails to -handle file sizes larger than 2GB, the test will print informational messages -stating the failure but will not exit with non-zero code. Failure to support -file size greater than 2GB is not a fatal error for HDF5 because HDF5 can -use other file-drivers such as families of files to bypass the file size limit. +The testpar/ directory contains tests for Parallel HDF5 and MPI-IO. Here are +some notes about some of the tests. + +The t_mpi tests the basic functionalities of some MPI-IO features used by +Parallel HDF5. It usually exits with non-zero code if a required MPI-IO +feature does not succeed as expected. One exception is the testing of +accessing files larger than 2GB. If the underlying filesystem or if the +MPI-IO library fails to handle file sizes larger than 2GB, the test will +print informational messages stating the failure but will not exit with +non-zero code. Failure to support file size greater than 2GB is not a fatal +error for HDF5 because HDF5 can use other file-drivers such as families of +files to bypass the file size limit. + +The t_posix_compliant tests if the file system is POSIX compliant when POSIX +and MPI IO APIs are used. This is for information only and it always exits +with 0 even when non-compliance errors have occurred. This is to prevent +the test from aborting the remaining parallel HDF5 tests unnecessarily. + +The t_cache does many small sized I/O requests and may not run well in a +slow file system such as NFS disk. If it takes a long time to run it, try +set the environment variable $HDF5_PARAPREFIX to a file system more suitable +for MPI-IO requests before running t_cache. By default, the parallel tests use the current directory as the test directory. This can be changed by the environment variable $HDF5_PARAPREFIX. For example, diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f1f58b6..881865b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,32 +1,20 @@ -HDF5 version 1.8.0 currently under development +HDF5 version 1.9.5 currently under development ================================================================================ INTRODUCTION -This document describes the differences between HDF5-1.6.* and -Hdf5 1.8.0 release candidate "HDF5-1.8.0-rc*", and contains information -on the platforms tested and known problems in HDF5-1.8.0-rc*. -For more details check the HISTORY.txt file in the HDF5 source. - - -Links to HDF5 1.8.0-rc* source code, documentation, and additional materials -can be found on THG's development server (www.hdfgroup.uiuc.edu) at the -following location: - http://www.hdfgroup.uiuc.edu/HDF5/release/beta/obtain518.html -User documentation for the beta can be accessed directly at this location: - http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ - -New features of the upcoming 1.8.0 release are described in -the "What's New in 1.8.0?" document: - http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/WhatsNew180.html - -New and modified APIs are described briefly in - http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/WhatsNew180.html -and will be listed in the "HDF5 Software Changes" document: - http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ADGuide/Changes.html +This document describes the differences between HDF5-1.9.0 and +HDF5 1.9.x snapshot, and contains information on the platforms +tested and known problems in HDF5-1.9.x. +For more details check the HISTORY*.txt files in the HDF5 source. +Links to HDF5 1.9.x source code can be found on THG's development +FTP server at the following location: + ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots +User documentation for the snapshot can be accessed directly at this location: + http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ For more information, see the HDF5 home page: @@ -41,7 +29,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.6.0 +- Bug Fixes since HDF5-1.8.0 - Platforms Tested - Known Problems @@ -50,940 +38,71 @@ New Features ============ Configuration: - -------------- - - Removed stream-vfd from the HDF5 library. - AKC 2007/11/19. - - Updated versions of autotools. HDF5 now uses automake 1.10.0, - autoconf 2.61, and libtool 1.5.22. MAM - 2007/7/25. - - Changed default fortran compiler to g95 when gcc is used. - AKC - 2007/2/17. - - 'make check-vfd' can now be run from the top level directory. Not all - tests that 'make check' invokes work with certain Virtual File Drivers, - so those tests have been skipped. - MAM 2006/7/17 - - Added the variable HDF5TestExpress to control how long tests run. - Setting it to a value between 0 and 3 controls how thoroughly the - library is tested, with 0 being an "exhaustive run" and 3 being a - very quick "smoke test." 1 (a "full run") is the default. - -JML 2006/6/21 - - If both shared and static libraries are installed, now both will be - tested during 'make install'. -MAM 2006/06/21 - - Added support to explicity enable stream_vfd or shared libraries - when using parallel via the '--enable-stream_vfd' and - '--enable-shared' options, respectively. If not explicity defined, - These settings default to enabled when parallel is not used, - and disabled when parallel is used. -MAM 2006/06/17 - - Remove the flexible parallel code and the --enable-fphdf5 - configure option, it was never up to production standards - anyway. -QAK 2006/4/20 - - Added a macro hdf5_mpi_special_collective_io_works to filter out - some mpi-io packages that don't support collective IO for no IO - contributions in some processes. -KY 2006/2/16 - - Added -shlib option to link against installed shared libraries to - h5c++ and h5fc. -JML 2005/11/1 - - Added --enable-build-all option to configure, which only developers - should need to use. -JML 2005/10/24 - - Configure uses the 'TR' variable to let the user override the path - to the 'tr' utility. -JML 2005/10/17 - - Configure can recognize -lmpich as a form of MPI library. -AKC- - 2005/9/28. - - MD5 checksumming has been added to snapshot releases. Release - tarballs will be accompanied by .md5 checksum files, which can - be verified using the md5sum utility. -JML 2005/9/6 - - Some configure flags are incompatible (e.g., the C++ APIs cannot - be built using the parallel version of HDF5). configure will now - output errors when some common incompatible features are used - together. -JML 2005/9/6 - - A new API function, H5Tis_hard(), was added to the library. It - checks if a conversion function is a compiler (hard) conversion. - SLU - 2005/9/6 - - t_mpi will run the test_mpio_derived_dtype by default unless it is - known not working (indicated by macro H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - not defined.) -AKC- 2005/8/23. - - Test execution has changed in a number of ways: - When make is invoked in parallel (using -j), sequential tests - are now executed as parallel make targets. This should make them - finish more quickly on machines with multiple processors. - Since test output is garbled when they are executed by parallel make, - tests now dump their output to foo.log files and foo.logsh files - (for test scripts). These logs are printed to the screen only - when a test fails or when all tests in the current directory have - completed successfully. - When tests pass, they will create a foo.chkexe file. - This prevents the test from executing again until the test or - main library changes. - All files generated by tests (*.chkexe, *.log, and any *.h5 files - created) can be removed by invoking 'make check-clean'. - Sequential and parallel library tests can now be invoked separately. - 'make check-s' will execute only sequential tests, and 'make check-p' - will execute only parallel tests. 'make check' will still execute - all tests. - -JML 2005/08/03 - - On windows, all.zip is deprecated. users should - read INSTALL_Windows.txt to know the details. - Reasons to deprecate all.zip: - 1. Avoid confliction for windows programmers - 2. Decrease size of CVS tree by adding all.zip - 3. Avoid using winzip as the intermediate step - --KY 2005/04/22 - - When HDF5 is created as a shared library, it now uses libtool's - shared library versioning scheme. -JML 2005/04/18 - - HDF5 now uses automake 1.9.5 to generate Makefiles.in. - This has a number of effects on users: - The Fortran compiler should be set using the environment - variable $FC, not $F9X. F9X still works, but is depreciated. - The output of make may be different. This should be only a - cosmetic effect. - make depened (or make dep) is no longer recognized, since automake - handles dependency tracking. - Some new configure options exist. --enable-dependency-tracking - and --disable-dependency-tracking are used to control automake's - dependency tracking. Dependencies are on by default *on most - platforms and compilers*. If --enable-dependency-tracking is - used, they will be enabled on any platform. However, this can - slow down builds or even cause build errors in some cases. - Likewise, --disable-dependency-tracking can speed up builds and - avoid some build errors. - Some make targets have alternate names. make check-install and - make installcheck do the same thing, for instance. - pmake on IRIX can be invoked from the root directory, but the - -V flag must be used to invoke it in any subdirectory or it - will give an error about undefined variables. - JML 2005/01 - 2005/03 - - Hardware conversion between long double and integers is also added. - SLU 2005/02/10 - - Started to support software conversion between long double and - integers. Hardware conversion will come very soon. SLU - 2005/1/6 - - Intel v8.0 compiler would infinite loop when compiling some test - code with -O3 option. Changed enable-production default compiler - option to -O2. AKC - 2004/12/06 - - Long double is assumed to be a supported C data type. It is a - stanadard C89 type. AKC - 2004/10/22 - - The IA64 will use ecc as the C++ compiler by default. - - Added some initial support for making valgrind/Purify (or similar - memory checking products) happier by initializing buffers to zero - and disabling the internal free list code. To take advantage of - this, use the "--enable-using-memchecker" configure option when - building the library. QAK - 2004/07/23 - - Fixed the long compile time of H5detect.c when v7.x Intel Compiler - is used with optimization NOT off. AKC - 2004/05/20 - - Fixed configure setting of C++ for OSF1 platform. AKC - 2004/01/06 - - Prefix default is changed from /usr/local to `pwd`/hdf5. - AKC - 2003/07/09 + ------------- Library: -------- - - Removed size restrictions on attributes, when using the "latest" - version of the file format. - QAK - 2007/02/21 - - Relaxed restrictions on attribute operations to allow a file ID to - be used as the "location ID". If a file ID is used, the attribute - operation will occur on the root group of the file. - - QAK - 2007/02/09 - - Enabled the CORE driver to read an existing file depending on - the setting of the backing_store for H5Pset_fapl_core and file - open flags. - SLU - 2006/11/30 - - Added new H5Gget_info_by_idx() routine to query the information about - a group according to the order within an index. - - QAK - 2006/11/27 - - Added new H5Gget_info() routine to query the information about a - group by name. - - QAK - 2006/11/27 - - Added new H5Oget_info_by_idx() routine to query the information about - an object in a group according to the order within an index. - - QAK - 2006/11/26 - - Added new H5Oget_info() routine to query the information about an - object in a group by name. - - QAK - 2006/11/26 - - Added new H5Oopen_by_idx() routine to open an object in a group - according to the order within an index. - - QAK - 2006/11/20 - - Added new H5Literate() routine to iterate over links in a group - according to the order within an index. - - QAK - 2006/11/20 - - Added new H5Ldelete_by_idx() routine to delete a link according to - the order within an index. - - QAK - 2006/11/13 - - Added new H5Lget_val_by_idx() routine to query the value of a soft link - according to the order within an index. - - QAK - 2006/11/13 - - Added new H5Lget_name_by_idx() routine to query the name of a link - according to the order within an index. - - QAK - 2006/11/12 - - Added new H5Rget_name() routine to determine the name of the object - that a reference points to, as long as the object is still - reachable in the group hierarchy. - - QAK - 2006/11/10 - - Added new H5Lget_info_by_idx() routine to query the link information - according to the order within an index. - - QAK - 2006/11/10 - - Added feature to H5Iget_name to allow retrieving the name of any - object's ID, as long as the object is still reachable in the - group hierarchy. - - LA - 2006/11/01 - - Added External and User-defined links. - External links are links from one HDF5 file to another; they - require both the name of the file and a path within that file. - User-defined links allow users to supply callback functions - for link traversals, allowing links to exhibit essentially - any behavior. - External links are a kind of user-defined link, so their default - behavior can be overridden by the user. - -JML 2006/8/23 - - Added H5Oopen and H5Oclose for opening objects of unknown type - (as link callback functions do). - -JML 2006/8/23 - - Added H5Oopen_by_addr, H5Oincr_refcount, and H5Odecr_refcount for - opening objects by address. Be very careful with these! - -JML 2006/8/23 - - Added H5Fget_intent to get the "intent" of a file (whether it - was opened with read-write access or read-only. - -JML 2006/8/23 - - Added Link Access Property Lists. They currently contain two - properties, nlinks (H5Pget/set_nlinks) and elink_prefix - (H5Pget/set_elink_prefix). nlinks controls how many soft and - user-defined traversals are allowed before HDF5 assumes it has - found a cycle (previously this defaulted to 16). - The elink_prefix is a filesystem path that is prefixed to the - names of any external link files opened using this LAPL. - -JML 2006/8/23 - - Add H5L link APIs. Old APIs (H5Glink, H5Gmove, etc.) are still - supported but deprecated. - New APIs are: - H5Llink - create a link to an object given its ID - H5Lmove - just like H5Gmove2 - H5Lcopy - copy a link without copying the underlying object - H5Lcreate_hard - like H5Glink2 for hard links - H5Lcreate_soft - like H5Glink2 for soft links - H5Ldelete - just like H5Gunlink - H5Lget_val - just like H5Gget_linkval - H5Lget_info - gets link-specific info (like H5Gget_objinfo) - - In addition, H5Gcreate_anon, H5Tcommit_anon, and H5Dcreate_anon - no longer create links to objects; objects must be manually linked - using H5Llink or they will be deleted when the ID is closed. - - Link Creation Property Lists can be used to pass character - encoding (ASCII or UTF-8) for link names and to set the Intermediate - Group Creation Flag: - H5Pset_char_encoding, H5Pget_char_encoding - H5Pset_copy_object, H5Pget_copy_object - -JML 2006/7/5 - - Added managements of collective IO supports for chunking storage - inside parallel HDF5 - 1) Implemented One IO with collective mode for all chunks in the - application by building one MPI derived datatype accross all - chunks. - 2) Implemented the decision-making support to do collective IO inside - MPI-IO per chunk. - 3) Added the decision-making support to do one IO accross all chunks - or to do multiple IOs with each IO per chunk. - 4) Added the support to handle the case some processes won't do any IOs in - collectively. - 5) Some MPI-IO package(mpich 1.2.6 or lower, e.g.) cannot handle - collective IO correctly for the case when some processes have no - contributions to IOs, a special macro is added to change - collective IO mode to independent IO mode inside HDF5 library. - - Currently we find that MPICH at Linux and vender MPI-IO package at NCSA - Altix cannot handle this case. - - "hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}" - has been added at the end of file and - . - - If MPI-IO packages at your Linux and Altix support this case, - please comment out the last line and report to us at - help@hdfgroup.org. We can tune in our configuration to - support this. - - KY - 2006/02/16 - - Added character encoding to attribute creation property lists. - JML - 2006/01/02 - - Added H5Gcopy() routine to copy objects between while keeping - data in compressed form. QAK - 2005/11/06 - - Added H5Sextent_equal() routine. QAK - 2005/11/06 - - Added HSYS_ERROR which retrieves the system error message and pushes - it to the error stack. This gives more information of the failed - system call. AKC - 2005/08/04 - - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to - allow querying for objects in file that were opened with a particular - file ID, instead of all objects opened in file with any file ID. - QAK - 2005/06/01 - - Added H5T_CSET_UTF8 character set to mark datatypes that use the - UTF-8 Unicode character encoding. Added tests to ensure that - library handles UTF-8 object names, attributes, etc. -JL 2005/05/13 - - HDF5 supports collective MPI-IO for irregular selection with HDF5 - dataset. Irregular selection is when users use H5Sselect_hyperslab - more than once for the same dataset. - Currently, not all MPI-IO packages support complicated MPI derived - datatype used in the implementation of irregular - selection INSIDE HDF5. - 1) DEC 5.x is not supporting complicated derived datatype. - 2) For AIX 5.1, - if your poe version number is 3.2.0.19 or lower, - please edit powerpc-ibm-aix5.x under hdf5/config, - Find the line with - << hdf5_mpi_complex_derived_datatype_works>> - and UNCOMMENT this line before the configure. - check poe version with the following command: - lpp -l all | grep ppe.poe - 3) For Linux cluster, - if mpich version is 1.2.5 or lower, collective irregular selection - IO is not supported, internally independent IO is used. - 4) For IRIX 6.5, - if C compiler version is 7.3 or lower, collective irregular selection - IO is not supported, internally independent IO is used. - 5) For platforms which internally used mpich, if the - mpich version is 1.2.5 or lower, please find the - corresponding config file and add - hdf5_mpi_complex_derived_datatype_works='no' at the - end of the configuration file. For example, at NCSA - SGI Altix, the internal mpich library is 1.2.5. So - hdf5_mpi_complex_derived_datatype_works='no' should be - added at the end of the config file ia64-linux-gnu. - KY - 2005/09/12 - We also found not all MPI-IO packages support collective IO with one - or more processes to have no contributions to IO. - For mpich version 1.2.6 or lower and all IRIX machine, - if the library checks that there are no IO contributions for some - processes, collective IO request is replaced with - independent inside HDF5. - KY - 2006/05/04 - - - HDF5 N-bit filter - HDF5 support N-bit filter from this version, - The N-Bit filter is used effectively for compressing data of N-Bit - datatype as well as compound and array datatype with N-Bit fields. - KY - 2005/04/15 - - HDF5 scaleoffset filter - HDF5 supports scaleoffset filter for users to do data - compression through HDF5 library. - Scale-Offset compression performs a scale and/or offset operation - on each data value and truncates the resulting value to a minimum - number of bits and then stores the data. - Scaleoffset filter supports floating-point and integer datatype. - Please check the HDF5 reference manual for this. - KY - 2005/06/06 - - Retired SRB vfd (--with-srb). Functions H5Pset_fapl_srb and - H5Pget_fapl_srb were removed. EIP - 2005/04/07 - - Retired GASS vfd (--with-gass). Functions H5Pset_fapl_gass and - H5Pget_fapl_gass are removed too. AKC - 2005/3/3 - - Pablo was removed from the source code EIP - 2005/01/21 - - Modified registration of SZIP to dynamically detect the presence - or absence of the encoder. Changed configure and Makefiles, - and tests to dynamically detect encoder. BEM - 2004/11/02 - - Added function H5Pget_data_transform, together with the previously - added H5Pset_data_transform, to support the data transform - feature. AKC - 2004/10/26 - - Compound datatype has been enhanced with a new feature of size - adjustment. The size can be increased and decreased(without - cutting the last member) as long as it doesn't go down to zero. - No API change is involved. SLU - 2004/10/1 - - Put back 6 old error API functions to be backward compatible with - version 1.6. They are H5Epush, H5Eprint, H5Ewalk, H5Eclear, - H5Eset_auto, H5Eget_auto. Their new equivalent functions are - called H5Epush_stack, H5Eprint_stack, H5Ewalk_stack, - H5Eclear_stack, H5Eset_auto_stack, H5Eget_auto_stack. SLU - - 2004/9/2 - - 4 new API functions, H5Tencode, H5Tdecode, H5Sencode, H5Sdecode were - added to the library. Given object ID, these functions encode and - decode HDF5 objects(data type and space) information into and from - binary buffer. SLU - 2004/07/21 - - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for - SZIP compression. Now there is no restriction on the size and shape of the - chunk except that the total number of elements in the chunk cannot be - bigger than 'pixels_per_block' parameter provided by the user. - EIP - 2004/07/21 - - Added support for SZIP without encoder. Added H5Zget_filter_info - and changed H5Pget_filter and H5Pget_filter_by_id to support this - change. JL/NF - 2004/06/30 - - SZIP always uses K13 compression. This flag no longer needs to - be set when calling H5Pset_szip. If the flag for CHIP - compression is set, it will be ignored (since the two are mutually - exclusive). JL/NF - 2004/6/30 - - A new API function H5Fget_name was added. It returns the name - of the file by object(file, group, data set, named data type, - attribute) ID. SLU - 2004/06/29 - - Added support for user defined identifier types. NF/JL - 2004/06/29 - - A new API function H5Fget_filesize was added. It returns the - actual file size of the opened file. SLU - 2004/06/24 - - New Feature of Data transformation is added. AKC - 2004/05/03. - - New exception handler for datatype conversion is put in to - replace the old overflow callback function. This exception - handler is set through H5Pset_type_conv_cb function. - SLU - 2004/4/27 - - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, - will suppress all library version mismatch warning messages. - AKC - 2004/4/14 - - A new type of dataspace, null dataspace(dataspace without any - element) was added. SLU - 2004/3/24 - - Data type conversion(software) from integer to float was added. - SLU - 2004/3/13 - - Data type conversion(software) from float to integer was added. - Conversion from integer to float will be added later. - SLU -2004/2/4 - - Added new H5Premove_filter routine to remove I/O pipeline filters - from dataset creation property lists. PVN - 2004/01/26 - - Added new 'compare' callback parameter to H5Pregister & H5Pinsert - routines. QAK - 2004/01/07 - - Data type conversion(hardware) between integers and floats was added. - SLU 2003/11/21 - - New function H5Iget_file_id() was added. It returns file ID given - an object(dataset, group, or attribute) ID. SLU 2003/10/29 - - Added new fields to the H5G_stat_t for more information about an - object's object header. QAK 2003/10/06 - - Added new H5Fget_freespace() routine to query the free space in a - given file. QAK 2003/10/06 - - Added backward compatability with v1.6 for new Error API. SLU - - 2003/09/24 - - Changed 'objno' field in H5G_stat_t structure from 'unsigned long[2]' - to 'haddr_t'. QAK - 2003/08/08 - - Changed 'fileno' field in H5G_stat_t structure from 'unsigned long[2]' - to 'unsigned long'. QAK - 2003/08/08 - - Changed 'hobj_ref_t' type from structure with array field to 'haddr_t'. - QAK - 2003/08/08 - - Object references (hobj_ref_t) can now be compared with the 'objno' - field in the H5G_stat_t struct for testing if two objects are the - same within a file. QAK - 2003/08/08 - - Switched over to new error API. SLU - 2003/07/25 Parallel Library: ----------------- - - Added mpich2 as a testing "platform" informally. AKC - 2005/9/28. - - A dataset created in serial mode with H5D_ALLOC_TIME_INCR allocation - setting was not extendible, either explicitly by H5Dextend or - implicitly by writing to unallocated chunks. Library now allocates - more space when needed or directed if the file is opened by parallel - mode, independent of what the dataset allocation mode is. - CC/AKC - 2005/08/29. - - Allow compressed, chunked datasets to be read in parallel. - QAK - 2004/10/04 - - Add options of using atomicity and file-sync to test_mpio_1wMr. - AKC - 2003/11/13 - - Added parallel test, test_mpio_1wMr, which tests if the - underlaying parallel I/O system is conforming to the POSIX - write/read requirement. AKC - 2003/11/12 Fortran Library: ---------------- - - added support for shared Fortran libraries. -JML 2005/09/20 - - added missing h5tget_member_class_f function - EIP 2005/04/06 - - added new functions h5fget_name_f and h5fget_filesize_f - EIP 2004/07/08 - - h5dwrite/read_f and h5awrite/read_f functions only accept dims parameter - of the type INTEGER(HSIZE_T). - - added support for native integers of 8 bytes (i.e. when special - compiler flag is specified to set native fortran integers to 8 bytes, - for example, -i8 flag for PGI and Absoft Fortran compilers, - -qintsize=8 flag for IBM xlf compiler). - EIP 2005/06/20 - - added support for "big" REAL and DOUBLE PRECISION types - (usually the size is specified by compilers flags like - -r8, -r16, etc.) - Known problem: multi file test fails when REAL is 16 bytes. - EIP 2005/09/8 C++ Library: ---------------- - - added support for shared C++ libraries. -JML 2005/09/20 - - Added missing member functions - H5::CompType::getMemberArrayType - H5::CompType::getMemberVarLenType - H5::AbstractDs::getArrayType - H5::AbstractDs::getVarLenType - H5::CommonFG::openArrayType - H5::CommonFG::openVarLenType - H5::PropList::copyProp -- this will replace the current - H5::PropList::copyProp in later releases due - to incorrect prototype. - H5::IdComponent::getHDFObjType - BMR - 2005/08/08 Tools: ------ - - h5repack and h5diff changed command line parameter syntax to be - similar to h5dump, adding also long switch names. PVN - 2008/1/16 - - h5repack now supports adding multiple filters to all objects. - PVN - 2008/1/16 - - h5dump lists groups and attributes in requested orders (by name and - creation order, both ascending and descending). PVN - 2007/10/5 - - h5import imports string (text) data. PVN - 2007/10/5 - - h52gif and gif2h5: Both these tools were revised to include the High - Level Image API support, and tests were added to /hl/tools/gif2h5. - PVN - 2007/04/13 - - h5dump: added support for double long type H5T_NATIVE_LDOUBLE. PVN - 2007/03/13 - - h5dump: added support for binary output, see usage. PVN 2007/03/13 - - h5repack: added support for the new nbit and scaleoffset filters. - PVN - 2007/05/07 - - h5repack: now uses the API function H5Ocopy (of the tool h5copy) to - recreate objects if there is not a user input for changes. PVN - - 2007/05/07 - - h5repack: added support for reading and repacking by hyperslabs for - large files. PVN - 2007/03/01 - - h5repack: a new option allows the copy using the file type (default) - instead of the previous conversion to native type. PVN - 2007/03/01 - - h5repack: output the percentage of compression used. PVN - 2007/03/01 - - h5diff: added support for -p option for unsigned long_long data. PVN - - 2007/02/26 - - h5diff: added support for comparing dataset regions. PVN - 2007/02/20 - - h5diff: added support for reading and comparing by hyperslabs for large files. - PVN - 2007/02/20 - - h5diff: printing of dataset dimensions along with dataset name. PVN -2007/02/19 - - h5dump now uses the new API function H5Rget_name to display the name - of the dataset referenced instead of its ID. PVN - 2007/02/19 - - Added new tool, h5mkgrp. QAK - 2007/02/14 - - Added new tool, h5copy. PVN - 2006/7/15 - - Removed obsolete pdb2hdf5 tool from tools/misc -JML 2005/10/24 - - Added build_h5perf_alone.sh that builds h5perf by standalone mode. - AKC - 2005/09/18. - - Sped up h5dump on files with large numbers of objects. - QAK - 2005/08/25 - - Added a standalone mode for building h5perf. AKC - 2005/08/12 - - new tool, h5jam. See reference manual. 2004/10/08 - - h5repack.sh did not report errors encountered during tests. It does - now. AKC - 2004/04/02 - - Added the MPI-I/O and MPI-POSIX drivers to the list of VFL drivers - available for h5dump and h5ls. RPM & QAK - 2004/02/01 - - Added option --vfd= to h5ls to allow a VFL driver to be selected - by a user. RPM & QAK - 2004/02/01 - - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). - AKC - 2004/01/08 - - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" - respectively if library is built in parallel mode. - WCW - 2003/11/04 - - Added metadata benchmark (perform/perf_meta). SLU - 2003/10/03 - - Changed output of "OID"s from h5dump from "-" to - ":::" to ":" - QAK - 2003/08/08 High-Level APIs: ------ - - Fortran interfaces for the Image, Table and Lite APIs. PVN - 2007/5/1 - - New HDF5 Dimension Scale API (H5DS) allows dimension scales to be - created in an HDF5 file and associated with specific datasets. PVN - 2007/5/1 - - There are two new functions in the Lite library, H5LTtext_to_dtype - and H5LTdtype_to_text. H5LTtext_to_dtype creates a HDF5 data type - given a text description; H5LTdtype_to_text converts a data type - to text description. Only DDL definition is supported as text - desciption now. SLU - 2006/05/17 - - Added Packet Table API for creating tables with less overhead than - H5TB API. Added C++ wrapper for Packet Tables. See documentation. - JML - 2004/03/28 Documentation ------------- - - The documentation for this release is largely complete, but - trails the source code. A few of the newer functions are - not yet documented. FMB - 2007/04/18 - - The user documents for this release can be accessed directly at - this location: - http://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/ - The most recent document versions (updated daily) in the - 1.8 development branch can be accessed at this location: - http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/ - FMB - 2007/04/18 - Support for new platforms, languages and compilers. ======================================= - - Added support for Free-BSD on amd64 with GNU C and Fortran compilers - 4.2.1 - EIP - 2007/06/25 - - Added support for sequential and parallel libraries for Intel 64 Linux - cluster (abe.ncsa.uiuc.edu). Among three MPICH packages available on - this machine, only Open MPI works. The VMI has seg fault in hyperslab.c - and bittests.c tests. The MVAPICH2 complained about mpd not running - the parallel test. (see Known Problems section for more info) - EIP - 2007/06/25 - - Added support for HPUX11.23 for both 32 and 64-bit; HDF5 C++ - - Added support for 64-bit Windows with Visual Studio .NET and 2005. - SJW - 2007/06/25 - - Added suport for HPUX11.23 for both 32 and 64-bit; HDF5 C++ - shared library is not supported with +DD64 flag. - EIP - 2006/06/22 - - Added support for VAX floating numbers for Alpha Open VMS 7.3.2 - EIP - 2006/05/05 - - Fixed broken make.com files in tools directories - EIP - 2006/05/05 - - Added support for Alpha Open VMS 7.3.2 EIP - 2006/04/15 - - Added support for Cray X1. JML - 2005/10/03 - - PGI Fortran compiler is supported on Linux64 systems (x86_64) - EIP - 2004/08/19 - - Absoft compiler f95 v9.0 supported on Linux 2.4 - EIP - 2004/07/29 - - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran - compiler version 8.1. This is a default compiler. - - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler - version 8.2; set F9X environment varibale to f95, for example - setenv F9X f95 - Use --disable-shared --enable-static configure flags when Absoft - compiler is used. - EIP - 2004/07/27 - - HDF5 Fortran APIs are supported on MAC OSX with IBM XL Fortran - Compiler version 8.1 Use "--disable-shared --enable-static" - configure flags along with the "--enable-fortran" flag to build - Fortran library. EIP - 2004/01/07 - -Bug Fixes since HDF5-1.6.0 release + +Bug Fixes since HDF5-1.8.0 release ================================== Library ------- - - Changed library's behavior for reading files that might have - corrupted object header information from a previous (buggy) - version of the library. By default, the library now rebuilds the - correct object header information instead of issuing an error. - Previous "strict" file format interpretation can be enabled with - the "--enable-strict-format-checks" configure option. - QAK - 2008/01/13 - - Fixed several bugs with writing fill values for datasets that have - a variable-length datatype or component datatype. QAK - 2007/06/19 - - STDIO driver didn't support files bigger than 2GB because the OFFSET - parameter of fseek is of type LONG INT, not big enough for big files. - Use fseeko instead for big files if it's available on the system. - SLU - 2007/4/5 - - Fixed a bug in H5Sselect_valid() that caused an incorrect value to - be returned (0) instead of FAIL on error conditions such as the - selection or extent not being defined. CMC - 2007/01/17 - - Fixed the MULTI driver problem (Bug #731) that corruptted the data. - SLU - 2007/1/12 - - Fixed file corruption bug which could write an incorrect number of - messages to an object's header under certain circumstances. - Generally, the sequence of actions to generate this bug looks - like this: - - Create an object - - Close the file - - Re-open the file - - Add 2 (or more) attributes to the object - - Close the file - - Re-open the file - - Delete one of the attributes on the object - - Add a smaller attribute to the object - - Delete the smaller atttribute on the object - - Add a larger attribute on the object - - After this, the number of header messages stored for the object - will be off by one. Other sequences of modifying attributes on an - object could also trigger this bug. If you are opening an - object and the bottom few messages of the HDF5 error stack - resembles this, the object has been affected by this bug: - - #007: ../../hdf5_v1.6/src/H5C.c line 3887 in H5C_load_entry(): unable to load entry - major(08): Meta data cache layer - minor(40): Unable to load metadata into cache - #008: ../../hdf5_v1.6/src/H5Ocache.c line 332 in H5O_load(): corrupt object header - too few messages - major(12): Object header layer - minor(40): Unable to load metadata into cache - - Specifically, "corrupt object header" is the best string to search - for in the HDF5 error stack output. - - If your files have been affected by this bug, or you are concerned - that your files might have been, please contact the HDF Helpdesk - at help@hdfgroup.org for a tool to detect and repair files - affected by this problem. QAK - 2006/6/16 - - Fixed various problems with retrieving names of objects, especially - with mounted files. QAK - 2005/12/25 - - Fixed core dump when closing root groups opened through two different - file handles that operate on the same actual file. QAK - 2005/10/02 - - Corrected errors when performing various operations on a group opened - by dereferencing an object reference. QAK - 2005/07/30 - - Fixed a bug with named datatypes where a copy of a named datatype - used to create a dataset would accidentally use the original - named datatype for the dataset's datatype. QAK - 2005/07/23 - - Made H5Fget_name() be consistent and always return name of actual - file the ID is in. (Instead of the name of the top file in a - file mounting hierarchy). QAK - 2005/07/19 - - Reworked internal file mounting semantics to hopefully eliminate - mounting problems. We now require that files that are mounting - together all have the same "file close degree". QAK - 2005/07/19 - - More bug fixes on holding open files that are mounted and have - IDs open. QAK - 2005/07/14 - - Don't unmount child files until the parent file actually closes. - (Previously, if an object is holding open a file, the child files - would get unmounted too early). QAK - 2005/07/05 - - Fixed bug where unmounted files could cause the library to go into - an infinite loop when shutting down. QAK - 2005/06/30 - - The library didn't save the information of family driver in file. - The original file member size was lost after file was closed (see - bug #213). This has been fixed by saving driver name and member - file size in the superblock. SLU - 2005/6/24 - - Fixed bug with hyperslab selections that use selection offsets and - operate on chunked datasets going into infinite loop or dumping - core. QAK - 2005/06/17 - - Corrected memory leak and possible corruption when opening a group. - QAK - 2005/06/17 - - Added check for opaque datatype tags being too long (check against - H5T_OPAQUE_TAG_MAX, currently set to 256). QAK - 2005/06/14 - - Fixed various errors in maintaining names for open objects in the - face of unusual mount & unmount operations. QAK - 2005/06/08 - - "SEMI" and "STRONG" file close degree settings now apply only to the - particular file ID being closed, instead of operating on all open - file IDs for a given file. QAK - 2005/06/01 - - For family driver, the library didn't save member size in file. - When file is reopened, the size of 1st member file determine the - member size. Now member size is saved in file and is used to - define member file size. Wrong file access property of member size - will result in a failure. Using any other driver except family - will cause library to return error. So is multi driver. SLU - - 2005/05/24 - - Fixed error in opening object in group that was opened in mounted - file which has been unmounted. QAK - 2005/03/17 - - Fixed a racing condition in MPIPOSIX virtual file drive close - function. Now all processes must completed the close before any - of them is returned. This prevents some "faster" processes start - accessing the file for another purpose (e.g., open with truncate) - while other "slower" processes have not closed the same file with - the previous purpose. AKC - 2005/03/01 - - H5Tget_member_value calls for enum datatype didn't return correct - value if H5Tenum_valueof was called first. It's fixed. SLU - - 2005/02/08 - - For variable-length string, H5Tget_class returned H5T_STRING as its - class. But H5Tdetect_class and H5Tget_member_class considered it - as H5T_VLEN. This is fixed to let all these 3 functions treat it - as H5T_STRING. SLU - 2005/02/08 - - The byte order of 1-byte integer types was fixed as little endian - even on a big-endian machine. This has been corrected. SLU - - 2005/02/07 - - Fix segmentation fault when calling H5Fflush with an attribute that - hasn't had a value written to it open. QAK - 2004/10/18 - - Back up supporting bitfield and time types in H5Tget_native_type. - Leave it to future support. The function simply returns error - message of "not support" for bitfield and time types. - SLU - 2004/10/5 - - Fixed address check in Core VFL driver to avoid spurious address/size - overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - - Fixed parallel bug in which some processes attempted collective - I/O while others did independent I/O. Bug appeared when some - processes used point selections, and others didn't. JRM - 2004/9/15 - - Corrected error where dataset region references were written in an - incorrect way on Cray machines. PVN & QAK - 2004/09/13 - - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting - an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - - Changed H5Dread() to not overwrite data in an application's buffer - with garbage when accessing a chunked dataset with an undefined - fill value and an unwritten chunk is uncountered. QAK - 2004/08/25 - - Fixed error which could cause a core dump when a type conversion - routine was registered after a compound datatype had been - converted and then an equivalment compound datatype was converted - again. QAK - 2004/08/07 - - Fixed memory overwrite when encoding "multi" file driver information - for file's superblock. QAK - 2004/08/05 - - Fixed obscure bug where a filter which failed during chunk allocation - could allow library to write uncompressed data to disk but think - the data was compressed. QAK - 2004/07/29 - - Fixed bug where I/O to an extendible chunked dataset with zero-sized - dimensions would cause library to fail an assertion. - QAK - 2004/07/27 - - Fixed bug where chunked datasets which have filters defined, - allocation time set to "late" and whose chunks don't align with - the dataspace bounds could have incorrect data stored when - overwriting the entire dataset on the first write. QAK - 2004/07/27 - - Added check to ensure that dataspaces have extents set. JML-2004/07/26 - - Fixed bug on some Solaris systems where HDF5 would try to use - gettimeofday() when that function didn't work properly. - JML - 2004/07/23 - - Fixed bug in H5Sset_extent_simple where setting maximum size to - non-zero, then to zero would cause an error. JML - 2004/07/20 - - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite - when not writing data ("none" selection or hyperslab or point - selection with no elements defined). QAK - 2004/07/20 - - Calling H5Gcreate() on "/" or "." throws an error instead of - failing quietly. JML - 2004/07/19 - - Fixed bug where setting file address size to be very small could - trigger an assert if the file grew to more than 64 KB. Now throws - an error and data can be recovered. JL/NF - 2004/07/14 - - Fixed bug where "resurrecting" a dataset was failing. - QAK - 2004/07/14 - - Fixed bug where incorrect data could be read from a chunked dataset - after it was extended. QAK - 2004/07/12 - - Fixed failure to read data back from file of compound type with - variable-length string as field. SLU - 2004/06/10 - - Fixed potential file corruption bug when a block of metadata could - overlap the end of the internal metadata accumulator buffer and - the buffer would be extended correctly, but would incorrectly - change it's starting address. QAK - 2004/06/09 - - Opaque datatype with no tag failed for some operations. Fixed. - SLU - 2004/6/3 - - Fixed potential file corruption bug where dimensions that were - too large (a value greater than could be represented in 32-bits) - could cause the incorrect amount of space to be allocated in a - file for the raw data for the dataset. QAK - 2004/06/01 - - Fixed dtypes "sw long double -> double" failure in QSC class - machines. AKC - 2004/4/16 - - Fixed problem with fletcher32 filter when converting data of different - endianess. PVN - 2004/03/10 - - Fixed problem with H5Tget_native_type() not handling opaque fields - correctly. QAK - 2004/01/31 - - Fixed several errors in B-tree deletion code which could cause a - B-tree (used with groups and chunked datasets) to become corrupt - with the right sequence of deleted objects. QAK - 2004/01/19 - - Fixed small internal memory leaks of fill-value information. - QAK - 2004/01/13 - - Fixed bug that caused variable-length datatypes (strings or sequences) - used for datasets in files with objects that were unlinked to - fail to be read/written to a file. QAK - 2004/01/13 - - Detect situation where szip 'pixels per block' is larger than the - fastest changing dimension of a dataset's chunk size and disallow - this (due to limits in szip library). QAK - 2003/12/31 - - Fixed bug with flattened hyperslab selections that would generate - incorrect hyperslab information with certain high-dimensionality - combinations of start/stride/count/block information. - QAK - 2003/12/31 - - Fixed bug with variable-length datatypes used in compound datatypes. - SLU - 2003/12/29 - - Fixed bug in parallel I/O routines that would cause reads from - "short datasets" (datasets which were only partially written out) - to return invalid data. QAK & AKC - 2003/12/19 - - Fixed bug where scalar dataspaces for attributes were reporting as - simple dataspaces. QAK - 2003/12/13 - - Fixed problem with selection offsets of hyperslab selections in - chunked datasets causing the library to go into an infinite loop. - QAK - 2003/12/13 - - Fixed H5Giterate to avoid re-using index parameter after iteration - callback has been called (allows iteration callback to modify the - index parameter itself). QAK - 2003/12/06 - - Fixed various floating-point conversion problems, including a - change which could corrupt data when converting from double->float. - QAK - 2003/11/24 - - Changed "single process" metadata writing in library to collective - I/O by all processes, in order to guarantee correct data being - written with MPI-I/O. QAK - 2003/11/20 - - Fixed problems with fill values and variable-length types and also - I/O on VL values that were set to NULL. QAK - 2003/11/08 - - Fixed problems with MPI datatypes that caused ASCI Q machine to - hang. QAK - 2003/10/28 - - Removed HDF5_MPI_PREFER_DERIVED_TYPES environment variable support, - since it had no benefit. QAK - 2003/10/28 - - Single hyperslab selections (which were set with only one call to - H5Sselect_hyperslab) that had dimensions that could be "flattened" - but were interspersed with dimensions that could not be flattened - were not correctly handled, causing core dumps. QAK - 2003/10/25 - - Fixed incorrect datatype of the third parameter to the Fortran90 - h5pset(get)_cache_f subroutine (INTEGER to INTEGER(SIZE_T)) - EIP - 2003/10/13 - - Fixed problems with accessing variable-length data datatypes on - Crays. QAK - 2003/10/10 - - Fixed potential file corruption bug when too many object header - messages (probably attributes, from a user perspective) were - inserted into an object header and certain other conditions were - met. QAK - 2003/10/08 - - Changed implementation of internal ID searching algorithm to avoid - O(n) behavior for many common cases. QAK - 2003/10/06 - - Allow partial parallel writing to compact datasets. QAK - 2003/10/06 - - Correctly create reference to shared datatype in attribute, instead - of making a copy of the shared datatype in the attribute. - QAK - 2003/10/01 - - Revert changes which caused files >2GB to fail when created with - MPI-I/O file driver on certain platforms. QAK - 2003/09/16 - - Allow compound datatypes to grow in size. SLU - 2003/09/10 - - Detect if a type is already packed before attempting to pack it - again or check if it is locked. SLU - 2003/09/10 - - Corrected bug when opening a file twice with read-only permission - for one open and then closing the read-only access file ID would - generate an error. QAK - 2003/09/10 - - Corrected bug in repeated calls to H5Pget_access_plist() which would - incorrectly manage reference counts of internal information and - eventually blow up. QAK - 2003/09/02 - - Return rank of the array datatype on successful call to - H5Tget_array_dims(). QAK - 2003/08/30 - - Corrected bug in H5Tdetect_class which was not correctly detecting - datatype classes of fields in nested compound datatypes in some - circumstances. QAK - 2003/08/30 - - Corrected bug in sieve buffer code which could cause loss of data - when a small dataset was created and deleted in quick succession. - QAK - 2003/08/27 - - Corrected bug in H5Gget_objname_by_idx which was not allowing NULL - for the name when just querying for the object name's length. - QAK - 2003/08/25 - - Corrected bug in variable-length string handling which could - generate a core dump on writing variable-length strings as part - of a compound datatype on certain architectures. QAK - 2003/08/25 - - Corrected bug in H5Tget_native_type which would incorrectly compute - the size of certain compound datatypes and also incorrectly - compute the offset of the last field for those compound datatypes. - QAK - 2003/08/25 - - Corrected bug in H5Tget_native_type which would drop string datatype - metadata (padding, etc.) QAK - 2003/08/25 - - Corrected bugs in H5Gget_num_objs, H5Gget_objname_by_idx and - H5Gget_objtype_by_idx to allow them to accept location IDs, not just - group IDs. QAK - 2003/08/21 - - Corrected bug when using scalar dataspace for memory selection and - operating on chunked dataset. QAK - 2003/08/18 - - Corrected bugs with multiple '/' characters in names for H5Glink - and H5Gunlink. QAK - 2003/08/16 - - Corrected bug with user blocks that didn't allow a user block to - be inserted in front of a file after the file was created. - QAK - 2003/08/13 - - Corrected errors with using point selections to access data in - chunked datasets. QAK - 2003/07/23 - - Corrected error with variable-length datatypes and chunked datasets - caused H5Dwrite to fail sometimes. QAK - 2003/07/19 - - Modified library and file format to support storing indexed storage - (chunked dataset) B-tree's with non-default internal 'K' values. - QAK - 2003/07/15 - - Returned H5T_BKG_TEMP support to library after it was accidentally - removed. QAK - 2003/07/14 + - Fixed the problem with the searching of target file for H5Lcreate_external(). + The searching pattern will depend on whether the target file's + pathname is an absolute or a relative path. Please see the description + in the RM for H5Lcreate_external(). (VC - 4/8/08) + - Fixed possible file corruption bug when encoding datatype + descriptions for compound datatypes whose size was between + 256 & 511 bytes and the file was opened with the "use the + latest format" property enabled (with H5Pset_libver_bounds). + (QAK - 2008/03/13) + - Fixed bug in H5Aget_num_attrs() routine to handle invalid location + ID correctly. (QAK - 2008/03/11) + Configuration ------------- - - Configure can now use any tr command. No more need for - defining variable TR nor is it supported. -AKC 2006/05/19 - - Parallel I/O with the MPI-I/O driver will no longer work if the - filesystem is not POSIX compliant. The "HDF5_MPI_1_METAWRITE" - environment variable has been removed. QAK - 2004/01/30 - - Fixed the error that cause "make install" to fail because of the - macro definition syntax of "prefix?=..." AKC - 2003/07/22 Performance ------------- - - Optimized I/O for enumerated datatypes that are a superset of source - enumerated datatype. QAK - 2005/03/19 - - More optimizations to inner loops of datatype conversions for - integers and floats which give a 10-50% speedup. QAK - 2003/11/07 - - Hoisted invariant 'if/else's out of inner datatype conversion loop for - integer and floating-point values, giving about a 20% speedup. - QAK - 2003/10/20 Tools ----- - - Fixed h5dump regarding the display of blocks in hyperslab - selections. PVN 2008/01/16 - - Fixed h5diff regarding the display of NaN (Not a Number) - values. PVN 2008/01/16 - - Fixed h5dump regarding the parsing of binary output parameters. - PVN 2008/01/16 - - Fixed memory problems in h52gif and gif2h5. PVN 2008/01/16 - - Fixed h5repack dealing with NULL references. PVN 2008/01/16 - - Fixed h5dump & h5ls to display attributes in "name" order, rather - than the order they are encountered in the object header. - QAK - 2007/10/04 - - Fixed h5dump regarding the display of named datatypes - attributes. PVN 2007/03/13 - - Fixed h5dump regarding the display of group comments. PVN - 2007/03/13 - - Fixed h5dump regarding the display of hardlinks pointing - to the root group. PVN 2007/03/13 - - Fixed h5diff percentage option -p. PVN 2007/03/05 - - Fixed h5dump that caused array indices greater than 2 ^32-1 - not to be printed correctly - PVN 2007/2/19 - - Fixed h5dump to print attributes data in ASCII if -r option is used. - AKC - 2004/11/18 - - Fixed space utilization reported in h5ls to correct error in formula - used. QAK - 2004/10/22 - - Fixed h5redeploy which sometimes complain too many argument for the - test command. (The complain did not hinder the h5redploy to - proceed correctly.) AKC - 2003/11/03 - - Fixed a segmentation fault of h5diff when percentage option is used. - AKC - 2003/08/27 - - Switched away from tools using internal "fixtype" function(s) to use - H5Tget_native_type() internally. QAK - 2003/08/25 + - Fixed bug in h5diff that prevented datasets & attributes with + variable-length string elements from comparing correctly. + (QAK - 2008/02/28) + - h5import bug on Windows w/binary datasets. fread in windows needs a + binary file to be open with 'rb' instead of 'r' otherwise it + terminates execution if an end of file character is found on the + input file. Besides that the binary file generated needs to be open + with 'wb' , otherwise an end of line character is read twice. + (PVN - 2008/02/19) + - Fixed bug in h5dump that caused binary output to be made only for the first + dataset, when several datasets were requested. (PVN - 2008/04/07) + Documentation @@ -992,27 +111,23 @@ Bug Fixes since HDF5-1.6.0 release F90 APIs -------- - - h5pget_driver_f was returning information that could not be - interpreted by fortran application program; fixed. EIP - 2005/04/10 + + + C++ APIs + -------- + - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) + - Fixed bug in PropList::getClassName to use portable HDfree instead + of free. (BMR - 2008/04/20) Platforms Tested ================ -Platforms marked with * were not tested for hdf5-1.8.0-rc* release -(This information is somewhat out of date and may be inaccurate. It will be - updated for a later release) -* AIX 5.2 (32/64 bit) xlc 8.0.0.11 + AIX 5.2 (32/64 bit) xlc 8.0.0.11 xlC 8.0 xlf 10.01.0000.0 mpcc_r 6.0.0.8 mpxlf_r 8.1.1.7 -* AIX 5.3 (32/64 bit) xlc 7.0.0.8 - xlC 7.0.0.8 - xlf 09.01.0000.0007 -* Cray X1 water 3.0.35 Cray Standard C Version 5.4.0.7.4 - Cray Fortran 5.4.0.7.3 - Cray C++ 5.4.0.7.4 FreeBSD 6.2-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 (duty) g++ 3.4.6 [FreeBSD] 20060305 gcc 4.2.1 20080123 @@ -1024,14 +139,11 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release g++ 4.2.1 20080123 gfortran 4.2.1 20080123 -* HP-UX B.11.23 HP aC++/ANSI C B3910B A.06.00 - HP F90 v2.9.2 - HP aC++/ANSI C B3910B A.06.00 IRIX64 6.5 (64 & n32) MIPSpro cc 7.4.4m F90 MIPSpro 7.4.4m C++ MIPSpro cc 7.4.4m -* Linux 2.6.9 (RHEL4) Intel 10.0 compilers + Linux 2.6.9 (RHEL4) Intel 10.0 compilers (abe.ncsa.uiuc.edu) Linux 2.4.21-47 gcc 3.2.3 20030502 (osage) @@ -1048,9 +160,6 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 95 6.2 Sun WorkShop 6 update 2 C++ 5.3 -* SunOS 5.10 i86pc Sun C 5.7 - Sun Fortran 95 8.1 - Sun C++ 5.7 SunOS 5.10 cc: Sun C 5.8 (linew) f90: Sun Fortran 95 8.2 CC: Sun C++ 5.8 @@ -1075,105 +184,91 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) -* Alpha Open VMS 7.3 + Alpha Open VMS 7.3 Supported Configuration Features Summary -(This table was not modified for 1.8.0-rc* release; for information contact help@hdfgroup.org) ======================================== In the tables below y = tested and supported n = not supported or not tested in this release x = not working in this release - dna = does not apply ( ) = footnote appears below second table - = testing incomplete on this feature or platform - -Platform C F90 F90 C++ zlib SZIP - parallel parallel -SunOS5.8 64-bit n y n y y y -SunOS5.8 32-bit n y n y y y -SunOS5.10 64-bit y(1) y n y y y -SunOS5.10 32-bit y(1) y n y y y -IRIX64_6.5 64-bit n y y y y y -IRIX64_6.5 32-bit n n n n y y -Cray XT3 (16) n n n n n n -AIX-5.2 & 5.3 32-bit y y y y y y -AIX-5.2 & 5.3 64-bit y y y y y y -Windows XP n y(15) n(15) y y y -Windows XP x64 n y(15) n(15) y y y -Windows Vista n n n y y y -Mac OS X 10.4 PowerPC n n -FreeBSD 4.11 n n n y y y -RedHat EL3 W (3) y(1a) y(10) y(1a) y y y -RedHat EL3 W Intel (3) n y n y y n -RedHat EL3 W PGI (3) n y n y y n -SuSe x86_64 gcc (3,12) y(1a) y(11) n y y y -SuSe x86_64 Int (3,12) n y(13) n y y n -SuSe x86_64 PGI (3,12) n y(8) n y y y -Linux 2.4 Xeon C - Lustre Intel (3,6) n y n y y n -Linux 2.6 SuSE ia64 C - Intel (3,7) y y y y y n -Linux 2.6 SGI Altix - ia64 Intel (3) y y y y y y -Alpha OpenVMS 7.3.2 n y n y n n - - - -Platform Shared Shared Shared static- Thread- - C libs F90 libs C++ libs exec safe -Solaris2.8 64-bit y y y x y -Solaris2.8 32-bit y y y x y -Solaris2.10 64-bit y x y -Solaris2.10 32-bit y x y -IRIX64_6.5 64-bit y y n y y -IRIX64_6.5 32-bit y dna y y y -HPUX11.00 y n y x n -HPUX11.23-32bit y n n y n -HPUX11.23-64bit y dna n y n -Cray XT3 (16) n n n n n -AIX-5.2 & 5.3 32-bit n n n y n -AIX-5.2 & 5.3 64-bit n n n y n -Windows XP y y(15) y y y -Windows XP x64 y y(15) y y y -Windows Vista y n n y y -Mac OS X 10.3 y y n -Mac OS X 10.4 PowerPC -FreeBSD 4.11 y n y y y -RedHat EL3 W (3) y y(10) y y y -RedHat EL3 W Intel (3) y y y y n -RedHat EL3 W PGI (3) y y y y n -SuSe x86_64 W GNU (3,12) y y y y y -SuSe x86_64 W Int (3,12) y y y y(14) n -SuSe x86_64 W PGI (3,12) y y y y(14) n -Linux 2.4 Xeon C - Lustre Intel (6) y y y y n -Linux 2.4 SuSE - ia64 C Intel (7) y y y y n -Linux 2.4 SGI Altix - ia64 Intel y y n -Alpha OpenVMS 7.3.2 n n n y n + = testing incomplete on this feature or platform + W or C indicates workstation or cluster, respectively. + +Platform C F90 F90 C++ zlib SZIP + parallel parallel +SunOS5.8 64-bit n y n y y y +SunOS5.8 32-bit n y n y y y +SunOS5.10 64-bit n y n y y y +SunOS5.10 32-bit n y n y y y +IRIX64_6.5 64-bit n y y y y y +IRIX64_6.5 32-bit n n n n y y +AIX-5.2 32-bit y y y y y y +AIX-5.2 64-bit y y y y y y +Cray XT3 (not tested + for this release) n n n n n n +Windows XP n y(3) n(3) y y y +Windows XP x64 n y(3) n(3) y y y +Windows Vista n n n y y y +Mac OS X 10.4 PowerPC n n +Mac OS X 10.4 Intel n y n y y y +FreeBSD 6.2 32-bit n n n y y y +FreeBSD 6.2 64-bit +RedHat EL4 2.6.9 i686 GNU W y(2) y(4) y(2) y y y +RedHat EL4 2.6.9 i686 Intel W n y n y y n +RedHat EL4 2.6.9 i686 PGI W n y n y y n +SuSe Linux 2.6.16 x86_64 GNU (5) W y(2) y n y y y +SuSe Linux 2.6.16 x86_64 Int (5) W n y n y n n +SuSe Linux 2.6.16 x86_64 PGI (5) W n y n y n n +RHL9 Linux 2.4 Xeon Lustre Intel C n y n y y n +RHEL3 Linux 2.4 Xeon Intel W n y n n y n +RHEL4 Linux 2.6 Xeon Lustre Int C n y n y y n +SuSE Linux 2.4 ia64 Intel C y(1) y y y y y +SuSe Linux 2.6.5 + SGI Altix ia64 Intel C n y n y n y +Alpha OpenVMS 7.3.2 n y n y n n + + + +Platform Shared Shared Shared static- Thread- + C libs F90 libs C++ libs exec safe +SunOS 5.8 32-bit y y y x y +SunOS 5.8 64-bit y y y x y +SunOS 5.10 32-bit y y y x y +SunOS 5.10 64-bit y y y x y +IRIX64_6.5 32-bit y n y x y +IRIX64_6.5 64-bit y y n x y +AIX-5.2 32-bit n n n x n +AIX-5.2 64-bit n n n x n +Cray XT3 (not tested + for this release) n n n x n +Windows XP y y(3) y y y +Windows XP x64 y y(3) y y y +Windows Vista y n n y y +Mac OS X 10.4 Intel Duo y y y x n +FreeBSD 6.2 32-bit y y y x n +FreeBSD 6.2 64-bit y y y x n +RHEL4 2.6.9 i686 GNU W y y(4) y x y +RHEL4 2.6.9 i686 Intel W y y y x n +RHEL4 2.6.9 i686 PGI W y y y x n +SuSE Linux 2.6.16 x86_64 GNU (5) W y y y x y +SuSE Linux 2.6.16 x86_64 Intel(5) W y y y x n +SuSE Linux 2.6.16 x86_64 PGI(5) W y y y x n +RHL9 Linux 2.4 Xeon Lustre Intel C y y y x n +RHEL3 Linux 2.4 Xeon Intel W y n n x n +RHEL4 Linux 2.6 Xeon Lustre Intel C y y y x n +SuSE Linux 2.4 ia64 Intel C y y y x n +SuSe Linux 2.6.5 + SGI Altix ia64 Intel C n n n x n Notes: (1) Using mpich 1.2.6. - (1a) Using mpich2 1.0.6. - (2) Using mpt and mpich 1.2.6. - (3) Linux 2.6 with GNU, Intel, and PGI compilers, as indicated. - W or C indicates workstation or cluster, respectively. - - (6) Linux 2.4.21-32.0.1. Xeon cluster with ELsmp_perfctr_lustre - and Intel compilers - (7) Linux 2.4.21, SuSE_292.till. Ia64 cluster with Intel compilers - (8) pgf90 - (9) With Compaq Visual Fortran 6.6c compiler. - (10) With PGI and Absoft compilers. - (11) PGI and Intel compilers for both C and Fortran - (12) AMD Opteron x86_64 - (13) ifort - (14) Yes with C and Fortran, but not with C++ - (15) Using Visual Studio 2005 or Cygwin - (16) Not tested for this release. + (2) Using mpich2 1.0.6. + (3) Using Visual Studio 2005 or Cygwin + (4) With PGI and Absoft compilers. + (5) AMD Opteron x86_64 Compiler versions for each platform are listed in the preceding "Platforms Tested" table. @@ -1310,12 +405,6 @@ Known Problems the different precision in the values displayed and h5ls appears to be dumping floating-point numbers correctly. -* Before building HDF5 F90 Library from source on Crays - replace H5Aff.f90, H5Dff.f90 and H5Pff.f90 files in the fortran/src - subdirectory in the top level directory with the Cray-specific files - from this site: - ftp://www.hdfgroup.uiuc.edu/pub/outgoing/hdf5/hdf5-1.8.0-pre/PATCH/ - * Not all platforms behave correctly with szip's shared libraries. Szip is disabled in these cases, and a message is relayed at configure time. Static libraries should be working on all systems that support szip, and should be @@ -1328,23 +417,6 @@ Known Problems complaining about exit subroutine. Comment out the line IF (total_error .ne. 0) CALL exit (total_error) -* On IA32 and IA64 systems, if you use a compiler other than GCC (such as - Intel's ecc or icc compilers), you will need to modify the generated - "libtool" program after configuration is finished. On or around line 104 of - the libtool file, there are lines which look like: - - # How to pass a linker flag through the compiler. - wl="" - - change these lines to this: - - # How to pass a linker flag through the compiler. - wl="-Wl," - - UPDATE: This is now done automatically by the configure script. However, if - you still experience a problem, you may want to check this line in the - libtool file and make sure that it has the correct value. - * Information about building with PGI and Intel compilers is available in INSTALL file sections 5.7 and 5.8 diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9f888c8..85cef2f 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -312,6 +312,8 @@ H5Aget_num_attrs(hid_t loc_id) H5TRACE1("Is", "i", loc_id); /* check arguments */ + if(H5I_BADID == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad location ID") if(H5I_FILE == H5I_get_type(loc_id) || H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") if(NULL == (obj = H5I_object(loc_id))) diff --git a/src/H5B2int.c b/src/H5B2int.c index 2625c63..eae1291 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -203,7 +203,7 @@ HDmemset(shared->page, 0, shared->node_size); /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - shared->max_nrec_size = (H5V_log2_gen((uint64_t)shared->node_info[0].max_nrec) + 7) / 8; + shared->max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[0].max_nrec); HDassert(shared->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); /* Initialize internal node info */ @@ -217,7 +217,7 @@ HDmemset(shared->page, 0, shared->node_size); shared->node_info[u].cum_max_nrec = ((shared->node_info[u].max_nrec + 1) * shared->node_info[u - 1].cum_max_nrec) + shared->node_info[u].max_nrec; - shared->node_info[u].cum_max_nrec_size = (H5V_log2_gen((uint64_t)shared->node_info[u].cum_max_nrec) + 7) / 8; + shared->node_info[u].cum_max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[u].cum_max_nrec); if((shared->node_info[u].nat_rec_fac = H5FL_fac_init(shared->type->nrec_size * shared->node_info[u].max_nrec)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") @@ -576,7 +576,7 @@ H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, unsigned *bt2_flags_ptr) shared->node_info[shared->depth].merge_nrec = (shared->node_info[shared->depth].max_nrec * shared->merge_percent) / 100; shared->node_info[shared->depth].cum_max_nrec = ((shared->node_info[shared->depth].max_nrec + 1) * shared->node_info[shared->depth - 1].cum_max_nrec) + shared->node_info[shared->depth].max_nrec; - shared->node_info[shared->depth].cum_max_nrec_size = (H5V_log2_gen((uint64_t)shared->node_info[shared->depth].cum_max_nrec) + 7) / 8; + shared->node_info[shared->depth].cum_max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[shared->depth].cum_max_nrec); if((shared->node_info[shared->depth].nat_rec_fac = H5FL_fac_init(shared->type->nrec_size * shared->node_info[shared->depth].max_nrec)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") if((shared->node_info[shared->depth].node_ptr_fac = H5FL_fac_init(sizeof(H5B2_node_ptr_t) * (shared->node_info[shared->depth].max_nrec + 1))) == NULL) diff --git a/src/H5D.c b/src/H5D.c index 7153ea5..7fd03b3 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -625,7 +625,7 @@ H5Dget_create_plist(hid_t dset_id) H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) - H5FL_BLK_FREE(type_conv, bkg_buf); + (void)H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end if */ @@ -633,7 +633,7 @@ H5Dget_create_plist(hid_t dset_id) H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) - H5FL_BLK_FREE(type_conv, bkg_buf); + (void)H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ } /* end if */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c new file mode 100644 index 0000000..baaa5f1 --- /dev/null +++ b/src/H5Dchunk.c @@ -0,0 +1,1515 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/****************/ +/* Module Setup */ +/****************/ + +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#ifdef H5_HAVE_PARALLEL +#include "H5MMprivate.h" /* Memory management */ +#endif /* H5_HAVE_PARALLEL */ +#include "H5Vprivate.h" /* Vector and array functions */ + + +/****************/ +/* Local Macros */ +/****************/ + +/* Default skip list height for storing list of chunks */ +#define H5D_DEFAULT_SKIPLIST_HEIGHT 8 + +/* Macros for iterating over chunks to operate on */ +#define H5D_CHUNK_GET_FIRST_NODE(map) (map->use_single ? (H5SL_node_t *)(1) : H5SL_first(map->sel_chunks)) +#define H5D_CHUNK_GET_NODE_INFO(map, node) (map->use_single ? map->single_chunk_info : (H5D_chunk_info_t *)H5SL_item(node)) +#define H5D_CHUNK_GET_NEXT_NODE(map, node) (map->use_single ? (H5SL_node_t *)NULL : H5SL_next(node)) + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + +/* Chunked layout operation callbacks */ +static herr_t H5D_chunk_io_init(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, H5D_chunk_map_t *fm); +static herr_t H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *fm); +static herr_t H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *fm); +static herr_t H5D_chunk_io_term(const H5D_chunk_map_t *fm); + +/* "Null" layout operation callbacks */ +static ssize_t H5D_null_readvv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); + +/* Helper routines */ +static herr_t H5D_free_chunk_info(void *item, void *key, void *opdata); +static herr_t H5D_create_chunk_map_single(H5D_chunk_map_t *fm, + const H5D_io_info_t *io_info); +static herr_t H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, + const H5D_io_info_t *io_info); +static herr_t H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); +static herr_t H5D_chunk_file_cb(void *elem, hid_t type_id, unsigned ndims, + const hsize_t *coords, void *fm); +static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, + const hsize_t *coords, void *fm); + + + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Compact storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{ + H5D_chunk_io_init, + H5D_chunk_read, + H5D_chunk_write, +#ifdef H5_HAVE_PARALLEL + H5D_chunk_collective_read, + H5D_chunk_collective_write, +#endif /* H5_HAVE_PARALLEL */ + NULL, + NULL, + H5D_chunk_io_term +}}; + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* "null" storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_NULL[1] = {{ + NULL, + NULL, + NULL, +#ifdef H5_HAVE_PARALLEL + NULL, + NULL, +#endif /* H5_HAVE_PARALLEL */ + H5D_null_readvv, + NULL, + NULL +}}; + +/* Declare a free list to manage the H5D_chunk_info_t struct */ +H5FL_DEFINE(H5D_chunk_info_t); + + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_io_init + * + * Purpose: Performs initialization before any sort of I/O on the raw data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 20, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *fm) +{ + H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ + const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */ + H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ + hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ + htri_t file_space_normalized = FALSE; /* File dataspace was normalized */ + hid_t f_tid = (-1); /* Temporary copy of file datatype for iteration */ + hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + unsigned f_ndims; /* The number of dimensions of the file's dataspace */ + int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */ + H5SL_node_t *curr_node; /* Current node in skip list */ + H5S_sel_type fsel_type; /* Selection type on disk */ + char bogus; /* "bogus" buffer to pass to selection iterator */ + unsigned u; /* Local index variable */ + hbool_t sel_hyper_flag; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_io_init) + + /* Get layout for dataset */ + fm->layout = &(dataset->shared->layout); + fm->nelmts = nelmts; + + /* Check if the memory space is scalar & make equivalent memory space */ + if((sm_ndims = H5S_GET_EXTENT_NDIMS(mem_space)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number") + /* Set the number of dimensions for the memory dataspace */ + H5_ASSIGN_OVERFLOW(fm->m_ndims, sm_ndims, int, unsigned); + + /* Get dim number and dimensionality for each dataspace */ + fm->f_ndims = f_ndims = dataset->shared->layout.u.chunk.ndims - 1; + if(H5S_get_simple_extent_dims(file_space, fm->f_dims, NULL) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality") + + /* Normalize hyperslab selections by adjusting them by the offset */ + /* (It might be worthwhile to normalize both the file and memory dataspaces + * before any (contiguous, chunked, etc) file I/O operation, in order to + * speed up hyperslab calculations by removing the extra checks and/or + * additions involving the offset and the hyperslab selection -QAK) + */ + if((file_space_normalized = H5S_hyper_normalize_offset((H5S_t *)file_space, old_offset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset") + + /* Decide the number of chunks in each dimension*/ + for(u=0; uchunk_dim[u]=fm->layout->u.chunk.dim[u]; + + /* Round up to the next integer # of chunks, to accomodate partial chunks */ + fm->chunks[u] = ((fm->f_dims[u]+dataset->shared->layout.u.chunk.dim[u])-1) / dataset->shared->layout.u.chunk.dim[u]; + } /* end for */ + + /* Compute the "down" size of 'chunks' information */ + if(H5V_array_down(f_ndims,fm->chunks,fm->down_chunks) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute 'down' sizes") + +#ifdef H5_HAVE_PARALLEL + /* Calculate total chunk in file map*/ + fm->select_chunk = NULL; + fm->total_chunks = 1; + for(u = 0; u < fm->f_ndims; u++) + fm->total_chunks = fm->total_chunks * fm->chunks[u]; + if(io_info->using_mpi_vfd) { + H5_CHECK_OVERFLOW(fm->total_chunks, hsize_t, size_t); + if(NULL == (fm->select_chunk = (H5D_chunk_info_t **)H5MM_calloc((size_t)fm->total_chunks * sizeof(H5D_chunk_info_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + + + /* Initialize "last chunk" information */ + fm->last_index = (hsize_t)-1; + fm->last_chunk_info = NULL; + + /* Point at the dataspaces */ + fm->file_space = file_space; + fm->mem_space = mem_space; + + /* Special case for only one element in selection */ + /* (usually appending a record) */ + if(nelmts == 1 +#ifdef H5_HAVE_PARALLEL + && !(io_info->using_mpi_vfd) +#endif /* H5_HAVE_PARALLEL */ + ) { + /* Initialize skip list for chunk selections */ + fm->sel_chunks = NULL; + fm->use_single = TRUE; + + /* Initialize single chunk dataspace */ + if(NULL == dataset->shared->cache.chunk.single_space) { + /* Make a copy of the dataspace for the dataset */ + if((dataset->shared->cache.chunk.single_space = H5S_copy(file_space, TRUE, FALSE)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file space") + + /* Resize chunk's dataspace dimensions to size of chunk */ + if(H5S_set_extent_real(dataset->shared->cache.chunk.single_space, fm->chunk_dim) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust chunk dimensions") + + /* Set the single chunk dataspace to 'all' selection */ + if(H5S_select_all(dataset->shared->cache.chunk.single_space, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to set all selection") + } /* end if */ + fm->single_space = dataset->shared->cache.chunk.single_space; + HDassert(fm->single_space); + + /* Allocate the single chunk information */ + if(NULL == dataset->shared->cache.chunk.single_chunk_info) { + if(NULL == (dataset->shared->cache.chunk.single_chunk_info = H5FL_MALLOC(H5D_chunk_info_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + } /* end if */ + fm->single_chunk_info = dataset->shared->cache.chunk.single_chunk_info; + HDassert(fm->single_chunk_info); + + /* Reset chunk template information */ + fm->mchunk_tmpl = NULL; + + /* Set up chunk mapping for single element */ + if(H5D_create_chunk_map_single(fm, io_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") + } /* end if */ + else { + /* Initialize skip list for chunk selections */ + if(NULL == dataset->shared->cache.chunk.sel_chunks) { + if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, 0.5, (size_t)H5D_DEFAULT_SKIPLIST_HEIGHT))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for chunk selections") + } /* end if */ + fm->sel_chunks = dataset->shared->cache.chunk.sel_chunks; + HDassert(fm->sel_chunks); + + /* We are not using single element mode */ + fm->use_single = FALSE; + + /* Get type of selection on disk & in memory */ + if((fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE) + HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") + if((fm->msel_type = H5S_GET_SELECT_TYPE(mem_space)) < H5S_SEL_NONE) + HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") + + /* If the selection is NONE or POINTS, set the flag to FALSE */ + if(fsel_type == H5S_SEL_POINTS || fsel_type == H5S_SEL_NONE) + sel_hyper_flag = FALSE; + else + sel_hyper_flag = TRUE; + + /* Check if file selection is a not a hyperslab selection */ + if(sel_hyper_flag) { + /* Build the file selection for each chunk */ + if(H5D_create_chunk_file_map_hyper(fm, io_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") + + /* Clean file chunks' hyperslab span "scratch" information */ + curr_node = H5SL_first(fm->sel_chunks); + while(curr_node) { + H5D_chunk_info_t *chunk_info; /* Pointer chunk information */ + + /* Get pointer to chunk's information */ + chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); + HDassert(chunk_info); + + /* Clean hyperslab span's "scratch" information */ + if(H5S_hyper_reset_scratch(chunk_info->fspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") + + /* Get the next chunk node in the skip list */ + curr_node = H5SL_next(curr_node); + } /* end while */ + } /* end if */ + else { + /* Create temporary datatypes for selection iteration */ + if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") + + /* Spaces might not be the same shape, iterate over the file selection directly */ + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") + + /* Reset "last chunk" info */ + fm->last_index = (hsize_t)-1; + fm->last_chunk_info = NULL; + } /* end else */ + + /* Build the memory selection for each chunk */ + if(sel_hyper_flag && H5S_select_shape_same(file_space, mem_space) == TRUE) { + /* Reset chunk template information */ + fm->mchunk_tmpl = NULL; + + /* If the selections are the same shape, use the file chunk information + * to generate the memory chunk information quickly. + */ + if(H5D_create_chunk_mem_map_hyper(fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") + } /* end if */ + else { + size_t elmt_size; /* Memory datatype size */ + + /* Make a copy of equivalent memory space */ + if((tmp_mspace = H5S_copy(mem_space, TRUE, FALSE)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") + + /* De-select the mem space copy */ + if(H5S_select_none(tmp_mspace) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select memory space") + + /* Save chunk template information */ + fm->mchunk_tmpl = tmp_mspace; + + /* Create temporary datatypes for selection iteration */ + if(f_tid < 0) { + if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") + } /* end if */ + + /* Create selection iterator for memory selection */ + if(0 == (elmt_size = H5T_get_size(mem_type))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid") + if(H5S_select_iter_init(&(fm->mem_iter), mem_space, elmt_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") + iter_init = TRUE; /* Selection iteration info has been initialized */ + + /* Spaces aren't the same shape, iterate over the memory selection directly */ + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_mem_cb, fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") + + /* Clean up hyperslab stuff, if necessary */ + if(fm->msel_type != H5S_SEL_POINTS) { + /* Clean memory chunks' hyperslab span "scratch" information */ + curr_node = H5SL_first(fm->sel_chunks); + while(curr_node) { + H5D_chunk_info_t *chunk_info; /* Pointer chunk information */ + + /* Get pointer to chunk's information */ + chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); + HDassert(chunk_info); + + /* Clean hyperslab span's "scratch" information */ + if(H5S_hyper_reset_scratch(chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") + + /* Get the next chunk node in the skip list */ + curr_node = H5SL_next(curr_node); + } /* end while */ + } /* end if */ + } /* end else */ + } /* end else */ + +done: + /* Release the [potentially partially built] chunk mapping information if an error occurs */ + if(ret_value < 0) { + if(tmp_mspace && !fm->mchunk_tmpl) { + if(H5S_close(tmp_mspace) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") + } /* end if */ + + if(H5D_chunk_io_term(fm) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release chunk mapping") + } /* end if */ + + /* Reset the global dataspace info */ + fm->file_space = NULL; + fm->mem_space = NULL; + + if(iter_init) { + if(H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") + } /* end if */ + if(f_tid!=(-1)) { + if(H5I_dec_ref(f_tid) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") + } /* end if */ + if(file_space_normalized) { + if(H5S_hyper_denormalize_offset((H5S_t *)file_space, old_offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset") + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_io_init() */ + + +/*-------------------------------------------------------------------------- + NAME + H5D_free_chunk_info + PURPOSE + Internal routine to destroy a chunk info node + USAGE + void H5D_free_chunk_info(chunk_info) + void *chunk_info; IN: Pointer to chunk info to destroy + RETURNS + No return value + DESCRIPTION + Releases all the memory for a chunk info node. Called by H5SL_free + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) +{ + H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *)item; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_free_chunk_info) + + HDassert(chunk_info); + + /* Close the chunk's file dataspace, if it's not shared */ + if(!chunk_info->fspace_shared) + (void)H5S_close(chunk_info->fspace); + else + H5S_select_all(chunk_info->fspace, TRUE); + + /* Close the chunk's memory dataspace, if it's not shared */ + if(!chunk_info->mspace_shared) + (void)H5S_close(chunk_info->mspace); + + /* Free the actual chunk info */ + H5FL_FREE(H5D_chunk_info_t, chunk_info); + + FUNC_LEAVE_NOAPI(0) +} /* H5D_free_chunk_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_create_chunk_map_single + * + * Purpose: Create chunk selections when appending a single record + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, November 20, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t +#ifndef H5_HAVE_PARALLEL + UNUSED +#endif /* H5_HAVE_PARALLEL */ + *io_info) +{ + H5D_chunk_info_t *chunk_info; /* Chunk information to insert into skip list */ + hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ + hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_map_single) + + /* Sanity check */ + HDassert(fm->f_ndims > 0); + + /* Get coordinate for selection */ + if(H5S_SELECT_BOUNDS(fm->file_space, sel_start, sel_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") + + /* Initialize the 'single chunk' file & memory chunk information */ + chunk_info = fm->single_chunk_info; + chunk_info->chunk_points = 1; + + /* Set chunk location & hyperslab size */ + for(u = 0; u < fm->f_ndims; u++) { + HDassert(sel_start[u] == sel_end[u]); + chunk_info->coords[u] = (sel_start[u] / fm->layout->u.chunk.dim[u]) * fm->layout->u.chunk.dim[u]; + } /* end for */ + chunk_info->coords[fm->f_ndims] = 0; + + /* Calculate the index of this chunk */ + if(H5V_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->down_chunks, &chunk_info->index) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") + + /* Copy selection for file's dataspace into chunk dataspace */ + if(H5S_select_copy(fm->single_space, fm->file_space, FALSE) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file selection") + + /* Move selection back to have correct offset in chunk */ + if(H5S_SELECT_ADJUST_U(fm->single_space, chunk_info->coords) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") + +#ifdef H5_HAVE_PARALLEL + /* store chunk selection information */ + if(io_info->using_mpi_vfd) + fm->select_chunk[chunk_info->index] = chunk_info; +#endif /* H5_HAVE_PARALLEL */ + + /* Set the file dataspace for the chunk to the shared 'single' dataspace */ + chunk_info->fspace = fm->single_space; + + /* Indicate that the chunk's file dataspace is shared */ + chunk_info->fspace_shared = TRUE; + + /* Just point at the memory dataspace & selection */ + /* (Casting away const OK -QAK) */ + chunk_info->mspace = (H5S_t *)fm->mem_space; + + /* Indicate that the chunk's memory dataspace is shared */ + chunk_info->mspace_shared = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_create_chunk_map_single() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_create_chunk_file_map_hyper + * + * Purpose: Create all chunk selections in file. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t +#ifndef H5_HAVE_PARALLEL + UNUSED +#endif /* H5_HAVE_PARALLEL */ + *io_info) +{ + hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ + hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ + hsize_t sel_points; /* Number of elements in file selection */ + hsize_t start_coords[H5O_LAYOUT_NDIMS]; /* Starting coordinates of selection */ + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ + hsize_t end[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ + hsize_t chunk_index; /* Index of chunk */ + int curr_dim; /* Current dimension to increment */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_file_map_hyper) + + /* Sanity check */ + assert(fm->f_ndims>0); + + /* Get number of elements selected in file */ + sel_points = fm->nelmts; + + /* Get bounding box for selection (to reduce the number of chunks to iterate over) */ + if(H5S_SELECT_BOUNDS(fm->file_space, sel_start, sel_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") + + /* Set initial chunk location & hyperslab size */ + + for(u=0; uf_ndims; u++) { + start_coords[u]=(sel_start[u]/fm->layout->u.chunk.dim[u])*fm->layout->u.chunk.dim[u]; + coords[u]=start_coords[u]; + end[u]=(coords[u]+fm->chunk_dim[u])-1; + } /* end for */ + + + /* Calculate the index of this chunk */ + if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") + + /* Iterate through each chunk in the dataset */ + while(sel_points) { + /* Check for intersection of temporary chunk and file selection */ + /* (Casting away const OK - QAK) */ + if(H5S_hyper_intersect_block((H5S_t *)fm->file_space,coords,end)==TRUE) { + H5S_t *tmp_fchunk; /* Temporary file dataspace */ + H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */ + hssize_t schunk_points; /* Number of elements in chunk selection */ + + /* Create "temporary" chunk for selection operations (copy file space) */ + if((tmp_fchunk = H5S_copy(fm->file_space, TRUE, FALSE)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") + + /* Make certain selections are stored in span tree form (not "optimized hyperslab" or "all") */ + if(H5S_hyper_convert(tmp_fchunk) < 0) { + (void)H5S_close(tmp_fchunk); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees") + } /* end if */ + + /* "AND" temporary chunk and current chunk */ + if(H5S_select_hyperslab(tmp_fchunk,H5S_SELECT_AND,coords,NULL,fm->chunk_dim,NULL) < 0) { + (void)H5S_close(tmp_fchunk); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't create chunk selection") + } /* end if */ + + /* Resize chunk's dataspace dimensions to size of chunk */ + if(H5S_set_extent_real(tmp_fchunk,fm->chunk_dim) < 0) { + (void)H5S_close(tmp_fchunk); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk dimensions") + } /* end if */ + + /* Move selection back to have correct offset in chunk */ + if(H5S_SELECT_ADJUST_U(tmp_fchunk, coords) < 0) { + (void)H5S_close(tmp_fchunk); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") + } /* end if */ + + /* Add temporary chunk to the list of chunks */ + + /* Allocate the file & memory chunk information */ + if (NULL==(new_chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) { + (void)H5S_close(tmp_fchunk); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + } /* end if */ + + /* Initialize the chunk information */ + + /* Set the chunk index */ + new_chunk_info->index=chunk_index; + +#ifdef H5_HAVE_PARALLEL + /* store chunk selection information */ + if(io_info->using_mpi_vfd) + fm->select_chunk[chunk_index] = new_chunk_info; +#endif /* H5_HAVE_PARALLEL */ + + /* Set the file chunk dataspace */ + new_chunk_info->fspace = tmp_fchunk; + new_chunk_info->fspace_shared = FALSE; + + /* Set the memory chunk dataspace */ + new_chunk_info->mspace=NULL; + new_chunk_info->mspace_shared = FALSE; + + /* Copy the chunk's coordinates */ + for(u=0; uf_ndims; u++) + new_chunk_info->coords[u]=coords[u]; + new_chunk_info->coords[fm->f_ndims]=0; + + /* Insert the new chunk into the skip list */ + if(H5SL_insert(fm->sel_chunks,new_chunk_info,&new_chunk_info->index) < 0) { + H5D_free_chunk_info(new_chunk_info,NULL,NULL); + HGOTO_ERROR(H5E_DATASPACE,H5E_CANTINSERT,FAIL,"can't insert chunk into skip list") + } /* end if */ + + /* Get number of elements selected in chunk */ + if((schunk_points=H5S_GET_SELECT_NPOINTS(tmp_fchunk)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements") + H5_ASSIGN_OVERFLOW(new_chunk_info->chunk_points,schunk_points,hssize_t,size_t); + + /* Decrement # of points left in file selection */ + sel_points-=(hsize_t)schunk_points; + + /* Leave if we are done */ + if(sel_points==0) + HGOTO_DONE(SUCCEED) + assert(sel_points>0); + } /* end if */ + + /* Increment chunk index */ + chunk_index++; + + /* Set current increment dimension */ + curr_dim=(int)fm->f_ndims-1; + + /* Increment chunk location in fastest changing dimension */ + H5_CHECK_OVERFLOW(fm->chunk_dim[curr_dim],hsize_t,hssize_t); + coords[curr_dim]+=fm->chunk_dim[curr_dim]; + end[curr_dim]+=fm->chunk_dim[curr_dim]; + + /* Bring chunk location back into bounds, if necessary */ + if(coords[curr_dim]>sel_end[curr_dim]) { + do { + /* Reset current dimension's location to 0 */ + coords[curr_dim]=start_coords[curr_dim]; /*lint !e771 The start_coords will always be initialized */ + end[curr_dim]=(coords[curr_dim]+(hssize_t)fm->chunk_dim[curr_dim])-1; + + /* Decrement current dimension */ + curr_dim--; + + /* Increment chunk location in current dimension */ + coords[curr_dim]+=fm->chunk_dim[curr_dim]; + end[curr_dim]=(coords[curr_dim]+fm->chunk_dim[curr_dim])-1; + } while(coords[curr_dim]>sel_end[curr_dim]); + + /* Re-Calculate the index of this chunk */ + if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") + } /* end if */ + } /* end while */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_create_chunk_file_map_hyper() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_create_chunk_mem_map_hyper + * + * Purpose: Create all chunk selections in memory by copying the file + * chunk selections and adjusting their offsets to be correct + * for the memory. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, May 29, 2003 + * + * Assumptions: That the file and memory selections are the same shape. + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) +{ + H5SL_node_t *curr_node; /* Current node in skip list */ + hsize_t file_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ + hsize_t file_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ + hsize_t mem_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ + hsize_t mem_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ + hssize_t adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to all file chunks */ + hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_mem_map_hyper) + + /* Sanity check */ + assert(fm->f_ndims>0); + + /* Check for all I/O going to a single chunk */ + if(H5SL_count(fm->sel_chunks)==1) { + H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */ + + /* Get the node */ + curr_node=H5SL_first(fm->sel_chunks); + + /* Get pointer to chunk's information */ + chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); + assert(chunk_info); + + /* Just point at the memory dataspace & selection */ + /* (Casting away const OK -QAK) */ + chunk_info->mspace=(H5S_t *)fm->mem_space; + + /* Indicate that the chunk's memory space is shared */ + chunk_info->mspace_shared = TRUE; + } /* end if */ + else { + /* Get bounding box for file selection */ + if(H5S_SELECT_BOUNDS(fm->file_space, file_sel_start, file_sel_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") + + /* Get bounding box for memory selection */ + if(H5S_SELECT_BOUNDS(fm->mem_space, mem_sel_start, mem_sel_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") + + /* Calculate the adjustment for memory selection from file selection */ + assert(fm->m_ndims==fm->f_ndims); + for(u=0; uf_ndims; u++) { + H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t); + H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t); + adjust[u]=(hssize_t)file_sel_start[u]-(hssize_t)mem_sel_start[u]; + } /* end for */ + + /* Iterate over each chunk in the chunk list */ + curr_node=H5SL_first(fm->sel_chunks); + while(curr_node) { + H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */ + + /* Get pointer to chunk's information */ + chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); + assert(chunk_info); + + /* Copy the information */ + + /* Copy the memory dataspace */ + if((chunk_info->mspace = H5S_copy(fm->mem_space, TRUE, FALSE)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") + + /* Release the current selection */ + if(H5S_SELECT_RELEASE(chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection") + + /* Copy the file chunk's selection */ + if(H5S_select_copy(chunk_info->mspace,chunk_info->fspace,FALSE) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection") + + /* Compensate for the chunk offset */ + for(u=0; uf_ndims; u++) { + H5_CHECK_OVERFLOW(chunk_info->coords[u],hsize_t,hssize_t); + chunk_adjust[u]=adjust[u]-(hssize_t)chunk_info->coords[u]; /*lint !e771 The adjust array will always be initialized */ + } /* end for */ + + /* Adjust the selection */ + if(H5S_hyper_adjust_s(chunk_info->mspace,chunk_adjust) < 0) /*lint !e772 The chunk_adjust array will always be initialized */ + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") + + /* Get the next chunk node in the skip list */ + curr_node=H5SL_next(curr_node); + } /* end while */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_create_chunk_mem_map_hyper() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_file_cb + * + * Purpose: Callback routine for file selection iterator. Used when + * creating selections in file for each point selected. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Wednesday, July 23, 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +{ + H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ + H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ + hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ + hsize_t chunk_index; /* Chunk index */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb) + + /* Calculate the index of this chunk */ + if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") + + /* Find correct chunk in file & memory skip list */ + if(chunk_index==fm->last_index) { + /* If the chunk index is the same as the last chunk index we used, + * get the cached info to operate on. + */ + chunk_info=fm->last_chunk_info; + } /* end if */ + else { + /* If the chunk index is not the same as the last chunk index we used, + * find the chunk in the skip list. + */ + /* Get the chunk node from the skip list */ + if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_search(fm->sel_chunks, &chunk_index))) { + H5S_t *fspace; /* Memory chunk's dataspace */ + + /* Allocate the file & memory chunk information */ + if (NULL==(chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") + + /* Initialize the chunk information */ + + /* Set the chunk index */ + chunk_info->index=chunk_index; + + /* Create a dataspace for the chunk */ + if((fspace = H5S_create_simple(fm->f_ndims,fm->chunk_dim,NULL))==NULL) { + H5FL_FREE(H5D_chunk_info_t,chunk_info); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace for chunk") + } /* end if */ + + /* De-select the chunk space */ + if(H5S_select_none(fspace) < 0) { + (void)H5S_close(fspace); + H5FL_FREE(H5D_chunk_info_t,chunk_info); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select dataspace") + } /* end if */ + + /* Set the file chunk dataspace */ + chunk_info->fspace = fspace; + chunk_info->fspace_shared = FALSE; + + /* Set the memory chunk dataspace */ + chunk_info->mspace=NULL; + chunk_info->mspace_shared = FALSE; + + /* Set the number of selected elements in chunk to zero */ + chunk_info->chunk_points=0; + + /* Compute the chunk's coordinates */ + for(u=0; uf_ndims; u++) { + H5_CHECK_OVERFLOW(fm->layout->u.chunk.dim[u],hsize_t,hssize_t); + chunk_info->coords[u]=(coords[u]/(hssize_t)fm->layout->u.chunk.dim[u])*(hssize_t)fm->layout->u.chunk.dim[u]; + } /* end for */ + chunk_info->coords[fm->f_ndims]=0; + + /* Insert the new chunk into the skip list */ + if(H5SL_insert(fm->sel_chunks,chunk_info,&chunk_info->index) < 0) { + H5D_free_chunk_info(chunk_info,NULL,NULL); + HGOTO_ERROR(H5E_DATASPACE,H5E_CANTINSERT,FAIL,"can't insert chunk into skip list") + } /* end if */ + } /* end if */ + + /* Update the "last chunk seen" information */ + fm->last_index=chunk_index; + fm->last_chunk_info=chunk_info; + } /* end else */ + + /* Get the coordinates of the element in the chunk */ + for(u=0; uf_ndims; u++) + coords_in_chunk[u]=coords[u]%fm->layout->u.chunk.dim[u]; + + /* Add point to file selection for chunk */ + if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") + + /* Increment the number of elemented selected in chunk */ + chunk_info->chunk_points++; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_file_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_mem_cb + * + * Purpose: Callback routine for file selection iterator. Used when + * creating selections in memory for each chunk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Thursday, April 10, 2003 + * + *------------------------------------------------------------------------- + */ +/* ARGSUSED */ +static herr_t +H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +{ + H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ + H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ + hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */ + hsize_t chunk_index; /* Chunk index */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb) + + /* Calculate the index of this chunk */ + if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") + + /* Find correct chunk in file & memory skip list */ + if(chunk_index==fm->last_index) { + /* If the chunk index is the same as the last chunk index we used, + * get the cached spaces to operate on. + */ + chunk_info=fm->last_chunk_info; + } /* end if */ + else { + /* If the chunk index is not the same as the last chunk index we used, + * find the chunk in the skip list. + */ + /* Get the chunk node from the skip list */ + if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_search(fm->sel_chunks, &chunk_index))) + HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") + + /* Check if the chunk already has a memory space */ + if(chunk_info->mspace==NULL) { + /* Copy the template memory chunk dataspace */ + if((chunk_info->mspace = H5S_copy(fm->mchunk_tmpl, FALSE, FALSE)) == NULL) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file space") + } /* end else */ + + /* Update the "last chunk seen" information */ + fm->last_index=chunk_index; + fm->last_chunk_info=chunk_info; + } /* end else */ + + /* Get coordinates of selection iterator for memory */ + if(H5S_SELECT_ITER_COORDS(&fm->mem_iter,coords_in_mem) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator coordinates") + + /* Add point to memory selection for chunk */ + if(fm->msel_type==H5S_SEL_POINTS) { + if(H5S_select_elements(chunk_info->mspace, H5S_SELECT_APPEND, (size_t)1, coords_in_mem) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") + } /* end if */ + else { + if(H5S_hyper_add_span_element(chunk_info->mspace, fm->m_ndims, coords_in_mem) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") + } /* end else */ + + /* Move memory selection iterator to next element in selection */ + if(H5S_SELECT_ITER_NEXT(&fm->mem_iter, (size_t)1) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to move to next iterator location") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_mem_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_cacheable + * + * Purpose: A small internal function to if it's possible to load the + * chunk into cache. + * + * Return: TRUE or FALSE + * + * Programmer: Raymond Lu + * 17 July 2007 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr) +{ + const H5D_t *dataset = io_info->dset; + hbool_t ret_value; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_cacheable) + + HDassert(io_info); + HDassert(dataset); + + /* Must bring the whole chunk in if there are any filters */ + if(dataset->shared->dcpl_cache.pline.nused > 0) + ret_value = TRUE; + else +#ifdef H5_HAVE_PARALLEL + /* If MPI based VFD is used and the file is opened for write access, must + * bypass the chunk-cache scheme because other MPI processes could + * be writing to other elements in the same chunk. Do a direct + * write-through of only the elements requested. + */ + if(io_info->using_mpi_vfd && (H5F_ACC_RDWR & H5F_INTENT(dataset->oloc.file))) + ret_value = FALSE; + else +#endif /* H5_HAVE_PARALLEL */ + /* If the chunk is too large to keep in the cache and if the address + * for the chunk has been defined, then don't load the chunk into the + * cache, just write the data to it directly. + */ + if(dataset->shared->layout.u.chunk.size > dataset->shared->cache.chunk.nbytes + && H5F_addr_defined(caddr)) + ret_value = FALSE; + else + ret_value = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_cacheable() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_in_cache + * + * Purpose: Check if a chunk is in the cache. + * + * Return: TRUE or FALSE + * + * Programmer: Quincey Koziol + * 1 April 2008 + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5D_chunk_in_cache(const H5D_io_info_t *io_info) +{ + H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);/*raw data chunk cache*/ + hbool_t found = FALSE; /*already in cache? */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_in_cache) + + HDassert(io_info); + + /* Check if the chunk is in the cache (but hasn't been written to disk yet) */ + if(rdcc->nslots > 0) { + unsigned idx = H5D_CHUNK_HASH(io_info->dset->shared, io_info->store->chunk.index); /* Cache entry index */ + H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ + + /* Potential match... */ + if(ent) { + size_t u; /* Local index variable */ + + for(u = 0, found = TRUE; u < io_info->dset->shared->layout.u.chunk.ndims; u++) { + if(io_info->store->chunk.offset[u] != ent->offset[u]) { + found = FALSE; + break; + } /* end if */ + } /* end for */ + } /* end if */ + } /* end if */ + + FUNC_LEAVE_NOAPI(found) +} /* end H5D_chunk_in_cache() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_read + * + * Purpose: Read from a chunked dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Thursday, April 10, 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t *fm) +{ + H5SL_node_t *chunk_node; /* Current node in chunk skip list */ + H5D_io_info_t nul_io_info; /* "null" I/O info object */ + H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ + H5D_io_info_t cpt_io_info; /* Compact I/O info object */ + H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ + hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + size_t src_accessed_bytes = 0; /* Total accessed size in a chunk */ + hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ + unsigned idx_hint = 0; /* Cache index hint */ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_read) + + /* Sanity check */ + HDassert(io_info); + HDassert(io_info->u.rbuf); + HDassert(type_info); + HDassert(fm); + + /* Set up "null" I/O info object */ + HDmemcpy(&nul_io_info, io_info, sizeof(nul_io_info)); + nul_io_info.layout_ops = *H5D_LOPS_NULL; + + /* Set up contiguous I/O info object */ + HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + ctg_store.contig.dset_size = (hsize_t)io_info->dset->shared->layout.u.chunk.size; + + /* Set up compact I/O info object */ + HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + + { + const H5O_fill_t *fill = &(io_info->dset->shared->dcpl_cache.fill); /* Fill value info */ + H5D_fill_value_t fill_status; /* Fill value status */ + + /* Check the fill value status */ + if(H5P_is_fill_value_defined(fill, &fill_status) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined") + + /* If we are never to return fill values, or if we would return them + * but they aren't set, set the flag to skip missing chunks. + */ + if(fill->fill_time == H5D_FILL_TIME_NEVER || + (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED)) + skip_missing_chunks = TRUE; + } + + /* Iterate through nodes in chunk skip list */ + chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); + while(chunk_node) { + H5D_chunk_info_t *chunk_info; /* Chunk information */ + H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ + void *chunk; /* Pointer to locked chunk buffer */ + haddr_t chunk_addr; /* Chunk address on disk */ + H5D_istore_ud1_t udata; /* B-tree pass-through */ + + /* Get the actual chunk information from the skip list node */ + chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); + + /* Pass in chunk's coordinates in a union. */ + io_info->store->chunk.offset = chunk_info->coords; + io_info->store->chunk.index = chunk_info->index; + + /* Get the address of the chunk in the file */ + chunk_addr = H5D_istore_get_addr(io_info, &udata); + + /* Check for non-existant chunk & skip it if appropriate */ + if(!H5F_addr_defined(chunk_addr) && !H5D_chunk_in_cache(io_info) + && skip_missing_chunks) { + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at "null" I/O info for this chunk */ + chk_io_info = &nul_io_info; + } /* end if */ + else { + /* Load the chunk into cache and lock it. */ + if(H5D_chunk_cacheable(io_info, chunk_addr)) { + /* Compute # of bytes accessed in chunk */ + src_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size; + + /* Lock the chunk into the cache */ + if(NULL == (chunk = H5D_istore_lock(io_info, &udata, FALSE, &idx_hint))) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Set up the storage buffer information for this chunk */ + cpt_store.compact.buf = chunk; + + /* Point I/O info at contiguous I/O info for this chunk */ + chk_io_info = &cpt_io_info; + } /* end if */ + else { + /* Sanity check */ + HDassert(H5F_addr_defined(chunk_addr)); + + /* Set up the storage address information for this chunk */ + ctg_store.contig.dset_addr = chunk_addr; + + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at temporary I/O info for this chunk */ + chk_io_info = &ctg_io_info; + } /* end else */ + } /* end else */ + + /* Perform the actual read operation */ + if((io_info->io_ops.single_read)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") + + /* Release the cache lock on the chunk. */ + if(chunk && H5D_istore_unlock(io_info, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + + /* Advance to next chunk in list */ + chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); + } /* end while */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_chunk_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_write + * + * Purpose: Writes to a chunked dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Thursday, April 10, 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t *fm) +{ + H5SL_node_t *chunk_node; /* Current node in chunk skip list */ + H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ + H5D_io_info_t cpt_io_info; /* Compact I/O info object */ + H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ + hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + size_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ + unsigned idx_hint = 0; /* Cache index hint */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_write) + + /* Sanity check */ + HDassert(io_info); + HDassert(io_info->u.wbuf); + HDassert(type_info); + HDassert(fm); + + /* Set up contiguous I/O info object */ + HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + ctg_store.contig.dset_size = (hsize_t)io_info->dset->shared->layout.u.chunk.size; + + /* Set up compact I/O info object */ + HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + + /* Iterate through nodes in chunk skip list */ + chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); + while(chunk_node) { + H5D_chunk_info_t *chunk_info; /* Chunk information */ + H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ + void *chunk; /* Pointer to locked chunk buffer */ + haddr_t chunk_addr; /* Chunk address on disk */ + H5D_istore_ud1_t udata; /* B-tree pass-through */ + + /* Get the actual chunk information from the skip list node */ + chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); + + /* Pass in chunk's coordinates in a union. */ + io_info->store->chunk.offset = chunk_info->coords; + io_info->store->chunk.index = chunk_info->index; + + /* Load the chunk into cache. But if the whole chunk is written, + * simply allocate space instead of load the chunk. */ + chunk_addr = H5D_istore_get_addr(io_info, &udata); + if(H5D_chunk_cacheable(io_info, chunk_addr)) { + hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ + + /* Compute # of bytes accessed in chunk */ + dst_accessed_bytes = chunk_info->chunk_points * type_info->dst_type_size; + + /* Determine if we will access all the data in the chunk */ + if(dst_accessed_bytes != ctg_store.contig.dset_size || + (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size) + entire_chunk = FALSE; + + /* Lock the chunk into the cache */ + if(NULL == (chunk = H5D_istore_lock(io_info, &udata, entire_chunk, &idx_hint))) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Set up the storage buffer information for this chunk */ + cpt_store.compact.buf = chunk; + + /* Point I/O info at main I/O info for this chunk */ + chk_io_info = &cpt_io_info; + } /* end if */ + else { + /* Sanity check */ + HDassert(H5F_addr_defined(chunk_addr)); + + /* Set up the storage address information for this chunk */ + ctg_store.contig.dset_addr = chunk_addr; + + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at temporary I/O info for this chunk */ + chk_io_info = &ctg_io_info; + } /* end else */ + + /* Perform the actual write operation */ + if((io_info->io_ops.single_write)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") + + /* Release the cache lock on the chunk. */ + if(chunk && H5D_istore_unlock(io_info, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + + /* Advance to next chunk in list */ + chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); + } /* end while */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_chunk_write() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_io_term + * + * Purpose: Destroy I/O operation information. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, May 17, 2003 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_chunk_io_term(const H5D_chunk_map_t *fm) +{ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_io_term) + + /* Single element I/O vs. multiple element I/O cleanup */ + if(fm->use_single) { + /* Sanity checks */ + HDassert(fm->sel_chunks == NULL); + HDassert(fm->single_chunk_info); + HDassert(fm->single_chunk_info->fspace_shared); + HDassert(fm->single_chunk_info->mspace_shared); + + /* Reset the selection for the single element I/O */ + H5S_select_all(fm->single_space, TRUE); + } /* end if */ + else { + /* Release the nodes on the list of selected chunks */ + if(fm->sel_chunks) + if(H5SL_free(fm->sel_chunks, H5D_free_chunk_info, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTNEXT, FAIL, "can't iterate over chunks") + } /* end else */ + + /* Free the memory chunk dataspace template */ + if(fm->mchunk_tmpl) + if(H5S_close(fm->mchunk_tmpl) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") +#ifdef H5_HAVE_PARALLEL + if(fm->select_chunk) + H5MM_xfree(fm->select_chunk); +#endif /* H5_HAVE_PARALLEL */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_io_term() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_null_readvv + * + * Purpose: Performs "no-op" I/O operation, advancing through two I/O + * vectors, until one runs out. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, April 1, 2008 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5D_null_readvv(const H5D_io_info_t UNUSED *io_info, + size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) +{ + size_t u, v; /* Local index variables */ + size_t size; /* Size of sequence in bytes */ + ssize_t bytes_processed = 0; /* Eventual return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_null_readvv) + + /* Check args */ + HDassert(chunk_len_arr); + HDassert(chunk_offset_arr); + HDassert(mem_len_arr); + HDassert(mem_offset_arr); + + /* Work through all the sequences */ + for(u = *mem_curr_seq, v = *chunk_curr_seq; u < mem_max_nseq && v < chunk_max_nseq; ) { + /* Choose smallest buffer to write */ + if(chunk_len_arr[v] < mem_len_arr[u]) + size = chunk_len_arr[v]; + else + size = mem_len_arr[u]; + + /* Update source information */ + chunk_len_arr[v] -= size; + chunk_offset_arr[v] += size; + if(chunk_len_arr[v] == 0) + v++; + + /* Update destination information */ + mem_len_arr[u] -= size; + mem_offset_arr[u] += size; + if(mem_len_arr[u] == 0) + u++; + + /* Increment number of bytes copied */ + bytes_processed += (ssize_t)size; + } /* end for */ + + /* Update current sequence vectors */ + *mem_curr_seq = u; + *chunk_curr_seq = v; + + FUNC_LEAVE_NOAPI(bytes_processed) +} /* H5D_null_readvv() */ + diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 2e4d3f7..c3abab6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -41,22 +41,52 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Vprivate.h" /* Vector and array functions */ + /****************/ /* Local Macros */ /****************/ + /******************/ /* Local Typedefs */ /******************/ + /********************/ /* Local Prototypes */ /********************/ +/* Layout operation callbacks */ +static herr_t H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *cm); +static ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); + + /*********************/ /* Package Variables */ /*********************/ +/* Compact storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{ + H5D_compact_io_init, + H5D_contig_read, + H5D_contig_write, +#ifdef H5_HAVE_PARALLEL + NULL, + NULL, +#endif /* H5_HAVE_PARALLEL */ + H5D_compact_readvv, + H5D_compact_writevv, + NULL +}}; + + /*******************/ /* Local Variables */ /*******************/ @@ -64,6 +94,7 @@ /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); + /*------------------------------------------------------------------------- * Function: H5D_compact_fill @@ -118,6 +149,32 @@ done: /*------------------------------------------------------------------------- + * Function: H5D_compact_io_init + * + * Purpose: Performs initialization before any sort of I/O on the raw data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 20, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t UNUSED *cm) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_io_init) + + io_info->store->compact.buf = io_info->dset->shared->layout.u.compact.buf; + io_info->store->compact.dirty = &io_info->dset->shared->layout.u.compact.dirty; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_compact_io_init() */ + + +/*------------------------------------------------------------------------- * Function: H5D_compact_readvv * * Purpose: Reads some data vectors from a dataset into a buffer. @@ -135,20 +192,19 @@ done: * *------------------------------------------------------------------------- */ -ssize_t +static ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { - ssize_t ret_value; /* Return value */ + ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5D_compact_readvv) - assert(io_info->dset); + HDassert(io_info); /* Use the vectorized memory copy routine to do actual work */ - if((ret_value=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr,io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr))<0) + if((ret_value = H5V_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") done: @@ -177,24 +233,23 @@ done: * *------------------------------------------------------------------------- */ -ssize_t +static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { - ssize_t ret_value; /* Return value */ + ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5D_compact_writevv) - assert(io_info->dset); + HDassert(io_info); /* Use the vectorized memory copy routine to do actual work */ - if((ret_value=H5V_memcpyvv(io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr,buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr))<0) + if((ret_value = H5V_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") /* Mark the compact dataset's buffer as dirty */ - io_info->dset->shared->layout.u.compact.dirty = TRUE; + *io_info->store->compact.dirty = TRUE; done: FUNC_LEAVE_NOAPI(ret_value) @@ -371,11 +426,11 @@ done: if(H5I_dec_ref(tid_mem) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) - H5FL_BLK_FREE(type_conv, buf); + (void)H5FL_BLK_FREE(type_conv, buf); if(reclaim_buf) - H5FL_BLK_FREE(type_conv, reclaim_buf); + (void)H5FL_BLK_FREE(type_conv, reclaim_buf); if(bkg) - H5FL_BLK_FREE(type_conv, bkg); + (void)H5FL_BLK_FREE(type_conv, bkg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_copy() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index bdb8294..1a3fda5 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -45,24 +45,50 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5Vprivate.h" /* Vector and array functions */ + /****************/ /* Local Macros */ /****************/ + /******************/ /* Local Typedefs */ /******************/ + /********************/ /* Local Prototypes */ /********************/ -static herr_t H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, const H5D_storage_t *store, hsize_t offset, size_t size, const void *buf); + +/* Layout operation callbacks */ +static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *cm); + +/* Helper routines */ +static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, + size_t size); + /*********************/ /* Package Variables */ /*********************/ +/* Contiguous storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{ + H5D_contig_io_init, + H5D_contig_read, + H5D_contig_write, +#ifdef H5_HAVE_PARALLEL + H5D_contig_collective_read, + H5D_contig_collective_write, +#endif /* H5_HAVE_PARALLEL */ + H5D_contig_readvv, + H5D_contig_writevv, + NULL +}}; + + /*******************/ /* Local Variables */ /*******************/ @@ -73,6 +99,7 @@ H5FL_BLK_DEFINE(sieve_buf); /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); + /*------------------------------------------------------------------------- * Function: H5D_contig_create @@ -121,7 +148,8 @@ done: herr_t H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) { - H5D_storage_t store; /* Union of storage info for dataset */ + H5D_io_info_t ioinfo; /* Dataset I/O info */ + H5D_storage_t store; /* Union of storage info for dataset */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hssize_t snpoints; /* Number of points in space (for error checking) */ @@ -198,6 +226,9 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Start at the beginning of the dataset */ offset = 0; + /* Simple setup for dataset I/O info struct */ + H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, dxpl_cache, my_dxpl_id, &store, fb_info.fill_buf); + /* * Fill the entire current extent with the fill value. We can do * this quite efficiently by making sure we copy the fill value @@ -225,7 +256,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Write the chunks out from only one process */ /* !! Use the internal "independent" DXPL!! -QAK */ if(H5_PAR_META_WRITE == mpi_rank) - if(H5D_contig_write(dset, dxpl_cache, my_dxpl_id, &store, offset, size, fb_info.fill_buf) < 0) + if(H5D_contig_write_one(&ioinfo, offset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset") /* Indicate that blocks are being written */ @@ -234,7 +265,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) else { #endif /* H5_HAVE_PARALLEL */ H5_CHECK_OVERFLOW(size, size_t, hsize_t); - if(H5D_contig_write(dset, dxpl_cache, my_dxpl_id, &store, offset, size, fb_info.fill_buf) < 0) + if(H5D_contig_write_one(&ioinfo, offset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset") #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -324,8 +355,108 @@ H5D_contig_get_addr(const H5D_t *dset) /*------------------------------------------------------------------------- + * Function: H5D_contig_io_init + * + * Purpose: Performs initialization before any sort of I/O on the raw data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 20, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t UNUSED *cm) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_io_init) + + io_info->store->contig.dset_addr = io_info->dset->shared->layout.u.contig.addr; + io_info->store->contig.dset_size = io_info->dset->shared->layout.u.contig.size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_contig_io_init() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_contig_read + * + * Purpose: Read from a contiguous dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Thursday, April 10, 2003 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t UNUSED *fm) +{ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_read) + + /* Sanity check */ + HDassert(io_info); + HDassert(io_info->u.rbuf); + HDassert(type_info); + HDassert(mem_space); + HDassert(file_space); + + /* Read data */ + if((io_info->io_ops.single_read)(io_info, type_info, nelmts, file_space, mem_space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "contiguous read failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_read() */ + + +/*------------------------------------------------------------------------- * Function: H5D_contig_write * + * Purpose: Write to a contiguous dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * Thursday, April 10, 2003 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t UNUSED *fm) +{ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_write) + + /* Sanity check */ + HDassert(io_info); + HDassert(io_info->u.wbuf); + HDassert(type_info); + HDassert(mem_space); + HDassert(file_space); + + /* Write data */ + if((io_info->io_ops.single_write)(io_info, type_info, nelmts, file_space, mem_space) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "contiguous write failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_write() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_contig_write_one + * * Purpose: Writes some data from a dataset into a buffer. * The data is contiguous. The address is relative to the base * address for the file. @@ -338,34 +469,27 @@ H5D_contig_get_addr(const H5D_t *dset) *------------------------------------------------------------------------- */ static herr_t -H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, const H5D_storage_t *store, - hsize_t offset, size_t size, const void *buf) +H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size) { - H5D_io_info_t io_info; /* Dataset I/O info */ - hsize_t dset_off=offset; /* Offset in dataset */ - size_t dset_len=size; /* Length in dataset */ - size_t dset_curr_seq=0; /* "Current sequence" in dataset */ - hsize_t mem_off=0; /* Offset in memory */ - size_t mem_len=size; /* Length in memory */ - size_t mem_curr_seq=0; /* "Current sequence" in memory */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_contig_write, FAIL) - - assert (dset); - assert (dxpl_cache); - assert (store); - assert (buf); - - H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,store); - if(H5D_contig_writevv(&io_info, (size_t)1, &dset_curr_seq, &dset_len, &dset_off, - (size_t)1, &mem_curr_seq, &mem_len, &mem_off, (haddr_t)0, NULL, buf) < 0) + hsize_t dset_off = offset; /* Offset in dataset */ + size_t dset_len = size; /* Length in dataset */ + size_t dset_curr_seq = 0; /* "Current sequence" in dataset */ + hsize_t mem_off = 0; /* Offset in memory */ + size_t mem_len = size; /* Length in memory */ + size_t mem_curr_seq = 0; /* "Current sequence" in memory */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_contig_write_one) + + HDassert(io_info); + + if(H5D_contig_writevv(io_info, (size_t)1, &dset_curr_seq, &dset_len, &dset_off, + (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_write() */ +} /* end H5D_contig_write_one() */ /*------------------------------------------------------------------------- @@ -389,67 +513,76 @@ done: ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer, void *_buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) { H5F_t *file = io_info->dset->oloc.file; /* File for dataset */ - H5D_rdcdc_t *dset_contig=&(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ - const H5D_contig_storage_t *store_contig=&(io_info->store->contig); /* Contiguous storage info for this I/O operation */ - unsigned char *buf=(unsigned char *)_buf; /* Pointer to buffer to fill */ + H5D_rdcdc_t *dset_contig = &(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ + unsigned char *buf = (unsigned char *)io_info->u.rbuf; /* Pointer to buffer to fill */ haddr_t addr; /* Actual address to read */ - size_t total_size=0; /* Total size of sequence in bytes */ + size_t total_size = 0; /* Total size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL) +#ifdef QAK +HDfprintf(stderr, "%s: dset_max_nseq = %Zu\n", FUNC, dset_max_nseq); +HDfprintf(stderr, "%s: mem_max_nseq = %Zu\n", FUNC, mem_max_nseq); +HDfprintf(stderr, "%s: *dset_curr_seq= %Zu\n", FUNC, *dset_curr_seq); +HDfprintf(stderr, "%s: *mem_curr_seq= %Zu\n", FUNC, *mem_curr_seq); +for(u = 0; u < dset_max_nseq; u++) + HDfprintf(stderr, "%s: dset_len_arr[%Zu] = %Zu, dset_offset_arr[%Zu] = %Hu\n", FUNC, u, dset_len_arr[u], u, dset_offset_arr[u]); +for(u = 0; u < mem_max_nseq; u++) + HDfprintf(stderr, "%s: mem_len_arr[%Zu] = %Zu, mem_offset_arr[%Zu] = %Hu\n", FUNC, u, mem_len_arr[u], u, mem_offset_arr[u]); +#endif /* QAK */ /* Check args */ - assert(io_info); - assert(io_info->dset); - assert(io_info->store); - assert(buf); + HDassert(io_info); + HDassert(io_info->dset); + HDassert(io_info->store); + HDassert(buf); /* Check if data sieving is enabled */ - if(H5F_HAS_FEATURE(file,H5FD_FEAT_DATA_SIEVE)) { - haddr_t sieve_start=HADDR_UNDEF, sieve_end=HADDR_UNDEF; /* Start & end locations of sieve buffer */ + if(H5F_HAS_FEATURE(file, H5FD_FEAT_DATA_SIEVE)) { + haddr_t sieve_start = HADDR_UNDEF, sieve_end = HADDR_UNDEF; /* Start & end locations of sieve buffer */ haddr_t contig_end; /* End locations of block to write */ - size_t sieve_size=(size_t)-1; /* size of sieve buffer */ + size_t sieve_size = (size_t)-1; /* size of sieve buffer */ haddr_t abs_eoa; /* Absolute end of file address */ haddr_t rel_eoa; /* Relative end of file address */ hsize_t max_data; /* Actual maximum size of data to cache */ /* Set offsets in sequence lists */ - u=*dset_curr_seq; - v=*mem_curr_seq; + u = *dset_curr_seq; + v = *mem_curr_seq; /* Stash local copies of these value */ - if(dset_contig->sieve_buf!=NULL) { - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + if(dset_contig->sieve_buf != NULL) { + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start+sieve_size; } /* end if */ /* Works through sequences as fast as possible */ - for(; udset_addr+dset_offset_arr[u]; + addr = store_contig->dset_addr + dset_offset_arr[u]; /* Compute offset in memory */ - buf = (unsigned char *)_buf + mem_offset_arr[v]; + buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; /* Check if the sieve buffer is allocated yet */ - if(dset_contig->sieve_buf==NULL) { + if(dset_contig->sieve_buf == NULL) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(size>dset_contig->sieve_buf_size) { - if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") } /* end if */ else { @@ -465,40 +598,40 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") /* Adjust absolute EOA address to relative EOA address */ - rel_eoa=abs_eoa-H5F_get_base_addr(file); + rel_eoa = abs_eoa - H5F_get_base_addr(file); /* Set up the buffer parameters */ - max_data=store_contig->dset_size-dset_offset_arr[u]; + max_data = store_contig->dset_size-dset_offset_arr[u]; /* Compute the size of the sieve buffer */ - H5_ASSIGN_OVERFLOW(dset_contig->sieve_size,MIN3(rel_eoa-dset_contig->sieve_loc,max_data,dset_contig->sieve_buf_size),hsize_t,size_t); + H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa-dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t); /* Read the new sieve buffer */ - if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(buf,dset_contig->sieve_buf,size); + HDmemcpy(buf, dset_contig->sieve_buf, size); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; + dset_contig->sieve_dirty = 0; /* Stash local copies of these value */ - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start+sieve_size; } /* end else */ } /* end if */ else { /* Compute end of sequence to retrieve */ - contig_end=addr+size-1; + contig_end = addr + size - 1; /* If entire read is within the sieve buffer, read it from the buffer */ if(addr>=sieve_start && contig_endsieve_buf+(addr-sieve_start); /* Grab the data out of the buffer */ - HDmemcpy(buf,base_sieve_buf,size); + HDmemcpy(buf, base_sieve_buf, size); } /* end if */ /* Entire request is not within this data sieve buffer */ else { @@ -510,16 +643,16 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, /* Flush the sieve buffer, if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; + dset_contig->sieve_dirty = 0; } /* end if */ } /* end if */ /* Read directly into the user's buffer */ - if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") } /* end if */ /* Element size fits within the buffer size */ @@ -561,72 +694,72 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(buf,dset_contig->sieve_buf,size); + HDmemcpy(buf, dset_contig->sieve_buf, size); /* Reset sieve buffer dirty flag */ - dset_contig->sieve_dirty=0; + dset_contig->sieve_dirty = 0; } /* end else */ } /* end else */ } /* end else */ /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ } /* end if */ else { /* Work through all the sequences */ - for(u=*dset_curr_seq, v=*mem_curr_seq; udset_addr+dset_offset_arr[u]; + addr = store_contig->dset_addr + dset_offset_arr[u]; /* Compute offset in memory */ - buf = (unsigned char *)_buf + mem_offset_arr[v]; + buf = (unsigned char *)io_info->u.rbuf + mem_offset_arr[v]; /* Write data */ - if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ } /* end else */ /* Update current sequence vectors */ - *dset_curr_seq=u; - *mem_curr_seq=v; + *dset_curr_seq = u; + *mem_curr_seq = v; /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t); + H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); done: FUNC_LEAVE_NOAPI(ret_value) @@ -654,15 +787,14 @@ done: ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer, const void *_buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) { H5F_t *file = io_info->dset->oloc.file; /* File for dataset */ - H5D_rdcdc_t *dset_contig=&(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ - const H5D_contig_storage_t *store_contig=&(io_info->store->contig); /* Contiguous storage info for this I/O operation */ - const unsigned char *buf=(const unsigned char *)_buf; /* Pointer to buffer to fill */ + H5D_rdcdc_t *dset_contig = &(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ + const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ + const unsigned char *buf = (const unsigned char *)io_info->u.wbuf; /* Pointer to buffer to fill */ haddr_t addr; /* Actual address to read */ - size_t total_size=0; /* Size of sequence in bytes */ + size_t total_size = 0; /* Size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ size_t u; /* Counting variable */ size_t v; /* Counting variable */ @@ -671,10 +803,10 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL) /* Check args */ - assert(io_info); - assert(io_info->dset); - assert(io_info->store); - assert(buf); + HDassert(io_info); + HDassert(io_info->dset); + HDassert(io_info->store); + HDassert(buf); /* Check if data sieving is enabled */ if(H5F_HAS_FEATURE(file,H5FD_FEAT_DATA_SIEVE)) { @@ -708,18 +840,18 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, addr=store_contig->dset_addr+dset_offset_arr[u]; /* Compute offset in memory */ - buf = (const unsigned char *)_buf + mem_offset_arr[v]; + buf = (const unsigned char *)io_info->u.wbuf + mem_offset_arr[v]; /* No data sieve buffer yet, go allocate one */ if(dset_contig->sieve_buf==NULL) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(size>dset_contig->sieve_buf_size) { - if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ else { /* Allocate room for the data sieve buffer */ - if (NULL==(dset_contig->sieve_buf=H5FL_BLK_MALLOC(sieve_buf,dset_contig->sieve_buf_size))) + if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") #ifdef H5_CLEAR_MEMORY if(dset_contig->sieve_size > size) @@ -750,15 +882,15 @@ if(dset_contig->sieve_size > size) } /* end if */ /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(dset_contig->sieve_buf,buf,size); + HDmemcpy(dset_contig->sieve_buf, buf, size); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty=1; + dset_contig->sieve_dirty = 1; /* Stash local copies of these values */ - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; } /* end else */ } /* end if */ else { @@ -767,13 +899,13 @@ if(dset_contig->sieve_size > size) /* If entire write is within the sieve buffer, write it to the buffer */ if(addr>=sieve_start && contig_endsieve_buf+(addr-sieve_start); + unsigned char *base_sieve_buf = dset_contig->sieve_buf + (addr - sieve_start); /* Put the data into the sieve buffer */ - HDmemcpy(base_sieve_buf,buf,size); + HDmemcpy(base_sieve_buf, buf, size); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty=1; + dset_contig->sieve_dirty = 1; } /* end if */ /* Entire request is not within this data sieve buffer */ else { @@ -798,7 +930,7 @@ if(dset_contig->sieve_size > size) } /* end if */ /* Write directly from the user's buffer */ - if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ /* Element size fits within the buffer size */ @@ -808,30 +940,30 @@ if(dset_contig->sieve_size > size) (size+sieve_size)<=dset_contig->sieve_buf_size && dset_contig->sieve_dirty) { /* Prepend to existing sieve buffer */ - if((addr+size)==sieve_start) { + if((addr + size) == sieve_start) { /* Move existing sieve information to correct location */ - HDmemmove(dset_contig->sieve_buf+size,dset_contig->sieve_buf,dset_contig->sieve_size); + HDmemmove(dset_contig->sieve_buf + size, dset_contig->sieve_buf, dset_contig->sieve_size); /* Copy in new information (must be first in sieve buffer) */ - HDmemcpy(dset_contig->sieve_buf,buf,size); + HDmemcpy(dset_contig->sieve_buf, buf, size); /* Adjust sieve location */ - dset_contig->sieve_loc=addr; + dset_contig->sieve_loc = addr; } /* end if */ /* Append to existing sieve buffer */ else { /* Copy in new information */ - HDmemcpy(dset_contig->sieve_buf+sieve_size,buf,size); + HDmemcpy(dset_contig->sieve_buf + sieve_size, buf, size); } /* end else */ /* Adjust sieve size */ dset_contig->sieve_size += size; /* Update local copies of sieve information */ - sieve_start=dset_contig->sieve_loc; - sieve_size=dset_contig->sieve_size; - sieve_end=sieve_start+sieve_size; + sieve_start = dset_contig->sieve_loc; + sieve_size = dset_contig->sieve_size; + sieve_end = sieve_start + sieve_size; } /* end if */ /* Can't add the new data onto the existing sieve buffer */ else { @@ -875,73 +1007,73 @@ if(dset_contig->sieve_size > size) } /* end if */ /* Grab the data out of the buffer (must be first piece of data in buffer ) */ - HDmemcpy(dset_contig->sieve_buf,buf,size); + HDmemcpy(dset_contig->sieve_buf, buf, size); /* Set sieve buffer dirty flag */ - dset_contig->sieve_dirty=1; + dset_contig->sieve_dirty = 1; } /* end else */ } /* end else */ } /* end else */ } /* end else */ /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ } /* end if */ else { /* Work through all the sequences */ - for(u=*dset_curr_seq, v=*mem_curr_seq; udset_addr+dset_offset_arr[u]; + addr = store_contig->dset_addr + dset_offset_arr[u]; /* Compute offset in memory */ - buf = (const unsigned char *)_buf + mem_offset_arr[v]; + buf = (const unsigned char *)io_info->u.wbuf + mem_offset_arr[v]; /* Write data */ - if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ } /* end else */ /* Update current sequence vectors */ - *dset_curr_seq=u; - *mem_curr_seq=v; + *dset_curr_seq = u; + *mem_curr_seq = v; /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t); + H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 8f8aa50..fd1d2e8 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -156,7 +156,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") if(H5I_DATATYPE != H5I_get_type(type_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype ID") - if(NULL == (space = H5I_object_verify(space_id,H5I_DATASPACE))) + if(NULL == (space = (const H5S_t *)H5I_object_verify(space_id,H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace ID") if(H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; diff --git a/src/H5Defl.c b/src/H5Defl.c index c8d1098..7dac29b 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -33,30 +33,88 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ + /****************/ /* Local Macros */ /****************/ + /******************/ /* Local Typedefs */ /******************/ + /********************/ /* Local Prototypes */ /********************/ -static herr_t H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, + +/* Layout operation callbacks */ +static herr_t H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *cm); +static ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); + +/* Helper routines */ +static herr_t H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf); static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf); + /*********************/ /* Package Variables */ /*********************/ +/* External File List (EFL) storage layout I/O ops */ +const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ + H5D_efl_io_init, + H5D_contig_read, + H5D_contig_write, +#ifdef H5_HAVE_PARALLEL + NULL, + NULL, +#endif /* H5_HAVE_PARALLEL */ + H5D_efl_readvv, + H5D_efl_writevv, + NULL +}}; + + /*******************/ /* Local Variables */ /*******************/ + + +/*------------------------------------------------------------------------- + * Function: H5D_efl_io_init + * + * Purpose: Performs initialization before any sort of I/O on the raw data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 20, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t UNUSED *cm) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_efl_io_init) + + HDmemcpy(&io_info->store->efl, &(io_info->dset->shared->dcpl_cache.efl), sizeof(H5O_efl_t)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_efl_io_init() */ + /*------------------------------------------------------------------------- * Function: H5D_efl_read @@ -77,26 +135,26 @@ static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, *------------------------------------------------------------------------- */ static herr_t -H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) +H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) { - int fd=-1; + int fd = -1; size_t to_read; #ifndef NDEBUG hsize_t tempto_read; #endif /* NDEBUG */ - hsize_t skip=0; + hsize_t skip = 0; haddr_t cur; ssize_t n; size_t u; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read) /* Check args */ - assert (efl && efl->nused>0); - assert (H5F_addr_defined (addr)); - assert (size < SIZET_MAX); - assert (buf || 0==size); + HDassert(efl && efl->nused>0); + HDassert(H5F_addr_defined(addr)); + HDassert(size < SIZET_MAX); + HDassert(buf || 0 == size); /* Find the first efl member from which to read */ for (u=0, cur=0; unused; u++) { @@ -109,7 +167,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) /* Read the data */ while (size) { - assert(buf); + HDassert(buf); if (u>=efl->nused) HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file") if (H5F_OVERFLOW_HSIZET2OFFT (efl->slot[u].offset+skip)) @@ -165,25 +223,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf) +H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf) { - int fd=-1; + int fd = -1; size_t to_write; #ifndef NDEBUG hsize_t tempto_write; #endif /* NDEBUG */ haddr_t cur; - hsize_t skip=0; + hsize_t skip = 0; size_t u; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write) /* Check args */ - assert (efl && efl->nused>0); - assert (H5F_addr_defined (addr)); - assert (size < SIZET_MAX); - assert (buf || 0==size); + HDassert(efl && efl->nused>0); + HDassert(H5F_addr_defined(addr)); + HDassert(size < SIZET_MAX); + HDassert(buf || 0 == size); /* Find the first efl member in which to write */ for (u=0, cur=0; unused; u++) { @@ -248,71 +306,68 @@ done: * Programmer: Quincey Koziol * Wednesday, May 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ -ssize_t +static ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer/*in*/, void *_buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) { - const H5O_efl_t *efl=&(io_info->store->efl); /* Pointer to efl info */ + const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ unsigned char *buf; /* Pointer to buffer to write */ haddr_t addr; /* Actual address to read */ - size_t total_size=0; /* Total size of sequence in bytes */ + size_t total_size = 0; /* Total size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv) /* Check args */ - assert (efl && efl->nused>0); - assert (_buf); + HDassert(efl && efl->nused > 0); + HDassert(io_info->u.rbuf); /* Work through all the sequences */ - for(u=*dset_curr_seq, v=*mem_curr_seq; uu.rbuf + mem_offset_arr[v]; /* Read data */ - if (H5D_efl_read(efl, addr, size, buf)<0) + if(H5D_efl_read(efl, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ /* Update current sequence vectors */ - *dset_curr_seq=u; - *mem_curr_seq=v; + *dset_curr_seq = u; + *mem_curr_seq = v; /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t); + H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); done: FUNC_LEAVE_NOAPI(ret_value) @@ -332,71 +387,68 @@ done: * Programmer: Quincey Koziol * Friday, May 2, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ -ssize_t +static ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer/*in*/, const void *_buf) + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]) { - const H5O_efl_t *efl=&(io_info->store->efl); /* Pointer to efl info */ + const H5O_efl_t *efl = &(io_info->store->efl); /* Pointer to efl info */ const unsigned char *buf; /* Pointer to buffer to write */ haddr_t addr; /* Actual address to read */ - size_t total_size=0; /* Total size of sequence in bytes */ + size_t total_size = 0; /* Total size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv) /* Check args */ - assert (efl && efl->nused>0); - assert (_buf); + HDassert(efl && efl->nused > 0); + HDassert(io_info->u.wbuf); /* Work through all the sequences */ - for(u=*dset_curr_seq, v=*mem_curr_seq; uu.wbuf + mem_offset_arr[v]; /* Write data */ - if (H5D_efl_write(efl, addr, size, buf)<0) + if(H5D_efl_write(efl, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Update memory information */ - mem_len_arr[v]-=size; - mem_offset_arr[v]+=size; - if(mem_len_arr[v]==0) + mem_len_arr[v] -= size; + mem_offset_arr[v] += size; + if(mem_len_arr[v] == 0) v++; /* Update file information */ - dset_len_arr[u]-=size; - dset_offset_arr[u]+=size; - if(dset_len_arr[u]==0) + dset_len_arr[u] -= size; + dset_offset_arr[u] += size; + if(dset_len_arr[u] == 0) u++; /* Increment number of bytes copied */ - total_size+=size; + total_size += size; } /* end for */ /* Update current sequence vectors */ - *dset_curr_seq=u; - *mem_curr_seq=v; + *dset_curr_seq = u; + *mem_curr_seq = v; /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t); + H5_ASSIGN_OVERFLOW(ret_value, total_size, size_t, ssize_t); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dfill.c b/src/H5Dfill.c index bfb4354..4879f4d 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -275,7 +275,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") /* Scatter the data into memory */ - if(H5D_select_mscat(tmp_buf, space, &mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) { + if(H5D_scatter_mem(tmp_buf, space, &mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) { H5S_SELECT_ITER_RELEASE(&mem_iter); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end if */ @@ -337,13 +337,13 @@ done: if(dst_id != (-1) && H5I_dec_ref(dst_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tmp_buf) - H5FL_BLK_FREE(type_conv, tmp_buf); + (void)H5FL_BLK_FREE(type_conv, tmp_buf); if(elem_wb && H5WB_unwrap(elem_wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") if(bkg_elem_wb && H5WB_unwrap(bkg_elem_wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") if(bkg_buf) - H5FL_BLK_FREE(type_conv, bkg_buf); + (void)H5FL_BLK_FREE(type_conv, bkg_buf); FUNC_LEAVE_NOAPI(ret_value) } /* H5D_fill() */ @@ -636,9 +636,9 @@ H5D_fill_release(H5D_fill_buf_info_t *fb_info) fb_info->fill_free_func(fb_info->fill_buf, fb_info->fill_free_info); else { if(fb_info->fill->buf) - H5FL_BLK_FREE(non_zero_fill, fb_info->fill_buf); + (void)H5FL_BLK_FREE(non_zero_fill, fb_info->fill_buf); else - H5FL_BLK_FREE(zero_fill, fb_info->fill_buf); + (void)H5FL_BLK_FREE(zero_fill, fb_info->fill_buf); } /* end else */ fb_info->fill_buf = NULL; } /* end if */ @@ -677,7 +677,7 @@ H5D_fill_term(H5D_fill_buf_info_t *fb_info) else if(fb_info->mem_type) H5T_close(fb_info->mem_type); if(fb_info->bkg_buf) - H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); + (void)H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Dint.c b/src/H5Dint.c index a5ea398..acb95d2 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -59,10 +59,12 @@ typedef struct { /* General stuff */ static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, hid_t dxpl_id); +static herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); static H5D_shared_t *H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); static herr_t H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type); static herr_t H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); +static herr_t H5D_set_io_ops(H5D_t *dataset); static herr_t H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset); static herr_t H5D_open_oid(H5D_t *dataset, hid_t dxpl_id); static herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id, unsigned flags); @@ -250,6 +252,133 @@ H5D_term_interface(void) } /* end H5D_term_interface() */ +/*-------------------------------------------------------------------------- + NAME + H5D_get_dxpl_cache_real + PURPOSE + Get all the values for the DXPL cache. + USAGE + herr_t H5D_get_dxpl_cache_real(dxpl_id, cache) + hid_t dxpl_id; IN: DXPL to query + H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values + RETURNS + Non-negative on success/Negative on failure. + DESCRIPTION + Query all the values from a DXPL that are needed by internal routines + within the library. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) +{ + H5P_genplist_t *dx_plist; /* Data transfer property list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_get_dxpl_cache_real) + + /* Check args */ + HDassert(cache); + + /* Get the dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Get maximum temporary buffer size */ + if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &cache->max_temp_buf) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") + + /* Get temporary buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &cache->tconv_buf) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") + + /* Get background buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &cache->bkgr_buf) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") + + /* Get background buffer type */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &cache->bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") + + /* Get B-tree split ratios */ + if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") + + /* Get I/O vector size */ + if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &cache->vec_size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") + +#ifdef H5_HAVE_PARALLEL + /* Collect Parallel I/O information for possible later use */ + if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &cache->xfer_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + if(H5P_get(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &cache->coll_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") +#endif /* H5_HAVE_PARALLEL */ + + /* Get error detection properties */ + if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &cache->err_detect) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve error detection info") + + /* Get filter callback function */ + if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &cache->filter_cb) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") + + /* Get the data transform property */ + if(H5P_get(dx_plist, H5D_XFER_XFORM_NAME, &cache->data_xform_prop) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve data transform info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_get_dxpl_cache_real() */ + + +/*-------------------------------------------------------------------------- + NAME + H5D_get_dxpl_cache + PURPOSE + Get all the values for the DXPL cache. + USAGE + herr_t H5D_get_dxpl_cache(dxpl_id, cache) + hid_t dxpl_id; IN: DXPL to query + H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values + RETURNS + Non-negative on success/Negative on failure. + DESCRIPTION + Query all the values from a DXPL that are needed by internal routines + within the library. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + The CACHE pointer should point at already allocated memory to place + non-default property list info. If a default property list is used, the + CACHE pointer will be changed to point at the default information. + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) +{ + herr_t ret_value=SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5D_get_dxpl_cache,FAIL) + + /* Check args */ + assert(cache); + + /* Check for the default DXPL */ + if(dxpl_id==H5P_DATASET_XFER_DEFAULT) + *cache=&H5D_def_dxpl_cache; + else + if(H5D_get_dxpl_cache_real(dxpl_id,*cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't retrieve DXPL values") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_get_dxpl_cache() */ + + /*------------------------------------------------------------------------- * Function: H5D_create_named * @@ -556,6 +685,54 @@ done: /*------------------------------------------------------------------------- + * Function: H5D_set_io_ops + * + * Purpose: Set the I/O operation function pointers for a dataset + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 20, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_set_io_ops(H5D_t *dataset) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_set_io_ops) + + /* check args */ + HDassert(dataset); + + /* Set the I/O functions for each layout type */ + switch(dataset->shared->layout.type) { + case H5D_CONTIGUOUS: + if(dataset->shared->dcpl_cache.efl.nused > 0) + dataset->shared->layout_ops = H5D_LOPS_EFL; + else + dataset->shared->layout_ops = H5D_LOPS_CONTIG; + break; + + case H5D_CHUNKED: + dataset->shared->layout_ops = H5D_LOPS_CHUNK; + break; + + case H5D_COMPACT: + dataset->shared->layout_ops = H5D_LOPS_COMPACT; + break; + + default: + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown storage method") + } /* end switch */ /*lint !e788 All appropriate cases are covered */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_set_io_ops() */ + + +/*------------------------------------------------------------------------- * Function: H5D_update_oh_info * * Purpose: Create and fill object header for dataset @@ -979,18 +1156,10 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, } else if(max_points * H5T_get_size(type) > max_storage) { HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "data space size exceeds external storage size") } - - /* Set the I/O functions for this layout type */ - new_dset->shared->io_ops.readvv = H5D_efl_readvv; - new_dset->shared->io_ops.writevv = H5D_efl_writevv; } /* end if */ else { if(ndims > 0 && max_dim[0] > dim[0]) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "extendible contiguous non-external dataset") - - /* Set the I/O functions for this layout type */ - new_dset->shared->io_ops.readvv = H5D_contig_readvv; - new_dset->shared->io_ops.writevv = H5D_contig_writevv; } /* end else */ /* Compute the total size of a chunk */ @@ -1042,10 +1211,6 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, for(u = 1, new_dset->shared->layout.u.chunk.size = new_dset->shared->layout.u.chunk.dim[0]; u < new_dset->shared->layout.u.chunk.ndims; u++) new_dset->shared->layout.u.chunk.size *= new_dset->shared->layout.u.chunk.dim[u]; - /* Set the I/O functions for this layout type */ - new_dset->shared->io_ops.readvv = H5D_istore_readvv; - new_dset->shared->io_ops.writevv = H5D_istore_writevv; - /* Initialize the chunk cache for the dataset */ if(H5D_istore_init(file, new_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize chunk cache") @@ -1073,10 +1238,6 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, comp_data_size = H5O_MESG_MAX_SIZE - H5O_layout_meta_size(file, &(new_dset->shared->layout)); if(new_dset->shared->layout.u.compact.size > comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "compact dataset size is bigger than header message maximum size") - - /* Set the I/O functions for this layout type */ - new_dset->shared->io_ops.readvv = H5D_compact_readvv; - new_dset->shared->io_ops.writevv = H5D_compact_writevv; } /* end case */ break; @@ -1084,6 +1245,10 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ + /* Set the dataset's I/O operations */ + if(H5D_set_io_ops(new_dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize I/O operations") + /* Update the dataset's object header info. */ if(H5D_update_oh_info(file, dxpl_id, new_dset) != SUCCEED) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache") @@ -1252,9 +1417,9 @@ static herr_t H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) { H5P_genplist_t *plist; /* Property list */ - H5O_pline_t *pline; /* I/O pipeline information */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ unsigned alloc_time_state; /* Allocation time state */ + htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_open_oid) @@ -1285,13 +1450,17 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the optional filters message */ - pline = &dataset->shared->dcpl_cache.pline; - if(NULL != H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, pline, dxpl_id)) { - if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, pline) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") + if(msg_exists) { + /* Retrieve the I/O pipeline message */ + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline, dxpl_id)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") + + /* Set the I/O pipeline info in the property list */ + if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &dataset->shared->dcpl_cache.pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set pipeline") } /* end if */ - else - H5E_clear_stack(NULL); /* * Get the raw data layout info. It's actually stored in two locations: @@ -1316,10 +1485,6 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) H5_ASSIGN_OVERFLOW(dataset->shared->layout.u.contig.size, tmp_size, hssize_t, hsize_t); } /* end if */ - /* Set the I/O functions for this layout type */ - dataset->shared->io_ops.readvv = H5D_contig_readvv; - dataset->shared->io_ops.writevv = H5D_contig_writevv; - /* Get the sieve buffer size for this dataset */ dataset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(dataset->oloc.file); break; @@ -1344,33 +1509,34 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) if(H5D_istore_init(dataset->oloc.file, dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize chunk cache") } - - /* Set the I/O functions for this layout type */ - dataset->shared->io_ops.readvv = H5D_istore_readvv; - dataset->shared->io_ops.writevv = H5D_istore_writevv; break; case H5D_COMPACT: - /* Set the I/O functions for this layout type */ - dataset->shared->io_ops.readvv = H5D_compact_readvv; - dataset->shared->io_ops.writevv = H5D_compact_writevv; break; default: - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "not implemented yet") + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown storage method") } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Point at dataset's copy, to cache it for later */ fill_prop = &dataset->shared->dcpl_cache.fill; /* Try to get the new fill value message from the object header */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop, dxpl_id)) { - H5E_clear_stack(NULL); - + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_NEW_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") + if(msg_exists) { + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop, dxpl_id)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") + } /* end if */ + else { /* For backward compatibility, try to retrieve the old fill value message */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop, dxpl_id)) { - H5E_clear_stack(NULL); - + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") + if(msg_exists) { + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop, dxpl_id)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") + } /* end if */ + else { /* Set the space allocation time appropriately, based on the type of dataset storage */ switch(dataset->shared->layout.type) { case H5D_COMPACT: @@ -1388,7 +1554,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ - } /* end if */ + } /* end else */ /* If "old" fill value size is 0 (undefined), map it to -1 */ if(fill_prop->size == 0) @@ -1412,18 +1578,23 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) * also undefined when space allocate time is H5D_ALLOC_TIME_LATE. */ if((dataset->shared->layout.type == H5D_CONTIGUOUS && !H5F_addr_defined(dataset->shared->layout.u.contig.addr)) || (dataset->shared->layout.type == H5D_CHUNKED && !H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) { - if(NULL != H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl, dxpl_id)) { + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID, dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") + if(msg_exists) { + /* Retrieve the EFL message */ + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl, dxpl_id)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") + + /* Set the EFL info in the property list */ if(H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &dataset->shared->dcpl_cache.efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set external file list") - - /* Override the I/O functions for this layout type */ - dataset->shared->io_ops.readvv = H5D_efl_readvv; - dataset->shared->io_ops.writevv = H5D_efl_writevv; } /* end if */ - else - H5E_clear_stack(NULL); } /* end if */ + /* Set the dataset's I/O operations */ + if(H5D_set_io_ops(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize I/O operations") + /* * Make sure all storage is properly initialized. * This is important only for parallel I/O where the space must @@ -2334,7 +2505,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Construct dataset I/O info */ - H5D_BUILD_IO_INFO(&io_info, dset, dxpl_cache, dxpl_id, NULL); + H5D_BUILD_IO_INFO_RD(&io_info, dset, dxpl_cache, dxpl_id, NULL, NULL); /* Remove excess chunks */ if(H5D_istore_prune_by_extent(&io_info, curr_dims) < 0) diff --git a/src/H5Dio.c b/src/H5Dio.c index 8576464..17bab19 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -28,27 +28,17 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Sprivate.h" /* Dataspace functions */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Vprivate.h" /* Vector and array functions */ #ifdef H5_HAVE_PARALLEL /* Remove this if H5R_DATASET_REGION is no longer used in this file */ -# include "H5Rpublic.h" +#include "H5Rpublic.h" #endif /*H5_HAVE_PARALLEL*/ + /****************/ /* Local Macros */ /****************/ -#define H5D_DEFAULT_SKIPLIST_HEIGHT 8 - -/* Macros for iterating over chunks to operate on */ -#define H5D_CHUNK_GET_FIRST_NODE(map) (map.use_single ? (H5SL_node_t *)(1) : H5SL_first(map.sel_chunks)) -#define H5D_CHUNK_GET_NODE_INFO(map, node) (map.use_single ? map.single_chunk_info : (H5D_chunk_info_t *)H5SL_item(node)) -#define H5D_CHUNK_GET_NEXT_NODE(map, node) (map.use_single ? (H5SL_node_t *)NULL : H5SL_next(node)) - /******************/ /* Local Typedefs */ @@ -59,64 +49,36 @@ /* Local Prototypes */ /********************/ +/* Internal I/O routines */ static herr_t H5D_read(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, - hid_t dset_xfer_plist, void *buf/*out*/); + const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, + void *buf/*out*/); static herr_t H5D_write(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, - hid_t dset_xfer_plist, const void *buf); -static herr_t H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, void *buf/*out*/); -static herr_t H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, const void *buf); -static herr_t H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, void *buf/*out*/); -static herr_t H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, const void *buf); -static herr_t H5D_compound_opt_read(size_t nelmts, const H5S_t *mem_space, - H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, - hid_t src_id, hid_t dst_id, H5T_subset_t subset, void *data_buf, - void *user_buf/*out*/); -static herr_t H5D_compound_opt_write(size_t nelmts, hid_t src_id, hid_t dst_id, - void *data_buf); + const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, + const void *buf); +/* Setup/teardown routines */ +static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, + hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, + H5D_io_info_t *io_info); +static herr_t H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, + hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, + H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL +static herr_t H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, + const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, + const H5S_t *file_space, const H5S_t *mem_space, + const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); static herr_t H5D_ioinfo_term(H5D_io_info_t *io_info); #endif /* H5_HAVE_PARALLEL */ +static herr_t H5D_typeinfo_term(const H5D_type_info_t *type_info); -/* I/O info operations */ -static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, const H5S_t *mem_space, const H5S_t *file_space, - H5T_path_t *tpath, H5D_io_info_t *io_info); - -/* Chunk operations */ -static herr_t H5D_create_chunk_map(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info, - hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, - const H5T_t *mem_type); -static herr_t H5D_destroy_chunk_map(const H5D_chunk_map_t *fm); -static herr_t H5D_free_chunk_info(void *item, void *key, void *opdata); -static herr_t H5D_create_chunk_map_single(H5D_chunk_map_t *fm, - const H5D_io_info_t *io_info); -static herr_t H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, - const H5D_io_info_t *io_info); -static herr_t H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); -static herr_t H5D_chunk_file_cb(void *elem, hid_t type_id, unsigned ndims, - const hsize_t *coords, void *fm); -static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, - const hsize_t *coords, void *fm); /*********************/ /* Package Variables */ /*********************/ + /*******************/ /* Local Variables */ /*******************/ @@ -124,142 +86,6 @@ static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, /* Declare a free list to manage blocks of type conversion data */ H5FL_BLK_DEFINE(type_conv); -/* Declare a free list to manage the H5D_chunk_info_t struct */ -H5FL_DEFINE(H5D_chunk_info_t); - -/* Declare a free list to manage sequences of size_t */ -H5FL_SEQ_DEFINE_STATIC(size_t); - -/* Declare a free list to manage sequences of hsize_t */ -H5FL_SEQ_DEFINE_STATIC(hsize_t); - - - -/*-------------------------------------------------------------------------- - NAME - H5D_get_dxpl_cache_real - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D_get_dxpl_cache_real(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) -{ - H5P_genplist_t *dx_plist; /* Data transfer property list */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_get_dxpl_cache_real,FAIL) - - /* Check args */ - assert(cache); - - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get maximum temporary buffer size */ - if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &cache->max_temp_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") - - /* Get temporary buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &cache->tconv_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") - - /* Get background buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &cache->bkgr_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") - - /* Get background buffer type */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &cache->bkgr_buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") - - /* Get B-tree split ratios */ - if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") - - /* Get I/O vector size */ - if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &cache->vec_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") - -#ifdef H5_HAVE_PARALLEL - /* Collect Parallel I/O information for possible later use */ - if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") - if(H5P_get(dx_plist, H5D_XFER_IO_XFER_OPT_MODE_NAME, &cache->xfer_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") -#endif /*H5_HAVE_PARALLEL*/ - - /* Get error detection properties */ - if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &cache->err_detect) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve error detection info") - - /* Get filter callback function */ - if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &cache->filter_cb) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") - - /* Get the data transform property */ - if(H5P_get(dx_plist, H5D_XFER_XFORM_NAME, &cache->data_xform_prop) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve data transform info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_get_dxpl_cache_real() */ - - -/*-------------------------------------------------------------------------- - NAME - H5D_get_dxpl_cache - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D_get_dxpl_cache(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - The CACHE pointer should point at already allocated memory to place - non-default property list info. If a default property list is used, the - CACHE pointer will be changed to point at the default information. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) -{ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_get_dxpl_cache,FAIL) - - /* Check args */ - assert(cache); - - /* Check for the default DXPL */ - if(dxpl_id==H5P_DATASET_XFER_DEFAULT) - *cache=&H5D_def_dxpl_cache; - else - if(H5D_get_dxpl_cache_real(dxpl_id,*cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't retrieve DXPL values") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_get_dxpl_cache() */ /*------------------------------------------------------------------------- @@ -300,7 +126,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; char fake_char; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Dread, FAIL) H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, @@ -316,7 +142,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Check for valid selection */ - if(H5S_SELECT_VALID(mem_space)!=TRUE) + if(H5S_SELECT_VALID(mem_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") } /* end if */ if(H5S_ALL != file_space_id) { @@ -324,33 +150,33 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space)!=TRUE) + if(H5S_SELECT_VALID(file_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "selection+offset not within extent") - } + } /* end if */ /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == plist_id) plist_id= H5P_DATASET_XFER_DEFAULT; else - if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - if (!buf && H5S_GET_SELECT_NPOINTS(file_space)!=0) + if(!buf && H5S_GET_SELECT_NPOINTS(file_space) != 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") /* If the buffer is nil, and 0 element is selected, make a fake buffer. * This is for some MPI package like ChaMPIon on NCSA's tungsten which * doesn't support this feature. */ - if (!buf) + if(!buf) buf = &fake_char; /* read raw data */ - if (H5D_read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) + if(H5D_read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Dread() */ /*------------------------------------------------------------------------- @@ -392,7 +218,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; char fake_char; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Dwrite, FAIL) H5TRACE6("e", "iiiii*x", dset_id, mem_type_id, mem_space_id, file_space_id, @@ -408,7 +234,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Check for valid selection */ - if (H5S_SELECT_VALID(mem_space)!=TRUE) + if(H5S_SELECT_VALID(mem_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "memory selection+offset not within extent") } /* end if */ if(H5S_ALL != file_space_id) { @@ -416,7 +242,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Check for valid selection */ - if(H5S_SELECT_VALID(file_space)!=TRUE) + if(H5S_SELECT_VALID(file_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") } /* end if */ @@ -424,16 +250,16 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5P_DEFAULT == plist_id) plist_id= H5P_DATASET_XFER_DEFAULT; else - if(TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - if(!buf && H5S_GET_SELECT_NPOINTS(file_space)!=0) + if(!buf && H5S_GET_SELECT_NPOINTS(file_space) != 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") /* If the buffer is nil, and 0 element is selected, make a fake buffer. * This is for some MPI package like ChaMPIon on NCSA's tungsten which * doesn't support this feature. */ - if (!buf) + if(!buf) buf = &fake_char; /* write raw data */ @@ -442,7 +268,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Dwrite() */ /*------------------------------------------------------------------------- @@ -462,16 +288,18 @@ static herr_t H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) { + H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ + H5D_io_info_t io_info; /* Dataset I/O info */ + H5D_type_info_t type_info; /* Datatype info for operation */ + H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - H5T_path_t *tpath = NULL; /*type conversion info */ - const H5T_t *mem_type = NULL; /* Memory datatype */ - H5D_io_info_t io_info; /* Dataset I/O info */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ + hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_read) @@ -479,10 +307,6 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* check args */ HDassert(dataset && dataset->oloc.file); - /* Get memory datatype */ - if(NULL == (mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(!file_space) file_space = dataset->shared->space; if(!mem_space) @@ -492,23 +316,27 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id,&dxpl_cache) < 0) + if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + /* Set up datatype info for operation */ + if(H5D_typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") + #ifdef H5_HAVE_PARALLEL /* Collective access is not permissible without a MPI based VFD */ - if (dxpl_cache->xfer_mode==H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPI(dataset->oloc.file)) + if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPI(dataset->oloc.file)) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") #endif /*H5_HAVE_PARALLEL*/ /* Make certain that the number of elements in each selection is the same */ - if (nelmts!=(hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) + if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") /* Make sure that both selections have their extents set */ - if( !(H5S_has_extent(file_space)) ) + if(!(H5S_has_extent(file_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file dataspace does not have extent set") - if( !(H5S_has_extent(mem_space)) ) + if(!(H5S_has_extent(mem_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "memory dataspace does not have extent set") /* Retrieve dataset properties */ @@ -539,49 +367,56 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_DONE(SUCCEED) /* Go fill the user's selection with the dataset's fill value */ - if(H5D_fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, mem_type, mem_space, dxpl_id) < 0) + if(H5D_fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, type_info.mem_type, mem_space, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "filling buf failed") else HGOTO_DONE(SUCCEED) } /* end if */ - /* - * Locate the type conversion function and data space conversion - * functions, and set up the element numbering information. If a data - * type conversion is necessary then register datatype atoms. Data type - * conversion is necessary if the user has set the `need_bkg' to a high - * enough value in xfer_parms since turning off datatype conversion also - * turns off background preservation. - */ - if (NULL==(tpath=H5T_path_find(dataset->shared->type, mem_type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") - /* Set up I/O operation */ - if(H5D_ioinfo_init(dataset,dxpl_cache,dxpl_id,mem_space,file_space,tpath,&io_info) < 0) + io_info.op_type = H5D_IO_OP_READ; + io_info.u.rbuf = buf; + if(H5D_ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") #ifdef H5_HAVE_PARALLEL io_info_init = TRUE; #endif /*H5_HAVE_PARALLEL*/ - /* Determine correct I/O routine to invoke */ - if(dataset->shared->layout.type!=H5D_CHUNKED) { - if(H5D_contig_read(&io_info, nelmts, mem_type, mem_space, file_space, tpath, - dataset->shared->type_id, mem_type_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") - } /* end if */ - else { - if(H5D_chunk_read(&io_info, nelmts, mem_type, mem_space, file_space, tpath, - dataset->shared->type_id, mem_type_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") - } /* end else */ + /* Sanity check that space is allocated, if there are elements */ + if(nelmts > 0) + HDassert(((dataset->shared->layout.type == H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) + || (dataset->shared->layout.type == H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) + || dataset->shared->dcpl_cache.efl.nused > 0 + || dataset->shared->layout.type == H5D_COMPACT); + + /* Call storage method's I/O initialization routine */ + if(io_info.layout_ops.init && (*io_info.layout_ops.init)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info") + io_op_init = TRUE; + +#ifdef H5_HAVE_PARALLEL + /* Adjust I/O info for any parallel I/O */ + if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") +#endif /*H5_HAVE_PARALLEL*/ + + /* Invoke correct "high level" I/O routine */ + if((*io_info.io_ops.multi_read)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: + /* Shut down the I/O op information */ + if(io_op_init && io_info.layout_ops.term && (*io_info.layout_ops.term)(&fm) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down I/O op info") #ifdef H5_HAVE_PARALLEL /* Shut down io_info struct */ - if (io_info_init) + if(io_info_init) if(H5D_ioinfo_term(&io_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") #endif /*H5_HAVE_PARALLEL*/ + /* Shut down datatype info for operation */ + if(H5D_typeinfo_term(&type_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_read() */ @@ -604,16 +439,18 @@ static herr_t H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf) { + H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ + H5D_io_info_t io_info; /* Dataset I/O info */ + H5D_type_info_t type_info; /* Datatype info for operation */ + H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - H5T_path_t *tpath = NULL; /*type conversion info */ - const H5T_t *mem_type = NULL; /* Memory datatype */ - H5D_io_info_t io_info; /* Dataset I/O info */ #ifdef H5_HAVE_PARALLEL hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ #endif /*H5_HAVE_PARALLEL*/ + hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_write) @@ -621,33 +458,33 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* check args */ HDassert(dataset && dataset->oloc.file); - /* Get the memory datatype */ - if(NULL == (mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - /* All filters in the DCPL must have encoding enabled. */ if(!dataset->shared->checked_filters) { - if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) <0) + if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters") dataset->shared->checked_filters = TRUE; } /* end if */ /* Check if we are allowed to write to this file */ - if(0==(H5F_get_intent(dataset->oloc.file) & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id,&dxpl_cache) < 0) + if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") + /* Set up datatype info for operation */ + if(H5D_typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") + /* Various MPI based checks */ #ifdef H5_HAVE_PARALLEL if(IS_H5FD_MPI(dataset->oloc.file)) { /* If MPI based VFD is used, no VL datatype support yet. */ /* This is because they use the global heap in the file and we don't */ /* support parallel access of that yet */ - if(H5T_detect_class(mem_type, H5T_VLEN)>0) + if(H5T_detect_class(type_info.mem_type, H5T_VLEN) > 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing VL datatypes yet") /* If MPI based VFD is used, no VL datatype support yet. */ @@ -656,42 +493,48 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* We should really use H5T_detect_class() here, but it will be difficult * to detect the type of the reference if it is nested... -QAK */ - if (H5T_get_class(mem_type, TRUE)==H5T_REFERENCE && - H5T_get_ref_type(mem_type)==H5R_DATASET_REGION) + if(H5T_get_class(type_info.mem_type, TRUE) == H5T_REFERENCE && + H5T_get_ref_type(type_info.mem_type) == H5R_DATASET_REGION) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet") + + /* Can't write to chunked datasets with filters, in parallel */ + if(dataset->shared->layout.type == H5D_CHUNKED && + dataset->shared->dcpl_cache.pline.nused > 0) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot write to chunked storage with filters in parallel") } /* end if */ else { /* Collective access is not permissible without a MPI based VFD */ - if (dxpl_cache->xfer_mode==H5FD_MPIO_COLLECTIVE) + if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based driver only") } /* end else */ #endif /*H5_HAVE_PARALLEL*/ - if (!file_space) + /* Initialize dataspace information */ + if(!file_space) file_space = dataset->shared->space; - if (!mem_space) + if(!mem_space) mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") - H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); + H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t); /* Make certain that the number of elements in each selection is the same */ - if (nelmts!=(hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) + if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes") /* Make sure that both selections have their extents set */ - if( !(H5S_has_extent(file_space)) ) + if(!(H5S_has_extent(file_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file dataspace does not have extent set") - if( !(H5S_has_extent(mem_space)) ) + if(!(H5S_has_extent(mem_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "memory dataspace does not have extent set") /* Retrieve dataset properties */ /* */ /* Allocate data space and initialize it if it hasn't been. */ - if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused==0 && - ((dataset->shared->layout.type==H5D_CONTIGUOUS && !H5F_addr_defined(dataset->shared->layout.u.contig.addr)) - || (dataset->shared->layout.type==H5D_CHUNKED && !H5F_addr_defined(dataset->shared->layout.u.chunk.addr)))) { + if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 && + ((dataset->shared->layout.type == H5D_CONTIGUOUS && !H5F_addr_defined(dataset->shared->layout.u.contig.addr)) + || (dataset->shared->layout.type == H5D_CHUNKED && !H5F_addr_defined(dataset->shared->layout.u.chunk.addr)))) { hssize_t file_nelmts; /* Number of elements in file dataset's dataspace */ hbool_t full_overwrite; /* Whether we are over-writing all the elements */ @@ -703,42 +546,36 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(H5T_detect_class(dataset->shared->type, H5T_VLEN)) full_overwrite = FALSE; else - full_overwrite = (hsize_t)file_nelmts==nelmts ? TRUE : FALSE; + full_overwrite = (hsize_t)file_nelmts == nelmts ? TRUE : FALSE; /* Allocate storage */ if(H5D_alloc_storage(dataset->oloc.file, dxpl_id, dataset, H5D_ALLOC_WRITE, full_overwrite) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") } /* end if */ - /* - * Locate the type conversion function and data space conversion - * functions, and set up the element numbering information. If a data - * type conversion is necessary then register datatype atoms. Data type - * conversion is necessary if the user has set the `need_bkg' to a high - * enough value in xfer_parms since turning off datatype conversion also - * turns off background preservation. - */ - if (NULL==(tpath=H5T_path_find(mem_type, dataset->shared->type, NULL, NULL, dxpl_id, FALSE))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") - /* Set up I/O operation */ - if(H5D_ioinfo_init(dataset,dxpl_cache,dxpl_id,mem_space,file_space,tpath,&io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") + io_info.op_type = H5D_IO_OP_WRITE; + io_info.u.wbuf = buf; + if(H5D_ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up I/O operation") #ifdef H5_HAVE_PARALLEL io_info_init = TRUE; #endif /*H5_HAVE_PARALLEL*/ - /* Determine correct I/O routine to invoke */ - if(dataset->shared->layout.type!=H5D_CHUNKED) { - if(H5D_contig_write(&io_info, nelmts, mem_type, mem_space, file_space, tpath, - mem_type_id, dataset->shared->type_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") - } /* end if */ - else { - if(H5D_chunk_write(&io_info, nelmts, mem_type, mem_space, file_space, tpath, - mem_type_id, dataset->shared->type_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") - } /* end else */ + /* Call storage method's I/O initialization routine */ + if(io_info.layout_ops.init && (*io_info.layout_ops.init)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info") + io_op_init = TRUE; + +#ifdef H5_HAVE_PARALLEL + /* Adjust I/O info for any parallel I/O */ + if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") +#endif /*H5_HAVE_PARALLEL*/ + + /* Invoke correct "high level" I/O routine */ + if((*io_info.io_ops.multi_write)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") #ifdef OLD_WAY /* @@ -756,2705 +593,409 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #endif /* OLD_WAY */ done: + /* Shut down the I/O op information */ + if(io_op_init && io_info.layout_ops.term && (*io_info.layout_ops.term)(&fm) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down I/O op info") #ifdef H5_HAVE_PARALLEL /* Shut down io_info struct */ - if (io_info_init) - if(H5D_ioinfo_term(&io_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") + if(io_info_init && H5D_ioinfo_term(&io_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") #endif /*H5_HAVE_PARALLEL*/ + /* Shut down datatype info for operation */ + if(H5D_typeinfo_term(&type_info) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_write() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_read + * Function: H5D_ioinfo_init * - * Purpose: Read from a contiguous dataset. + * Purpose: Routine for determining correct I/O operations for + * each I/O action. * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Quincey Koziol + * Thursday, September 30, 2004 * *------------------------------------------------------------------------- */ static herr_t -H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, void *buf/*out*/) +H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, + const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) { - H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ - const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - herr_t status; /*function return status*/ -#ifdef H5S_DEBUG - H5_timer_t timer; -#endif - size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ - size_t max_type_size; /* Size of largest source/destination type */ - size_t target_size; /*desired buffer size */ - size_t request_nelmts; /*requested strip mine */ - H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ - hbool_t mem_iter_init=0; /*memory selection iteration info has been initialized */ - H5S_sel_iter_t bkg_iter; /*background iteration info*/ - hbool_t bkg_iter_init=0; /*background iteration info has been initialized */ - H5S_sel_iter_t file_iter; /*file selection iteration info*/ - hbool_t file_iter_init=0; /*file selection iteration info has been initialized */ - H5T_bkg_t need_bkg; /*type of background buf*/ - uint8_t *tconv_buf = NULL; /*datatype conv buffer */ - uint8_t *bkg_buf = NULL; /*background buffer */ - hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ - H5D_storage_t store; /*union of storage info for dataset */ - - - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_read) - - assert (buf); - - /* Initialize storage info for this dataset */ - if (dataset->shared->dcpl_cache.efl.nused > 0) - HDmemcpy(&store.efl, &(dataset->shared->dcpl_cache.efl), sizeof(H5O_efl_t)); - else { - store.contig.dset_addr = dataset->shared->layout.u.contig.addr; - store.contig.dset_size = dataset->shared->layout.u.contig.size; - } /* end if */ - - /* Set dataset storage for I/O info */ - io_info->store=&store; - - /* - * If there is no type conversion then read directly into the - * application's buffer. This saves at least one mem-to-mem copy. - */ - if ( H5Z_xform_noop(dxpl_cache->data_xform_prop) && H5T_path_noop(tpath)) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - /* Sanity check dataset, then read it */ - assert(((dataset->shared->layout.type == H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) - || (dataset->shared->layout.type == H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) - || dataset->shared->dcpl_cache.efl.nused > 0 || 0 == nelmts - || dataset->shared->layout.type==H5D_COMPACT); - H5_CHECK_OVERFLOW(nelmts,hsize_t,size_t); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_ioinfo_init) -#ifdef H5_HAVE_PARALLEL - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_contig_collective_io(io_info,file_space,mem_space,buf,FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "contiguous read failed in collective mode"); - } - else -#endif - { - if((io_info->ops.read)(io_info, (size_t)nelmts, - H5T_get_size(dataset->shared->type), file_space, mem_space, - (haddr_t)0, NULL, buf/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "contiguous read failed "); - } - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].read_timer), &timer); - io_info->stats->stats[1].read_nbytes += nelmts * H5T_get_size(dataset->shared->type); - io_info->stats->stats[1].read_ncalls++; -#endif - - /* direct xfer accomplished successfully */ - HGOTO_DONE(SUCCEED) - } /* end if */ + /* check args */ + HDassert(dset); + HDassert(dset->oloc.file); + HDassert(type_info); + HDassert(type_info->tpath); + HDassert(io_info); - /* - * This is the general case (type conversion, usually). - */ - if(nelmts==0) - HGOTO_DONE(SUCCEED) - - /* Compute element sizes and other parameters */ - src_type_size = H5T_get_size(dataset->shared->type); - dst_type_size = H5T_get_size(mem_type); - max_type_size = MAX(src_type_size, dst_type_size); - target_size = dxpl_cache->max_temp_buf; - /* XXX: This could cause a problem if the user sets their buffer size - * to the same size as the default, and then the dataset elements are - * too large for the buffer... - QAK - */ - if(target_size == H5D_TEMP_BUF_SIZE) { - /* If the buffer is too small to hold even one element, make it bigger */ - if(target_size(nelmts*max_type_size)) - target_size=(size_t)(nelmts*max_type_size); - } /* end if */ - request_nelmts = target_size / max_type_size; - - /* Sanity check elements in temporary buffer */ - if (request_nelmts==0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") - - /* Figure out the strip mine size. */ - if (H5S_select_iter_init(&file_iter, file_space, src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") - file_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&mem_iter, mem_space, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&bkg_iter, mem_space, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") - bkg_iter_init=1; /*file selection iteration info has been initialized */ + /* Set up "normal" I/O fields */ + io_info->dset = dset; + io_info->dxpl_cache = dxpl_cache; + io_info->dxpl_id = dxpl_id; + io_info->store = store; - /* - * Get a temporary buffer for type conversion unless the app has already - * supplied one through the xfer properties. Instead of allocating a - * buffer which is the exact size, we allocate the target size. The - * malloc() is usually less resource-intensive if we allocate/free the - * same size over and over. - */ - if (H5T_path_bkg(tpath)) { - H5T_bkg_t path_bkg; /* Type conversion's background info */ - - /* Retrieve the bkgr buffer property */ - need_bkg=dxpl_cache->bkgr_buf_type; - path_bkg = H5T_path_bkg(tpath); - need_bkg = MAX(path_bkg, need_bkg); - } else { - need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/ - } /* end else */ - if(NULL == (tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { - /* Allocate temporary buffer */ - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") - } /* end if */ - if(need_bkg && NULL == (bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - /* Allocate background buffer */ - /* (Need calloc()-like call since memory needs to be initialized) */ - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, (request_nelmts * dst_type_size)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") - } /* end if */ + /* Set I/O operations to initial values */ + io_info->layout_ops = *dset->shared->layout_ops; - /* Start strip mining... */ - for (smine_start=0; smine_startio_ops.multi_read = dset->shared->layout_ops->ser_read; + io_info->io_ops.multi_write = dset->shared->layout_ops->ser_write; + /* Set the I/O operations for reading/writing single blocks on disk */ + if(type_info->is_xform_noop && type_info->is_conv_noop) { /* - * Gather the data from disk into the datatype conversion - * buffer. Also gather data from application to background buffer - * if necessary. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - /* Sanity check that space is allocated, then read data from it */ - HDassert(((dataset->shared->layout.type == H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) - || (dataset->shared->layout.type == H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) - || dataset->shared->dcpl_cache.efl.nused > 0 || - dataset->shared->layout.type == H5D_COMPACT); - n = H5D_select_fgath(io_info, file_space, &file_iter, smine_nelmts, (haddr_t)0, NULL, tconv_buf/*out*/); - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].gath_timer), &timer); - io_info->stats->stats[1].gath_nbytes += n * src_type_size; - io_info->stats->stats[1].gath_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - - /* If the source and destination are compound types and subset of each other - * and no conversion is needed, copy the data directly into user's buffer and - * bypass the rest of steps. This optimization is for Chicago company */ - if(H5T_SUBSET_SRC==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_read(smine_nelmts, mem_space, &mem_iter, dxpl_cache, - src_id, dst_id, H5T_SUBSET_SRC, tconv_buf, buf /*out*/)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - continue; - } else if(H5T_SUBSET_DST==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_read(smine_nelmts, mem_space, &mem_iter, dxpl_cache, - src_id, dst_id, H5T_SUBSET_DST, tconv_buf, buf /*out*/)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - continue; - } - - if (H5T_BKG_YES==need_bkg) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - n = H5D_select_mgath(buf, mem_space, &bkg_iter, - smine_nelmts, dxpl_cache, bkg_buf/*out*/); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].bkg_timer), &timer); - io_info->stats->stats[1].bkg_nbytes += n * dst_type_size; - io_info->stats->stats[1].bkg_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") - } /* end if */ - - /* - * Perform datatype conversion. + * If there is no data transform or type conversion then read directly into + * the application's buffer. This saves at least one mem-to-mem copy. */ - if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - /* Do the data transform after the conversion (since we're using type mem_type) */ - if(!H5Z_xform_noop(dxpl_cache->data_xform_prop)) - if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") - + io_info->io_ops.single_read = H5D_select_read; + io_info->io_ops.single_write = H5D_select_write; + } /* end if */ + else { /* - * Scatter the data into memory. + * This is the general case (type conversion, usually). */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - status = H5D_select_mscat(tconv_buf, mem_space, - &mem_iter, smine_nelmts, dxpl_cache, buf/*out*/); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].scat_timer), &timer); - io_info->stats->stats[1].scat_nbytes += smine_nelmts * dst_type_size; - io_info->stats->stats[1].scat_ncalls++; -#endif - if (status<0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") - } /* end for */ - -done: - /* Release selection iterators */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ + io_info->io_ops.single_read = H5D_scatgath_read; + io_info->io_ops.single_write = H5D_scatgath_write; + } /* end else */ - if (tconv_buf && NULL==dxpl_cache->tconv_buf) - (void)H5FL_BLK_FREE(type_conv,tconv_buf); - if (bkg_buf && NULL==dxpl_cache->bkgr_buf) - (void)H5FL_BLK_FREE(type_conv,bkg_buf); +#ifdef H5_HAVE_PARALLEL + /* Determine if the file was opened with an MPI VFD */ + io_info->using_mpi_vfd = IS_H5FD_MPI(dset->oloc.file); +#endif /* H5_HAVE_PARALLEL */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_read() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_ioinfo_init() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_write + * Function: H5D_typeinfo_init * - * Purpose: Write to a contiguous dataset. + * Purpose: Routine for determining correct datatype information for + * each I/O action. * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, const void *buf) +H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, + hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, + H5D_type_info_t *type_info) { - H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ - const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - herr_t status; /*function return status*/ -#ifdef H5S_DEBUG - H5_timer_t timer; -#endif - size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ - size_t max_type_size; /* Size of largest source/destination type */ - size_t target_size; /*desired buffer size */ - size_t request_nelmts; /*requested strip mine */ - H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ - hbool_t mem_iter_init=0; /*memory selection iteration info has been initialized */ - H5S_sel_iter_t bkg_iter; /*background iteration info*/ - hbool_t bkg_iter_init=0; /*background iteration info has been initialized */ - H5S_sel_iter_t file_iter; /*file selection iteration info*/ - hbool_t file_iter_init=0; /*file selection iteration info has been initialized */ - H5T_bkg_t need_bkg; /*type of background buf*/ - uint8_t *tconv_buf = NULL; /*datatype conv buffer */ - uint8_t *bkg_buf = NULL; /*background buffer */ - hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ - H5D_storage_t store; /*union of storage info for dataset */ - - herr_t ret_value = SUCCEED; /*return value */ + const H5T_t *src_type; /* Source datatype */ + const H5T_t *dst_type; /* Destination datatype */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_write) + FUNC_ENTER_NOAPI_NOINIT(H5D_typeinfo_init) - assert (buf); + /* check args */ + HDassert(type_info); + HDassert(dset); - /* Initialize storage info for this dataset */ - if(dataset->shared->dcpl_cache.efl.nused > 0) - HDmemcpy(&store.efl, &(dataset->shared->dcpl_cache.efl), sizeof(H5O_efl_t)); - else { - store.contig.dset_addr = dataset->shared->layout.u.contig.addr; - store.contig.dset_size = dataset->shared->layout.u.contig.size; - } /* end if */ + /* Initialize type info safely */ + HDmemset(type_info, 0, sizeof(H5D_type_info_t)); - /* Set dataset storage for I/O info */ - io_info->store = &store; + /* Get the memory & dataset datatypes */ + if(NULL == (type_info->mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + type_info->dset_type = dset->shared->type; - /* - * If there is no type conversion then write directly from the - * application's buffer. This saves at least one mem-to-mem copy. - */ - if(H5Z_xform_noop(dxpl_cache->data_xform_prop) && H5T_path_noop(tpath)) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - H5_CHECK_OVERFLOW(nelmts,hsize_t,size_t); -#ifdef H5_HAVE_PARALLEL - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_contig_collective_io(io_info, file_space, mem_space, buf, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "contiguous write failed in collective mode") - } - else -#endif - { - if((io_info->ops.write)(io_info, (size_t)nelmts, - H5T_get_size(dataset->shared->type), file_space, mem_space, - (haddr_t)0, NULL, buf/*out*/) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "contiguous write failed ") - } - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].write_timer), &timer); - io_info->stats->stats[0].write_nbytes += nelmts * H5T_get_size(mem_type); - io_info->stats->stats[0].write_ncalls++; -#endif - - /* direct xfer accomplished successfully */ - HGOTO_DONE(SUCCEED) + if(do_write) { + src_type = type_info->mem_type; + dst_type = dset->shared->type; + type_info->src_type_id = mem_type_id; + type_info->dst_type_id = dset->shared->type_id; } /* end if */ + else { + src_type = dset->shared->type; + dst_type = type_info->mem_type; + type_info->src_type_id = dset->shared->type_id; + type_info->dst_type_id = mem_type_id; + } /* end else */ /* - * This is the general case. - */ - if(nelmts==0) - HGOTO_DONE(SUCCEED) - - /* Compute element sizes and other parameters */ - src_type_size = H5T_get_size(mem_type); - dst_type_size = H5T_get_size(dataset->shared->type); - max_type_size = MAX(src_type_size, dst_type_size); - target_size = dxpl_cache->max_temp_buf; - /* XXX: This could cause a problem if the user sets their buffer size - * to the same size as the default, and then the dataset elements are - * too large for the buffer... - QAK + * Locate the type conversion function and data space conversion + * functions, and set up the element numbering information. If a data + * type conversion is necessary then register datatype atoms. Data type + * conversion is necessary if the user has set the `need_bkg' to a high + * enough value in xfer_parms since turning off datatype conversion also + * turns off background preservation. */ - if(target_size == H5D_TEMP_BUF_SIZE) { - /* If the buffer is too small to hold even one element, make it bigger */ - if(target_size(nelmts*max_type_size)) - target_size=(size_t)(nelmts*max_type_size); - } /* end if */ - request_nelmts = target_size / max_type_size; - - /* Sanity check elements in temporary buffer */ - if (request_nelmts==0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") - - /* Figure out the strip mine size. */ - if (H5S_select_iter_init(&file_iter, file_space, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") - file_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&mem_iter, mem_space, src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&bkg_iter, file_space, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") - bkg_iter_init=1; /*file selection iteration info has been initialized */ + if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type, NULL, NULL, dxpl_id, FALSE))) + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") - /* - * Get a temporary buffer for type conversion unless the app has already - * supplied one through the xfer properties. Instead of allocating a - * buffer which is the exact size, we allocate the target size. The - * malloc() is usually less resource-intensive if we allocate/free the - * same size over and over. - */ - if(H5T_detect_class(dataset->shared->type, H5T_VLEN)) { - /* Old data is retrieved into background buffer for VL datatype. The - * data is used later for freeing heap objects. */ - need_bkg = H5T_BKG_YES; - } else if (H5T_path_bkg(tpath)) { - H5T_bkg_t path_bkg; /* Type conversion's background info */ - - /* Retrieve the bkgr buffer property */ - need_bkg=dxpl_cache->bkgr_buf_type; - path_bkg = H5T_path_bkg(tpath); - need_bkg = MAX (path_bkg, need_bkg); - } else { - need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/ - } /* end else */ - if(NULL == (tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { - /* Allocate temporary buffer */ - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") - } /* end if */ - if(need_bkg && NULL == (bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - /* Allocate background buffer */ - /* (Don't need calloc()-like call since file data is already initialized) */ - if(NULL == (bkg_buf = H5FL_BLK_MALLOC(type_conv, (request_nelmts * dst_type_size)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") + /* Precompute some useful information */ + type_info->src_type_size = H5T_get_size(src_type); + type_info->dst_type_size = H5T_get_size(dst_type); + type_info->max_type_size = MAX(type_info->src_type_size, type_info->dst_type_size); + type_info->is_conv_noop = H5T_path_noop(type_info->tpath); + type_info->is_xform_noop = H5Z_xform_noop(dxpl_cache->data_xform_prop); + if(type_info->is_xform_noop && type_info->is_conv_noop) { + type_info->cmpd_subset = H5T_SUBSET_FALSE; + type_info->need_bkg = H5T_BKG_NO; } /* end if */ + else { + size_t target_size; /* Desired buffer size */ - /* Start strip mining... */ - for (smine_start=0; smine_startcmpd_subset = H5T_path_compound_subset(type_info->tpath); - /* - * Gather data from application buffer into the datatype conversion - * buffer. Also gather data from the file into the background buffer - * if necessary. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - n = H5D_select_mgath(buf, mem_space, &mem_iter, - smine_nelmts, dxpl_cache, tconv_buf/*out*/); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].gath_timer), &timer); - io_info->stats->stats[0].gath_nbytes += n * src_type_size; - io_info->stats->stats[0].gath_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed") - - /* If the source and destination are compound types and the destination is - * is a subset of the source and no conversion is needed, copy the data - * directly into user's buffer and bypass the rest of steps. If the source - * is a subset of the destination, the optimization is done in conversion - * function H5T_conv_struct_opt to protect the background data. This - * optimization is for Chicago company */ - if(H5T_SUBSET_DST==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_write(smine_nelmts, src_id, dst_id, tconv_buf)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - } else { - if (H5T_BKG_YES==need_bkg) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - n = H5D_select_fgath(io_info, file_space, &bkg_iter, smine_nelmts, - (haddr_t)0, NULL, bkg_buf/*out*/); - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].bkg_timer), &timer); - io_info->stats->stats[0].bkg_nbytes += n * dst_type_size; - io_info->stats->stats[0].bkg_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed") + /* Check if we need a background buffer */ + if(do_write && H5T_detect_class(dset->shared->type, H5T_VLEN)) + type_info->need_bkg = H5T_BKG_YES; + else { + H5T_bkg_t path_bkg; /* Type conversion's background info */ + + if((path_bkg = H5T_path_bkg(type_info->tpath))) { + /* Retrieve the bkgr buffer property */ + type_info->need_bkg = dxpl_cache->bkgr_buf_type; + type_info->need_bkg = MAX(path_bkg, type_info->need_bkg); } /* end if */ + else + type_info->need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/ + } /* end else */ - /* - * Perform datatype conversion. - */ - if(H5T_convert(tpath, src_id, dst_id, smine_nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - /* Do the data transform after the type conversion (since we're using dataset->shared->type). */ - if(!H5Z_xform_noop(dxpl_cache->data_xform_prop)) - if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->shared->type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") - } + /* Set up datatype conversion/background buffers */ + + /* Get buffer size from DXPL */ + target_size = dxpl_cache->max_temp_buf; + + /* If the buffer is too small to hold even one element, try to make it bigger */ + if(target_size < type_info->max_type_size) { + hbool_t default_buffer_info; /* Whether the buffer information are the defaults */ + + /* Detect if we have all default settings for buffers */ + default_buffer_info = (H5D_TEMP_BUF_SIZE == dxpl_cache->max_temp_buf) + && (NULL == dxpl_cache->tconv_buf) && (NULL == dxpl_cache->bkgr_buf); + + /* Check if we are using the default buffer info */ + if(default_buffer_info) + /* OK to get bigger for library default settings */ + target_size = type_info->max_type_size; + else + /* Don't get bigger than the application has requested */ + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") + } /* end if */ + + /* Compute the number of elements that will fit into buffer */ + type_info->request_nelmts = target_size / type_info->max_type_size; + + /* Sanity check elements in temporary buffer */ + if(type_info->request_nelmts == 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") /* - * Scatter the data out to the file. + * Get a temporary buffer for type conversion unless the app has already + * supplied one through the xfer properties. Instead of allocating a + * buffer which is the exact size, we allocate the target size. The + * malloc() is usually less resource-intensive if we allocate/free the + * same size over and over. */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - status = H5D_select_fscat(io_info, file_space, &file_iter, smine_nelmts, - (haddr_t)0, NULL, tconv_buf); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].scat_timer), &timer); - io_info->stats->stats[0].scat_nbytes += smine_nelmts * dst_type_size; - io_info->stats->stats[0].scat_ncalls++; -#endif - if (status<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "scatter failed") - } /* end for */ + if(NULL == (type_info->tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { + /* Allocate temporary buffer */ + if(NULL == (type_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") + type_info->tconv_buf_allocated = TRUE; + } /* end if */ + if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { + size_t bkg_size; /* Desired background buffer size */ + + /* Compute the background buffer size */ + /* (don't try to use buffers smaller than the default size) */ + bkg_size = type_info->request_nelmts * type_info->dst_type_size; + if(bkg_size < dxpl_cache->max_temp_buf) + bkg_size = dxpl_cache->max_temp_buf; + + /* Allocate background buffer */ + /* (Need calloc()-like call since memory needs to be initialized) */ + if(NULL == (type_info->bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") + type_info->bkg_buf_allocated = TRUE; + } /* end if */ + } /* end else */ done: - /* Release selection iterators */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - - if (tconv_buf && NULL==dxpl_cache->tconv_buf) - (void)H5FL_BLK_FREE(type_conv,tconv_buf); - if (bkg_buf && NULL==dxpl_cache->bkgr_buf) - (void)H5FL_BLK_FREE(type_conv,bkg_buf); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_write() */ +} /* end H5D_typeinfo_init() */ +#ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5D_chunk_read + * Function: H5D_ioinfo_adjust * - * Purpose: Read from a chunked dataset. + * Purpose: Adjust operation's I/O info for any parallel I/O * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Quincey Koziol + * Thursday, March 27, 2008 * - * Modification: - * Raymond Lu - * 20 July 2007 - * Moved H5D_istore_lock and H5D_istore_unlock to this level - * from H5D_istore_readvv to avoid frequent lock and unlock - * and to improve performance. *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, void *buf/*out*/) +H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, + const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, + const H5S_t *file_space, const H5S_t *mem_space, + const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { - H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ - const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - H5D_chunk_map_t fm; /* File<->memory mapping */ - H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - herr_t status; /*function return status*/ -#ifdef H5S_DEBUG - H5_timer_t timer; -#endif - size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ - size_t max_type_size; /* Size of largest source/destination type */ - size_t target_size; /*desired buffer size */ - size_t request_nelmts; /*requested strip mine */ - hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ - size_t accessed_bytes = 0; /*total accessed size in a chunk */ - H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ - hbool_t mem_iter_init = FALSE; /*memory selection iteration info has been initialized */ - H5S_sel_iter_t bkg_iter; /*background iteration info*/ - hbool_t bkg_iter_init = FALSE; /*background iteration info has been initialized */ - H5S_sel_iter_t file_iter; /*file selection iteration info*/ - hbool_t file_iter_init = FALSE; /*file selection iteration info has been initialized */ - H5T_bkg_t need_bkg; /*type of background buf*/ - uint8_t *tconv_buf = NULL; /*datatype conv buffer */ - uint8_t *bkg_buf = NULL; /*background buffer */ - H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - void *chunk = NULL; - haddr_t chunk_addr; /* Chunk address on disk */ - H5D_istore_ud1_t udata; /*B-tree pass-through */ - unsigned idx_hint=0; /* Cache index hint */ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_read) - - assert (buf); + herr_t ret_value = SUCCEED; /* Return value */ - /* Map elements between file and memory for each chunk*/ - if(H5D_create_chunk_map(&fm, io_info, nelmts, file_space, mem_space, mem_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't build chunk mapping") + FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_adjust) - /* Set dataset storage for I/O info */ - io_info->store=&store; + /* check args */ + HDassert(dset); + HDassert(dset->oloc.file); + HDassert(mem_space); + HDassert(file_space); + HDassert(type_info); + HDassert(type_info->tpath); + HDassert(io_info); - /* Compute element sizes */ - src_type_size = H5T_get_size(dataset->shared->type); - dst_type_size = H5T_get_size(mem_type); - max_type_size = MAX(src_type_size, dst_type_size); + /* Make any parallel I/O adjustments */ + if(io_info->using_mpi_vfd) { + htri_t opt; /* Flag whether a selection is optimizable */ - /* - * If there is no type conversion then read directly into the - * application's buffer. This saves at least one mem-to-mem copy. - */ - if ( H5Z_xform_noop(dxpl_cache->data_xform_prop) && H5T_path_noop(tpath)) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - /* Sanity check dataset, then read it */ - HDassert(((dataset->shared->layout.type == H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) - || (dataset->shared->layout.type == H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) - || dataset->shared->dcpl_cache.efl.nused > 0 || 0 == nelmts - || dataset->shared->layout.type == H5D_COMPACT); + /* Record the original state of parallel I/O transfer options */ + io_info->orig.xfer_mode = io_info->dxpl_cache->xfer_mode; + io_info->orig.coll_opt_mode = io_info->dxpl_cache->coll_opt_mode; + io_info->orig.io_ops.single_read = io_info->io_ops.single_read; + io_info->orig.io_ops.single_write = io_info->io_ops.single_write; -#ifdef H5_HAVE_PARALLEL - /* Check whether the collective mode can be turned off globally*/ -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_mpio_chunk_adjust_iomode(io_info ,&fm)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't adjust collective I/O") - } -#endif /* H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ - /* Temporarily shut down collective IO for chunking */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_chunk_collective_io(io_info, &fm, buf, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunked read failed in collective mode") - } - else {/* sequential or independent read */ -#endif - /* Get first node in chunk skip list */ - chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); - - while(chunk_node) { - H5D_chunk_info_t *chunk_info; /* chunk information */ - - /* Get the actual chunk information from the skip list node */ - chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); - - /* Pass in chunk's coordinates in a union. */ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - /* Load the chunk into cache and lock it. */ - chunk_addr = H5D_istore_get_addr(io_info, &udata); - if(H5D_istore_if_load(io_info, chunk_addr)) { - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, FALSE, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - /* Perform the actual read operation */ - if((io_info->ops.read)(io_info, chunk_info->chunk_points, - src_type_size, chunk_info->fspace, - chunk_info->mspace, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, " chunked read failed") - - /* Release the cache lock on the chunk. */ - if(chunk) { - accessed_bytes = chunk_info->chunk_points * src_type_size; - if(H5D_istore_unlock(io_info, FALSE, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ - - /* Advance to next chunk in list */ - chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); - } /* end while */ -#ifdef H5_HAVE_PARALLEL - } -#endif + /* Get MPI communicator */ + if(MPI_COMM_NULL == (io_info->comm = H5F_mpi_get_comm(dset->oloc.file))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator") + /* Check if we can set direct MPI-IO read/write functions */ + if((opt = H5D_mpio_opt_possible(io_info, file_space, mem_space, type_info, fm)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace ") -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].read_timer), &timer); - io_info->stats->stats[1].read_nbytes += nelmts * src_type_size; - io_info->stats->stats[1].read_ncalls++; -#endif + /* Check if we can use the optimized parallel I/O routines */ + if(opt == TRUE) { + /* Override the I/O op pointers to the MPI-specific routines */ + io_info->io_ops.multi_read = dset->shared->layout_ops->par_read; + io_info->io_ops.multi_write = dset->shared->layout_ops->par_write; + io_info->io_ops.single_read = H5D_mpio_select_read; + io_info->io_ops.single_write = H5D_mpio_select_write; + } /* end if */ + else { + /* If we won't be doing collective I/O, but the user asked for + * collective I/O, change the request to use independent I/O, but + * mark it so that we remember to revert the change. + */ + if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { + H5P_genplist_t *dx_plist; /* Data transer property list */ - /* direct xfer accomplished successfully */ - HGOTO_DONE(SUCCEED) - } /* end if */ + /* Get the dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - /* - * This is the general case (type conversion, usually). - */ - if(nelmts==0) - HGOTO_DONE(SUCCEED) - - /* Compute buffer sizes and other parameters */ - target_size = dxpl_cache->max_temp_buf; - /* XXX: This could cause a problem if the user sets their buffer size - * to the same size as the default, and then the dataset elements are - * too large for the buffer... - QAK - */ - if(target_size == H5D_TEMP_BUF_SIZE) { - /* If the buffer is too small to hold even one element, make it bigger */ - if(target_size(nelmts*max_type_size)) - target_size=(size_t)(nelmts*max_type_size); + /* Change the xfer_mode to independent for handling the I/O */ + io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; + if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") + } /* end if */ + } /* end else */ } /* end if */ - request_nelmts = target_size / max_type_size; - /* Sanity check elements in temporary buffer */ - if (request_nelmts==0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") - - /* - * Get a temporary buffer for type conversion unless the app has already - * supplied one through the xfer properties. Instead of allocating a - * buffer which is the exact size, we allocate the target size. The - * malloc() is usually less resource-intensive if we allocate/free the - * same size over and over. - */ - if (H5T_path_bkg(tpath)) { - H5T_bkg_t path_bkg; /* Type conversion's background info */ - - /* Retrieve the bkgr buffer property */ - need_bkg=dxpl_cache->bkgr_buf_type; - path_bkg = H5T_path_bkg(tpath); - need_bkg = MAX(path_bkg, need_bkg); - } else { - need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/ - } /* end else */ - if(NULL == (tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { - /* Allocate temporary buffer */ - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") - } /* end if */ - if(need_bkg && NULL == (bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - /* Allocate background buffer */ - /* (Need calloc()-like call since memory needs to be initialized) */ - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, (request_nelmts * dst_type_size)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") - } /* end if */ - - /* Loop over all the chunks, performing I/O on each */ - - /* Get first node in chunk skip list */ - chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); - - /* Iterate through chunks to be operated on */ - while(chunk_node) { - H5D_chunk_info_t *chunk_info; /* chunk information */ - - /* Get the actual chunk information from the skip list nodes */ - chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); - - /* initialize selection iterator */ - if (H5S_select_iter_init(&file_iter, chunk_info->fspace, src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") - file_iter_init = TRUE; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&mem_iter, chunk_info->mspace, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init = TRUE; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&bkg_iter, chunk_info->mspace, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") - bkg_iter_init = TRUE; /*file selection iteration info has been initialized */ - - /* Pass in chunk's coordinates in a union*/ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - /* Load the chunk into cache and lock it. */ - chunk_addr = H5D_istore_get_addr(io_info, &udata); - - if(H5D_istore_if_load(io_info, chunk_addr)) { - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, FALSE, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - for(smine_start=0; smine_startchunk_points; smine_start+=smine_nelmts) { - /* Go figure out how many elements to read from the file */ - assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start)); - smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start)); - - /* - * Gather the data from disk into the datatype conversion - * buffer. Also gather data from application to background buffer - * if necessary. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - /* Sanity check that space is allocated, then read data from it */ - HDassert(((dataset->shared->layout.type == H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) - || (dataset->shared->layout.type == H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) - || dataset->shared->dcpl_cache.efl.nused > 0 || dataset->shared->layout.type == H5D_COMPACT); - - if(chunk) { - n = H5D_select_mgath(chunk, chunk_info->fspace, &file_iter, - smine_nelmts, dxpl_cache, tconv_buf/*out*/); - } else { - n = H5D_select_fgath(io_info, chunk_info->fspace, &file_iter, smine_nelmts, - chunk_addr, NULL, tconv_buf/*out*/); - } - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].gath_timer), &timer); - io_info->stats->stats[1].gath_nbytes += n * src_type_size; - io_info->stats->stats[1].gath_ncalls++; -#endif - if(n != smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - - /* If the source and destination are compound types and subset of each other - * and no conversion is needed, copy the data directly into user's buffer and - * bypass the rest of steps. This optimization is for Chicago company */ - if(H5T_SUBSET_SRC==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_read(smine_nelmts, chunk_info->mspace, &mem_iter, dxpl_cache, - src_id, dst_id, H5T_SUBSET_SRC, tconv_buf, buf /*out*/)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - continue; - } else if(H5T_SUBSET_DST==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_read(smine_nelmts, chunk_info->mspace, &mem_iter, dxpl_cache, - src_id, dst_id, H5T_SUBSET_DST, tconv_buf, buf /*out*/)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - continue; - } - - if(H5T_BKG_YES == need_bkg) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - n = H5D_select_mgath(buf, chunk_info->mspace, &bkg_iter, smine_nelmts, dxpl_cache, bkg_buf/*out*/); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].bkg_timer), &timer); - io_info->stats->stats[1].bkg_nbytes += n * dst_type_size; - io_info->stats->stats[1].bkg_ncalls++; -#endif - if(n != smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") - } /* end if */ - - /* - * Perform datatype conversion. - */ - if(H5T_convert(tpath, src_id, dst_id, smine_nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - /* Do the data transform after the conversion (since we're using type mem_type) */ - if(!H5Z_xform_noop(dxpl_cache->data_xform_prop)) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") - - /* - * Scatter the data into memory. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - status = H5D_select_mscat(tconv_buf, chunk_info->mspace, &mem_iter, smine_nelmts, dxpl_cache, buf/*out*/); -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].scat_timer), &timer); - io_info->stats->stats[1].scat_nbytes += smine_nelmts * dst_type_size; - io_info->stats->stats[1].scat_ncalls++; -#endif - if(status < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") - } /* end for */ - - /* Release the cache lock on the chunk. */ - if(chunk) { - accessed_bytes = chunk_info->chunk_points * src_type_size; - if(H5D_istore_unlock(io_info, FALSE, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ - - /* Release selection iterators */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - file_iter_init = FALSE; - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - mem_iter_init = FALSE; - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - bkg_iter_init = FALSE; - } /* end if */ - - /* Get the next chunk node in the skip list */ - chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); - } /* end while */ - -done: - /* Release selection iterators, if necessary */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - - if(tconv_buf && NULL == dxpl_cache->tconv_buf) - (void)H5FL_BLK_FREE(type_conv, tconv_buf); - if(bkg_buf && NULL == dxpl_cache->bkgr_buf) - (void)H5FL_BLK_FREE(type_conv, bkg_buf); - - /* Release chunk mapping information */ - if(H5D_destroy_chunk_map(&fm) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_read() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_ioinfo_adjust() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_write + * Function: H5D_ioinfo_term * - * Purpose: Writes to a chunked dataset. + * Purpose: Common logic for terminating an I/O info object + * (Only used for restoring MPI transfer mode currently) * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 + * Programmer: Quincey Koziol + * Friday, February 6, 2004 * - * Modification: - * Raymond Lu - * 20 July 2007 - * Moved H5D_istore_lock and H5D_istore_unlock to this level - * from H5D_istore_writevv to avoid frequent lock and unlock - * and to improve performance. *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, - const H5T_t *mem_type, const H5S_t *mem_space, - const H5S_t *file_space, H5T_path_t *tpath, - hid_t src_id, hid_t dst_id, const void *buf) +H5D_ioinfo_term(H5D_io_info_t *io_info) { - H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ - const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - H5D_chunk_map_t fm; /* File<->memory mapping */ - H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - herr_t status; /*function return status*/ -#ifdef H5S_DEBUG - H5_timer_t timer; -#endif - size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ - size_t max_type_size; /* Size of largest source/destination type */ - size_t target_size; /*desired buffer size */ - size_t request_nelmts; /*requested strip mine */ - size_t accessed_bytes; /*total accessed size in a chunk */ - hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ - H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ - hbool_t mem_iter_init=0; /*memory selection iteration info has been initialized */ - H5S_sel_iter_t bkg_iter; /*background iteration info*/ - hbool_t bkg_iter_init=0; /*background iteration info has been initialized */ - H5S_sel_iter_t file_iter; /*file selection iteration info*/ - hbool_t file_iter_init=0; /*file selection iteration info has been initialized */ - H5T_bkg_t need_bkg; /*type of background buf*/ - uint8_t *tconv_buf = NULL; /*datatype conv buffer */ - uint8_t *bkg_buf = NULL; /*background buffer */ - H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - void *chunk = NULL; - haddr_t chunk_addr; /* Chunk address on disk */ - H5D_istore_ud1_t udata; /*B-tree pass-through */ - unsigned idx_hint=0; /* Cache index hint */ - hbool_t relax=TRUE; /* Whether whole chunk is selected */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_write) - - assert (buf); - - /* Map elements between file and memory for each chunk*/ - if(H5D_create_chunk_map(&fm, io_info, nelmts, file_space, mem_space, mem_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't build chunk mapping") - - /* Set dataset storage for I/O info */ - io_info->store=&store; - -#ifdef H5_HAVE_PARALLEL - /* Additional sanity checks when operating in parallel */ - if(io_info->using_mpi_vfd) { - if (chunk_addr==HADDR_UNDEF) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk") - if (dataset->shared->dcpl_cache.pline.nused>0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot write to chunked storage with filters in parallel") - } /* end if */ -#endif /* H5_HAVE_PARALLEL */ - - /* Compute element sizes and other parameters */ - src_type_size = H5T_get_size(mem_type); - dst_type_size = H5T_get_size(dataset->shared->type); - max_type_size = MAX(src_type_size, dst_type_size); - - /* - * If there is no type conversion then write directly from the - * application's buffer. This saves at least one mem-to-mem copy. - */ - if ( H5Z_xform_noop(dxpl_cache->data_xform_prop) && H5T_path_noop(tpath)) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - -#ifdef H5_HAVE_PARALLEL - /* Check whether the collective mode can be turned off globally*/ -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_mpio_chunk_adjust_iomode(io_info,&fm)) - HGOTO_ERROR(H5E_DATASET,H5E_CANTGET,FAIL,"can't adjust collective I/O") - } -#endif /* H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ - /* Temporarily shut down collective IO for chunking */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - if(H5D_chunk_collective_io(io_info,&fm,buf,TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunked write failed in collective mode"); - } - else {/* sequential or independent write */ -#endif /* H5_HAVE_PARALLEL */ - /* Get first node in chunk skip list */ - chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); - - while(chunk_node) { - H5D_chunk_info_t *chunk_info; /* Chunk information */ - - /* Get the actual chunk information from the skip list node */ - chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); - - /* Pass in chunk's coordinates in a union. */ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - /* Load the chunk into cache. But if the whole chunk is written, - * simply allocate space instead of load the chunk. */ - chunk_addr = H5D_istore_get_addr(io_info, &udata); - - if(H5D_istore_if_load(io_info, chunk_addr)) { - accessed_bytes = chunk_info->chunk_points * dst_type_size; - if(accessed_bytes != dataset->shared->layout.u.chunk.size) - relax = FALSE; - - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, relax, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - /* Perform the actual read operation */ - if((io_info->ops.write)(io_info, chunk_info->chunk_points, - dst_type_size, chunk_info->fspace, - chunk_info->mspace, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, " chunked write failed") - - /* Release the cache lock on the chunk. */ - if(chunk) { - if(H5D_istore_unlock(io_info, TRUE, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ - relax = TRUE; - - /* Advance to next chunk in list */ - chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); - } /* end while */ -#ifdef H5_HAVE_PARALLEL - } -#endif - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].write_timer), &timer); - io_info->stats->stats[0].write_nbytes += nelmts * src_type_size; - io_info->stats->stats[0].write_ncalls++; -#endif - - /* direct xfer accomplished successfully */ - HGOTO_DONE(SUCCEED) - } /* end if */ - - /* - * This is the general case (type conversion, usually). - */ - if(nelmts==0) - HGOTO_DONE(SUCCEED) - - /* Compute buffer sizes and other parameters */ - target_size = dxpl_cache->max_temp_buf; - /* XXX: This could cause a problem if the user sets their buffer size - * to the same size as the default, and then the dataset elements are - * too large for the buffer... - QAK - */ - if(target_size == H5D_TEMP_BUF_SIZE) { - /* If the buffer is too small to hold even one element, make it bigger */ - if(target_size(nelmts*max_type_size)) - target_size=(size_t)(nelmts*max_type_size); - } /* end if */ - request_nelmts = target_size / max_type_size; - - /* Sanity check elements in temporary buffer */ - if (request_nelmts==0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") - - /* - * Get a temporary buffer for type conversion unless the app has already - * supplied one through the xfer properties. Instead of allocating a - * buffer which is the exact size, we allocate the target size. The - * malloc() is usually less resource-intensive if we allocate/free the - * same size over and over. - */ - if(H5T_detect_class(dataset->shared->type, H5T_VLEN)) { - /* Old data is retrieved into background buffer for VL datatype. The - * data is used later for freeing heap objects. */ - need_bkg = H5T_BKG_YES; - } else if (H5T_path_bkg(tpath)) { - H5T_bkg_t path_bkg; /* Type conversion's background info */ - - /* Retrieve the bkgr buffer property */ - need_bkg=dxpl_cache->bkgr_buf_type; - path_bkg = H5T_path_bkg(tpath); - need_bkg = MAX (path_bkg, need_bkg); - } else { - need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/ - } /* end else */ - if(NULL == (tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { - /* Allocate temporary buffer */ - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") - } /* end if */ - if(need_bkg && NULL == (bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { - /* Allocate background buffer */ - /* (Don't need calloc()-like call since file data is already initialized) */ - if(NULL == (bkg_buf = H5FL_BLK_MALLOC(type_conv, (request_nelmts * dst_type_size)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") - } /* end if */ - - /* Loop over all the chunks, performing I/O on each */ - - /* Get first node in chunk skip list */ - chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); - - /* Iterate through chunks to be operated on */ - while(chunk_node) { - H5D_chunk_info_t *chunk_info; /* chunk information */ - - /* Get the actual chunk information from the skip list node */ - chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); - - /* initialize selection iterator */ - if (H5S_select_iter_init(&file_iter, chunk_info->fspace, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") - file_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&mem_iter, chunk_info->mspace, src_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") - mem_iter_init=1; /*file selection iteration info has been initialized */ - if (H5S_select_iter_init(&bkg_iter, chunk_info->fspace, dst_type_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") - bkg_iter_init=1; /*file selection iteration info has been initialized */ - - /*pass in chunk's coordinates in a union*/ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - /* Load the chunk into cache. But if the whole chunk is written, - * simply allocate space instead of load the chunk. */ - chunk_addr = H5D_istore_get_addr(io_info, &udata); - - if(H5D_istore_if_load(io_info, chunk_addr)) { - accessed_bytes = chunk_info->chunk_points * dst_type_size; - if(accessed_bytes != dataset->shared->layout.u.chunk.size) - relax=FALSE; - if(relax) { - accessed_bytes = H5S_GET_SELECT_NPOINTS(chunk_info->mspace) * src_type_size; - if(accessed_bytes != dataset->shared->layout.u.chunk.size) - relax = FALSE; - } - - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, relax, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - for(smine_start=0; smine_startchunk_points; smine_start+=smine_nelmts) { - /* Go figure out how many elements to read from the file */ - assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start)); - smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start)); - - /* - * Gather the data from disk into the datatype conversion - * buffer. Also gather data from application to background buffer - * if necessary. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - n = H5D_select_mgath(buf, chunk_info->mspace, &mem_iter, - smine_nelmts, dxpl_cache, tconv_buf/*out*/); - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[1].gath_timer), &timer); - io_info->stats->stats[1].gath_nbytes += n * src_type_size; - io_info->stats->stats[1].gath_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - - /* If the source and destination are compound types and the destination is - * is a subset of the source and no conversion is needed, copy the data - * directly into user's buffer and bypass the rest of steps. If the source - * is a subset of the destination, the optimization is done in conversion - * function H5T_conv_struct_opt to protect the background data. This - * optimization is for Chicago company */ - if(H5T_SUBSET_DST==H5T_path_compound_subset(tpath)) { - if(H5D_compound_opt_write(smine_nelmts, src_id, dst_id, tconv_buf)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - } else { - if (H5T_BKG_YES==need_bkg) { -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - if(chunk) { - n = H5D_select_mgath(chunk, chunk_info->fspace, &bkg_iter, - smine_nelmts, dxpl_cache, bkg_buf/*out*/); - } else { - n = H5D_select_fgath(io_info, chunk_info->fspace, &bkg_iter, smine_nelmts, - chunk_addr, NULL, bkg_buf/*out*/); - } - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].bkg_timer), &timer); - io_info->stats->stats[0].bkg_nbytes += n * dst_type_size; - io_info->stats->stats[0].bkg_ncalls++; -#endif - if (n!=smine_nelmts) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed") - } /* end if */ - - /* - * Perform datatype conversion. - */ - if(H5T_convert(tpath, src_id, dst_id, smine_nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, io_info->dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") - - /* Do the data transform after the type conversion (since we're using dataset->shared->type) */ - if(!H5Z_xform_noop(dxpl_cache->data_xform_prop)) - if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->shared->type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") - } - - /* - * Scatter the data out to the file. - */ -#ifdef H5S_DEBUG - H5_timer_begin(&timer); -#endif - status = H5D_select_fscat(io_info, - chunk_info->fspace, &file_iter, smine_nelmts, - chunk_addr, chunk, tconv_buf); - -#ifdef H5S_DEBUG - H5_timer_end(&(io_info->stats->stats[0].scat_timer), &timer); - io_info->stats->stats[0].scat_nbytes += n * dst_type_size; - io_info->stats->stats[0].scat_ncalls++; -#endif - if (status<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "scatter failed") - } /* end for */ - - /* Release the cache lock on the chunk. */ - if(chunk) { - accessed_bytes = chunk_info->chunk_points * dst_type_size; - if(H5D_istore_unlock(io_info, TRUE, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ - relax = TRUE; - - /* Release selection iterators */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - file_iter_init=0; - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - mem_iter_init=0; - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - bkg_iter_init=0; - } /* end if */ - - /* Get the next chunk node in the skip list */ - chunk_node = H5D_CHUNK_GET_NEXT_NODE(fm, chunk_node); - } /* end while */ - -done: - /* Release selection iterators, if necessary */ - if(file_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(mem_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - if(bkg_iter_init) { - if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") - } /* end if */ - - if (tconv_buf && NULL==dxpl_cache->tconv_buf) - (void)H5FL_BLK_FREE(type_conv,tconv_buf); - if (bkg_buf && NULL==dxpl_cache->bkgr_buf) - (void)H5FL_BLK_FREE(type_conv,bkg_buf); - - /* Release chunk mapping information */ - if(H5D_destroy_chunk_map(&fm) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_write() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_compound_opt_read - * - * Purpose: A shortcut optimization for the Chicago company for - * a special optimization case when the source and - * destination members are a subset of each other, and - * the order is the same, and no conversion is needed. - * For example: - * struct source { struct destination { - * TYPE1 A; --> TYPE1 A; - * TYPE2 B; --> TYPE2 B; - * TYPE3 C; --> TYPE3 C; - * }; TYPE4 D; - * TYPE5 E; - * }; - * or - * struct destination { struct source { - * TYPE1 A; <-- TYPE1 A; - * TYPE2 B; <-- TYPE2 B; - * TYPE3 C; <-- TYPE3 C; - * }; TYPE4 D; - * TYPE5 E; - * }; - * The optimization is simply moving data to the appropriate - * places in the buffer. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * 11 June 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_compound_opt_read(size_t nelmts, const H5S_t *space, - H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, - hid_t src_id, hid_t dst_id, H5T_subset_t subset, - void *data_buf, void *user_buf/*out*/) -{ - uint8_t *dbuf = (uint8_t *)data_buf; /*cast for pointer arithmetic */ - uint8_t *ubuf = (uint8_t *)user_buf; /*cast for pointer arithmetic */ - uint8_t *xdbuf; - uint8_t *xubuf; - - hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t *off=NULL; /* Pointer to sequence offsets */ - size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t *len=NULL; /* Pointer to sequence lengths */ - size_t nseq; /* Number of sequences generated */ - size_t curr_off; /* offset of bytes left to process in sequence */ - size_t curr_seq; /* Current sequence being processed */ - size_t curr_len; /* Length of bytes left to process in sequence */ - size_t curr_nelmts; /* number of elements to process in sequence */ - size_t i; - - H5T_t *src, *dst; - size_t src_stride, dst_stride, type_size = 0; - size_t elmtno; /*element counter */ - - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_compound_opt_read) - - /* Check args */ - assert (data_buf); - assert (user_buf); - assert (space); - assert (iter); - assert (nelmts>0); - - /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if((len = H5FL_SEQ_MALLOC(size_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array"); - if((off = H5FL_SEQ_MALLOC(hsize_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array"); - } /* end if */ - else { - len=_len; - off=_off; - } /* end else */ - - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - - src_stride = H5T_get_size(src); - dst_stride = H5T_get_size(dst); - - if(H5T_SUBSET_SRC == subset) - type_size = src_stride; - else if(H5T_SUBSET_DST == subset) - type_size = dst_stride; - - xdbuf = dbuf; - - /* Loop until all elements are written */ - while(nelmts>0) { - /* Get list of sequences for selection to write */ - if(H5S_SELECT_GET_SEQ_LIST(space,0,iter,dxpl_cache->vec_size,nelmts,&nseq,&elmtno,off,len)<0) - HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed"); - - /* Loop, while sequences left to process */ - for(curr_seq=0; curr_seqvec_size != H5D_IO_VECTOR_SIZE) { - if(len!=NULL) - H5FL_SEQ_FREE(size_t,len); - if(off!=NULL) - H5FL_SEQ_FREE(hsize_t,off); - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compound_opt_read() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_compound_opt_write - * - * Purpose: A shortcut optimization for the Chicago company for - * a special optimization case when the source and - * destination members are a subset of each other, and - * the order is the same, and no conversion is needed. - * For example: - * struct source { struct destination { - * TYPE1 A; --> TYPE1 A; - * TYPE2 B; --> TYPE2 B; - * TYPE3 C; --> TYPE3 C; - * }; TYPE4 D; - * TYPE5 E; - * }; - * or - * struct destination { struct source { - * TYPE1 A; <-- TYPE1 A; - * TYPE2 B; <-- TYPE2 B; - * TYPE3 C; <-- TYPE3 C; - * }; TYPE4 D; - * TYPE5 E; - * }; - * The optimization is simply moving data to the appropriate - * places in the buffer. - * - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * 11 June 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_compound_opt_write(size_t nelmts, hid_t src_id, hid_t dst_id, void *data_buf) -{ - uint8_t *dbuf = (uint8_t *)data_buf; /*cast for pointer arithmetic */ - uint8_t *xsbuf, *xdbuf; - size_t i; - H5T_t *src, *dst; - size_t src_stride, dst_stride; - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_compound_opt_write) - - /* Check args */ - assert (data_buf); - assert (nelmts>0); - - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - - src_stride = H5T_get_size(src); - dst_stride = H5T_get_size(dst); - - xsbuf = dbuf; - xdbuf = dbuf; - - /* Loop until all elements are written */ - for(i=0; idset; /* Local pointer to dataset info */ - H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ - hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ - htri_t file_space_normalized = FALSE; /* File dataspace was normalized */ - hid_t f_tid = (-1); /* Temporary copy of file datatype for iteration */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ - unsigned f_ndims; /* The number of dimensions of the file's dataspace */ - int sm_ndims; /* The number of dimensions of the memory buffer's dataspace (signed) */ - H5SL_node_t *curr_node; /* Current node in skip list */ - H5S_sel_type fsel_type; /* Selection type on disk */ - char bogus; /* "bogus" buffer to pass to selection iterator */ - unsigned u; /* Local index variable */ - hbool_t sel_hyper_flag; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_map) - - /* Get layout for dataset */ - fm->layout = &(dataset->shared->layout); - fm->nelmts = nelmts; - - /* Check if the memory space is scalar & make equivalent memory space */ - if((sm_ndims = H5S_GET_EXTENT_NDIMS(mem_space)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number") - /* Set the number of dimensions for the memory dataspace */ - H5_ASSIGN_OVERFLOW(fm->m_ndims, sm_ndims, int, unsigned); - - /* Get dim number and dimensionality for each dataspace */ - fm->f_ndims = f_ndims = dataset->shared->layout.u.chunk.ndims - 1; - if(H5S_get_simple_extent_dims(file_space, fm->f_dims, NULL) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality") - - /* Normalize hyperslab selections by adjusting them by the offset */ - /* (It might be worthwhile to normalize both the file and memory dataspaces - * before any (contiguous, chunked, etc) file I/O operation, in order to - * speed up hyperslab calculations by removing the extra checks and/or - * additions involving the offset and the hyperslab selection -QAK) - */ - if((file_space_normalized = H5S_hyper_normalize_offset((H5S_t *)file_space, old_offset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset") - - /* Decide the number of chunks in each dimension*/ - for(u=0; uchunk_dim[u]=fm->layout->u.chunk.dim[u]; - - /* Round up to the next integer # of chunks, to accomodate partial chunks */ - fm->chunks[u] = ((fm->f_dims[u]+dataset->shared->layout.u.chunk.dim[u])-1) / dataset->shared->layout.u.chunk.dim[u]; - } /* end for */ - - /* Compute the "down" size of 'chunks' information */ - if(H5V_array_down(f_ndims,fm->chunks,fm->down_chunks) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute 'down' sizes") + FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_term) -#ifdef H5_HAVE_PARALLEL - /* Calculate total chunk in file map*/ - fm->select_chunk = NULL; - fm->total_chunks = 1; - for(u = 0; u < fm->f_ndims; u++) - fm->total_chunks = fm->total_chunks * fm->chunks[u]; + /* Check if we used the MPI VFD for the I/O */ if(io_info->using_mpi_vfd) { - H5_CHECK_OVERFLOW(fm->total_chunks, hsize_t, size_t); - if(NULL == (fm->select_chunk = (hbool_t *)H5MM_calloc((size_t)fm->total_chunks * sizeof(hbool_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") - } /* end if */ -#endif /* H5_HAVE_PARALLEL */ - + /* Check if we need to revert the change to the xfer mode */ + if(io_info->orig.xfer_mode != io_info->dxpl_cache->xfer_mode) { + H5P_genplist_t *dx_plist; /* Data transer property list */ - /* Initialize "last chunk" information */ - fm->last_index = (hsize_t)-1; - fm->last_chunk_info = NULL; + /* Get the dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Point at the dataspaces */ - fm->file_space = file_space; - fm->mem_space = mem_space; - - /* Special case for only one element in selection */ - /* (usually appending a record) */ - if(nelmts == 1 -#ifdef H5_HAVE_PARALLEL - && !(io_info->using_mpi_vfd) -#endif /* H5_HAVE_PARALLEL */ - ) { - /* Initialize skip list for chunk selections */ - fm->sel_chunks = NULL; - fm->use_single = TRUE; - - /* Initialize single chunk dataspace */ - if(NULL == dataset->shared->cache.chunk.single_space) { - /* Make a copy of the dataspace for the dataset */ - if((dataset->shared->cache.chunk.single_space = H5S_copy(file_space, TRUE, FALSE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file space") - - /* Resize chunk's dataspace dimensions to size of chunk */ - if(H5S_set_extent_real(dataset->shared->cache.chunk.single_space, fm->chunk_dim) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust chunk dimensions") - - /* Set the single chunk dataspace to 'all' selection */ - if(H5S_select_all(dataset->shared->cache.chunk.single_space, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to set all selection") + /* Restore the original parallel I/O mode */ + if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->orig.xfer_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") } /* end if */ - fm->single_space = dataset->shared->cache.chunk.single_space; - HDassert(fm->single_space); - /* Allocate the single chunk information */ - if(NULL == dataset->shared->cache.chunk.single_chunk_info) { - if(NULL == (dataset->shared->cache.chunk.single_chunk_info = H5FL_MALLOC(H5D_chunk_info_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") - } /* end if */ - fm->single_chunk_info = dataset->shared->cache.chunk.single_chunk_info; - HDassert(fm->single_chunk_info); + /* Check if we need to revert the change to the collective opt mode */ + if(io_info->orig.coll_opt_mode != io_info->dxpl_cache->coll_opt_mode) { + H5P_genplist_t *dx_plist; /* Data transer property list */ - /* Reset chunk template information */ - fm->mchunk_tmpl = NULL; + /* Get the dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Set up chunk mapping for single element */ - if(H5D_create_chunk_map_single(fm, io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") - } /* end if */ - else { - /* Initialize skip list for chunk selections */ - if(NULL == dataset->shared->cache.chunk.sel_chunks) { - if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, 0.5, (size_t)H5D_DEFAULT_SKIPLIST_HEIGHT))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for chunk selections") + /* Restore the original parallel I/O mode */ + if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->orig.coll_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective option mode") } /* end if */ - fm->sel_chunks = dataset->shared->cache.chunk.sel_chunks; - HDassert(fm->sel_chunks); - - /* We are not using single element mode */ - fm->use_single = FALSE; - - /* Get type of selection on disk & in memory */ - if((fsel_type = H5S_GET_SELECT_TYPE(file_space)) < H5S_SEL_NONE) - HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") - if((fm->msel_type = H5S_GET_SELECT_TYPE(mem_space)) < H5S_SEL_NONE) - HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to get type of selection") - - /* If the selection is NONE or POINTS, set the flag to FALSE */ - if(fsel_type == H5S_SEL_POINTS || fsel_type == H5S_SEL_NONE) - sel_hyper_flag = FALSE; - else - sel_hyper_flag = TRUE; - - /* Check if file selection is a not a hyperslab selection */ - if(sel_hyper_flag) { - /* Build the file selection for each chunk */ - if(H5D_create_chunk_file_map_hyper(fm, io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") - - /* Clean file chunks' hyperslab span "scratch" information */ - curr_node=H5SL_first(fm->sel_chunks); - while(curr_node) { - H5D_chunk_info_t *chunk_info; /* Pointer chunk information */ - - /* Get pointer to chunk's information */ - chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); - - /* Clean hyperslab span's "scratch" information */ - if(H5S_hyper_reset_scratch(chunk_info->fspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") - - /* Get the next chunk node in the skip list */ - curr_node=H5SL_next(curr_node); - } /* end while */ - } /* end if */ - else { - /* Create temporary datatypes for selection iteration */ - if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") - - /* Spaces might not be the same shape, iterate over the file selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") - - /* Reset "last chunk" info */ - fm->last_index=(hsize_t)-1; - fm->last_chunk_info=NULL; - } /* end else */ - - /* Build the memory selection for each chunk */ - if(sel_hyper_flag && H5S_select_shape_same(file_space, mem_space) == TRUE) { - /* Reset chunk template information */ - fm->mchunk_tmpl = NULL; - - /* If the selections are the same shape, use the file chunk information - * to generate the memory chunk information quickly. - */ - if(H5D_create_chunk_mem_map_hyper(fm) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") - } /* end if */ - else { - size_t elmt_size; /* Memory datatype size */ - - /* Make a copy of equivalent memory space */ - if((tmp_mspace = H5S_copy(mem_space, TRUE, FALSE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - - /* De-select the mem space copy */ - if(H5S_select_none(tmp_mspace) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select memory space") - - /* Save chunk template information */ - fm->mchunk_tmpl=tmp_mspace; - - /* Create temporary datatypes for selection iteration */ - if(f_tid<0) { - if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") - } /* end if */ - - /* Create selection iterator for memory selection */ - if((elmt_size=H5T_get_size(mem_type))==0) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid") - if(H5S_select_iter_init(&(fm->mem_iter), mem_space, elmt_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") - iter_init = TRUE; /* Selection iteration info has been initialized */ - - /* Spaces aren't the same shape, iterate over the memory selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_mem_cb, fm) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") - - /* Clean up hyperslab stuff, if necessary */ - if(fm->msel_type != H5S_SEL_POINTS) { - /* Clean memory chunks' hyperslab span "scratch" information */ - curr_node=H5SL_first(fm->sel_chunks); - while(curr_node) { - H5D_chunk_info_t *chunk_info; /* Pointer chunk information */ - - /* Get pointer to chunk's information */ - chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); - - /* Clean hyperslab span's "scratch" information */ - if(H5S_hyper_reset_scratch(chunk_info->mspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") - - /* Get the next chunk node in the skip list */ - curr_node=H5SL_next(curr_node); - } /* end while */ - } /* end if */ - } /* end else */ - } /* end else */ - -done: - /* Release the [potentially partially built] chunk mapping information if an error occurs */ - if(ret_value<0) { - if(tmp_mspace && !fm->mchunk_tmpl) { - if(H5S_close(tmp_mspace) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") - } /* end if */ - - if (H5D_destroy_chunk_map(fm) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release chunk mapping") } /* end if */ - /* Reset the global dataspace info */ - fm->file_space = NULL; - fm->mem_space = NULL; - - if(iter_init) { - if(H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") - } /* end if */ - if(f_tid!=(-1)) { - if(H5I_dec_ref(f_tid) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") - } /* end if */ - if(file_space_normalized) { - if(H5S_hyper_denormalize_offset((H5S_t *)file_space, old_offset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset") - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_map() */ - - -/*-------------------------------------------------------------------------- - NAME - H5D_free_chunk_info - PURPOSE - Internal routine to destroy a chunk info node - USAGE - void H5D_free_chunk_info(chunk_info) - void *chunk_info; IN: Pointer to chunk info to destroy - RETURNS - No return value - DESCRIPTION - Releases all the memory for a chunk info node. Called by H5SL_free - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) -{ - H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *)item; - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_free_chunk_info) - - HDassert(chunk_info); - - /* Close the chunk's file dataspace, if it's not shared */ - if(!chunk_info->fspace_shared) - (void)H5S_close(chunk_info->fspace); - else - H5S_select_all(chunk_info->fspace, TRUE); - - /* Close the chunk's memory dataspace, if it's not shared */ - if(!chunk_info->mspace_shared) - (void)H5S_close(chunk_info->mspace); - - /* Free the actual chunk info */ - H5FL_FREE(H5D_chunk_info_t, chunk_info); - - FUNC_LEAVE_NOAPI(0); -} /* H5D_free_chunk_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_destroy_chunk_map - * - * Purpose: Destroy chunk mapping information. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Saturday, May 17, 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_destroy_chunk_map(const H5D_chunk_map_t *fm) -{ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_destroy_chunk_map) - - /* Single element I/O vs. multiple element I/O cleanup */ - if(fm->use_single) { - /* Sanity checks */ - HDassert(fm->sel_chunks == NULL); - HDassert(fm->single_chunk_info); - HDassert(fm->single_chunk_info->fspace_shared); - HDassert(fm->single_chunk_info->mspace_shared); - - /* Reset the selection for the single element I/O */ - H5S_select_all(fm->single_space, TRUE); - } /* end if */ - else { - /* Release the nodes on the list of selected chunks */ - if(fm->sel_chunks) - if(H5SL_free(fm->sel_chunks, H5D_free_chunk_info, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTNEXT, FAIL, "can't iterate over chunks") - } /* end else */ - - /* Free the memory chunk dataspace template */ - if(fm->mchunk_tmpl) - if(H5S_close(fm->mchunk_tmpl) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") -#ifdef H5_HAVE_PARALLEL - if(fm->select_chunk) - H5MM_xfree(fm->select_chunk); -#endif /* H5_HAVE_PARALLEL */ - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_destroy_chunk_map() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_create_chunk_map_single - * - * Purpose: Create chunk selections when appending a single record - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, November 20, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t -#ifndef H5_HAVE_PARALLEL - UNUSED -#endif /* H5_HAVE_PARALLEL */ - *io_info) -{ - H5D_chunk_info_t *chunk_info; /* Chunk information to insert into skip list */ - hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ - hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_map_single) - - /* Sanity check */ - HDassert(fm->f_ndims > 0); - - /* Get coordinate for selection */ - if(H5S_SELECT_BOUNDS(fm->file_space, sel_start, sel_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") - - /* Initialize the 'single chunk' file & memory chunk information */ - chunk_info = fm->single_chunk_info; - chunk_info->chunk_points = 1; - - /* Set chunk location & hyperslab size */ - for(u = 0; u < fm->f_ndims; u++) { - HDassert(sel_start[u] == sel_end[u]); - chunk_info->coords[u] = (sel_start[u] / fm->layout->u.chunk.dim[u]) * fm->layout->u.chunk.dim[u]; - } /* end for */ - chunk_info->coords[fm->f_ndims] = 0; - - /* Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->down_chunks, &chunk_info->index) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") - - /* Copy selection for file's dataspace into chunk dataspace */ - if(H5S_select_copy(fm->single_space, fm->file_space, FALSE) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file selection") - - /* Move selection back to have correct offset in chunk */ - if(H5S_SELECT_ADJUST_U(fm->single_space, chunk_info->coords) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") +} /* end H5D_ioinfo_term() */ -#ifdef H5_HAVE_PARALLEL - /* store chunk selection information */ - if(io_info->using_mpi_vfd) - fm->select_chunk[chunk_info->index] = TRUE; #endif /* H5_HAVE_PARALLEL */ - /* Set the file dataspace for the chunk to the shared 'single' dataspace */ - chunk_info->fspace = fm->single_space; - - /* Indicate that the chunk's file dataspace is shared */ - chunk_info->fspace_shared = TRUE; - - /* Just point at the memory dataspace & selection */ - /* (Casting away const OK -QAK) */ - chunk_info->mspace = (H5S_t *)fm->mem_space; - - /* Indicate that the chunk's memory dataspace is shared */ - chunk_info->mspace_shared = TRUE; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_map_single() */ - /*------------------------------------------------------------------------- - * Function: H5D_create_chunk_file_map_hyper + * Function: H5D_typeinfo_term * - * Purpose: Create all chunk selections in file. + * Purpose: Common logic for terminating a type info object * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * Thursday, May 29, 2003 + * Thursday, March 6, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t -#ifndef H5_HAVE_PARALLEL - UNUSED -#endif /* H5_HAVE_PARALLEL */ - *io_info) +H5D_typeinfo_term(const H5D_type_info_t *type_info) { - hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ - hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ - hsize_t sel_points; /* Number of elements in file selection */ - hsize_t start_coords[H5O_LAYOUT_NDIMS]; /* Starting coordinates of selection */ - hsize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ - hsize_t end[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */ - hsize_t chunk_index; /* Index of chunk */ - int curr_dim; /* Current dimension to increment */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_file_map_hyper) - - /* Sanity check */ - assert(fm->f_ndims>0); - - /* Get number of elements selected in file */ - sel_points = fm->nelmts; - - /* Get bounding box for selection (to reduce the number of chunks to iterate over) */ - if(H5S_SELECT_BOUNDS(fm->file_space, sel_start, sel_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") - - /* Set initial chunk location & hyperslab size */ - - for(u=0; uf_ndims; u++) { - start_coords[u]=(sel_start[u]/fm->layout->u.chunk.dim[u])*fm->layout->u.chunk.dim[u]; - coords[u]=start_coords[u]; - end[u]=(coords[u]+fm->chunk_dim[u])-1; - } /* end for */ - - - /* Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") - - /* Iterate through each chunk in the dataset */ - while(sel_points) { - /* Check for intersection of temporary chunk and file selection */ - /* (Casting away const OK - QAK) */ - if(H5S_hyper_intersect_block((H5S_t *)fm->file_space,coords,end)==TRUE) { - H5S_t *tmp_fchunk; /* Temporary file dataspace */ - H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */ - hssize_t schunk_points; /* Number of elements in chunk selection */ - - /* Create "temporary" chunk for selection operations (copy file space) */ - if((tmp_fchunk = H5S_copy(fm->file_space, TRUE, FALSE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - - /* Make certain selections are stored in span tree form (not "optimized hyperslab" or "all") */ - if(H5S_hyper_convert(tmp_fchunk) < 0) { - (void)H5S_close(tmp_fchunk); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees") - } /* end if */ - - /* "AND" temporary chunk and current chunk */ - if(H5S_select_hyperslab(tmp_fchunk,H5S_SELECT_AND,coords,NULL,fm->chunk_dim,NULL) < 0) { - (void)H5S_close(tmp_fchunk); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't create chunk selection") - } /* end if */ - - /* Resize chunk's dataspace dimensions to size of chunk */ - if(H5S_set_extent_real(tmp_fchunk,fm->chunk_dim) < 0) { - (void)H5S_close(tmp_fchunk); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk dimensions") - } /* end if */ - - /* Move selection back to have correct offset in chunk */ - if(H5S_SELECT_ADJUST_U(tmp_fchunk, coords) < 0) { - (void)H5S_close(tmp_fchunk); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") - } /* end if */ - - /* Add temporary chunk to the list of chunks */ - - /* Allocate the file & memory chunk information */ - if (NULL==(new_chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) { - (void)H5S_close(tmp_fchunk); - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") - } /* end if */ - - /* Initialize the chunk information */ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_typeinfo_term) - /* Set the chunk index */ - new_chunk_info->index=chunk_index; - -#ifdef H5_HAVE_PARALLEL - /* store chunk selection information */ - if(io_info->using_mpi_vfd) - fm->select_chunk[chunk_index] = TRUE; -#endif /* H5_HAVE_PARALLEL */ - - /* Set the file chunk dataspace */ - new_chunk_info->fspace = tmp_fchunk; - new_chunk_info->fspace_shared = FALSE; - - /* Set the memory chunk dataspace */ - new_chunk_info->mspace=NULL; - new_chunk_info->mspace_shared = FALSE; - - /* Copy the chunk's coordinates */ - for(u=0; uf_ndims; u++) - new_chunk_info->coords[u]=coords[u]; - new_chunk_info->coords[fm->f_ndims]=0; - - /* Insert the new chunk into the skip list */ - if(H5SL_insert(fm->sel_chunks,new_chunk_info,&new_chunk_info->index) < 0) { - H5D_free_chunk_info(new_chunk_info,NULL,NULL); - HGOTO_ERROR(H5E_DATASPACE,H5E_CANTINSERT,FAIL,"can't insert chunk into skip list") - } /* end if */ - - /* Get number of elements selected in chunk */ - if((schunk_points=H5S_GET_SELECT_NPOINTS(tmp_fchunk)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements") - H5_ASSIGN_OVERFLOW(new_chunk_info->chunk_points,schunk_points,hssize_t,size_t); - - /* Decrement # of points left in file selection */ - sel_points-=(hsize_t)schunk_points; - - /* Leave if we are done */ - if(sel_points==0) - HGOTO_DONE(SUCCEED) - assert(sel_points>0); - } /* end if */ - - /* Increment chunk index */ - chunk_index++; - - /* Set current increment dimension */ - curr_dim=(int)fm->f_ndims-1; - - /* Increment chunk location in fastest changing dimension */ - H5_CHECK_OVERFLOW(fm->chunk_dim[curr_dim],hsize_t,hssize_t); - coords[curr_dim]+=fm->chunk_dim[curr_dim]; - end[curr_dim]+=fm->chunk_dim[curr_dim]; - - /* Bring chunk location back into bounds, if necessary */ - if(coords[curr_dim]>sel_end[curr_dim]) { - do { - /* Reset current dimension's location to 0 */ - coords[curr_dim]=start_coords[curr_dim]; /*lint !e771 The start_coords will always be initialized */ - end[curr_dim]=(coords[curr_dim]+(hssize_t)fm->chunk_dim[curr_dim])-1; - - /* Decrement current dimension */ - curr_dim--; - - /* Increment chunk location in current dimension */ - coords[curr_dim]+=fm->chunk_dim[curr_dim]; - end[curr_dim]=(coords[curr_dim]+fm->chunk_dim[curr_dim])-1; - } while(coords[curr_dim]>sel_end[curr_dim]); - - /* Re-Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") - } /* end if */ - } /* end while */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_file_map_hyper() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_create_chunk_mem_map_hyper - * - * Purpose: Create all chunk selections in memory by copying the file - * chunk selections and adjusting their offsets to be correct - * for the memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, May 29, 2003 - * - * Assumptions: That the file and memory selections are the same shape. - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) -{ - H5SL_node_t *curr_node; /* Current node in skip list */ - hsize_t file_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ - hsize_t file_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ - hsize_t mem_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ - hsize_t mem_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */ - hssize_t adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to all file chunks */ - hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_mem_map_hyper) - - /* Sanity check */ - assert(fm->f_ndims>0); - - /* Check for all I/O going to a single chunk */ - if(H5SL_count(fm->sel_chunks)==1) { - H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */ - - /* Get the node */ - curr_node=H5SL_first(fm->sel_chunks); - - /* Get pointer to chunk's information */ - chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); - - /* Just point at the memory dataspace & selection */ - /* (Casting away const OK -QAK) */ - chunk_info->mspace=(H5S_t *)fm->mem_space; - - /* Indicate that the chunk's memory space is shared */ - chunk_info->mspace_shared = TRUE; + /* Check for releasing datatype conversion & background buffers */ + if(type_info->tconv_buf_allocated) { + HDassert(type_info->tconv_buf); + (void)H5FL_BLK_FREE(type_conv, type_info->tconv_buf); } /* end if */ - else { - /* Get bounding box for file selection */ - if(H5S_SELECT_BOUNDS(fm->file_space, file_sel_start, file_sel_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") - - /* Get bounding box for memory selection */ - if(H5S_SELECT_BOUNDS(fm->mem_space, mem_sel_start, mem_sel_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") - - /* Calculate the adjustment for memory selection from file selection */ - assert(fm->m_ndims==fm->f_ndims); - for(u=0; uf_ndims; u++) { - H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t); - H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t); - adjust[u]=(hssize_t)file_sel_start[u]-(hssize_t)mem_sel_start[u]; - } /* end for */ - - /* Iterate over each chunk in the chunk list */ - curr_node=H5SL_first(fm->sel_chunks); - while(curr_node) { - H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */ - - /* Get pointer to chunk's information */ - chunk_info = (H5D_chunk_info_t *)H5SL_item(curr_node); - assert(chunk_info); - - /* Copy the information */ - - /* Copy the memory dataspace */ - if((chunk_info->mspace = H5S_copy(fm->mem_space, TRUE, FALSE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - - /* Release the current selection */ - if(H5S_SELECT_RELEASE(chunk_info->mspace) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection") - - /* Copy the file chunk's selection */ - if(H5S_select_copy(chunk_info->mspace,chunk_info->fspace,FALSE) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection") - - /* Compensate for the chunk offset */ - for(u=0; uf_ndims; u++) { - H5_CHECK_OVERFLOW(chunk_info->coords[u],hsize_t,hssize_t); - chunk_adjust[u]=adjust[u]-(hssize_t)chunk_info->coords[u]; /*lint !e771 The adjust array will always be initialized */ - } /* end for */ - - /* Adjust the selection */ - if(H5S_hyper_adjust_s(chunk_info->mspace,chunk_adjust) < 0) /*lint !e772 The chunk_adjust array will always be initialized */ - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection") - - /* Get the next chunk node in the skip list */ - curr_node=H5SL_next(curr_node); - } /* end while */ - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_mem_map_hyper() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_chunk_file_cb - * - * Purpose: Callback routine for file selection iterator. Used when - * creating selections in file for each point selected. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Wednesday, July 23, 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) -{ - H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ - H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ - hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ - hsize_t chunk_index; /* Chunk index */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb) - - /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") - - /* Find correct chunk in file & memory skip list */ - if(chunk_index==fm->last_index) { - /* If the chunk index is the same as the last chunk index we used, - * get the cached info to operate on. - */ - chunk_info=fm->last_chunk_info; + if(type_info->bkg_buf_allocated) { + HDassert(type_info->bkg_buf); + (void)H5FL_BLK_FREE(type_conv, type_info->bkg_buf); } /* end if */ - else { - /* If the chunk index is not the same as the last chunk index we used, - * find the chunk in the skip list. - */ - /* Get the chunk node from the skip list */ - if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_search(fm->sel_chunks, &chunk_index))) { - H5S_t *fspace; /* Memory chunk's dataspace */ - - /* Allocate the file & memory chunk information */ - if (NULL==(chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") - - /* Initialize the chunk information */ - - /* Set the chunk index */ - chunk_info->index=chunk_index; - - /* Create a dataspace for the chunk */ - if((fspace = H5S_create_simple(fm->f_ndims,fm->chunk_dim,NULL))==NULL) { - H5FL_FREE(H5D_chunk_info_t,chunk_info); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace for chunk") - } /* end if */ - - /* De-select the chunk space */ - if(H5S_select_none(fspace) < 0) { - (void)H5S_close(fspace); - H5FL_FREE(H5D_chunk_info_t,chunk_info); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select dataspace") - } /* end if */ - - /* Set the file chunk dataspace */ - chunk_info->fspace = fspace; - chunk_info->fspace_shared = FALSE; - - /* Set the memory chunk dataspace */ - chunk_info->mspace=NULL; - chunk_info->mspace_shared = FALSE; - - /* Set the number of selected elements in chunk to zero */ - chunk_info->chunk_points=0; - - /* Compute the chunk's coordinates */ - for(u=0; uf_ndims; u++) { - H5_CHECK_OVERFLOW(fm->layout->u.chunk.dim[u],hsize_t,hssize_t); - chunk_info->coords[u]=(coords[u]/(hssize_t)fm->layout->u.chunk.dim[u])*(hssize_t)fm->layout->u.chunk.dim[u]; - } /* end for */ - chunk_info->coords[fm->f_ndims]=0; - - /* Insert the new chunk into the skip list */ - if(H5SL_insert(fm->sel_chunks,chunk_info,&chunk_info->index) < 0) { - H5D_free_chunk_info(chunk_info,NULL,NULL); - HGOTO_ERROR(H5E_DATASPACE,H5E_CANTINSERT,FAIL,"can't insert chunk into skip list") - } /* end if */ - } /* end if */ - - /* Update the "last chunk seen" information */ - fm->last_index=chunk_index; - fm->last_chunk_info=chunk_info; - } /* end else */ - - /* Get the coordinates of the element in the chunk */ - for(u=0; uf_ndims; u++) - coords_in_chunk[u]=coords[u]%fm->layout->u.chunk.dim[u]; - - /* Add point to file selection for chunk */ - if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") - - /* Increment the number of elemented selected in chunk */ - chunk_info->chunk_points++; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_file_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_chunk_mem_cb - * - * Purpose: Callback routine for file selection iterator. Used when - * creating selections in memory for each chunk. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * Thursday, April 10, 2003 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) -{ - H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ - H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ - hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */ - hsize_t chunk_index; /* Chunk index */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb) - - /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") - - /* Find correct chunk in file & memory skip list */ - if(chunk_index==fm->last_index) { - /* If the chunk index is the same as the last chunk index we used, - * get the cached spaces to operate on. - */ - chunk_info=fm->last_chunk_info; - } /* end if */ - else { - /* If the chunk index is not the same as the last chunk index we used, - * find the chunk in the skip list. - */ - /* Get the chunk node from the skip list */ - if(NULL == (chunk_info = (H5D_chunk_info_t *)H5SL_search(fm->sel_chunks, &chunk_index))) - HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") - - /* Check if the chunk already has a memory space */ - if(chunk_info->mspace==NULL) { - /* Copy the template memory chunk dataspace */ - if((chunk_info->mspace = H5S_copy(fm->mchunk_tmpl, FALSE, FALSE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file space") - } /* end else */ - - /* Update the "last chunk seen" information */ - fm->last_index=chunk_index; - fm->last_chunk_info=chunk_info; - } /* end else */ - - /* Get coordinates of selection iterator for memory */ - if(H5S_SELECT_ITER_COORDS(&fm->mem_iter,coords_in_mem) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get iterator coordinates") - - /* Add point to memory selection for chunk */ - if(fm->msel_type==H5S_SEL_POINTS) { - if(H5S_select_elements(chunk_info->mspace, H5S_SELECT_APPEND, (size_t)1, coords_in_mem) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") - } /* end if */ - else { - if(H5S_hyper_add_span_element(chunk_info->mspace, fm->m_ndims, coords_in_mem) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element") - } /* end else */ - - /* Move memory selection iterator to next element in selection */ - if(H5S_SELECT_ITER_NEXT(&fm->mem_iter, (size_t)1) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTNEXT, FAIL, "unable to move to next iterator location") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_mem_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_ioinfo_init - * - * Purpose: Routine for determining correct I/O operations for - * each I/O action. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, September 30, 2004 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - const H5S_t -#if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG) - UNUSED -#endif /* H5_HAVE_PARALLEL */ - *mem_space, const H5S_t -#if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG) - UNUSED -#endif /* H5_HAVE_PARALLEL */ - *file_space, H5T_path_t -#ifndef H5_HAVE_PARALLEL - UNUSED -#endif /* H5_HAVE_PARALLEL */ - *tpath, - H5D_io_info_t *io_info) -{ - herr_t ret_value = SUCCEED; /* Return value */ - -#if defined H5_HAVE_PARALLEL || defined H5S_DEBUG - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_init) -#else /* defined H5_HAVE_PARALLEL || defined H5S_DEBUG */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_ioinfo_init) -#endif /* defined H5_HAVE_PARALLEL || defined H5S_DEBUG */ - - /* check args */ - HDassert(dset); - HDassert(dset->oloc.file); - HDassert(mem_space); - HDassert(file_space); - HDassert(tpath); - HDassert(io_info); - - /* Set up "normal" I/O fields */ - io_info->dset=dset; - io_info->dxpl_cache=dxpl_cache; - io_info->dxpl_id=dxpl_id; - io_info->store=NULL; /* Set later in I/O routine? */ - - /* Set I/O operations to initial values */ - io_info->ops=dset->shared->io_ops; - -#ifdef H5_HAVE_PARALLEL - /* Start in the "not modified" xfer_mode state */ - io_info->xfer_mode_changed = FALSE; - io_info->using_mpi_vfd = IS_H5FD_MPI(dset->oloc.file); - - if(io_info->using_mpi_vfd) { - htri_t opt; /* Flag whether a selection is optimizable */ - - /* Get MPI communicator */ - if((io_info->comm = H5F_mpi_get_comm(dset->oloc.file)) == MPI_COMM_NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator") - - /* - * Check if we can set direct MPI-IO read/write functions - */ - opt=H5D_mpio_opt_possible(io_info, mem_space, file_space, tpath); - if(opt==FAIL) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace "); - - /* Check if we can use the optimized parallel I/O routines */ - if(opt==TRUE) { - /* Set the pointers to the MPI-specific routines */ - io_info->ops.read = H5D_mpio_select_read; - io_info->ops.write = H5D_mpio_select_write; - } /* end if */ - else { - /* Set the pointers to the non-MPI-specific routines */ - io_info->ops.read = H5D_select_read; - io_info->ops.write = H5D_select_write; - - /* If we won't be doing collective I/O, but the user asked for - * collective I/O, change the request to use independent I/O, but - * mark it so that we remember to revert the change. - */ - if(io_info->dxpl_cache->xfer_mode==H5FD_MPIO_COLLECTIVE) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - - /* Change the xfer_mode to independent for handling the I/O */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - - /* Indicate that the transfer mode should be restored before returning - * to user. - */ - io_info->xfer_mode_changed = TRUE; - } /* end if */ - } /* end else */ - } /* end if */ - else { - /* Set the pointers to the non-MPI-specific routines */ - io_info->ops.read = H5D_select_read; - io_info->ops.write = H5D_select_write; - } /* end else */ -#else /* H5_HAVE_PARALLEL */ - io_info->ops.read = H5D_select_read; - io_info->ops.write = H5D_select_write; -#endif /* H5_HAVE_PARALLEL */ - -#ifdef H5S_DEBUG - /* Get the information for the I/O statistics */ - if((io_info->stats=H5S_find(mem_space,file_space))==NULL) - HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "can't set up selection statistics"); -#endif /* H5S_DEBUG */ - -#if defined H5_HAVE_PARALLEL || defined H5S_DEBUG -done: -#endif /* H5_HAVE_PARALLEL || H5S_DEBUG */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_init() */ - -#ifdef H5_HAVE_PARALLEL - -/*------------------------------------------------------------------------- - * Function: H5D_ioinfo_term - * - * Purpose: Common logic for terminating an I/O info object - * (Only used for restoring MPI transfer mode currently) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, February 6, 2004 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_ioinfo_term(H5D_io_info_t *io_info) -{ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_term) - - /* Check if we need to revert the change to the xfer mode */ - if (io_info->xfer_mode_changed) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Restore the original parallel I/O mode */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_COLLECTIVE; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_term() */ -#endif + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_typeinfo_term() */ diff --git a/src/H5Distore.c b/src/H5Distore.c index 47e4cab..efab271 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -104,30 +104,12 @@ */ #define H5D_ISTORE_NDIMS(X) (((X)->sizeof_rkey-8)/8) -#define H5D_HASH(D,ADDR) H5F_addr_hash(ADDR,(D)->cache.chunk.nslots) - #define H5D_ISTORE_DEFAULT_SKIPLIST_HEIGHT 8 /******************/ /* Local Typedefs */ /******************/ -/* Raw data chunks are cached. Each entry in the cache is: */ -typedef struct H5D_rdcc_ent_t { - hbool_t locked; /*entry is locked in cache */ - hbool_t dirty; /*needs to be written to disk? */ - hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */ - size_t rd_count; /*bytes remaining to be read */ - size_t wr_count; /*bytes remaining to be written */ - size_t chunk_size; /*size of a chunk */ - size_t alloc_size; /*amount allocated for the chunk */ - uint8_t *chunk; /*the unfiltered chunk data */ - unsigned idx; /*index in hash table */ - struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */ - struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */ -} H5D_rdcc_ent_t; -typedef H5D_rdcc_ent_t *H5D_rdcc_ent_ptr_t; /* For free lists */ - /* * Data exchange structure for indexed storage nodes. This structure is * passed through the B-link tree layer to the methods for the objects @@ -192,7 +174,7 @@ typedef struct H5D_istore_it_ud4_t { /* B-tree callback info for iteration to obtain chunk address and the index of the chunk for all chunks in the B-tree. */ typedef struct H5D_istore_it_ud5_t { H5D_istore_bt_ud_common_t common; /* Common info for B-tree user data (must be first) */ - hsize_t *down_chunks; + const hsize_t *down_chunks; haddr_t *chunk_addr; } H5D_istore_it_ud5_t; @@ -1490,7 +1472,7 @@ H5D_istore_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Construct dataset I/O info */ - H5D_BUILD_IO_INFO(&io_info, dset, dxpl_cache, dxpl_id, NULL); + H5D_BUILD_IO_INFO_WRT(&io_info, dset, dxpl_cache, dxpl_id, NULL, NULL); /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { @@ -1525,48 +1507,48 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_istore_dest (H5D_t *dset, hid_t dxpl_id) +H5D_istore_dest(H5D_t *dset, hid_t dxpl_id) { H5D_io_info_t io_info; /* Temporary I/O info object */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - int nerrors=0; - H5D_rdcc_ent_t *ent=NULL, *next=NULL; - herr_t ret_value=SUCCEED; /* Return value */ + H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ + H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + int nerrors = 0; + H5D_rdcc_ent_t *ent = NULL, *next = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL) - assert(dset); + HDassert(dset); /* Fill the DXPL cache values for later use */ - if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0) + if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Construct dataset I/O info */ - H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,NULL); + H5D_BUILD_IO_INFO_WRT(&io_info, dset, dxpl_cache, dxpl_id, NULL, NULL); /* Flush all the cached chunks */ - for (ent=rdcc->head; ent; ent=next) { + for(ent = rdcc->head; ent; ent = next) { #ifdef H5D_ISTORE_DEBUG HDfputc('c', stderr); HDfflush(stderr); #endif next = ent->next; - if (H5D_istore_preempt(&io_info, ent, TRUE )<0) + if(H5D_istore_preempt(&io_info, ent, TRUE) < 0) nerrors++; - } - if (nerrors) + } /* end for */ + if(nerrors) HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") if(rdcc->slot) - H5FL_SEQ_FREE (H5D_rdcc_ent_ptr_t,rdcc->slot); - HDmemset (rdcc, 0, sizeof(H5D_rdcc_t)); + H5FL_SEQ_FREE(H5D_rdcc_ent_ptr_t, rdcc->slot); + HDmemset(rdcc, 0, sizeof(H5D_rdcc_t)); /* Free the raw B-tree node buffer */ - if(dset->shared->layout.u.chunk.btree_shared==NULL) + if(dset->shared->layout.u.chunk.btree_shared == NULL) HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil") - if(H5RC_DEC(dset->shared->layout.u.chunk.btree_shared)<0) + if(H5RC_DEC(dset->shared->layout.u.chunk.btree_shared) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page") done: @@ -1835,7 +1817,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, H5D_istore_ud1_t *udata, /* Search for the chunk in the cache */ if(rdcc->nslots > 0) { - idx = H5D_HASH(dset->shared,io_info->store->chunk.index); + idx = H5D_CHUNK_HASH(dset->shared, io_info->store->chunk.index); ent = rdcc->slot[idx]; if(ent) @@ -1950,10 +1932,8 @@ H5D_istore_lock(const H5D_io_info_t *io_info, H5D_istore_ud1_t *udata, if(H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "can't refill fill value buffer") } /* end if */ -#ifdef H5_CLEAR_MEMORY else HDmemset(chunk, 0, chunk_size); -#endif /* H5_CLEAR_MEMORY */ #ifdef H5D_ISTORE_DEBUG rdcc->ninits++; #endif /* H5D_ISTORE_DEBUG */ @@ -2154,339 +2134,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_istore_if_load - * - * Purpose: A small internal function to if it's necessary to load the - * chunk into cache. - * - * Return: TRUE or FALSE - * - * Programmer: Raymond Lu - * 17 July 2007 - * - *------------------------------------------------------------------------- - */ -hbool_t -H5D_istore_if_load(const H5D_io_info_t *io_info, haddr_t caddr) -{ - const H5D_t *dataset = io_info->dset; - hbool_t ret_value; - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_if_load) - - HDassert(io_info); - HDassert(dataset); - - /* - * If the chunk is too large to load into the cache and it has no - * filters in the pipeline (i.e. not compressed) and if the address - * for the chunk has been defined, then don't load the chunk into the - * cache, just write the data to it directly. - * - * If MPI based VFD is used, must bypass the - * chunk-cache scheme because other MPI processes could be - * writing to other elements in the same chunk. Do a direct - * write-through of only the elements requested. - */ - if(dataset->shared->dcpl_cache.pline.nused==0 && - ((dataset->shared->layout.u.chunk.size > dataset->shared->cache.chunk.nbytes && caddr != HADDR_UNDEF) -#ifdef H5_HAVE_PARALLEL - || (io_info->using_mpi_vfd && (H5F_ACC_RDWR & H5F_get_intent(dataset->oloc.file))) -#endif /* H5_HAVE_PARALLEL */ - )) { - ret_value = FALSE; - } else - ret_value = TRUE; - - FUNC_LEAVE_NOAPI(ret_value) -} - - -/*------------------------------------------------------------------------- - * Function: H5D_istore_readvv - * - * Purpose: Reads a multi-dimensional buffer from (part of) an indexed raw - * storage array. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Wednesday, May 7, 2003 - * - * Modification: - * Raymond Lu - * 20 July 2007 - * Moved H5D_istore_lock and H5D_istore_unlock to H5D_chunk_read - * from this function to avoid frequent lock and unlock. - * - *------------------------------------------------------------------------- - */ -ssize_t -H5D_istore_readvv(const H5D_io_info_t *io_info, - size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t chunk_addr, void *chunk, void *buf) -{ - H5D_t *dset=io_info->dset; /* Local pointer to the dataset info */ - size_t u; /* Local index variables */ - ssize_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL) - - /* Check args */ - HDassert(io_info); - HDassert(dset && H5D_CHUNKED==dset->shared->layout.type); - HDassert(dset->shared->layout.u.chunk.ndims>0 && dset->shared->layout.u.chunk.ndims<=H5O_LAYOUT_NDIMS); - HDassert(io_info->dxpl_cache); - HDassert(io_info->store); - HDassert(chunk_len_arr); - HDassert(chunk_offset_arr); - HDassert(mem_len_arr); - HDassert(mem_offset_arr); - HDassert(buf); - - /* Get the address of this chunk on disk */ -#ifdef QAK -HDfprintf(stderr,"%s: io_info->store->chunk.offset={",FUNC); -for(u=0; ushared->layout.u.chunk.ndims; u++) - HDfprintf(stderr,"%Hd%s",io_info->store->chunk.offset[u],(u<(dset->shared->layout.u.chunk.ndims-1) ? ", " : "}\n")); - -HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Zu\n",FUNC,chunk_addr,dset->shared->layout.u.chunk.size); -HDfprintf(stderr,"%s: chunk_len_arr[%Zu]=%Zu\n",FUNC,*chunk_curr_seq,chunk_len_arr[*chunk_curr_seq]); -HDfprintf(stderr,"%s: chunk_offset_arr[%Zu]=%Hu\n",FUNC,*chunk_curr_seq,chunk_offset_arr[*chunk_curr_seq]); -HDfprintf(stderr,"%s: mem_len_arr[%Zu]=%Zu\n",FUNC,*mem_curr_seq,mem_len_arr[*mem_curr_seq]); -HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_arr[*mem_curr_seq]); -HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); -#endif /* QAK */ - - /* - * If the chunk is too large to load into the cache and it has no - * filters in the pipeline (i.e. not compressed) and if the address - * for the chunk has been defined, then don't load the chunk into the - * cache, just read the data from it directly. - * - * If MPI based VFD is used, must bypass the - * chunk-cache scheme because other MPI processes could be - * writing to other elements in the same chunk. Do a direct - * read-through of only the elements requested. - */ - if(!H5D_istore_if_load(io_info, chunk_addr)) { - H5D_io_info_t chk_io_info; /* Temporary I/O info object */ - H5D_storage_t chk_store; /* Chunk storage information */ - - /* Set up the storage information for the chunk */ - chk_store.contig.dset_addr=chunk_addr; - chk_store.contig.dset_size=(hsize_t)dset->shared->layout.u.chunk.size; - - /* Set up new dataset I/O info */ - H5D_BUILD_IO_INFO(&chk_io_info,dset,io_info->dxpl_cache,io_info->dxpl_id,&chk_store); - - /* Do I/O directly on chunk without reading it into the cache */ - if ((ret_value=H5D_contig_readvv(&chk_io_info, chunk_max_nseq, chunk_curr_seq, chunk_len_arr, - chunk_offset_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_offset_arr, (haddr_t)0, NULL, buf))<0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data to file") - } /* end if */ - else { - ssize_t naccessed; /* Number of bytes accessed in chunk */ - - /* If the chunk address is not defined, check if the fill value is - * undefined also. If both situations hold, don't bother copying - * values to the destination buffer, since they will just be - * garbage. - * - * Ideally, this will eventually be checked at a higher level and - * the entire I/O operation on the chunk will be skipped. -QAK - */ - if(!H5F_addr_defined(chunk_addr)) { - H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);/*raw data chunk cache*/ - hbool_t found = FALSE; /*already in cache? */ - - /* Check if the chunk is in the cache (but hasn't been written to disk yet) */ - if(rdcc->nslots>0) { - unsigned idx = H5D_HASH(dset->shared, io_info->store->chunk.index); /* Cache entry index */ - H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ - - /* Potential match... */ - if(ent) { - for(u = 0, found = TRUE; u < dset->shared->layout.u.chunk.ndims; u++) { - if(io_info->store->chunk.offset[u] != ent->offset[u]) { - found = FALSE; - break; - } /* end if */ - } /* end for */ - } /* end if */ - } /* end if */ - - /* If the chunk is in the cache, then it must have valid data */ - if(!found) { - const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ - H5D_fill_value_t fill_status; - - /* Check if the fill value is defined */ - if(H5P_is_fill_value_defined(fill, &fill_status) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined") - - /* If we are never to return fill values, or if we would return them - * but they aren't set, process the entire set of I/O vectors and - * get out now. - */ - if(fill->fill_time == H5D_FILL_TIME_NEVER || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status!=H5D_FILL_VALUE_USER_DEFINED)) { - size_t size; /* Size of sequence in bytes */ - size_t v; /* Local index variable */ - ssize_t bytes_processed = 0; /* Eventual return value */ - - /* Work through all the sequences */ - for(u = *mem_curr_seq, v = *chunk_curr_seq; u < mem_max_nseq && v < chunk_max_nseq; ) { - /* Choose smallest buffer to write */ - if(chunk_len_arr[v] < mem_len_arr[u]) - size = chunk_len_arr[v]; - else - size = mem_len_arr[u]; - - /* Update source information */ - chunk_len_arr[v] -= size; - chunk_offset_arr[v] += size; - if(chunk_len_arr[v] == 0) - v++; - - /* Update destination information */ - mem_len_arr[u] -= size; - mem_offset_arr[u] += size; - if(mem_len_arr[u] == 0) - u++; - - /* Increment number of bytes copied */ - bytes_processed += (ssize_t)size; - } /* end for */ - - /* Update current sequence vectors */ - *mem_curr_seq = u; - *chunk_curr_seq = v; - - HGOTO_DONE(bytes_processed) - } /* end if */ - } /* end if */ - } /* end if */ - - /* Use the vectorized memory copy routine to do actual work */ - if((naccessed = H5V_memcpyvv(buf, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_offset_arr, chunk, chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_offset_arr)) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "vectorized memcpy failed") - - H5_CHECK_OVERFLOW(naccessed, ssize_t, size_t); - - /* Set return value */ - ret_value = naccessed; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_istore_readvv() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_istore_writevv - * - * Purpose: Writes a multi-dimensional buffer to (part of) an indexed raw - * storage array. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, May 2, 2003 - * - * Modification: - * Raymond Lu - * 20 July 2007 - * Moved H5D_istore_lock and H5D_istore_unlock to H5D_chunk_write - * from this function to avoid frequent lock and unlock. - * - *------------------------------------------------------------------------- - */ -ssize_t -H5D_istore_writevv(const H5D_io_info_t *io_info, - size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t chunk_addr, void *chunk, const void *buf) -{ - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ - ssize_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL) - - /* Check args */ - HDassert(io_info); - HDassert(dset && H5D_CHUNKED==dset->shared->layout.type); - HDassert(dset->shared->layout.u.chunk.ndims>0 && dset->shared->layout.u.chunk.ndims<=H5O_LAYOUT_NDIMS); - HDassert(io_info->dxpl_cache); - HDassert(io_info->store); - HDassert(chunk_len_arr); - HDassert(chunk_offset_arr); - HDassert(mem_len_arr); - HDassert(mem_offset_arr); - HDassert(buf); - -#ifdef QAK -{ -size_t u; /* Local index variables */ - -HDfprintf(stderr,"%s: io_info->store->chunk.offset={",FUNC); -for(u=0; ushared->layout.u.chunk.ndims; u++) - HDfprintf(stderr,"%Hd%s",io_info->store->chunk.offset[u],(u<(dset->shared->layout.u.chunk.ndims-1) ? ", " : "}\n")); - -HDfprintf(stderr,"%s: chunk_addr=%a, chunk_size=%Zu\n",FUNC,chunk_addr,dset->shared->layout.u.chunk.size); -HDfprintf(stderr,"%s: chunk_len_arr[%Zu]=%Zu\n",FUNC,*chunk_curr_seq,chunk_len_arr[*chunk_curr_seq]); -HDfprintf(stderr,"%s: chunk_offset_arr[%Zu]=%Hu\n",FUNC,*chunk_curr_seq,chunk_offset_arr[*chunk_curr_seq]); -HDfprintf(stderr,"%s: mem_len_arr[%Zu]=%Zu\n",FUNC,*mem_curr_seq,mem_len_arr[*mem_curr_seq]); -HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_arr[*mem_curr_seq]); -} -#endif /* QAK */ - - /* - * If the chunk is too large to load into the cache and it has no - * filters in the pipeline (i.e. not compressed) and if the address - * for the chunk has been defined, then don't load the chunk into the - * cache, just write the data to it directly. - * - * If MPI based VFD is used, must bypass the - * chunk-cache scheme because other MPI processes could be - * writing to other elements in the same chunk. Do a direct - * write-through of only the elements requested. - */ - if(!H5D_istore_if_load(io_info, chunk_addr)) { - H5D_io_info_t chk_io_info; /* Temporary I/O info object */ - H5D_storage_t chk_store; /* Chunk storage information */ - - /* Set up the storage information for the chunk */ - chk_store.contig.dset_addr=chunk_addr; - chk_store.contig.dset_size=(hsize_t)dset->shared->layout.u.chunk.size; - - /* Set up new dataset I/O info */ - H5D_BUILD_IO_INFO(&chk_io_info,dset,io_info->dxpl_cache,io_info->dxpl_id,&chk_store); - - /* Do I/O directly on chunk without reading it into the cache */ - if((ret_value = H5D_contig_writevv(&chk_io_info, chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_offset_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_offset_arr, (haddr_t)0, NULL, buf)) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") - } /* end if */ - else { - ssize_t naccessed; /* Number of bytes accessed in chunk */ - - /* Use the vectorized memory copy routine to do actual work */ - if((naccessed=H5V_memcpyvv(chunk,chunk_max_nseq,chunk_curr_seq,chunk_len_arr,chunk_offset_arr,buf,mem_max_nseq,mem_curr_seq,mem_len_arr,mem_offset_arr))<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") - - H5_CHECK_OVERFLOW(naccessed,ssize_t,size_t); - - /* Set return value */ - ret_value=naccessed; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_istore_writevv() */ - - -/*------------------------------------------------------------------------- * Function: H5D_istore_create * * Purpose: Creates a new indexed-storage B-tree and initializes the @@ -2567,16 +2214,16 @@ H5D_istore_allocated(H5D_t *dset, hid_t dxpl_id) HDassert(dset); /* Fill the DXPL cache values for later use */ - if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0) + if(H5D_get_dxpl_cache(dxpl_id,&dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't fill dxpl cache") /* Construct dataset I/O info */ - H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,NULL); + H5D_BUILD_IO_INFO_WRT(&io_info, dset, dxpl_cache, dxpl_id, NULL, NULL); /* Search for cached chunks that haven't been written out */ for(ent = rdcc->head; ent; ent = ent->next) { /* Flush the chunk out to disk, to make certain the size is correct later */ - if (H5D_istore_flush_entry(&io_info, ent, FALSE)<0) + if (H5D_istore_flush_entry(&io_info, ent, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, 0, "cannot flush indexed storage buffer") } /* end for */ @@ -2609,7 +2256,7 @@ done: */ herr_t H5D_istore_chunkmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[], - hsize_t down_chunks[]) + const hsize_t down_chunks[]) { H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ H5D_istore_it_ud5_t udata; @@ -2908,7 +2555,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) /* Set up dataset I/O info */ store.chunk.offset = chunk_offset; - H5D_BUILD_IO_INFO(&io_info, dset, dxpl_cache, data_dxpl_id, &store); + H5D_BUILD_IO_INFO_WRT(&io_info, dset, dxpl_cache, data_dxpl_id, &store, NULL); /* Reset the chunk offset indices */ HDmemset(chunk_offset, 0, (layout->u.chunk.ndims * sizeof(chunk_offset[0]))); @@ -3574,7 +3221,7 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunk selection information") /* Scatter the data into memory */ - if(H5D_select_mscat(fb_info.fill_buf, space_chunk, &chunk_iter, (size_t)nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) { + if(H5D_scatter_mem(fb_info.fill_buf, space_chunk, &chunk_iter, (size_t)nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) { H5S_SELECT_ITER_RELEASE(&chunk_iter); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end if */ @@ -3728,7 +3375,7 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Construct dataset I/O info */ - H5D_BUILD_IO_INFO(&io_info, dset, dxpl_cache, dxpl_id, NULL); + H5D_BUILD_IO_INFO_WRT(&io_info, dset, dxpl_cache, dxpl_id, NULL, NULL); /* Recompute the index for each cached chunk that is in a dataset */ for(ent = rdcc->head; ent; ent = next) { @@ -3744,7 +3391,7 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id) /* Compute the index for the chunk entry */ old_idx=ent->idx; /* Save for later */ - ent->idx=H5D_HASH(dset->shared,idx); + ent->idx=H5D_CHUNK_HASH(dset->shared, idx); if(old_idx != ent->idx) { /* Check if there is already a chunk at this chunk's new location */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 22f32ab..889fbce 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -34,12 +34,12 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Iprivate.h" #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ -#include "H5MMprivate.h" +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Sprivate.h" /* Dataspaces */ @@ -86,6 +86,7 @@ #define H5D_CHUNK_SELECT_IRREG 2 #define H5D_CHUNK_SELECT_NONE 0 + /******************/ /* Local Typedefs */ /******************/ @@ -95,66 +96,47 @@ typedef struct H5D_chunk_addr_info_t { H5D_chunk_info_t chunk_info; } H5D_chunk_addr_info_t; -/* Combine all information that needs to know for collective MPI-IO of this selection. */ -typedef struct H5D_common_coll_info_t { - hbool_t mbt_is_derived; - hbool_t mft_is_derived; - size_t mpi_buf_count; - haddr_t chunk_addr; -} H5D_common_coll_info_t; - /********************/ /* Local Prototypes */ /********************/ - -static herr_t -H5D_multi_chunk_collective_io(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, - hbool_t do_write); -static herr_t -H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, - hbool_t do_write); - -static herr_t -H5D_link_chunk_collective_io(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, - hbool_t do_write,int sum_chunk); - -static herr_t -H5D_inter_collective_io(H5D_io_info_t *io_info,const H5S_t *file_space, - const H5S_t *mem_space,haddr_t addr, - const void *buf, hbool_t do_write ); - -static herr_t -H5D_final_collective_io(H5D_io_info_t *io_info,MPI_Datatype*mpi_file_type, - MPI_Datatype *mpi_buf_type, - H5D_common_coll_info_t* coll_info, - const void *buf, hbool_t do_write); -static herr_t -H5D_sort_chunk(H5D_io_info_t * io_info, - H5D_chunk_map_t *fm, - H5D_chunk_addr_info_t chunk_addr_info_array[], - int many_chunk_opt); - -static herr_t -H5D_obtain_mpio_mode(H5D_io_info_t* io_info, - H5D_chunk_map_t *fm, - uint8_t assign_io_mode[], - haddr_t chunk_addr[]); - -static herr_t H5D_ioinfo_make_ind(H5D_io_info_t *io_info); -static herr_t H5D_ioinfo_make_coll_opt(H5D_io_info_t *io_info); -static herr_t H5D_ioinfo_make_coll(H5D_io_info_t *io_info); +static herr_t H5D_chunk_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); +static herr_t H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, + H5P_genplist_t *dx_plist); +static herr_t H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist); +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS +static herr_t H5D_link_chunk_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk); +#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ +static herr_t H5D_inter_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, const H5S_t *file_space, + const H5S_t *mem_space); +static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, size_t nelmts, MPI_Datatype *mpi_file_type, + MPI_Datatype *mpi_buf_type); +static herr_t H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, + H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); +static herr_t H5D_obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, + H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]); +static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, + H5FD_mpio_xfer_t xfer_mode); +static herr_t H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, + H5FD_mpio_collective_opt_t coll_opt_mode); static herr_t H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *min_chunkf); static int H5D_cmp_chunk_addr(const void *addr1, const void *addr2); static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, - const H5D_chunk_map_t *fm, int *sum_chunkf); + const H5D_chunk_map_t *fm, int *sum_chunkf); /*********************/ /* Package Variables */ /*********************/ + /*******************/ /* Local Variables */ /*******************/ @@ -175,64 +157,77 @@ static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, *------------------------------------------------------------------------- */ htri_t -H5D_mpio_opt_possible( const H5D_io_info_t *io_info, - const H5S_t *mem_space, const H5S_t *file_space, const H5T_path_t *tpath) +H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, + const H5S_t *mem_space, const H5D_type_info_t *type_info, + const H5D_chunk_map_t *fm) { - int local_opinion = TRUE; /* This process's idea of whether to perform collective I/O or not */ - int consensus; /* Consensus opinion of all processes */ - int mpi_code; /* MPI error code */ - htri_t ret_value=TRUE; + int local_opinion = TRUE; /* This process's idea of whether to perform collective I/O or not */ + int consensus; /* Consensus opinion of all processes */ + int mpi_code; /* MPI error code */ + htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI(H5D_mpio_opt_possible, FAIL); + FUNC_ENTER_NOAPI(H5D_mpio_opt_possible, FAIL) /* Check args */ - assert(io_info); - assert(mem_space); - assert(file_space); + HDassert(io_info); + HDassert(mem_space); + HDassert(file_space); + HDassert(type_info); /* For independent I/O, get out quickly and don't try to form consensus */ - if (io_info->dxpl_cache->xfer_mode==H5FD_MPIO_INDEPENDENT) + if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_INDEPENDENT) HGOTO_DONE(FALSE); + /* Don't allow collective operations if datatype conversions need to happen */ + if(!type_info->is_conv_noop) { + local_opinion = FALSE; + goto broadcast; + } /* end if */ + + /* Don't allow collective operations if data transform operations should occur */ + if(!type_info->is_xform_noop) { + local_opinion = FALSE; + goto broadcast; + } /* end if */ + /* Optimized MPI types flag must be set and it must be collective IO */ /* (Don't allow parallel I/O for the MPI-posix driver, since it doesn't do real collective I/O) */ - if (!(H5S_mpi_opt_types_g && io_info->dxpl_cache->xfer_mode==H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) { + if(!(H5S_mpi_opt_types_g && io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE + && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) { local_opinion = FALSE; goto broadcast; } /* end if */ /* Check whether these are both simple or scalar dataspaces */ - if (!((H5S_SIMPLE==H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR==H5S_GET_EXTENT_TYPE(mem_space)) - && (H5S_SIMPLE==H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR==H5S_GET_EXTENT_TYPE(file_space)))) { + if(!((H5S_SIMPLE == H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(mem_space)) + && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) { local_opinion = FALSE; goto broadcast; } /* end if */ /* Can't currently handle point selections */ - if (H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(mem_space) || H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(file_space)) { + if(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(mem_space) + || H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(file_space)) { local_opinion = FALSE; goto broadcast; } /* end if */ /* Dataset storage must be contiguous or chunked */ - if (!(io_info->dset->shared->layout.type == H5D_CONTIGUOUS || + if(!(io_info->dset->shared->layout.type == H5D_CONTIGUOUS || io_info->dset->shared->layout.type == H5D_CHUNKED)) { local_opinion = FALSE; goto broadcast; } /* end if */ - /* The handling of memory space is different for chunking - and contiguous storage, - For contigous storage, mem_space and file_space won't - change when it it is doing disk IO. - For chunking storage, mem_space will change for different - chunks. So for chunking storage, whether we can use - collective IO will defer until each chunk IO is reached. - For contiguous storage, if we find MPI-IO cannot - support complicated MPI derived data type and the shape - of data space is not regular, we will - set use_par_opt_io = FALSE. - */ + /* The handling of memory space is different for chunking and contiguous + * storage. For contiguous storage, mem_space and file_space won't change + * when it it is doing disk IO. For chunking storage, mem_space will + * change for different chunks. So for chunking storage, whether we can + * use collective IO will defer until each chunk IO is reached. For + * contiguous storage, if we find MPI-IO cannot support complicated MPI + * derived data type and the shape of data space is not regular, we will + * set use_par_opt_io = FALSE. + */ #ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS if(io_info->dset->shared->layout.type == H5D_CONTIGUOUS) if((H5S_SELECT_IS_REGULAR(file_space) != TRUE) || @@ -243,81 +238,43 @@ H5D_mpio_opt_possible( const H5D_io_info_t *io_info, #endif /* Don't allow collective operations if filters need to be applied */ - if(io_info->dset->shared->layout.type == H5D_CHUNKED) - if(io_info->dset->shared->dcpl_cache.pline.nused>0) { + if(io_info->dset->shared->layout.type == H5D_CHUNKED) { + if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { local_opinion = FALSE; goto broadcast; } /* end if */ - /* Don't allow collective operations if datatype conversions need to happen */ - if(!H5T_path_noop(tpath)) { - local_opinion = FALSE; - goto broadcast; - } /* end if */ - - /* Don't allow collective operations if data transform operations should occur */ - if(!H5Z_xform_noop(io_info->dxpl_cache->data_xform_prop)) { - local_opinion = FALSE; - goto broadcast; +/* If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS and H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS + * are defined, the HDF5 library will do collective IO if the application + * asks for it. + * + * If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS is not defined and one or more + * processes are not participating in the IO, then collective IO is not + * assured. The library will check each process for the number of chunks + * it involves. If any process involves zero chunks, the library will use + * independent IO mode instead. + */ +#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS + /* Check the number of chunks to perform I/O on */ + if(0 == H5SL_count(fm->sel_chunks)) { + local_opinion = FALSE; + goto broadcast; + } /* end if */ +#endif /* H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ } /* end if */ broadcast: /* Form consensus opinion among all processes about whether to perform - * collective I/O */ - if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_opinion, &consensus, 1, MPI_INT, MPI_LAND, io_info->comm))) + * collective I/O + */ + if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_opinion, &consensus, 1, MPI_INT, MPI_LAND, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) ret_value = consensus > 0 ? TRUE : FALSE; done: - FUNC_LEAVE_NOAPI(ret_value); -} /* H5D_mpio_opt_possible() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_mpio_chunk_adjust_iomode - * - * Decription: If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS and - H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS are defined, - the HDF5 library will do collective IO if the application asks for it. - - If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS is not defined - and one or more processes are not participating in the IO, - then collective IO is not assured. The library will check - each process for the - number of chunks it involves. If any process involves zero chunks, - the library will use independent IO mode instead. - This function is only used for linked chunk IO. - * Purpose: Checks if it is possible to do collective IO - * - * Return: Success: Non-negative: TRUE or FALSE - * Failure: Negative - * - * Programmer: Muqun Yang - * Monday, Feb. 13th, 2006 - * - *------------------------------------------------------------------------- - */ -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS -herr_t -H5D_mpio_chunk_adjust_iomode(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm) -{ - int min_chunk; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_chunk_adjust_iomode) - - if(H5D_mpio_get_min_chunk(io_info,fm,&min_chunk) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to obtain the min chunk number of all processes"); - if(min_chunk == 0) { - /* Switch to independent I/O */ - if(H5D_ioinfo_make_ind(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") - } /* end if */ -done: FUNC_LEAVE_NOAPI(ret_value) -} -#endif +} /* H5D_mpio_opt_possible() */ /*------------------------------------------------------------------------- @@ -332,23 +289,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mpio_select_read(H5D_io_info_t *io_info, - size_t mpi_buf_count, - const size_t UNUSED elmt_size, - const H5S_t UNUSED *file_space, - const H5S_t UNUSED *mem_space, - haddr_t addr, - void UNUSED *pointer, - void *buf/*out*/) +H5D_mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, + hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) { + const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5D_mpio_select_read,FAIL); + FUNC_ENTER_NOAPI(H5D_mpio_select_read, FAIL) + + H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); + if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->dxpl_id, io_info->u.rbuf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read") - if(H5F_block_read (io_info->dset->oloc.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO,H5E_READERROR,FAIL,"can't finish collective parallel read"); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mpio_select_read() */ @@ -364,32 +318,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mpio_select_write(H5D_io_info_t *io_info, - size_t mpi_buf_count, - const size_t UNUSED elmt_size, - const H5S_t UNUSED *file_space, - const H5S_t UNUSED *mem_space, - haddr_t addr, - void UNUSED *pointer, - const void *buf) +H5D_mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, + hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) { + const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5D_mpio_select_write,FAIL); + FUNC_ENTER_NOAPI(H5D_mpio_select_write, FAIL) /*OKAY: CAST DISCARDS CONST QUALIFIER*/ - if(H5F_block_write (io_info->dset->oloc.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf)<0) - HGOTO_ERROR(H5E_IO,H5E_WRITEERROR,FAIL,"can't finish collective parallel write"); + H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); + if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->dxpl_id, io_info->u.wbuf) < 0) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't finish collective parallel write") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mpio_select_write() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_make_ind + * Function: H5D_ioinfo_xfer_mode * - * Purpose: Switch to MPI independent I/O + * Purpose: Switch to between collective & independent MPI I/O * * Return: Non-negative on success/Negative on failure * @@ -399,42 +349,42 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_make_ind(H5D_io_info_t *io_info) +H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, + H5FD_mpio_xfer_t xfer_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_make_ind) - - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_xfer_mode) - /* Change the xfer_mode to independent, handle the request, - * then set xfer_mode before return. - */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) + /* Change the xfer_mode */ + io_info->dxpl_cache->xfer_mode = xfer_mode; + if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - /* Set the pointers to the non-MPI-specific routines */ - io_info->ops.read = H5D_select_read; - io_info->ops.write = H5D_select_write; + /* Change the "single I/O" function pointers */ + if(xfer_mode == H5FD_MPIO_INDEPENDENT) { + /* Set the pointers to the original, non-MPI-specific routines */ + io_info->io_ops.single_read = io_info->orig.io_ops.single_read; + io_info->io_ops.single_write = io_info->orig.io_ops.single_write; + } /* end if */ + else { + HDassert(xfer_mode == H5FD_MPIO_COLLECTIVE); - /* Indicate that the transfer mode should be restored before returning - * to user. - */ - io_info->xfer_mode_changed=TRUE; + /* Set the pointers to the MPI-specific routines */ + io_info->io_ops.single_read = H5D_mpio_select_read; + io_info->io_ops.single_write = H5D_mpio_select_write; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_make_ind() */ +} /* end H5D_ioinfo_xfer_mode() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_make_coll_opt + * Function: H5D_ioinfo_coll_opt_mode * - * Purpose: Switch to MPI independent I/O with file set view + * Purpose: Switch between using collective & independent MPI I/O w/file + * set view * * Return: Non-negative on success/Negative on failure * @@ -444,87 +394,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_make_coll_opt(H5D_io_info_t *io_info) +H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, + H5FD_mpio_collective_opt_t coll_opt_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_make_coll_opt) + FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_coll_opt_mode) - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Change the optimial xfer_mode to independent, handle the request, - * then set xfer_mode before return. - */ - io_info->dxpl_cache->xfer_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_OPT_MODE_NAME, &io_info->dxpl_cache->xfer_opt_mode) < 0) + /* Change the optimal xfer_mode */ + io_info->dxpl_cache->coll_opt_mode = coll_opt_mode; + if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->dxpl_cache->coll_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - /* Set the pointers to the non-MPI-specific routines */ - io_info->ops.read = H5D_mpio_select_read; - io_info->ops.write = H5D_mpio_select_write; - - /* Indicate that the transfer mode should be restored before returning - * to user. - */ - io_info->xfer_opt_mode_changed = TRUE; - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_make_coll_opt() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_ioinfo_make_coll - * - * Purpose: Switch to MPI collective I/O - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, August 12, 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D_ioinfo_make_coll(H5D_io_info_t *io_info) -{ - H5P_genplist_t *dx_plist; /* Data transer property list */ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_make_coll) - - /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Change the xfer_mode to independent, handle the request, - * then set xfer_mode before return. - */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_COLLECTIVE; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - - io_info->dxpl_cache->xfer_opt_mode = H5FD_MPIO_COLLECTIVE_IO; - if(H5P_set (dx_plist, H5D_XFER_IO_XFER_OPT_MODE_NAME, &io_info->dxpl_cache->xfer_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - - - /* Set the pointers to the MPI-specific routines */ - io_info->ops.read = H5D_mpio_select_read; - io_info->ops.write = H5D_mpio_select_write; - - /* Indicate that the transfer mode should _NOT_ be restored before returning - * to user. - */ - io_info->xfer_mode_changed=FALSE; - io_info->xfer_opt_mode_changed=FALSE; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_make_coll() */ +} /* end H5D_ioinfo_coll_opt_mode() */ /*------------------------------------------------------------------------- @@ -535,29 +419,30 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, - const H5D_chunk_map_t *fm, int *min_chunkf) +H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, + int *min_chunkf) { int num_chunkf; /* Number of chunks to iterate over */ int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_min_chunk); + FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_min_chunk) /* Get the number of chunks to perform I/O on */ num_chunkf = H5SL_count(fm->sel_chunks); /* Determine the minimum # of chunks for all processes */ - if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, min_chunkf, 1, MPI_INT, MPI_MIN, io_info->comm))) + if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, min_chunkf, 1, MPI_INT, MPI_MIN, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mpio_get_min_chunk() */ @@ -569,221 +454,252 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, - const H5D_chunk_map_t *fm, int *sum_chunkf) +H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, + int *sum_chunkf) { int num_chunkf; /* Number of chunks to iterate over */ size_t ori_num_chunkf; int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_sum_chunk); + FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_sum_chunk) /* Get the number of chunks to perform I/O on */ num_chunkf = 0; ori_num_chunkf = H5SL_count(fm->sel_chunks); - H5_ASSIGN_OVERFLOW(num_chunkf,ori_num_chunkf,size_t,int); + H5_ASSIGN_OVERFLOW(num_chunkf, ori_num_chunkf, size_t, int); /* Determine the summation of number of chunks for all processes */ - if (MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm))) + if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mpio_get_sum_chunk() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_collective_io + * Function: H5D_contig_collective_read * - * Purpose: Wrapper Routine for H5D_inter_collective_io - The starting file address of contiguous layout - will be calculated and passed to H5D_inter_collective_io routine. - * + * Purpose: Reads directly from contiguous data in file into application + * memory using collective I/O. * * Return: Non-negative on success/Negative on failure * - * Programmer: - * - * Modifications: + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- */ herr_t -H5D_contig_collective_io(H5D_io_info_t *io_info, - const H5S_t *file_space, - const H5S_t *mem_space, - const void *buf, - hbool_t do_write) +H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t UNUSED *fm) { + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_NOAPI(H5D_contig_collective_read, FAIL) - haddr_t addr = HADDR_UNDEF; /* Address of dataset (or selection) within file */ - herr_t ret_value = SUCCEED; /* return value */ + /* Sanity check */ + HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); + HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER)); + + /* Call generic internal collective I/O routine */ + if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_collective_io) - assert (IS_H5FD_MPIO(io_info->dset->oloc.file)); +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_contig_collective_read() */ - /* Make certain we have the correct type of property list */ - assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); + +/*------------------------------------------------------------------------- + * Function: H5D_contig_collective_write + * + * Purpose: Write directly to contiguous data in file from application + * memory using collective I/O. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t UNUSED *fm) +{ + herr_t ret_value = SUCCEED; /* Return value */ - /* Get the base address of the contiguous dataset */ - if(io_info->dset->shared->layout.type == H5D_CONTIGUOUS) - addr = H5D_contig_get_addr(io_info->dset); + FUNC_ENTER_NOAPI(H5D_contig_collective_write, FAIL) - if(H5D_inter_collective_io(io_info,file_space,mem_space,addr,buf,do_write)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - - done: + /* Sanity check */ + HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); + HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER)); + /* Call generic internal collective I/O routine */ + if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") + +done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_collective_io */ +} /* end H5D_contig_collective_write() */ /*------------------------------------------------------------------------- * Function: H5D_chunk_collective_io * * Purpose: Routine for - 1) choose an IO option: - a) One collective IO defined by one MPI derived datatype to link through all chunks - or b) multiple chunk IOs,to do MPI-IO for each chunk, the IO mode may be adjusted - due to the selection pattern for each chunk. + * 1) choose an IO option: + * a) One collective IO defined by one MPI derived datatype to link through all chunks + * or b) multiple chunk IOs,to do MPI-IO for each chunk, the IO mode may be adjusted + * due to the selection pattern for each chunk. * For option a) - 1. Sort the chunk address, obtain chunk info according to the sorted chunk address - 2. Build up MPI derived datatype for each chunk - 3. Build up the final MPI derived datatype - 4. Set up collective IO property list - 5. Do IO + * 1. Sort the chunk address, obtain chunk info according to the sorted chunk address + * 2. Build up MPI derived datatype for each chunk + * 3. Build up the final MPI derived datatype + * 4. Set up collective IO property list + * 5. Do IO * For option b) - 1. Use MPI_gather and MPI_Bcast to obtain information of *collective/independent/none* - IO mode for each chunk of the selection - 2. Depending on whether the IO mode is collective or independent or none, - Create either MPI derived datatype for each chunk to do collective IO or - just do independent IO or independent IO with file set view - 3. Set up collective IO property list for collective mode - 4. DO IO + * 1. Use MPI_gather and MPI_Bcast to obtain information of *collective/independent/none* + * IO mode for each chunk of the selection + * 2. Depending on whether the IO mode is collective or independent or none, + * Create either MPI derived datatype for each chunk to do collective IO or + * just do independent IO or independent IO with file set view + * 3. Set up collective IO property list for collective mode + * 4. DO IO * * Return: Non-negative on success/Negative on failure * - * Programmer: - * - * Modifications: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ -herr_t -H5D_chunk_collective_io(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, hbool_t do_write) +static herr_t +H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + H5D_chunk_map_t *fm) { - - int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; - int sum_chunk = 0,mpi_size; - unsigned one_link_chunk_io_threshold; - H5P_genplist_t *plist; + H5P_genplist_t *dx_plist; /* Pointer to DXPL */ H5FD_mpio_chunk_opt_t chunk_opt_mode; - + int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; + int sum_chunk = -1; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - htri_t check_prop,temp_not_link_io = FALSE; - int new_value; + htri_t temp_not_link_io = FALSE; #endif - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_collective_io) - assert (IS_H5FD_MPIO(io_info->dset->oloc.file)); + /* Sanity checks */ + HDassert(io_info); + HDassert(io_info->using_mpi_vfd); + HDassert(type_info); + HDassert(fm); /* Obtain the data transfer properties */ - if(NULL == (plist = H5I_object(io_info->dxpl_id))) + if(NULL == (dx_plist = H5I_object(io_info->dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + /* Check the optional property list on what to do with collective chunk IO. */ - chunk_opt_mode=(H5FD_mpio_chunk_opt_t)H5P_peek_unsigned(plist,H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME); - + chunk_opt_mode = (H5FD_mpio_chunk_opt_t)H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME); if(chunk_opt_mode == H5FD_MPIO_CHUNK_ONE_IO) - io_option = H5D_ONE_LINK_CHUNK_IO;/*no opt*/ + io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ else if(chunk_opt_mode == H5FD_MPIO_CHUNK_MULTI_IO) - io_option = H5D_MULTI_CHUNK_IO;/*no opt */ + io_option = H5D_MULTI_CHUNK_IO; /*no opt */ else { - if(H5D_mpio_get_sum_chunk(io_info,fm,&sum_chunk)<0) + unsigned one_link_chunk_io_threshold; /* Threshhold to use single collective I/O for all chunks */ + int mpi_size; /* Number of processes in MPI job */ + + if(H5D_mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to obtain the total chunk number of all processes"); - if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file))<0) - HGOTO_ERROR (H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size"); + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - if(NULL == (plist = H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - one_link_chunk_io_threshold =H5P_peek_unsigned(plist,H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME); + one_link_chunk_io_threshold = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME); - /* step 1: choose an IO option */ - /* If the average number of chunk per process is greater than a threshold, we will do one link chunked IO. */ - if((unsigned)sum_chunk/mpi_size >= one_link_chunk_io_threshold) + /* step 1: choose an IO option */ + /* If the average number of chunk per process is greater than a threshold, we will do one link chunked IO. */ + if((unsigned)sum_chunk / mpi_size >= one_link_chunk_io_threshold) io_option = H5D_ONE_LINK_CHUNK_IO_MORE_OPT; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - else - temp_not_link_io = TRUE; + else + temp_not_link_io = TRUE; +#endif + } /* end else */ + +#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS + if(io_option == H5D_ONE_LINK_CHUNK_IO) + io_option = H5D_MULTI_CHUNK_IO; /* We can not do this with one chunk IO. */ + if(io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) + io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; #endif - } #ifdef H5_HAVE_INSTRUMENTED_LIBRARY +{ + htri_t check_prop; + int new_value; + /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); if(check_prop > 0) { if(io_option == H5D_ONE_LINK_CHUNK_IO) { - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); - } - } - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ + } /* end if */ + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); if(check_prop > 0) { - if(io_option == H5D_MULTI_CHUNK_IO) { - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); - } - } - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); + if(io_option == H5D_MULTI_CHUNK_IO) { + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ + } /* end if */ + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); if(check_prop > 0) { - if(io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) { - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); - } - } - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); + if(io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) { + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ + } /* end if */ + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); if(check_prop > 0) { - if(temp_not_link_io){ - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); - } - } -#endif - -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - if(io_option == H5D_ONE_LINK_CHUNK_IO ) - io_option = H5D_MULTI_CHUNK_IO ;/* We can not do this with one chunk IO. */ - if(io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) - io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; + if(temp_not_link_io) { + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ + } /* end if */ +} #endif /* step 2: Go ahead to do IO.*/ +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS if(io_option == H5D_ONE_LINK_CHUNK_IO || io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) { - if(H5D_link_chunk_collective_io(io_info,fm,buf,do_write,sum_chunk)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish linked chunk MPI-IO"); - } - else if(io_option == H5D_MULTI_CHUNK_IO) { - if(H5D_multi_chunk_collective_io_no_opt(io_info,fm,buf,do_write)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish multiple chunk MPI-IO"); - } + if(H5D_link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") + } /* end if */ + else +#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ + if(io_option == H5D_MULTI_CHUNK_IO) { + if(H5D_multi_chunk_collective_io_no_opt(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish multiple chunk MPI-IO") + } /* end if */ else { /*multiple chunk IOs with opt */ - if(H5D_multi_chunk_collective_io(io_info,fm,buf,do_write)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish multiple chunk MPI-IO"); - } + if(H5D_multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -791,459 +707,583 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_link_chunk_collective_io + * Function: H5D_chunk_collective_read * - * Purpose: Routine for one collective IO with one MPI derived datatype to link with all chunks + * Purpose: Reads directly from chunks in file into application memory + * using collective I/O. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t *fm) +{ + herr_t ret_value = SUCCEED; /* Return value */ - 1. Sort the chunk address and chunk info - 2. Build up MPI derived datatype for each chunk - 3. Build up the final MPI derived datatype - 4. Use common collective IO routine to do MPI-IO + FUNC_ENTER_NOAPI(H5D_chunk_collective_read, FAIL) + /* Call generic selection operation */ + if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_collective_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_chunk_collective_write * - * Return: Non-negative on success/Negative on failure + * Purpose: Write directly to chunks in file from application memory + * using collective I/O. * - * Programmer: + * Return: Non-negative on success/Negative on failure * - * Modifications: + * Programmer: Quincey Koziol + * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- */ +herr_t +H5D_chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, + H5D_chunk_map_t *fm) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5D_chunk_collective_write, FAIL) + + /* Call generic selection operation */ + if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_chunk_collective_write() */ +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS + +/*------------------------------------------------------------------------- + * Function: H5D_link_chunk_collective_io + * + * Purpose: Routine for one collective IO with one MPI derived datatype to link with all chunks + * + * 1. Sort the chunk address and chunk info + * 2. Build up MPI derived datatype for each chunk + * 3. Build up the final MPI derived datatype + * 4. Use common collective IO routine to do MPI-IO + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 + * + *------------------------------------------------------------------------- + */ static herr_t -H5D_link_chunk_collective_io(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, hbool_t do_write,int sum_chunk) +H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + H5D_chunk_map_t *fm, int sum_chunk) { - size_t src_type_size; /*size of source type */ - size_t dst_type_size; /*size of destination type*/ - hsize_t mpi_buf_extra_offset; - hsize_t mpi_file_extra_offset; - size_t mpi_buf_count; - size_t mpi_file_count; - hbool_t mbt_is_derived=0, /* Whether the buffer (memory) type is derived and needs to be free'd */ - mft_is_derived=0; /* Whether the file type is derived and needs to be free'd */ - - int mpi_size,mpi_code; /* MPI return code */ - - int i,num_chunk=0,total_chunks; - size_t ori_num_chunk; - hsize_t ori_total_chunks; - haddr_t chunk_base_addr; - haddr_t* total_chunk_addr_array=NULL; - MPI_Datatype *chunk_mtype=NULL; - MPI_Datatype *chunk_ftype=NULL; - MPI_Datatype chunk_final_mtype; - MPI_Datatype chunk_final_ftype; - MPI_Aint *chunk_disp_array=NULL; - MPI_Aint *chunk_mem_disp_array=NULL; - int *blocklen=NULL; - int blocklen_value; - int actual_bsearch_coll_chunk_threshold; - int bsearch_coll_chunk_threshold; - int many_chunk_opt = 0; - - H5D_common_coll_info_t coll_info; - H5D_chunk_addr_info_t* chunk_addr_info_array=NULL; - - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5D_link_chunk_collective_io) - ori_total_chunks = fm->total_chunks; - H5_ASSIGN_OVERFLOW(total_chunks,ori_total_chunks,hsize_t,int); - - /* Handle with a special case when only one chunk is covered by all processes */ - if(total_chunks == 1){ - H5SL_node_t *chunk_node; - H5D_chunk_info_t *chunk_info; - H5D_storage_t store; + H5D_chunk_addr_info_t *chunk_addr_info_array = NULL; + hbool_t mbt_is_derived = FALSE; + hbool_t mft_is_derived = FALSE; + MPI_Datatype chunk_final_mtype; /* Final memory MPI datatype for all chunks with seletion */ + MPI_Datatype chunk_final_ftype; /* Final file MPI datatype for all chunks with seletion */ + H5D_storage_t ctg_store; /* Storage info for "fake" contiguous dataset */ + size_t total_chunks; + haddr_t *total_chunk_addr_array = NULL; + MPI_Datatype *chunk_mtype = NULL; + MPI_Datatype *chunk_ftype = NULL; + MPI_Aint *chunk_disp_array = NULL; + MPI_Aint *chunk_mem_disp_array = NULL; + int *blocklen = NULL; + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT(H5D_link_chunk_collective_io) + + /* Get the sum # of chunks, if not already available */ + if(sum_chunk < 0) { + if(H5D_mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to obtain the total chunk number of all processes"); + } /* end if */ + + /* Retrieve total # of chunks in dataset */ + H5_ASSIGN_OVERFLOW(total_chunks, fm->total_chunks, hsize_t, size_t); + + /* Handle special case when dataspace dimensions only allow one chunk in + * the dataset. [This sometimes is used by developers who want the + * equivalent of compressed contiguous datasets - QAK] + */ + if(total_chunks == 1) { + H5D_storage_t chk_store; /* Temporary storage info for chunk address lookup */ + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */ + H5SL_node_t *chunk_node; /* Pointer to chunk node for selection */ + H5S_t *fspace; /* Dataspace describing chunk & selection in it */ + H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ + + /* Initialize the chunk coordinates */ + /* (must be all zero, since there's only one chunk) */ + HDmemset(coords, 0, sizeof(coords)); + + /* Look up address of chunk */ + io_info->store = &chk_store; + chk_store.chunk.offset = coords; + chk_store.chunk.index = 0; + if(HADDR_UNDEF == (ctg_store.contig.dset_addr = H5D_istore_get_addr(io_info, NULL))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") + /* Check for this process having selection in this chunk */ chunk_node = H5SL_first(fm->sel_chunks); if(chunk_node == NULL) { - if(H5D_istore_chunkmap(io_info, &chunk_base_addr, fm->down_chunks) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); - if(H5D_inter_collective_io(io_info,NULL,NULL,chunk_base_addr,buf,do_write)<0) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - } + /* Set the dataspace info for I/O to NULL, this process doesn't have any I/O to perform */ + fspace = mspace = NULL; + } /* end if */ else { - if(NULL ==(chunk_info = H5SL_item(chunk_node))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - io_info->store = &store; - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; + H5D_chunk_info_t *chunk_info; + + /* Get the chunk info, for the selection in the chunk */ + if(NULL == (chunk_info = H5SL_item(chunk_node))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") + + /* Set the dataspace info for I/O */ + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + } /* end else */ + + /* Set up the base storage address for this chunk */ + io_info->store = &ctg_store; - if(HADDR_UNDEF==(chunk_base_addr = H5D_istore_get_addr(io_info,NULL))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"before inter_collective_io for total chunk = 1 \n"); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"before inter_collective_io for total chunk = 1 \n"); #endif - if(H5D_inter_collective_io(io_info,chunk_info->fspace,chunk_info->mspace,chunk_base_addr,buf,do_write)<0) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - } - goto done; - } - /* Allocate chunking information */ - ori_num_chunk = H5SL_count(fm->sel_chunks); - H5_ASSIGN_OVERFLOW(num_chunk,ori_num_chunk,size_t,int); + /* Perform I/O */ + if(H5D_inter_collective_io(io_info, type_info, fspace, mspace) < 0) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") + } /* end if */ + else { + size_t mpi_buf_count; /* Number of MPI types */ + size_t num_chunk; /* Number of chunks for this process */ + size_t u; /* Local index variable */ + + /* Get the number of chunks with a selection */ + num_chunk = H5SL_count(fm->sel_chunks); + H5_CHECK_OVERFLOW(num_chunk, size_t, int); #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"total_chunks = %d\n",(int)total_chunks); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"total_chunks = %Zu, num_chunk = %Zu\n", total_chunks, num_chunk); #endif - - if(num_chunk == 0) - total_chunk_addr_array = H5MM_malloc(sizeof(haddr_t)*total_chunks); - else - { - chunk_addr_info_array= H5MM_malloc(num_chunk*sizeof(H5D_chunk_addr_info_t)); - chunk_mtype = H5MM_malloc(num_chunk*sizeof(MPI_Datatype)); - chunk_ftype = H5MM_malloc(num_chunk*sizeof(MPI_Datatype)); - chunk_disp_array = H5MM_malloc(num_chunk*sizeof(MPI_Aint)); - chunk_mem_disp_array = H5MM_calloc(num_chunk*sizeof(MPI_Aint)); - blocklen = H5MM_malloc(num_chunk*sizeof(int)); - } - - /* Obtain information to do collective IO, - in order to do collective IO, no datatype conversion should happen. */ - if((src_type_size = H5T_get_size(io_info->dset->shared->type))==0) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid"); - dst_type_size = src_type_size; - - bsearch_coll_chunk_threshold = H5D_ALL_CHUNK_ADDR_THRES_COL; - - if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file))<0) - HGOTO_ERROR (H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size"); - - /* Calculate the actual threshold to obtain all chunk addresses collectively - The bigger this number is, the more possible the use of obtaining chunk address collectively. */ - /* For non-optimization one-link IO, - actual bsearch threshold is always 0, - we would always want to obtain the chunk addresses individually - for each process. */ - actual_bsearch_coll_chunk_threshold = sum_chunk*100/(total_chunks*mpi_size); - - if((actual_bsearch_coll_chunk_threshold > bsearch_coll_chunk_threshold) - &&(sum_chunk/mpi_size >= H5D_ALL_CHUNK_ADDR_THRES_COL_NUM)) - many_chunk_opt = H5D_OBTAIN_ALL_CHUNK_ADDR_COL; + + /* Set up MPI datatype for chunks selected */ + if(num_chunk) { + hsize_t mpi_mem_extra_offset; /* Extra offset for memory MPI datatype */ + hsize_t mpi_file_extra_offset; /* Extra offset for file MPI datatype */ + size_t mpi_mem_count; /* Memory MPI datatype count */ + size_t mpi_file_count; /* File MPI datatype count */ + hbool_t locl_mbt_is_derived = FALSE, /* Whether the buffer (memory) type is derived and needs to be free'd */ + local_mft_is_derived = FALSE; /* Whether the file type is derived and needs to be free'd */ + int blocklen_value; /* Placeholder for array fill */ + + /* Allocate chunking information */ + chunk_addr_info_array= H5MM_malloc(num_chunk * sizeof(H5D_chunk_addr_info_t)); + chunk_mtype = H5MM_malloc(num_chunk * sizeof(MPI_Datatype)); + chunk_ftype = H5MM_malloc(num_chunk * sizeof(MPI_Datatype)); + chunk_disp_array = H5MM_malloc(num_chunk * sizeof(MPI_Aint)); + chunk_mem_disp_array = H5MM_calloc(num_chunk * sizeof(MPI_Aint)); + blocklen = H5MM_malloc(num_chunk * sizeof(int)); #ifdef H5D_DEBUG - if(H5DEBUG(D)) +if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"before sorting the chunk address \n"); #endif - - /* Sort the chunk address - when chunk optimization selection is either H5D_OBTAIN_*/ - - if(num_chunk == 0){ /* special case: this process doesn't select anything */ - if(H5D_istore_chunkmap(io_info, total_chunk_addr_array, fm->down_chunks)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); - chunk_base_addr = total_chunk_addr_array[0]; - } - - else { - if(H5D_sort_chunk(io_info,fm,chunk_addr_info_array,many_chunk_opt)<0) - HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to sort chunk address"); - chunk_base_addr = chunk_addr_info_array[0].chunk_addr; - } + /* Sort the chunk address */ + if(H5D_sort_chunk(io_info, fm, chunk_addr_info_array, sum_chunk) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to sort chunk address") + ctg_store.contig.dset_addr = chunk_addr_info_array[0].chunk_addr; #ifdef H5D_DEBUG - if(H5DEBUG(D)) +if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"after sorting the chunk address \n"); #endif - - /* Obtain MPI derived datatype from all individual chunks */ - for ( i = 0; i < num_chunk; i++) { - /* Disk MPI derived datatype */ - if(H5S_mpio_space_type(chunk_addr_info_array[i].chunk_info.fspace,src_type_size,&chunk_ftype[i], - &mpi_file_count,&mpi_file_extra_offset,&mft_is_derived)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type"); - - /* Buffer MPI derived datatype */ - if(H5S_mpio_space_type(chunk_addr_info_array[i].chunk_info.mspace,dst_type_size,&chunk_mtype[i], - &mpi_buf_count,&mpi_buf_extra_offset,&mbt_is_derived)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buf type"); - - /* Chunk address relative to the first chunk */ - chunk_addr_info_array[i].chunk_addr -= chunk_base_addr; - H5_ASSIGN_OVERFLOW(chunk_disp_array[i],chunk_addr_info_array[i].chunk_addr,haddr_t,MPI_Aint); - } - - blocklen_value = 1; - if(num_chunk){ - - /* initialize the buffer with the constant value 1; this algo. is very fast. */ - H5V_array_fill(blocklen,&blocklen_value,sizeof(int),(size_t)num_chunk); - - /* Create final MPI derived datatype */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_struct(num_chunk,blocklen,chunk_disp_array,chunk_ftype,&chunk_final_ftype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_ftype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - - if(MPI_SUCCESS != (mpi_code = MPI_Type_struct(num_chunk,blocklen,chunk_mem_disp_array,chunk_mtype,&chunk_final_mtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_mtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - - for ( i = 0; i< num_chunk;i++){ - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( chunk_mtype+i ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( chunk_ftype+i ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } - - /* buffer, file derived datatypes should be true */ - coll_info.mbt_is_derived = 1; - coll_info.mft_is_derived = 1; - coll_info.mpi_buf_count = 1; - coll_info.chunk_addr = chunk_base_addr; - - } - - else {/* no selection at all for this process */ - chunk_final_ftype = MPI_BYTE; - chunk_final_mtype = MPI_BYTE; - - /* buffer, file derived datatypes should be true */ - coll_info.mbt_is_derived = 0; - coll_info.mft_is_derived = 0; - coll_info.mpi_buf_count = 0; - coll_info.chunk_addr = chunk_base_addr; - } + + /* Obtain MPI derived datatype from all individual chunks */ + for(u = 0; u < num_chunk; u++) { + /* Disk MPI derived datatype */ + if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.fspace, + type_info->src_type_size, &chunk_ftype[u], &mpi_file_count, + &mpi_file_extra_offset, &local_mft_is_derived) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") + + /* Buffer MPI derived datatype */ + if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.mspace, + type_info->dst_type_size, &chunk_mtype[u], &mpi_mem_count, + &mpi_mem_extra_offset, &locl_mbt_is_derived) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buf type") + + /* Chunk address relative to the first chunk */ + chunk_addr_info_array[u].chunk_addr -= ctg_store.contig.dset_addr; + H5_ASSIGN_OVERFLOW(chunk_disp_array[u], chunk_addr_info_array[u].chunk_addr, haddr_t, MPI_Aint); + } /* end for */ + + /* Initialize the buffer with the constant value 1 */ + blocklen_value = 1; + H5V_array_fill(blocklen, &blocklen_value, sizeof(int), num_chunk); + + /* Create final MPI derived datatype for the file */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_struct((int)num_chunk, blocklen, chunk_disp_array, chunk_ftype, &chunk_final_ftype))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_ftype))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + /* Create final MPI derived datatype for memory */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_struct(num_chunk, blocklen, chunk_mem_disp_array, chunk_mtype, &chunk_final_mtype))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_final_mtype))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + /* Free the file & memory MPI datatypes for each chunk */ + for(u = 0; u < num_chunk; u++) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_free(chunk_mtype + u))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + + if(MPI_SUCCESS != (mpi_code = MPI_Type_free(chunk_ftype + u))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + } /* end for */ + + /* buffer, file derived datatypes should be true */ + mbt_is_derived = TRUE; + mft_is_derived = TRUE; + mpi_buf_count = (size_t)1; + } /* end if */ + else { /* no selection at all for this process */ + /* Allocate chunking information */ + total_chunk_addr_array = H5MM_malloc(sizeof(haddr_t) * total_chunks); + + /* Retrieve chunk address map */ + if(H5D_istore_chunkmap(io_info, total_chunk_addr_array, fm->down_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") + + /* Get chunk with lowest address */ + ctg_store.contig.dset_addr = HADDR_MAX; + for(u = 0; u < total_chunks; u++) + if(total_chunk_addr_array[u] < ctg_store.contig.dset_addr) + ctg_store.contig.dset_addr = total_chunk_addr_array[u]; + HDassert(ctg_store.contig.dset_addr != HADDR_MAX); + + /* Set the MPI datatype */ + chunk_final_ftype = MPI_BYTE; + chunk_final_mtype = MPI_BYTE; + + /* buffer, file derived datatypes should be true */ + mpi_buf_count = (size_t)0; + } /* end else */ #ifdef H5D_DEBUG - if(H5DEBUG(D)) +if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"before coming to final collective IO\n"); #endif - if(H5D_final_collective_io(io_info,&chunk_final_ftype,&chunk_final_mtype,&coll_info,buf,do_write)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish MPI-IO"); + /* Set up the base storage address for this chunk */ + io_info->store = &ctg_store; + + /* Perform final collective I/O operation */ + if(H5D_final_collective_io(io_info, type_info, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") + } /* end else */ done: #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"before freeing memory inside H5D_link_collective_io ret_value = %d\n",ret_value); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"before freeing memory inside H5D_link_collective_io ret_value = %d\n", ret_value); #endif - if (fm->total_chunks != 1) { - if(num_chunk == 0) HDfree(total_chunk_addr_array); - else { - HDfree(chunk_addr_info_array); - HDfree(chunk_mtype); - HDfree(chunk_ftype); - HDfree(chunk_disp_array); - HDfree(chunk_mem_disp_array); - HDfree(blocklen); - } - } - FUNC_LEAVE_NOAPI(ret_value) + if(total_chunk_addr_array) + H5MM_xfree(total_chunk_addr_array); + if(chunk_addr_info_array) + H5MM_xfree(chunk_addr_info_array); + if(chunk_mtype) + H5MM_xfree(chunk_mtype); + if(chunk_ftype) + H5MM_xfree(chunk_ftype); + if(chunk_disp_array) + H5MM_xfree(chunk_disp_array); + if(chunk_mem_disp_array) + H5MM_xfree(chunk_mem_disp_array); + if(blocklen) + H5MM_xfree(blocklen); + + /* Free the MPI buf and file types, if they were derived */ + if(mbt_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&chunk_final_mtype))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if(mft_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&chunk_final_ftype))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_link_chunk_collective_io */ +#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /*------------------------------------------------------------------------- * Function: H5D_multi_chunk_collective_io * * Purpose: To do IO per chunk according to IO mode(collective/independent/none) - - 1. Use MPI_gather and MPI_Bcast to obtain IO mode in each chunk(collective/independent/none) - 2. Depending on whether the IO mode is collective or independent or none, - Create either MPI derived datatype for each chunk or just do independent IO - 3. Use common collective IO routine to do MPI-IO * - * Return: Non-negative on success/Negative on failure + * 1. Use MPI_gather and MPI_Bcast to obtain IO mode in each chunk(collective/independent/none) + * 2. Depending on whether the IO mode is collective or independent or none, + * Create either MPI derived datatype for each chunk or just do independent IO + * 3. Use common collective IO routine to do MPI-IO * - * Programmer: + * Return: Non-negative on success/Negative on failure * - * Modifications: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_multi_chunk_collective_io(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, hbool_t do_write) +H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - unsigned i, total_chunk; - hsize_t ori_total_chunk; - uint8_t *chunk_io_option; - - H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - H5D_chunk_info_t *chunk_info=NULL; - haddr_t *chunk_addr; - H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - hbool_t select_chunk; - hbool_t last_io_mode_coll = TRUE; - - void *chunk = NULL; /* Pointer to the data chunk in cache */ - H5D_t *dataset=io_info->dset;/* Local pointer to dataset info */ - H5D_istore_ud1_t udata; /*B-tree pass-through */ - haddr_t caddr; /* Address of the cached chunk */ - size_t accessed_bytes; /*total accessed size in a chunk */ - unsigned idx_hint=0; /* Cache index hint */ - hbool_t dirty = TRUE; /* Flag for cache flushing */ - hbool_t relax=TRUE; /* Whether whole chunk is selected */ - - herr_t ret_value = SUCCEED; + H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */ + H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ + H5D_io_info_t cpt_io_info; /* Compact I/O info object */ + H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ + hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + uint8_t *chunk_io_option = NULL; + haddr_t *chunk_addr = NULL; + H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + H5FD_mpio_xfer_t last_xfer_mode = H5FD_MPIO_COLLECTIVE; /* Last parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + H5FD_mpio_collective_opt_t last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; /* Last parallel transfer with independent IO or collective IO with this mode */ + size_t total_chunk; /* Total # of chunks in dataset */ #ifdef H5Dmpio_DEBUG - int mpi_rank; + int mpi_rank; #endif + size_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io) + FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io) #ifdef H5Dmpio_DEBUG - mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); + mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); #endif - /* Allocate memories */ - ori_total_chunk = fm->total_chunks; - H5_ASSIGN_OVERFLOW(total_chunk,ori_total_chunk,hsize_t,unsigned); - HDassert(total_chunk!=0); - chunk_io_option = (uint8_t *)H5MM_calloc(total_chunk*sizeof(MPI_BYTE)); - chunk_addr = (haddr_t *)H5MM_calloc(total_chunk*sizeof(haddr_t)); + /* Retrieve total # of chunks in dataset */ + H5_ASSIGN_OVERFLOW(total_chunk, fm->total_chunks, hsize_t, size_t); + HDassert(total_chunk != 0); + + /* Allocate memories */ + chunk_io_option = (uint8_t *)H5MM_calloc(total_chunk); + chunk_addr = (haddr_t *)H5MM_calloc(total_chunk * sizeof(haddr_t)); #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"total_chunk %u\n",total_chunk); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D), "total_chunk %Zu\n", total_chunk); #endif - /* obtain IO option for each chunk */ - if(H5D_obtain_mpio_mode(io_info,fm,chunk_io_option,chunk_addr)<0) - HGOTO_ERROR (H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode"); + /* Obtain IO option for each chunk */ + if(H5D_obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode") + + /* Set up contiguous I/O info object */ + HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + ctg_store.contig.dset_size = (hsize_t)io_info->dset->shared->layout.u.chunk.size; + + /* Set up compact I/O info object */ + HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + + /* Set dataset storage for I/O info */ + io_info->store = &store; + + /* Loop over _all_ the chunks */ + for(u = 0; u < total_chunk; u++) { + H5D_chunk_info_t *chunk_info; /* Chunk info for current chunk */ + H5S_t *fspace; /* Dataspace describing chunk & selection in it */ + H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */ - for(i = 0; i < total_chunk; i++) { #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %u\n",mpi_rank,i); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); #endif - select_chunk = fm->select_chunk[i]; - if(select_chunk == 1){/* Have selection elements in this chunk. Find the chunk info. */ - if(NULL ==(chunk_node = H5SL_first(fm->sel_chunks))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk node from skipped list"); - - while(chunk_node){ - if(NULL ==(chunk_info = H5SL_item(chunk_node))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - if(chunk_info->index == i) { - /* Set dataset storage for I/O info */ - io_info->store=&store; - /* Pass in chunk's coordinates in a union. */ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - break; - } - - chunk_node = H5SL_next(chunk_node); - } - } - - if(chunk_io_option[i] == 1){ /*collective IO for this chunk, - note: even there is no selection for this process, - the process still needs to contribute MPI NONE TYPE.*/ + /* Get the chunk info for this chunk, if there are elements selected */ + chunk_info = fm->select_chunk[u]; + + /* Set the storage information for chunks with selections */ + if(chunk_info) { + HDassert(chunk_info->index == u); + + /* Pass in chunk's coordinates in a union. */ + store.chunk.offset = chunk_info->coords; + store.chunk.index = chunk_info->index; + } /* end if */ + + /* Collective IO for this chunk, + * Note: even there is no selection for this process, the process still + * needs to contribute MPI NONE TYPE. + */ + if(chunk_io_option[u] == 1) { #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %u\n",mpi_rank,i); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); #endif - if(!last_io_mode_coll) - /* Switch back to collective I/O */ - if(H5D_ioinfo_make_coll(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + /* Set the file & memory dataspaces */ + if(chunk_info) { + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + } /* end if */ + else { + fspace = mspace = NULL; + } /* end else */ + + /* Switch back to collective I/O */ + if(last_xfer_mode != H5FD_MPIO_COLLECTIVE) { + if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + last_xfer_mode = H5FD_MPIO_COLLECTIVE; + } /* end if */ + if(last_coll_opt_mode != H5FD_MPIO_COLLECTIVE_IO) { + if(H5D_ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; + } /* end if */ - if(select_chunk){ - if(H5D_inter_collective_io(io_info,chunk_info->fspace,chunk_info->mspace, - chunk_addr[i],buf,do_write )<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - - } - else{ - if(H5D_inter_collective_io(io_info,NULL,NULL, - chunk_addr[i],buf,do_write )<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - - } - last_io_mode_coll = TRUE; - - } - else {/*possible independent IO for this chunk*/ + /* Initialize temporary contiguous storage address */ + ctg_store.contig.dset_addr = chunk_addr[u]; + + /* Perform the I/O */ + if(H5D_inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") + } /* end if */ + else { /* possible independent IO for this chunk */ #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %u\n",mpi_rank,i); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); #endif - HDassert(chunk_io_option[i] == 0); + HDassert(chunk_io_option[u] == 0); #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - if(!select_chunk) - continue; /* this process has nothing to do with this chunk, continue! */ - if(last_io_mode_coll) + /* Check if this process has somethign to do with this chunk */ + if(chunk_info) { + H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ + H5D_istore_ud1_t udata; /* B-tree pass-through */ + void *chunk; /* Pointer to the data chunk in cache */ + size_t accessed_bytes; /* Total accessed size in a chunk */ + unsigned idx_hint = 0; /* Cache index hint */ + haddr_t caddr; /* Address of the cached chunk */ + /* Switch to independent I/O */ - if(H5D_ioinfo_make_ind(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") - - /* Load the chunk into cache. But if the whole chunk is written, - * simply allocate space instead of load the chunk. */ - if(HADDR_UNDEF==(caddr = H5D_istore_get_addr(io_info, &udata))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - - if(H5D_istore_if_load(io_info, caddr)) { - accessed_bytes = chunk_info->chunk_points * H5T_get_size(dataset->shared->type); - if((do_write && (accessed_bytes != dataset->shared->layout.u.chunk.size)) || !do_write) - relax=FALSE; - - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, relax, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - if(do_write) { - if((io_info->ops.write)(io_info, - chunk_info->chunk_points,H5T_get_size(io_info->dset->shared->type), - chunk_info->fspace,chunk_info->mspace,caddr,chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") - } - else { - if((io_info->ops.read)(io_info, - chunk_info->chunk_points,H5T_get_size(io_info->dset->shared->type), - chunk_info->fspace,chunk_info->mspace,caddr,chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") - } + if(last_xfer_mode != H5FD_MPIO_INDEPENDENT) { + if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") + last_xfer_mode = H5FD_MPIO_INDEPENDENT; + } /* end if */ - /* Release the cache lock on the chunk. */ - if(chunk) { - if(!do_write) - dirty = FALSE; + /* Load the chunk into cache. But if the whole chunk is written, + * simply allocate space instead of load the chunk. + */ + if(HADDR_UNDEF == (caddr = H5D_istore_get_addr(io_info, &udata))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") - if(H5D_istore_unlock(io_info, dirty, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ -#else - if(!last_io_mode_coll) - /* using independent I/O with file setview.*/ - if(H5D_ioinfo_make_coll_opt(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") - if(select_chunk){ - if(H5D_inter_collective_io(io_info,chunk_info->fspace,chunk_info->mspace, - chunk_addr[i],buf,do_write )<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - } + /* Load the chunk into cache and lock it. */ + if(H5D_chunk_cacheable(io_info, caddr)) { + hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ + + /* Compute # of bytes accessed in chunk */ + accessed_bytes = chunk_info->chunk_points * type_info->src_type_size; + + /* Determine if we will access all the data in the chunk */ + if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size)) + || (io_info->op_type != H5D_IO_OP_WRITE)) + entire_chunk = FALSE; + + /* Lock the chunk into the cache */ + if(NULL == (chunk = H5D_istore_lock(io_info, &udata, entire_chunk, &idx_hint))) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") + + /* Set up the storage buffer information for this chunk */ + cpt_store.compact.buf = chunk; + + /* Point I/O info at contiguous I/O info for this chunk */ + chk_io_info = &cpt_io_info; + } /* end if */ + else { + /* Set up the storage address information for this chunk */ + ctg_store.contig.dset_addr = caddr; + + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at temporary I/O info for this chunk */ + chk_io_info = &ctg_io_info; + } /* end else */ + + if(io_info->op_type == H5D_IO_OP_WRITE) { + if((io_info->io_ops.single_write)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") + } /* end if */ + else { + if((io_info->io_ops.single_read)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") + } /* end else */ + + /* Release the cache lock on the chunk. */ + if(chunk && H5D_istore_unlock(io_info, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + } /* end if */ +#else /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */ + /* Set the file & memory dataspaces */ + if(chunk_info) { + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + } /* end if */ else { - if(H5D_inter_collective_io(io_info,NULL,NULL, - chunk_addr[i],buf,do_write )<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - } + fspace = mspace = NULL; + } /* end else */ + + /* Using independent I/O with file setview.*/ + if(last_coll_opt_mode != H5FD_MPIO_INDIVIDUAL_IO) { + if(H5D_ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to individual I/O") + last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; + } /* end if */ + /* Initialize temporary contiguous storage address */ + ctg_store.contig.dset_addr = chunk_addr[u]; + + /* Perform the I/O */ + if(H5D_inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") #ifdef H5D_DEBUG if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"after inter collective IO\n"); #endif -#endif - last_io_mode_coll = FALSE; - } - } - if(!last_io_mode_coll) - /* Switch back to collective I/O */ - if(H5D_ioinfo_make_coll(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") +#endif /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */ + } /* end else */ + } /* end for */ + done: - HDfree(chunk_io_option); - HDfree(chunk_addr); + if(chunk_io_option) + H5MM_xfree(chunk_io_option); + if(chunk_addr) + H5MM_xfree(chunk_addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_multi_chunk_collective_io */ @@ -1257,90 +1297,105 @@ done: * non-contiguous(or with holes) storage efficiently. * Under this case, the one independent IO call may consist of * many small disk IOs. So we may use independent IO with derived datatype - to replace the independent IO when we find this chunk is not good to - do collective IO. However, according to our performance study, - this approach may not overcome the overhead caused by MPI gather/scatter. - So we decide to leave the original collective IO per chunk approach as - an option for users. NO MPI gather/scatter calls are used. - HDF5 will try to collective IO if possible. - If users choose to use - H5Pset_dxpl_mpio_chunk_opt(dxpl_id,H5FD_MPIO_OPT_MULTI_IO), - this function will be called. - The HDF5 library won't do any IO management but leave it to MPI-IO to figure - out. + * to replace the independent IO when we find this chunk is not good to + * do collective IO. However, according to our performance study, + * this approach may not overcome the overhead caused by MPI gather/scatter. + * So we decide to leave the original collective IO per chunk approach as + * an option for users. NO MPI gather/scatter calls are used. + * HDF5 will try to collective IO if possible. + * If users choose to use + * H5Pset_dxpl_mpio_chunk_opt(dxpl_id,H5FD_MPIO_OPT_MULTI_IO), + * this function will be called. + * The HDF5 library won't do any IO management but leave it to MPI-IO to figure + * out. * * Return: Non-negative on success/Negative on failure * - * Programmer: - * - * Modifications: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info,H5D_chunk_map_t *fm,const void *buf, hbool_t do_write) +H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - int count_chunk,min_num_chunk; - haddr_t chunk_addr; - H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - H5D_chunk_info_t *chunk_info; /* chunk information */ - hbool_t make_ind, make_coll; /* Flags to indicate that the MPI mode should change */ - - void *chunk = NULL; /* Pointer to the data chunk in cache */ - H5D_t *dataset=io_info->dset;/* Local pointer to dataset info */ - H5D_istore_ud1_t udata; /*B-tree pass-through */ - size_t accessed_bytes; /*total accessed size in a chunk */ - unsigned idx_hint=0; /* Cache index hint */ - hbool_t dirty = TRUE; /* Flag for cache flushing */ - hbool_t relax=TRUE; /* Whether whole chunk is selected */ - herr_t ret_value = SUCCEED; - -#ifdef H5Dmpio_DEBUG - int mpi_rank; -#endif + H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */ + H5SL_node_t *chunk_node; /* Current node in chunk skip list */ + H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ + H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ + H5D_io_info_t cpt_io_info; /* Compact I/O info object */ + H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ + hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ + int min_chunk = -1; /* Minimum # of chunks all processes will operate on */ + int count_chunk; /* How many chunks have we operated on? */ + H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io_no_opt) - FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io_no_opt) #ifdef H5D_DEBUG - if(H5DEBUG(D)){ +if(H5DEBUG(D)) { + int mpi_rank; + mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); - HDfprintf(H5DEBUG(D),"coming to multi_chunk_collective_io_no_opt\n"); - } + HDfprintf(H5DEBUG(D), "coming to multi_chunk_collective_io_no_opt\n"); +} #endif - if(H5D_mpio_get_min_chunk(io_info,fm,&min_num_chunk)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get minimum number of chunk"); - count_chunk = 0; - - /* Get first node in chunk skip list */ - chunk_node=H5SL_first(fm->sel_chunks); - - /* Iterate through chunks to be operated on */ - while(chunk_node) { - H5D_chunk_info_t *chunk_info; /* chunk information */ - hbool_t make_ind, make_coll; /* Flags to indicate that the MPI mode should change */ - - /* Get the actual chunk information from the skip list node */ - chunk_info=H5SL_item(chunk_node); - - /* Set dataset storage for I/O info */ - io_info->store=&store; - - /* Pass in chunk's coordinates in a union. */ - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - /* Reset flags for changing parallel I/O mode */ - make_ind = make_coll = FALSE; - - count_chunk++; - /* If the number of chunk is greater than minimum number of chunk, - Do independent read */ - if(count_chunk > min_num_chunk) { - /* Switch to independent I/O (permanently) */ - make_ind = TRUE; - } + /* Set up contiguous I/O info object */ + HDmemcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + ctg_store.contig.dset_size = (hsize_t)io_info->dset->shared->layout.u.chunk.size; + + /* Set up compact I/O info object */ + HDmemcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + + /* Set dataset storage for I/O info */ + io_info->store = &store; + + /* Get the min. # of chunks */ + if(H5D_mpio_get_min_chunk(io_info, fm, &min_chunk) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get minimum number of chunk") + HDassert(min_chunk >= 0); + + /* Get first node in chunk skip list */ + chunk_node = H5SL_first(fm->sel_chunks); + count_chunk = 0; + + /* Iterate through chunks to be operated on */ + while(chunk_node) { + H5D_chunk_info_t *chunk_info; /* chunk information */ + haddr_t chunk_addr; /* Address of chunk in file */ + H5D_istore_ud1_t udata; /* B-tree pass-through */ + hbool_t make_ind, make_coll; /* Flags to indicate that the MPI mode should change */ + /* Get the actual chunk information from the skip list node */ + chunk_info = H5SL_item(chunk_node); + + /* Pass in chunk's coordinates in a union. */ + store.chunk.offset = chunk_info->coords; + store.chunk.index = chunk_info->index; + + /* Reset flags for changing parallel I/O mode */ + make_ind = make_coll = FALSE; + + count_chunk++; + + /* If the number of chunk is greater than minimum number of chunk, + * Do independent read. + */ + if(count_chunk > min_chunk) + /* Switch to independent I/O (permanently) */ + make_ind = TRUE; #ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS /* This case needs to be improved to check if the selected space is regular. If all selections are regular, collective IO can still be done. @@ -1349,67 +1404,92 @@ H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info,H5D_chunk_map_t *fm, we turn off this optimization but leave the following code for future optimization. Otherwise, the following else {} doesn't make sense. KY 2006/8/4/ */ - else { - /* Switch to independent I/O (temporarily) */ - make_ind = TRUE; - make_coll = TRUE; - } /* end else */ + else { + /* Switch to independent I/O (temporarily) */ + make_ind = TRUE; + make_coll = TRUE; + } /* end else */ #endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ + /* Retrieve the chunk's address */ + if(HADDR_UNDEF == (chunk_addr = H5D_istore_get_addr(io_info, &udata))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list") + + /* Independent I/O */ + if(make_ind) { + void *chunk; /* Pointer to the data chunk in cache */ + H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ + size_t accessed_bytes = 0; /* Total accessed size in a chunk */ + unsigned idx_hint = 0; /* Cache index hint */ + /* Switch to independent I/O */ - if(make_ind) - if(H5D_ioinfo_make_ind(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") + if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") - if(HADDR_UNDEF==(chunk_addr = H5D_istore_get_addr(io_info, &udata))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); + /* Load the chunk into cache and lock it. */ + if(H5D_chunk_cacheable(io_info, chunk_addr)) { + hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ - if(make_ind) {/*independent I/O */ - /* Load the chunk into cache. But if the whole chunk is written, - * simply allocate space instead of load the chunk. */ - if(H5D_istore_if_load(io_info, chunk_addr)) { - accessed_bytes = chunk_info->chunk_points * H5T_get_size(dataset->shared->type); - if((do_write && (accessed_bytes != dataset->shared->layout.u.chunk.size)) || !do_write) - relax=FALSE; - - if(NULL == (chunk = H5D_istore_lock(io_info, &udata, relax, &idx_hint))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - } else - chunk = NULL; - - if(do_write) { - if((io_info->ops.write)(io_info, - chunk_info->chunk_points,H5T_get_size(io_info->dset->shared->type), - chunk_info->fspace,chunk_info->mspace, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") - } else { - if((io_info->ops.read)(io_info, - chunk_info->chunk_points,H5T_get_size(io_info->dset->shared->type), - chunk_info->fspace,chunk_info->mspace, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") - } + /* Compute # of bytes accessed in chunk */ + accessed_bytes = chunk_info->chunk_points * type_info->src_type_size; - /* Release the cache lock on the chunk. */ - if(chunk) { - if(!do_write) - dirty = FALSE; + /* Determine if we will access all the data in the chunk */ + if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size)) + || (io_info->op_type != H5D_IO_OP_WRITE)) + entire_chunk = FALSE; + + /* Lock the chunk into the cache */ + if(NULL == (chunk = H5D_istore_lock(io_info, &udata, entire_chunk, &idx_hint))) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - if(H5D_istore_unlock(io_info, dirty, idx_hint, chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ + /* Set up the storage buffer information for this chunk */ + cpt_store.compact.buf = chunk; + + /* Point I/O info at contiguous I/O info for this chunk */ + chk_io_info = &cpt_io_info; } /* end if */ - else { /*collective I/O */ - if(H5D_inter_collective_io(io_info,chunk_info->fspace,chunk_info->mspace, - chunk_addr,buf,do_write ) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO"); - } - - if(make_coll) - if(H5D_ioinfo_make_coll(io_info) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") - /* Get the next chunk node in the skip list */ - chunk_node=H5SL_next(chunk_node); - } /* end while */ + else { + /* Set up the storage address information for this chunk */ + ctg_store.contig.dset_addr = chunk_addr; + + /* No chunk cached */ + chunk = NULL; + + /* Point I/O info at temporary I/O info for this chunk */ + chk_io_info = &ctg_io_info; + } /* end else */ + + if(io_info->op_type == H5D_IO_OP_WRITE) { + if((io_info->io_ops.single_write)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") + } /* end if */ + else { + if((io_info->io_ops.single_read)(chk_io_info, type_info, + (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") + } /* end ese */ + + /* Release the cache lock on the chunk. */ + if(chunk) + if(H5D_istore_unlock(io_info, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") + } /* end if */ + else { /*collective I/O */ + /* Set up the storage address information for this chunk */ + ctg_store.contig.dset_addr = chunk_addr; + + if(H5D_inter_collective_io(&ctg_io_info, type_info, chunk_info->fspace, chunk_info->mspace) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO") + } /* end else */ + + if(make_coll) + if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") + + /* Get the next chunk node in the skip list */ + chunk_node = H5SL_next(chunk_node); + } /* end while */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1420,303 +1500,266 @@ done: * Function: H5D_inter_collective_io * * Purpose: Routine for the shared part of collective IO between multiple chunk - collective IO and contiguous collective IO - + * collective IO and contiguous collective IO * * Return: Non-negative on success/Negative on failure * - * Programmer: - * - * Modifications: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_inter_collective_io(H5D_io_info_t *io_info,const H5S_t *file_space,const H5S_t *mem_space, - haddr_t addr, const void *buf, hbool_t do_write ) +H5D_inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + const H5S_t *file_space, const H5S_t *mem_space) { + size_t mpi_buf_count; /* # of MPI types */ + hbool_t mbt_is_derived = FALSE; + hbool_t mft_is_derived = FALSE; + MPI_Datatype mpi_file_type, mpi_buf_type; + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_inter_collective_io) + + if((file_space != NULL) && (mem_space != NULL)) { + hsize_t mpi_buf_offset, mpi_file_offset; /* Offset within dataset where selection (ie. MPI type) begins */ + size_t mpi_file_count; /* Number of file "objects" to transfer */ - size_t mpi_buf_count, mpi_file_count; /* Number of "objects" to transfer */ - MPI_Datatype mpi_file_type,mpi_buf_type; - hsize_t mpi_buf_offset, mpi_file_offset; /* Offset within dataset where selection (ie. MPI type) begins */ - hbool_t mbt_is_derived=0, /* Whether the buffer (memory) type is derived and needs to be free'd */ - mft_is_derived=0; /* Whether the file type is derived and needs to be free'd */ - H5D_common_coll_info_t coll_info; - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5D_inter_collective_io) - if((file_space!=NULL) && (mem_space != NULL)) { - /*Obtain disk and memory MPI derived datatype */ - if(H5S_mpio_space_type(file_space,H5T_get_size(io_info->dset->shared->type), - &mpi_file_type,&mpi_file_count,&mpi_file_offset,&mft_is_derived)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type"); - - if(H5S_mpio_space_type(mem_space,H5T_get_size(io_info->dset->shared->type), - &mpi_buf_type,&mpi_buf_count,&mpi_buf_offset,&mbt_is_derived)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buffer type"); - - } - else { - /* For non-selection, participate with a none MPI derived datatype, the count is 0. */ - mpi_buf_type = MPI_BYTE; - mpi_file_type = MPI_BYTE; - mpi_file_count = 0; - mpi_buf_count = 0; - } - - coll_info.mbt_is_derived = mbt_is_derived; - coll_info.mft_is_derived = mft_is_derived; - coll_info.mpi_buf_count = mpi_buf_count; - coll_info.chunk_addr = addr; + /* Obtain disk and memory MPI derived datatype */ + if(H5S_mpio_space_type(file_space, type_info->src_type_size, + &mpi_file_type, &mpi_file_count, &mpi_file_offset, &mft_is_derived) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") + if(H5S_mpio_space_type(mem_space, type_info->src_type_size, + &mpi_buf_type, &mpi_buf_count, &mpi_buf_offset, &mbt_is_derived) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type") + } /* end if */ + else { + /* For non-selection, participate with a none MPI derived datatype, the count is 0. */ + mpi_buf_type = MPI_BYTE; + mpi_file_type = MPI_BYTE; + mpi_buf_count = (size_t)0; + mbt_is_derived = FALSE; + mft_is_derived = FALSE; + } /* end else */ #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"before final collective IO \n"); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D),"before final collective IO \n"); #endif - if(H5D_final_collective_io(io_info,&mpi_file_type,&mpi_buf_type,&coll_info,buf,do_write)<0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish collective MPI-IO"); - done: + /* Perform final collective I/O operation */ + if(H5D_final_collective_io(io_info, type_info, mpi_buf_count, &mpi_file_type, &mpi_buf_type) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish collective MPI-IO") + +done: + /* Free the MPI buf and file types, if they were derived */ + if(mbt_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mpi_buf_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if(mft_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mpi_file_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + #ifdef H5D_DEBUG - if(H5DEBUG(D)) +if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"before leaving inter_collective_io ret_value = %d\n",ret_value); #endif - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_inter_collective_io */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_inter_collective_io() */ /*------------------------------------------------------------------------- * Function: H5D_final_collective_io * * Purpose: Routine for the common part of collective IO with different storages. - * * Return: Non-negative on success/Negative on failure * - * Programmer: - * - * Modifications: + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ static herr_t -H5D_final_collective_io(H5D_io_info_t *io_info,MPI_Datatype*mpi_file_type,MPI_Datatype *mpi_buf_type, - H5D_common_coll_info_t* coll_info, const void *buf, hbool_t do_write) +H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + size_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) { - - - int mpi_code; /* MPI return code */ - hbool_t plist_is_setup=0; /* Whether the dxpl has been customized */ - herr_t ret_value = SUCCEED; - + int mpi_code; /* MPI return code */ + hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT(H5D_final_collective_io) - /* - * Pass buf type, file type to the file driver. - */ - - if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties"); + /* Pass buf type, file type to the file driver. */ + if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") + plist_is_setup = TRUE; - plist_is_setup=1; -#ifdef H5D_DEBUG - if(H5DEBUG(D)){ - HDfprintf(H5DEBUG(D),"chunk addr %Hu\n",coll_info->chunk_addr); - HDfprintf(H5DEBUG(D),"mpi_buf_count %d\n",coll_info->mpi_buf_count); - } - -#endif - - if(do_write) { - if((io_info->ops.write)(io_info, - coll_info->mpi_buf_count,0,NULL,NULL,coll_info->chunk_addr, - NULL, buf) < 0) + if(io_info->op_type == H5D_IO_OP_WRITE) { + if((io_info->io_ops.single_write)(io_info, type_info, + (hsize_t)mpi_buf_count, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") - } + } /* end if */ else { - if((io_info->ops.read)(io_info, - coll_info->mpi_buf_count,0,NULL,NULL,coll_info->chunk_addr, - NULL, buf) < 0) + if((io_info->io_ops.single_read)(io_info, type_info, + (hsize_t)mpi_buf_count, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") - } + } /* end else */ done: - /* Reset the dxpl settings */ - if(plist_is_setup) { - if(H5FD_mpi_teardown_collective(io_info->dxpl_id)<0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values"); - } /* end if */ - - /* free the MPI buf and file types */ - if (coll_info->mbt_is_derived) { - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( mpi_buf_type ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } - if (coll_info->mft_is_derived) { - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( mpi_file_type ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } + /* Reset the dxpl settings */ + if(plist_is_setup) + if(H5FD_mpi_teardown_collective(io_info->dxpl_id) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values") + #ifdef H5D_DEBUG - if(H5DEBUG(D)) +if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"ret_value before leaving final_collective_io=%d\n",ret_value); #endif - FUNC_LEAVE_NOAPI(ret_value) -}/* end H5D_final_collective_io */ +} /* end H5D_final_collective_io */ /*------------------------------------------------------------------------- * Function: H5D_sort_chunk * * Purpose: Routine to sort chunks in increasing order of chunk address - Each chunk address is also obtained. - - Description: - For most cases, the chunk address has already been sorted in increasing order. - The special sorting flag is used to optimize this common case. - quick sort is used for necessary sorting. - - Parameters: - Input: H5D_io_info_t* io_info, - H5D_chunk_map_t *fm(global chunk map struct) - Input/Output: H5D_chunk_addr_info_t chunk_addr_info_array[] : array to store chunk address and information - many_chunk_opt : flag to optimize the way to obtain chunk addresses - for many chunks + * Each chunk address is also obtained. * - * Return: Non-negative on success/Negative on failure + * Description: + * For most cases, the chunk address has already been sorted in increasing order. + * The special sorting flag is used to optimize this common case. + * quick sort is used for necessary sorting. * - * Programmer: + * Parameters: + * Input: H5D_io_info_t* io_info, + * H5D_chunk_map_t *fm(global chunk map struct) + * Input/Output: H5D_chunk_addr_info_t chunk_addr_info_array[] : array to store chunk address and information + * many_chunk_opt : flag to optimize the way to obtain chunk addresses + * for many chunks * - * Modifications: + * Return: Non-negative on success/Negative on failure + * + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ - static herr_t -H5D_sort_chunk(H5D_io_info_t * io_info, - H5D_chunk_map_t *fm, - H5D_chunk_addr_info_t chunk_addr_info_array[], - int many_chunk_opt) +H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, + H5D_chunk_addr_info_t chunk_addr_info_array[], int sum_chunk) { - - - H5SL_node_t *chunk_node; /* Current node in chunk skip list */ + H5SL_node_t *chunk_node; /* Current node in chunk skip list */ H5D_chunk_info_t *chunk_info; /* Current chunking info. of this node. */ - haddr_t chunk_addr; /* Current chunking address of this node */ - haddr_t *total_chunk_addr_array=NULL; /* The array of chunk address for the total number of chunk */ - int i,mpi_code; - int total_chunks; - size_t num_chunks; - int mpi_type_cleanup = 0; - int tchunk_addr_cleanup = 0; - MPI_Datatype chunk_addrtype; - H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hbool_t do_sort = FALSE; - herr_t ret_value = SUCCEED; /*return value */ + haddr_t chunk_addr; /* Current chunking address of this node */ + haddr_t *total_chunk_addr_array = NULL; /* The array of chunk address for the total number of chunk */ + H5D_storage_t store; /*union of EFL and chunk pointer in file space */ + hbool_t do_sort = FALSE; /* Whether the addresses need to be sorted */ + int bsearch_coll_chunk_threshold; + int many_chunk_opt = H5D_OBTAIN_ONE_CHUNK_ADDR_IND; + int mpi_size; /* Number of MPI processes */ + int mpi_code; /* MPI return code */ + int i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_sort_chunk) - num_chunks = H5SL_count(fm->sel_chunks); + /* Retrieve # of MPI processes */ + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") + + /* Calculate the actual threshold to obtain all chunk addresses collectively + * The bigger this number is, the more possible the use of obtaining chunk + * address collectively. + */ + /* For non-optimization one-link IO, actual bsearch threshold is always + * 0, we would always want to obtain the chunk addresses individually + * for each process. + */ + bsearch_coll_chunk_threshold = (sum_chunk * 100) / ((int)fm->total_chunks * mpi_size); + if((bsearch_coll_chunk_threshold > H5D_ALL_CHUNK_ADDR_THRES_COL) + && ((sum_chunk / mpi_size) >= H5D_ALL_CHUNK_ADDR_THRES_COL_NUM)) + many_chunk_opt = H5D_OBTAIN_ALL_CHUNK_ADDR_COL; + #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"many_chunk_opt= %d\n",many_chunk_opt); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D), "many_chunk_opt= %d\n", many_chunk_opt); #endif /* If we need to optimize the way to obtain the chunk address */ - if(many_chunk_opt != H5D_OBTAIN_ONE_CHUNK_ADDR_IND){ + if(many_chunk_opt != H5D_OBTAIN_ONE_CHUNK_ADDR_IND) { + int mpi_rank; - int mpi_rank, root; - total_chunks = (int)fm->total_chunks; - total_chunk_addr_array = H5MM_malloc(sizeof(haddr_t)*total_chunks); - tchunk_addr_cleanup = 1; #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"Coming inside H5D_OBTAIN_ALL_CHUNK_ADDR_COL\n"); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D), "Coming inside H5D_OBTAIN_ALL_CHUNK_ADDR_COL\n"); #endif - root = 0; - if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file))<0) - HGOTO_ERROR (H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank"); - - /*Create received MPI derived datatype */ - if(MPI_SUCCESS !=(mpi_code = MPI_Type_contiguous((int)(sizeof(haddr_t)*total_chunks), MPI_BYTE, &chunk_addrtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); - if(MPI_SUCCESS !=(mpi_code = MPI_Type_commit(&chunk_addrtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - - mpi_type_cleanup = 1; - - if(mpi_rank == root) { - if(H5D_istore_chunkmap(io_info, total_chunk_addr_array, fm->down_chunks)<0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); - } + /* Allocate array for chunk addresses */ + if(NULL == (total_chunk_addr_array = H5MM_malloc(sizeof(haddr_t) * (size_t)fm->total_chunks))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory chunk address array") + + /* Retrieve all the chunk addresses with process 0 */ + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if(mpi_rank == 0) { + if(H5D_istore_chunkmap(io_info, total_chunk_addr_array, fm->down_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") + } /* end if */ + /* Broadcasting the MPI_IO option info. and chunk address info. */ - if(MPI_SUCCESS !=(mpi_code = MPI_Bcast(total_chunk_addr_array,1,chunk_addrtype,root,io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(total_chunk_addr_array, (int)(sizeof(haddr_t) * fm->total_chunks), MPI_BYTE, (int)0, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code) } /* end if */ - /* Get first node in chunk skip list */ - if(NULL ==(chunk_node = H5SL_first(fm->sel_chunks))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk node from skipped list"); /* Set dataset storage for I/O info */ io_info->store = &store; - if(NULL ==(chunk_info = H5SL_item(chunk_node))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; + + /* Start at first node in chunk skip list */ i = 0; - if(many_chunk_opt == H5D_OBTAIN_ONE_CHUNK_ADDR_IND){ - if(HADDR_UNDEF==(chunk_addr = H5D_istore_get_addr(io_info,NULL))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); + if(NULL == (chunk_node = H5SL_first(fm->sel_chunks))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk node from skipped list") -#ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"coming to obtain each chunk address individually \n"); -#endif - } - else - chunk_addr = total_chunk_addr_array[chunk_info->index]; + /* Iterate over all chunks for this process */ + while(chunk_node) { + if(NULL == (chunk_info = H5SL_item(chunk_node))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list") + + if(many_chunk_opt == H5D_OBTAIN_ONE_CHUNK_ADDR_IND) { + store.chunk.offset = chunk_info->coords; + store.chunk.index = chunk_info->index; + if(HADDR_UNDEF == (chunk_addr = H5D_istore_get_addr(io_info, NULL))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") + } /* end if */ + else + chunk_addr = total_chunk_addr_array[chunk_info->index]; - chunk_addr_info_array[i].chunk_addr = chunk_addr; - chunk_addr_info_array[i].chunk_info = *chunk_info; + /* Check if chunk addresses are not in increasing order in the file */ + if(i > 0 && chunk_addr < chunk_addr_info_array[i - 1].chunk_addr) + do_sort = TRUE; - chunk_node = H5SL_next(chunk_node); + /* Set the address & info for this chunk */ + chunk_addr_info_array[i].chunk_addr = chunk_addr; + chunk_addr_info_array[i].chunk_info = *chunk_info; - while(chunk_node) { + /* Advance to next chunk in list */ + i++; + chunk_node = H5SL_next(chunk_node); + } /* end while */ - chunk_info = H5SL_item(chunk_node); - store.chunk.offset = chunk_info->coords; - store.chunk.index = chunk_info->index; - - if(many_chunk_opt == H5D_OBTAIN_ONE_CHUNK_ADDR_IND){ - if(HADDR_UNDEF==(chunk_addr = H5D_istore_get_addr(io_info,NULL))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get chunk info from skipped list"); - } - else - chunk_addr = total_chunk_addr_array[chunk_info->index]; - - if(chunk_addr < chunk_addr_info_array[i].chunk_addr) do_sort = TRUE; - chunk_addr_info_array[i+1].chunk_addr = chunk_addr; - chunk_addr_info_array[i+1].chunk_info =*chunk_info; - i++; - chunk_node = H5SL_next(chunk_node); - } #ifdef H5D_DEBUG - if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"before Qsort\n"); +if(H5DEBUG(D)) + HDfprintf(H5DEBUG(D), "before Qsort\n"); #endif - if(do_sort) - HDqsort(chunk_addr_info_array,num_chunks,sizeof(chunk_addr_info_array),H5D_cmp_chunk_addr); + if(do_sort) { + size_t num_chunks = H5SL_count(fm->sel_chunks); + + HDqsort(chunk_addr_info_array, num_chunks, sizeof(chunk_addr_info_array[0]), H5D_cmp_chunk_addr); + } /* end if */ done: + if(total_chunk_addr_array) + H5MM_xfree(total_chunk_addr_array); - if(tchunk_addr_cleanup) - HDfree(total_chunk_addr_array); - if(mpi_type_cleanup) { - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &chunk_addrtype ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_sort_chunk() */ @@ -1725,310 +1768,244 @@ done: * Function: H5D_obtain_mpio_mode * * Purpose: Routine to obtain each io mode(collective,independent or none) for each chunk; - Each chunk address is also obtained. - - Description: - - 1) Each process provides two piece of information for all chunks having selection - a) chunk index - b) wheather this chunk is regular(for MPI derived datatype not working case) - - 2) Gather all the information to the root process - - 3) Root process will do the following: - a) Obtain chunk addresses for all chunks in this data space - b) With the consideration of the user option, calculate IO mode for each chunk - c) Build MPI derived datatype to combine "chunk address" and "assign_io" information - in order to do MPI Bcast only once - d) MPI Bcast the IO mode and chunk address information for each chunk. - 4) Each process then retrieves IO mode and chunk address information to assign_io_mode and chunk_addr. - - Parameters: - - Input: H5D_io_info_t* io_info, - H5D_chunk_map_t *fm,(global chunk map struct) - Output: uint8_t assign_io_mode[], : IO mode, collective, independent or none - haddr_t chunk_addr[], : chunk address array for each chunk + * Each chunk address is also obtained. * - * Return: Non-negative on success/Negative on failure + * Description: * - * Programmer: + * 1) Each process provides two piece of information for all chunks having selection + * a) chunk index + * b) wheather this chunk is regular(for MPI derived datatype not working case) + * + * 2) Gather all the information to the root process * - * Modifications: + * 3) Root process will do the following: + * a) Obtain chunk addresses for all chunks in this data space + * b) With the consideration of the user option, calculate IO mode for each chunk + * c) Build MPI derived datatype to combine "chunk address" and "assign_io" information + * in order to do MPI Bcast only once + * d) MPI Bcast the IO mode and chunk address information for each chunk. + * 4) Each process then retrieves IO mode and chunk address information to assign_io_mode and chunk_addr. + * + * Parameters: + * + * Input: H5D_io_info_t* io_info, + * H5D_chunk_map_t *fm,(global chunk map struct) + * Output: uint8_t assign_io_mode[], : IO mode, collective, independent or none + * haddr_t chunk_addr[], : chunk address array for each chunk + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- */ - static herr_t -H5D_obtain_mpio_mode(H5D_io_info_t* io_info, - H5D_chunk_map_t *fm, - uint8_t assign_io_mode[], - haddr_t chunk_addr[]) +H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, + H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]) { - - int total_chunks; - hsize_t ori_total_chunks; - unsigned percent_nproc_per_chunk,threshold_nproc_per_chunk; - H5FD_mpio_chunk_opt_t chunk_opt_mode; - uint8_t* io_mode_info=NULL; - uint8_t* recv_io_mode_info=NULL; - uint8_t* mergebuf=NULL; - uint8_t* tempbuf; - - H5SL_node_t* chunk_node; - H5D_chunk_info_t* chunk_info; - - MPI_Datatype bastype[2]; - MPI_Datatype chunk_addrtype; - int bascount; - int basblock[2]; - MPI_Aint basdisp[2]; - MPI_Datatype rtype; - MPI_Datatype stype; - int mpi_size,mpi_rank; - MPI_Comm comm; - int ic,root; - int mpi_code; - H5P_genplist_t *plist; - int mem_cleanup = 0, - mpi_type_cleanup = 0; - + int total_chunks; + unsigned percent_nproc_per_chunk,threshold_nproc_per_chunk; + H5FD_mpio_chunk_opt_t chunk_opt_mode; + uint8_t* io_mode_info=NULL; + uint8_t* recv_io_mode_info=NULL; + uint8_t* mergebuf=NULL; + uint8_t* tempbuf; + H5SL_node_t* chunk_node; + H5D_chunk_info_t* chunk_info; + int mpi_size,mpi_rank; + MPI_Comm comm; + int ic,root; + int mpi_code; + int mem_cleanup = 0; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - int new_value; - htri_t check_prop; + int new_value; + htri_t check_prop; #endif + herr_t ret_value = SUCCEED; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5D_obtain_mpio_mode) + FUNC_ENTER_NOAPI_NOINIT(H5D_obtain_mpio_mode) - /* Assign the rank 0 to the root */ - root = 0; - comm = io_info->comm; + /* Assign the rank 0 to the root */ + root = 0; + comm = io_info->comm; - /* Obtain the number of process and the current rank of the process */ - if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file))<0) - HGOTO_ERROR (H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank"); - if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file))<0) - HGOTO_ERROR (H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size"); + /* Obtain the number of process and the current rank of the process */ + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - /* Allocate memory */ - ori_total_chunks = fm->total_chunks; - H5_ASSIGN_OVERFLOW(total_chunks,ori_total_chunks,hsize_t,int); - - /* Obtain the data transfer properties */ - if(NULL == (plist = H5I_object(io_info->dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - percent_nproc_per_chunk=H5P_peek_unsigned(plist,H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME); + /* Setup parameters */ + H5_ASSIGN_OVERFLOW(total_chunks, fm->total_chunks, hsize_t, int); + percent_nproc_per_chunk = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME); #if defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) && defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - - chunk_opt_mode=(H5FD_mpio_chunk_opt_t)H5P_peek_unsigned(plist,H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME); - - if((chunk_opt_mode == H5FD_MPIO_CHUNK_MULTI_IO) || (percent_nproc_per_chunk == 0)){ - if(H5D_istore_chunkmap(io_info, chunk_addr, fm->down_chunks) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); - for(ic = 0; icdown_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); + for(ic = 0; ic < total_chunks; ic++) + assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; + + HGOTO_DONE(SUCCEED) + } /* end if */ #endif - threshold_nproc_per_chunk = mpi_size * percent_nproc_per_chunk/100; - - io_mode_info = (uint8_t *)H5MM_calloc(total_chunks*sizeof(MPI_BYTE)); - mergebuf = H5MM_malloc((sizeof(haddr_t)+sizeof(MPI_BYTE))*total_chunks); - tempbuf = mergebuf + sizeof(MPI_BYTE)*total_chunks; - if(mpi_rank == root) - recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks*sizeof(MPI_BYTE)*mpi_size); + threshold_nproc_per_chunk = mpi_size * percent_nproc_per_chunk/100; + + /* Allocate memory */ + io_mode_info = (uint8_t *)H5MM_calloc(total_chunks); + mergebuf = H5MM_malloc((sizeof(haddr_t) + 1) * total_chunks); + tempbuf = mergebuf + total_chunks; + if(mpi_rank == root) + recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks * mpi_size); - mem_cleanup = 1; + mem_cleanup = 1; - chunk_node = H5SL_first(fm->sel_chunks); - - /*Obtain the regularity and selection information for all chunks in this process. */ - while(chunk_node){ - - chunk_info = H5SL_item(chunk_node); + /* Obtain the regularity and selection information for all chunks in this process. */ + chunk_node = H5SL_first(fm->sel_chunks); + while(chunk_node) { + chunk_info = H5SL_item(chunk_node); #ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - /* regularity information: 1, selection information: 2 */ - if(H5S_SELECT_IS_REGULAR(chunk_info->fspace) == TRUE && - H5S_SELECT_IS_REGULAR(chunk_info->mspace) == TRUE) + /* regularity information: 1, selection information: 2 */ + if(H5S_SELECT_IS_REGULAR(chunk_info->fspace) == TRUE && + H5S_SELECT_IS_REGULAR(chunk_info->mspace) == TRUE) #endif - io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" without defining H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS. */ + io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" without defining H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS. */ #ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - else - io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_IRREG; /* this chunk is selected and is irregular*/ + else + io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_IRREG; /* this chunk is selected and is irregular*/ #endif - - chunk_node = H5SL_next(chunk_node); - } + chunk_node = H5SL_next(chunk_node); + } /* end while */ - /*Create sent MPI derived datatype */ - if(MPI_SUCCESS !=(mpi_code = MPI_Type_contiguous(total_chunks,MPI_BYTE,&stype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&stype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - - /*Create received basic MPI derived datatype */ - bascount = 2; - basblock[0] = total_chunks; - basblock[1] = total_chunks; - basdisp[0] = 0; - basdisp[1] = (MPI_Aint)(sizeof(MPI_BYTE)*total_chunks);/* may need to check overflow */ - bastype[0] = MPI_BYTE; - - if(MPI_SUCCESS !=(mpi_code = MPI_Type_contiguous(sizeof(haddr_t),MPI_BYTE,&chunk_addrtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&chunk_addrtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - bastype[1] = chunk_addrtype; - - if(MPI_SUCCESS !=(mpi_code = MPI_Type_struct(bascount,basblock,basdisp,bastype,&rtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code); - if(MPI_SUCCESS !=(mpi_code = MPI_Type_commit(&rtype))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - - /* Set up a flag to clean up the MPI derived datatype later */ - mpi_type_cleanup = 1; - - /*Gather all the information */ - if(MPI_SUCCESS !=(mpi_code = MPI_Gather(io_mode_info,1,stype,recv_io_mode_info,1,stype,root,comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Gather failed", mpi_code); - - /* Calculate the mode for IO(collective, independent or none) at root process */ - if(mpi_rank == root) { - - int nproc; - int* nproc_per_chunk; + /*Gather all the information */ + if(MPI_SUCCESS != (mpi_code = MPI_Gather(io_mode_info, total_chunks, MPI_BYTE, recv_io_mode_info, total_chunks, MPI_BYTE, root, comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Gather failed", mpi_code) + + /* Calculate the mode for IO(collective, independent or none) at root process */ + if(mpi_rank == root) { + int nproc; + int* nproc_per_chunk; #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - int* ind_this_chunk; + int* ind_this_chunk; #endif - /* pre-computing: calculate number of processes and - regularity of the selection occupied in each chunk */ - nproc_per_chunk = (int*)H5MM_calloc(total_chunks*sizeof(int)); + /* pre-computing: calculate number of processes and + regularity of the selection occupied in each chunk */ + nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - ind_this_chunk = (int*)H5MM_calloc(total_chunks*sizeof(int)); + ind_this_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); #endif - /* calculating the chunk address */ - if(H5D_istore_chunkmap(io_info, chunk_addr, fm->down_chunks)<0){ - HDfree(nproc_per_chunk); + /* calculating the chunk address */ + if(H5D_istore_chunkmap(io_info, chunk_addr, fm->down_chunks) < 0) { + HDfree(nproc_per_chunk); #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - HDfree(ind_this_chunk); + HDfree(ind_this_chunk); #endif - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); - } - - /* checking for number of process per chunk and regularity of the selection*/ - for (nproc = 0;nproc MAX(1,threshold_nproc_per_chunk)){ + /* Calculating MPIO mode for each chunk (collective, independent, none) */ + for(ic = 0; ic < total_chunks; ic++) { + if(nproc_per_chunk[ic] > MAX(1, threshold_nproc_per_chunk)) { #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - if(!ind_this_chunk[ic]) assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; + if(!ind_this_chunk[ic]) + assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; #else - assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; + assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; #endif - } - } + } /* end if */ + } /* end for */ - /* merge buffer io_mode info and chunk addr into one */ - HDmemcpy(mergebuf,assign_io_mode,sizeof(MPI_BYTE)*total_chunks); - HDmemcpy(tempbuf,chunk_addr,sizeof(haddr_t)*total_chunks); + /* merge buffer io_mode info and chunk addr into one */ + HDmemcpy(mergebuf, assign_io_mode, total_chunks); + HDmemcpy(tempbuf, chunk_addr, sizeof(haddr_t) * total_chunks); - HDfree(nproc_per_chunk); + HDfree(nproc_per_chunk); #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - HDfree(ind_this_chunk); + HDfree(ind_this_chunk); #endif - } + } /* end if */ - /* Broadcasting the MPI_IO option info. and chunk address info. */ - if(MPI_SUCCESS !=(mpi_code = MPI_Bcast(mergebuf,1,rtype,root,comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code); + /* Broadcasting the MPI_IO option info. and chunk address info. */ + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, ((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code) - HDmemcpy(assign_io_mode,mergebuf,sizeof(MPI_BYTE)*total_chunks); - HDmemcpy(chunk_addr,tempbuf,sizeof(haddr_t)*total_chunks); + HDmemcpy(assign_io_mode, mergebuf, total_chunks); + HDmemcpy(chunk_addr, tempbuf, sizeof(haddr_t) * total_chunks); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); if(check_prop > 0) { #if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value"); + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") #else - for(ic = 0; ic < total_chunks; ic++){ - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value"); - break; - } - } + for(ic = 0; ic < total_chunks; ic++) { + if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { + new_value = 0; + if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&new_value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") + break; + } /* end if */ + } /* end for */ #endif - } - check_prop = H5Pexist(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); - if(check_prop > 0) { - int temp_count = 0; - for(ic = 0; ic < total_chunks; ic++){ - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - temp_count++; - break; - } - } - if(temp_count==0){ - new_value = 0; - if(H5Pset(io_info->dxpl_id,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&new_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value"); - } - } + } /* end if */ + + check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); + if(check_prop > 0) { + int temp_count = 0; + + for(ic = 0; ic < total_chunks; ic++) { + if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { + temp_count++; + break; + } /* end if */ + } /* end for */ + if(temp_count == 0) { + new_value = 0; + if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") + } /* end if */ + } /* end if */ #endif done: - - if(mpi_type_cleanup) { - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &chunk_addrtype ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &stype ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - - if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &rtype ))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } - - if(mem_cleanup){ - HDfree(io_mode_info); - HDfree(mergebuf); - if(mpi_rank == root) - HDfree(recv_io_mode_info); - } + if(mem_cleanup) { + HDfree(io_mode_info); + HDfree(mergebuf); + if(mpi_rank == root) + HDfree(recv_io_mode_info); + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -}/* end H5D_obtain_mpio_mode*/ +} /* end H5D_obtain_mpio_mode() */ static int H5D_cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) @@ -2041,7 +2018,6 @@ H5D_cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) addr2 = ((const H5D_chunk_addr_info_t *)chunk_addr_info2)->chunk_addr; FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) - } #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Doh.c b/src/H5Doh.c index 01447a3..37f011b 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -316,7 +316,7 @@ H5O_dset_get_oloc(hid_t obj_id) FUNC_ENTER_NOAPI_NOINIT(H5O_dset_get_oloc) /* Get the dataset */ - if(NULL == (dset = H5I_object(obj_id))) + if(NULL == (dset = (H5D_t *)H5I_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") /* Get the dataset's object header location */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index aec5e19..97dcacf 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -49,74 +49,156 @@ #define H5D_MINHDR_SIZE 256 /* [Simple] Macro to construct a H5D_io_info_t from it's components */ -#define H5D_BUILD_IO_INFO(io_info,ds,dxpl_c,dxpl_i,str) \ - (io_info)->dset=ds; \ - (io_info)->dxpl_cache=dxpl_c; \ - (io_info)->dxpl_id=dxpl_i; \ - (io_info)->store=str +#define H5D_BUILD_IO_INFO_WRT(io_info, ds, dxpl_c, dxpl_i, str, buf) \ + (io_info)->dset = ds; \ + (io_info)->dxpl_cache = dxpl_c; \ + (io_info)->dxpl_id = dxpl_i; \ + (io_info)->store = str; \ + (io_info)->op_type = H5D_IO_OP_WRITE; \ + (io_info)->u.wbuf = buf +#define H5D_BUILD_IO_INFO_RD(io_info, ds, dxpl_c, dxpl_i, str, buf) \ + (io_info)->dset = ds; \ + (io_info)->dxpl_cache = dxpl_c; \ + (io_info)->dxpl_id = dxpl_i; \ + (io_info)->store = str; \ + (io_info)->op_type = H5D_IO_OP_READ; \ + (io_info)->u.rbuf = buf + +#define H5D_CHUNK_HASH(D, ADDR) H5F_addr_hash(ADDR, (D)->cache.chunk.nslots) /****************************/ /* Package Private Typedefs */ /****************************/ -/* - * If there is no data type conversion then it might be possible to - * transfer data points between application memory and the file in one - * step without going through the data type conversion buffer. - */ - -/* Read from file to application w/o intermediate scratch buffer */ +/* Typedef for datatype information for raw data I/O operation */ +typedef struct H5D_type_info_t { + /* Initial values */ + const H5T_t *mem_type; /* Pointer to memory datatype */ + const H5T_t *dset_type; /* Pointer to dataset datatype */ + H5T_path_t *tpath; /* Datatype conversion path */ + hid_t src_type_id; /* Source datatype ID */ + hid_t dst_type_id; /* Destination datatype ID */ + + /* Computed/derived values */ + size_t src_type_size; /* Size of source type */ + size_t dst_type_size; /* Size of destination type*/ + size_t max_type_size; /* Size of largest source/destination type */ + hbool_t is_conv_noop; /* Whether the type conversion is a NOOP */ + hbool_t is_xform_noop; /* Whether the data transform is a NOOP */ + H5T_subset_t cmpd_subset; /* Whether (and which) the source/destination datatypes are compound subsets of one another */ + H5T_bkg_t need_bkg; /* Type of background buf needed */ + size_t request_nelmts; /* Requested strip mine */ + uint8_t *tconv_buf; /* Datatype conv buffer */ + hbool_t tconv_buf_allocated; /* Whether the type conversion buffer was allocated */ + uint8_t *bkg_buf; /* Background buffer */ + hbool_t bkg_buf_allocated; /* Whether the background buffer was allocated */ +} H5D_type_info_t; + +/* Forward declaration of structs used below */ struct H5D_io_info_t; -typedef herr_t (*H5D_io_read_func_t)(struct H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, haddr_t addr, - void *chunk, void *buf/*out*/); - - -/* Write directly from app buffer to file */ -typedef herr_t (*H5D_io_write_func_t)(struct H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, haddr_t addr, - void *chunk, const void *buf); +struct H5D_chunk_map_t; /* Function pointers for I/O on particular types of dataset layouts */ -typedef ssize_t (*H5D_io_readvv_func_t)(const struct H5D_io_info_t *io_info, +typedef herr_t (*H5D_layout_init_func_t)(const struct H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + struct H5D_chunk_map_t *cm); +typedef herr_t (*H5D_layout_read_func_t)(struct H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, struct H5D_chunk_map_t *fm); +typedef herr_t (*H5D_layout_write_func_t)(struct H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, struct H5D_chunk_map_t *fm); +typedef ssize_t (*H5D_layout_readvv_func_t)(const struct H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t chunk_addr, void *chunk, void *buf); -typedef ssize_t (*H5D_io_writevv_func_t)(const struct H5D_io_info_t *io_info, + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t chunk_addr, void *chunk, const void *buf); + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +typedef herr_t (*H5D_layout_term_func_t)(const struct H5D_chunk_map_t *cm); + +/* Typedef for grouping layout I/O routines */ +typedef struct H5D_layout_ops_t { + H5D_layout_init_func_t init; /* I/O initialization routine */ + H5D_layout_read_func_t ser_read; /* High-level I/O routine for reading data in serial */ + H5D_layout_write_func_t ser_write; /* High-level I/O routine for writing data in serial */ +#ifdef H5_HAVE_PARALLEL + H5D_layout_read_func_t par_read; /* High-level I/O routine for reading data in parallel */ + H5D_layout_write_func_t par_write; /* High-level I/O routine for writing data in parallel */ +#endif /* H5_HAVE_PARALLEL */ + H5D_layout_readvv_func_t readvv; /* Low-level I/O routine for reading data */ + H5D_layout_writevv_func_t writevv; /* Low-level I/O routine for writing data */ + H5D_layout_term_func_t term; /* I/O shutdown routine */ +} H5D_layout_ops_t; + +/* Function pointers for either multiple or single block I/O access */ +typedef herr_t (*H5D_io_single_read_func_t)(const struct H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); +typedef herr_t (*H5D_io_single_write_func_t)(const struct H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Typedef for raw data I/O framework info */ typedef struct H5D_io_ops_t { - H5D_io_read_func_t read; /* Direct I/O routine for reading */ - H5D_io_write_func_t write; /* Direct I/O routine for writing */ - H5D_io_readvv_func_t readvv; /* I/O routine for reading data */ - H5D_io_writevv_func_t writevv; /* I/O routine for writing data */ + H5D_layout_read_func_t multi_read; /* High-level I/O routine for reading data */ + H5D_layout_write_func_t multi_write; /* High-level I/O routine for writing data */ + H5D_io_single_read_func_t single_read; /* I/O routine for reading single block */ + H5D_io_single_write_func_t single_write; /* I/O routine for writing single block */ } H5D_io_ops_t; +/* Typedefs for dataset storage information */ +typedef struct { + haddr_t dset_addr; /* Address of dataset in file */ + hsize_t dset_size; /* Total size of dataset in file */ +} H5D_contig_storage_t; + +typedef struct { + hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */ + hsize_t *offset; /* Chunk's coordinates in elements */ +} H5D_chunk_storage_t; + +typedef struct { + void *buf; /* Buffer for compact dataset */ + hbool_t *dirty; /* Pointer to dirty flag to mark */ +} H5D_compact_storage_t; + +typedef union H5D_storage_t { + H5D_contig_storage_t contig; /* Contiguous information for dataset */ + H5D_chunk_storage_t chunk; /* Chunk information for dataset */ + H5D_compact_storage_t compact; /* Compact information for dataset */ + H5O_efl_t efl; /* External file list information for dataset */ +} H5D_storage_t; + /* Typedef for raw data I/O operation info */ typedef struct H5D_io_info_t { H5D_t *dset; /* Pointer to dataset being operated on */ #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache; /* Pointer to cache DXPL info */ + H5D_dxpl_cache_t *dxpl_cache; /* Pointer to cached DXPL info */ hid_t dxpl_id; /* Original DXPL ID */ #ifdef H5_HAVE_PARALLEL MPI_Comm comm; /* MPI communicator for file */ - hbool_t xfer_mode_changed; /* Whether the transfer mode was changed */ - hbool_t xfer_opt_mode_changed; hbool_t using_mpi_vfd; /* Whether the file is using an MPI-based VFD */ + struct { + H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ + H5D_io_ops_t io_ops; /* I/O operation function pointers */ + } orig; #endif /* H5_HAVE_PARALLEL */ - const H5D_storage_t *store; /* Dataset storage info */ - H5D_io_ops_t ops; /* I/O operation function pointers */ -#ifdef H5S_DEBUG - H5S_iostats_t *stats; /* I/O statistics */ -#endif /* H5S_DEBUG */ + H5D_storage_t *store; /* Dataset storage info */ + H5D_layout_ops_t layout_ops; /* Dataset layout I/O operation function pointers */ + H5D_io_ops_t io_ops; /* I/O operation function pointers */ + enum { + H5D_IO_OP_READ, /* Read operation */ + H5D_IO_OP_WRITE /* Write operation */ + } op_type; + union { + void *rbuf; /* Pointer to buffer for read */ + const void *wbuf; /* Pointer to buffer to write */ + } u; } H5D_io_info_t; /* Structure holding information about a chunk's selection for mapping */ @@ -183,8 +265,8 @@ typedef struct H5D_shared_t { hbool_t layout_dirty; /* Whether the layout info needs to be flushed to the file */ hid_t dcpl_id; /* dataset creation property id */ H5D_dcpl_cache_t dcpl_cache; /* Cached DCPL values */ - H5D_io_ops_t io_ops; /* I/O operations */ H5O_layout_t layout; /* data layout */ + const H5D_layout_ops_t *layout_ops; /* Pointer to data layout I/O operations */ hbool_t checked_filters;/* TRUE if dataset passes can_apply check */ /* Buffered/cached information for types of raw data storage*/ @@ -229,18 +311,21 @@ typedef struct H5D_chunk_map_t { H5S_sel_type msel_type; /* Selection type in memory */ H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */ + H5S_t *single_space; /* Dataspace for single chunk */ H5D_chunk_info_t *single_chunk_info; /* Pointer to single chunk's info */ hbool_t use_single; /* Whether I/O is on a single element */ + hsize_t last_index; /* Index of last chunk operated on */ H5D_chunk_info_t *last_chunk_info; /* Pointer to last chunk's info */ + hsize_t chunks[H5O_LAYOUT_NDIMS]; /* Number of chunks in each dimension */ hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in each dimension */ hsize_t down_chunks[H5O_LAYOUT_NDIMS]; /* "down" size of number of chunks in each dimension */ #ifdef H5_HAVE_PARALLEL - hsize_t total_chunks; /* Number of total chunks */ - hbool_t *select_chunk; /* store the information about whether this chunk is selected or not */ + hsize_t total_chunks; /* Number of chunks covered by dataspace */ + H5D_chunk_info_t **select_chunk; /* Store the information about whether this chunk is selected or not */ #endif /* H5_HAVE_PARALLEL */ } H5D_chunk_map_t; @@ -332,12 +417,34 @@ typedef struct { hsize_t size; /* Accumulated number of bytes for the selection */ } H5D_vlen_bufsize_t; +/* Raw data chunks are cached. Each entry in the cache is: */ +typedef struct H5D_rdcc_ent_t { + hbool_t locked; /*entry is locked in cache */ + hbool_t dirty; /*needs to be written to disk? */ + hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */ + size_t rd_count; /*bytes remaining to be read */ + size_t wr_count; /*bytes remaining to be written */ + size_t chunk_size; /*size of a chunk */ + size_t alloc_size; /*amount allocated for the chunk */ + uint8_t *chunk; /*the unfiltered chunk data */ + unsigned idx; /*index in hash table */ + struct H5D_rdcc_ent_t *next;/*next item in doubly-linked list */ + struct H5D_rdcc_ent_t *prev;/*previous item in doubly-linked list */ +} H5D_rdcc_ent_t; +typedef H5D_rdcc_ent_t *H5D_rdcc_ent_ptr_t; /* For free lists */ + /*****************************/ /* Package Private Variables */ /*****************************/ extern H5D_dxpl_cache_t H5D_def_dxpl_cache; +/* Storage layout classes */ +H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_CONTIG[1]; +H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_EFL[1]; +H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_COMPACT[1]; +H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_CHUNK[1]; + /******************************/ /* Package Private Prototypes */ @@ -361,54 +468,51 @@ H5_DLL herr_t H5D_vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); H5_DLL herr_t H5D_check_filters(H5D_t *dataset); H5_DLL herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); - -/* Functions that perform serial I/O operations */ -H5_DLL herr_t H5D_select_fscat(H5D_io_info_t *io_info, - const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, - haddr_t chunk_addr, void *chunk, const void *_buf); -H5_DLL size_t H5D_select_fgath(H5D_io_info_t *io_info, - const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, - haddr_t chunk_addr, void *chunk, void *buf); -H5_DLL herr_t H5D_select_mscat(const void *_tscat_buf, +H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); + +/* Functions that perform direct serial I/O operations */ +H5_DLL herr_t H5D_select_read(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); +H5_DLL herr_t H5D_select_write(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); + +/* Functions that perform scatter-gather serial I/O operations */ +H5_DLL herr_t H5D_scatter_mem(const void *_tscat_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - const H5D_dxpl_cache_t *dxpl_cache, void *_buf/*out*/); -H5_DLL size_t H5D_select_mgath(const void *_buf, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); -H5_DLL herr_t H5D_select_read(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - haddr_t addr, void *chunk/*in*/, void *buf/*out*/); -H5_DLL herr_t H5D_select_write(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - haddr_t addr, void *chunk/*in*/, const void *buf/*out*/); + const H5D_dxpl_cache_t *dxpl_cache, void *_buf); +H5_DLL herr_t H5D_scatgath_read(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); +H5_DLL herr_t H5D_scatgath_write(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Functions that operate on contiguous storage */ H5_DLL herr_t H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout); H5_DLL herr_t H5D_contig_fill(H5D_t *dset, hid_t dxpl_id); H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset); +H5_DLL herr_t H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *fm); +H5_DLL herr_t H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, + H5D_chunk_map_t *fm); H5_DLL ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer, void *buf); + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED address, void UNUSED *pointer, const void *buf); + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); +/* Functions that operate on chunked dataset storage */ +H5_DLL hbool_t H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr); + /* Functions that operate on compact dataset storage */ H5_DLL herr_t H5D_compact_fill(H5D_t *dset, hid_t dxpl_id); -H5_DLL ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf); -H5_DLL ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf); H5_DLL herr_t H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); @@ -430,19 +534,11 @@ H5_DLL herr_t H5D_istore_initialize_by_extent(H5D_io_info_t *io_info); H5_DLL herr_t H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D_istore_dump_btree(H5F_t *f, hid_t dxpl_id, FILE *stream, unsigned ndims, haddr_t addr); -H5_DLL herr_t H5D_istore_chunkmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[],hsize_t down_chunks[] ); +H5_DLL herr_t H5D_istore_chunkmap(const H5D_io_info_t *io_info, + haddr_t chunk_addr[], const hsize_t down_chunks[]); #ifdef H5D_ISTORE_DEBUG H5_DLL herr_t H5D_istore_stats (H5D_t *dset, hbool_t headers); #endif /* H5D_ISTORE_DEBUG */ -H5_DLL ssize_t H5D_istore_readvv(const H5D_io_info_t *io_info, - size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], - hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_offset_arr[], haddr_t chunk_addr, void *chunk, void *buf); -H5_DLL ssize_t H5D_istore_writevv(const H5D_io_info_t *io_info, - size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], - hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_offset_arr[], haddr_t chunk_addr, void *chunk, - const void *buf); H5_DLL haddr_t H5D_istore_get_addr(const H5D_io_info_t *io_info, struct H5D_istore_ud1_t *_udata); H5_DLL herr_t H5D_istore_copy(H5F_t *f_src, H5O_layout_t *layout_src, @@ -452,17 +548,6 @@ H5_DLL void * H5D_istore_lock(const H5D_io_info_t *io_info, H5D_istore_ud1_t *ud hbool_t relax, unsigned *idx_hint/*in,out*/); H5_DLL herr_t H5D_istore_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint, void *chunk, size_t naccessed); -H5_DLL hbool_t H5D_istore_if_load(const H5D_io_info_t *io_info, haddr_t caddr); - -/* Functions that operate on external file list (efl) storage */ -H5_DLL ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf); -H5_DLL ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[], - haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf); /* Functions that perform fill value operations on datasets */ H5_DLL herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, @@ -485,36 +570,37 @@ H5_DLL herr_t H5D_fill_term(H5D_fill_buf_info_t *fb_info); #define H5Dmpio_DEBUG #endif /*H5Dmpio_DEBUG*/ #endif/*H5S_DEBUG*/ -/* MPI-IO function to read , it will select either regular or irregular read */ -H5_DLL herr_t H5D_mpio_select_read(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const struct H5S_t *file_space, const struct H5S_t *mem_space, - haddr_t addr, void UNUSED *pointer/*in*/, void *buf/*out*/); - -/* MPI-IO function to read , it will select either regular or irregular read */ -H5_DLL herr_t H5D_mpio_select_write(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const struct H5S_t *file_space, const struct H5S_t *mem_space, - haddr_t addr, void UNUSED *pointer/*in*/, const void *buf); - -/* MPI-IO function to handle contiguous collective IO */ -H5_DLL herr_t -H5D_contig_collective_io(H5D_io_info_t *io_info, - const H5S_t *file_space,const H5S_t *mem_space, - const void *_buf,hbool_t do_write); - -/* MPI-IO function to handle chunked collective IO */ -H5_DLL herr_t -H5D_chunk_collective_io(H5D_io_info_t * io_info, H5D_chunk_map_t *fm, const void*buf, - hbool_t do_write); +/* MPI-IO function to read, it will select either regular or irregular read */ +H5_DLL herr_t H5D_mpio_select_read(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); + +/* MPI-IO function to write, it will select either regular or irregular read */ +H5_DLL herr_t H5D_mpio_select_write(const H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); + +/* MPI-IO functions to handle contiguous collective IO */ +H5_DLL herr_t H5D_contig_collective_read(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, H5D_chunk_map_t *fm); +H5_DLL herr_t H5D_contig_collective_write(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, H5D_chunk_map_t *fm); + +/* MPI-IO functions to handle chunked collective IO */ +H5_DLL herr_t H5D_chunk_collective_read(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, H5D_chunk_map_t *fm); +H5_DLL herr_t H5D_chunk_collective_write(H5D_io_info_t *io_info, + const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, + const H5S_t *mem_space, H5D_chunk_map_t *fm); + /* MPI-IO function to check if a direct I/O transfer is possible between * memory and the file */ -H5_DLL htri_t H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *mem_space, - const H5S_t *file_space, const H5T_path_t *tpath); - -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS -H5_DLL herr_t H5D_mpio_chunk_adjust_iomode(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm); -#endif /* H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ +H5_DLL htri_t H5D_mpio_opt_possible(const H5D_io_info_t *io_info, + const H5S_t *file_space, const H5S_t *mem_space, + const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 410dc43..8cf134f 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -65,7 +65,6 @@ #define H5D_XFER_HYPER_VECTOR_SIZE_NAME "vec_size" /* Hyperslab vector size */ #ifdef H5_HAVE_PARALLEL #define H5D_XFER_IO_XFER_MODE_NAME "io_xfer_mode" /* I/O transfer mode */ -#define H5D_XFER_IO_XFER_OPT_MODE_NAME "io_xfer_opt_mode" /* I/O optimization transfer mode (using MPI-IO independent IO with file set view) */ #define H5D_XFER_MPIO_COLLECTIVE_OPT_NAME "mpio_collective_opt" /* Optimization of MPI-IO transfer mode */ #define H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME "mpio_chunk_opt_hard" #define H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME "mpio_chunk_opt_num" @@ -107,23 +106,6 @@ /* Typedef for dataset in memory (defined in H5Dpkg.h) */ typedef struct H5D_t H5D_t; -/* Typedef for dataset storage information */ -typedef struct { - hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */ - hsize_t *offset; /* Chunk's coordinates in elements */ -} H5D_chunk_storage_t; - -typedef struct { - haddr_t dset_addr; /* Address of dataset in file */ - hsize_t dset_size; /* Total size of dataset in file */ -} H5D_contig_storage_t; - -typedef union H5D_storage_t { - H5O_efl_t efl; /* External file list information for dataset */ - H5D_chunk_storage_t chunk; /* Chunk information for dataset */ - H5D_contig_storage_t contig; /* Contiguous information for dataset */ -} H5D_storage_t; - /* Typedef for cached dataset transfer property list information */ typedef struct H5D_dxpl_cache_t { size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ @@ -135,7 +117,7 @@ typedef struct H5D_dxpl_cache_t { size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5FD_mpio_collective_opt_t xfer_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ + H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ #endif /*H5_HAVE_PARALLEL*/ H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */ @@ -163,8 +145,6 @@ H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset); H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); -H5_DLL herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); /* Functions that operate on vlen data */ H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c new file mode 100644 index 0000000..3ea4c69 --- /dev/null +++ b/src/H5Dscatgath.c @@ -0,0 +1,899 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/****************/ +/* Module Setup */ +/****************/ + +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ + + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ +static size_t H5D_gather_file(const H5D_io_info_t *io_info, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, + void *buf); +static herr_t H5D_scatter_file(const H5D_io_info_t *io_info, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, + const void *buf); +static size_t H5D_gather_mem(const void *_buf, + const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, + const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); +static herr_t H5D_compound_opt_read(size_t nelmts, const H5S_t *mem_space, + H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, + const H5D_type_info_t *type_info, void *user_buf/*out*/); +static herr_t H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Declare a free list to manage sequences of size_t */ +H5FL_SEQ_EXTERN(size_t); + +/* Declare a free list to manage sequences of hsize_t */ +H5FL_SEQ_EXTERN(hsize_t); + + + +/*------------------------------------------------------------------------- + * Function: H5D_scatter_file + * + * Purpose: Scatters dataset elements from the type conversion buffer BUF + * to the file F where the data points are arranged according to + * the file dataspace FILE_SPACE and stored according to + * LAYOUT and EFL. Each element is ELMT_SIZE bytes. + * The caller is requesting that NELMTS elements are copied. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, June 20, 2002 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_scatter_file(const H5D_io_info_t *_io_info, + const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, + const void *_buf) +{ + H5D_io_info_t tmp_io_info; /* Temporary I/O info object */ + hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + hsize_t *off = NULL; /* Pointer to sequence offsets */ + hsize_t mem_off; /* Offset in memory */ + size_t mem_curr_seq; /* "Current sequence" in memory */ + size_t dset_curr_seq; /* "Current sequence" in dataset */ + size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t *len = NULL; /* Array to store sequence lengths */ + size_t orig_mem_len, mem_len; /* Length of sequence in memory */ + size_t nseq; /* Number of sequences generated */ + size_t nelem; /* Number of elements used in sequences */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_scatter_file) + + /* Check args */ + HDassert(_io_info); + HDassert(space); + HDassert(iter); + HDassert(nelmts > 0); + HDassert(_buf); + + /* Set up temporary I/O info object */ + HDmemcpy(&tmp_io_info, _io_info, sizeof(*_io_info)); + tmp_io_info.op_type = H5D_IO_OP_WRITE; + tmp_io_info.u.wbuf = _buf; + + /* Allocate the vector I/O arrays */ + if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { + if(NULL == (len = H5FL_SEQ_MALLOC(size_t, tmp_io_info.dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array") + if(NULL == (off = H5FL_SEQ_MALLOC(hsize_t, tmp_io_info.dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array") + } /* end if */ + else { + len = _len; + off = _off; + } /* end else */ + + /* Loop until all elements are written */ + while(nelmts > 0) { + /* Get list of sequences for selection to write */ + if(H5S_SELECT_GET_SEQ_LIST(space, H5S_GET_SEQ_LIST_SORTED, iter, tmp_io_info.dxpl_cache->vec_size, nelmts, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") + + /* Reset the current sequence information */ + mem_curr_seq = dset_curr_seq = 0; + orig_mem_len = mem_len = nelem * iter->elmt_size; + mem_off = 0; + + /* Write sequence list out */ + if((*tmp_io_info.layout_ops.writevv)(&tmp_io_info, nseq, &dset_curr_seq, + len, off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") + + /* Update buffer */ + tmp_io_info.u.wbuf = (const uint8_t *)tmp_io_info.u.wbuf + orig_mem_len; + + /* Decrement number of elements left to process */ + nelmts -= nelem; + } /* end while */ + +done: + /* Release resources, if allocated */ + if(len && len != _len) + H5FL_SEQ_FREE(size_t, len); + if(off && off != _off) + H5FL_SEQ_FREE(hsize_t, off); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_scatter_file() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_gather_file + * + * Purpose: Gathers data points from file F and accumulates them in the + * type conversion buffer BUF. The LAYOUT argument describes + * how the data is stored on disk and EFL describes how the data + * is organized in external files. ELMT_SIZE is the size in + * bytes of a datum which this function treats as opaque. + * FILE_SPACE describes the dataspace of the dataset on disk + * and the elements that have been selected for reading (via + * hyperslab, etc). This function will copy at most NELMTS + * elements. + * + * Return: Success: Number of elements copied. + * Failure: 0 + * + * Programmer: Quincey Koziol + * Monday, June 24, 2002 + * + *------------------------------------------------------------------------- + */ +static size_t +H5D_gather_file(const H5D_io_info_t *_io_info, + const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, + void *_buf/*out*/) +{ + H5D_io_info_t tmp_io_info; /* Temporary I/O info object */ + hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + hsize_t *off = NULL; /* Pointer to sequence offsets */ + hsize_t mem_off; /* Offset in memory */ + size_t mem_curr_seq; /* "Current sequence" in memory */ + size_t dset_curr_seq; /* "Current sequence" in dataset */ + size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t *len = NULL; /* Pointer to sequence lengths */ + size_t orig_mem_len, mem_len; /* Length of sequence in memory */ + size_t nseq; /* Number of sequences generated */ + size_t nelem; /* Number of elements used in sequences */ + size_t ret_value = nelmts; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_gather_file) + + /* Check args */ + HDassert(_io_info); + HDassert(_io_info->dset); + HDassert(_io_info->store); + HDassert(space); + HDassert(iter); + HDassert(nelmts > 0); + HDassert(_buf); + + /* Set up temporary I/O info object */ + HDmemcpy(&tmp_io_info, _io_info, sizeof(*_io_info)); + tmp_io_info.op_type = H5D_IO_OP_READ; + tmp_io_info.u.rbuf = _buf; + + /* Allocate the vector I/O arrays */ + if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { + if(NULL == (len = H5FL_SEQ_MALLOC(size_t, tmp_io_info.dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O length vector array") + if(NULL == (off = H5FL_SEQ_MALLOC(hsize_t, tmp_io_info.dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O offset vector array") + } /* end if */ + else { + len = _len; + off = _off; + } /* end else */ + + /* Loop until all elements are read */ + while(nelmts > 0) { + /* Get list of sequences for selection to read */ + if(H5S_SELECT_GET_SEQ_LIST(space, H5S_GET_SEQ_LIST_SORTED, iter, tmp_io_info.dxpl_cache->vec_size, nelmts, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed") + + /* Reset the current sequence information */ + mem_curr_seq = dset_curr_seq = 0; + orig_mem_len = mem_len = nelem * iter->elmt_size; + mem_off = 0; + + /* Read sequence list in */ + if((*tmp_io_info.layout_ops.readvv)(&tmp_io_info, nseq, &dset_curr_seq, + len, off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error") + + /* Update buffer */ + tmp_io_info.u.rbuf = (uint8_t *)tmp_io_info.u.rbuf + orig_mem_len; + + /* Decrement number of elements left to process */ + nelmts -= nelem; + } /* end while */ + +done: + /* Release resources, if allocated */ + if(len && len != _len) + H5FL_SEQ_FREE(size_t, len); + if(off && off != _off) + H5FL_SEQ_FREE(hsize_t, off); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_gather_file() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_scatter_mem + * + * Purpose: Scatters NELMTS data points from the scatter buffer + * TSCAT_BUF to the application buffer BUF. Each element is + * ELMT_SIZE bytes and they are organized in application memory + * according to SPACE. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Monday, July 8, 2002 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_scatter_mem (const void *_tscat_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, + void *_buf/*out*/) +{ + uint8_t *buf = (uint8_t *)_buf; /* Get local copies for address arithmetic */ + const uint8_t *tscat_buf = (const uint8_t *)_tscat_buf; + hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + hsize_t *off = NULL; /* Pointer to sequence offsets */ + size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t *len = NULL; /* Pointer to sequence lengths */ + size_t curr_len; /* Length of bytes left to process in sequence */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being processed */ + size_t nelem; /* Number of elements used in sequences */ + herr_t ret_value = SUCCEED; /* Number of elements scattered */ + + FUNC_ENTER_NOAPI(H5D_scatter_mem, FAIL) + + /* Check args */ + HDassert(tscat_buf); + HDassert(space); + HDassert(iter); + HDassert(nelmts > 0); + HDassert(buf); + + /* Allocate the vector I/O arrays */ + if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { + if(NULL == (len = H5FL_SEQ_MALLOC(size_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array") + if(NULL == (off = H5FL_SEQ_MALLOC(hsize_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array") + } /* end if */ + else { + len = _len; + off = _off; + } /* end else */ + + /* Loop until all elements are written */ + while(nelmts > 0) { + /* Get list of sequences for selection to write */ + if(H5S_SELECT_GET_SEQ_LIST(space, 0, iter, dxpl_cache->vec_size, nelmts, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed") + + /* Loop, while sequences left to process */ + for(curr_seq = 0; curr_seq < nseq; curr_seq++) { + /* Get the number of bytes in sequence */ + curr_len = len[curr_seq]; + + HDmemcpy(buf + off[curr_seq], tscat_buf, curr_len); + + /* Advance offset in destination buffer */ + tscat_buf += curr_len; + } /* end for */ + + /* Decrement number of elements left to process */ + nelmts -= nelem; + } /* end while */ + +done: + /* Release resources, if allocated */ + if(len && len != _len) + H5FL_SEQ_FREE(size_t, len); + if(off && off != _off) + H5FL_SEQ_FREE(hsize_t, off); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_scatter_mem() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_gather_mem + * + * Purpose: Gathers dataset elements from application memory BUF and + * copies them into the gather buffer TGATH_BUF. + * Each element is ELMT_SIZE bytes and arranged in application + * memory according to SPACE. + * The caller is requesting that at most NELMTS be gathered. + * + * Return: Success: Number of elements copied. + * Failure: 0 + * + * Programmer: Quincey Koziol + * Monday, June 24, 2002 + * + *------------------------------------------------------------------------- + */ +static size_t +H5D_gather_mem(const void *_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, + void *_tgath_buf/*out*/) +{ + const uint8_t *buf = (const uint8_t *)_buf; /* Get local copies for address arithmetic */ + uint8_t *tgath_buf = (uint8_t *)_tgath_buf; + hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + hsize_t *off = NULL; /* Pointer to sequence offsets */ + size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t *len = NULL; /* Pointer to sequence lengths */ + size_t curr_len; /* Length of bytes left to process in sequence */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being processed */ + size_t nelem; /* Number of elements used in sequences */ + size_t ret_value = nelmts; /* Number of elements gathered */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_gather_mem) + + /* Check args */ + HDassert(buf); + HDassert(space); + HDassert(iter); + HDassert(nelmts > 0); + HDassert(tgath_buf); + + /* Allocate the vector I/O arrays */ + if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { + if(NULL == (len = H5FL_SEQ_MALLOC(size_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O length vector array") + if(NULL == (off = H5FL_SEQ_MALLOC(hsize_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O offset vector array") + } /* end if */ + else { + len = _len; + off = _off; + } /* end else */ + + /* Loop until all elements are written */ + while(nelmts > 0) { + /* Get list of sequences for selection to write */ + if(H5S_SELECT_GET_SEQ_LIST(space, 0, iter, dxpl_cache->vec_size, nelmts, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed") + + /* Loop, while sequences left to process */ + for(curr_seq = 0; curr_seq < nseq; curr_seq++) { + /* Get the number of bytes in sequence */ + curr_len = len[curr_seq]; + + HDmemcpy(tgath_buf, buf + off[curr_seq], curr_len); + + /* Advance offset in gather buffer */ + tgath_buf += curr_len; + } /* end for */ + + /* Decrement number of elements left to process */ + nelmts -= nelem; + } /* end while */ + +done: + /* Release resources, if allocated */ + if(len && len != _len) + H5FL_SEQ_FREE(size_t, len); + if(off && off != _off) + H5FL_SEQ_FREE(hsize_t, off); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5D_gather_mem() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_scatgath_read + * + * Purpose: Perform scatter/gather ead from a contiguous [piece of a] dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 6, 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) +{ + const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ + void *buf = io_info->u.rbuf; /* Local pointer to application buffer */ + H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ + hbool_t mem_iter_init = FALSE; /*memory selection iteration info has been initialized */ + H5S_sel_iter_t bkg_iter; /*background iteration info*/ + hbool_t bkg_iter_init = FALSE; /*background iteration info has been initialized */ + H5S_sel_iter_t file_iter; /*file selection iteration info*/ + hbool_t file_iter_init = FALSE; /*file selection iteration info has been initialized */ + hsize_t smine_start; /*strip mine start loc */ + size_t smine_nelmts; /*elements per strip */ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_scatgath_read) + + /* Sanity check */ + HDassert(io_info); + HDassert(type_info); + HDassert(mem_space); + HDassert(file_space); + HDassert(buf); + + /* Check for NOOP read */ + if(nelmts == 0) + HGOTO_DONE(SUCCEED) + + /* Figure out the strip mine size. */ + if(H5S_select_iter_init(&file_iter, file_space, type_info->src_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") + file_iter_init = TRUE; /*file selection iteration info has been initialized */ + if(H5S_select_iter_init(&mem_iter, mem_space, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; /*file selection iteration info has been initialized */ + if(H5S_select_iter_init(&bkg_iter, mem_space, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") + bkg_iter_init = TRUE; /*file selection iteration info has been initialized */ + + /* Start strip mining... */ + for(smine_start = 0; smine_start < nelmts; smine_start += smine_nelmts) { + size_t n; /* Elements operated on */ + + /* Go figure out how many elements to read from the file */ + HDassert(H5S_SELECT_ITER_NELMTS(&file_iter) == (nelmts - smine_start)); + smine_nelmts = (size_t)MIN(type_info->request_nelmts, (nelmts - smine_start)); + + /* + * Gather the data from disk into the datatype conversion + * buffer. Also gather data from application to background buffer + * if necessary. + */ + + /* + * Gather data + */ + n = H5D_gather_file(io_info, file_space, &file_iter, smine_nelmts, + type_info->tconv_buf/*out*/); + if(n != smine_nelmts) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") + + /* If the source and destination are compound types and subset of each other + * and no conversion is needed, copy the data directly into user's buffer and + * bypass the rest of steps. + */ + if(H5T_SUBSET_FALSE != type_info->cmpd_subset) { + if(H5D_compound_opt_read(smine_nelmts, mem_space, &mem_iter, dxpl_cache, + type_info, buf /*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") + } /* end if */ + else { + if(H5T_BKG_YES == type_info->need_bkg) { + n = H5D_gather_mem(buf, mem_space, &bkg_iter, smine_nelmts, + dxpl_cache, type_info->bkg_buf/*out*/); + if(n != smine_nelmts) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") + } /* end if */ + + /* + * Perform datatype conversion. + */ + if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, + smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, + type_info->bkg_buf, io_info->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") + + /* Do the data transform after the conversion (since we're using type mem_type) */ + if(!type_info->is_xform_noop) + if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + + /* + * Scatter the data into memory. + */ + if(H5D_scatter_mem(type_info->tconv_buf, mem_space, &mem_iter, + smine_nelmts, dxpl_cache, buf/*out*/) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") + } /* end else */ + } /* end for */ + +done: + /* Release selection iterators */ + if(file_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + if(mem_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + if(bkg_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_scatgath_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_scatgath_write + * + * Purpose: Perform scatter/gather write to a contiguous [piece of a] dataset. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, March 6, 2008 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) +{ + const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ + const void *buf = io_info->u.wbuf; /* Local pointer to application buffer */ + H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ + hbool_t mem_iter_init = FALSE; /*memory selection iteration info has been initialized */ + H5S_sel_iter_t bkg_iter; /*background iteration info*/ + hbool_t bkg_iter_init = FALSE; /*background iteration info has been initialized */ + H5S_sel_iter_t file_iter; /*file selection iteration info*/ + hbool_t file_iter_init = FALSE; /*file selection iteration info has been initialized */ + hsize_t smine_start; /*strip mine start loc */ + size_t smine_nelmts; /*elements per strip */ + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_scatgath_write) + + /* Sanity check */ + HDassert(io_info); + HDassert(type_info); + HDassert(mem_space); + HDassert(file_space); + HDassert(buf); + + /* Check for NOOP write */ + if(nelmts == 0) + HGOTO_DONE(SUCCEED) + + /* Figure out the strip mine size. */ + if(H5S_select_iter_init(&file_iter, file_space, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") + file_iter_init = TRUE; /*file selection iteration info has been initialized */ + if(H5S_select_iter_init(&mem_iter, mem_space, type_info->src_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") + mem_iter_init = TRUE; /*file selection iteration info has been initialized */ + if(H5S_select_iter_init(&bkg_iter, file_space, type_info->dst_type_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") + bkg_iter_init = TRUE; /*file selection iteration info has been initialized */ + + /* Start strip mining... */ + for(smine_start = 0; smine_start < nelmts; smine_start += smine_nelmts) { + size_t n; /* Elements operated on */ + + /* Go figure out how many elements to read from the file */ + HDassert(H5S_SELECT_ITER_NELMTS(&file_iter) == (nelmts - smine_start)); + smine_nelmts = (size_t)MIN(type_info->request_nelmts, (nelmts - smine_start)); + + /* + * Gather data from application buffer into the datatype conversion + * buffer. Also gather data from the file into the background buffer + * if necessary. + */ + n = H5D_gather_mem(buf, mem_space, &mem_iter, smine_nelmts, + dxpl_cache, type_info->tconv_buf/*out*/); + if(n != smine_nelmts) + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed") + + /* If the source and destination are compound types and the destination is + * is a subset of the source and no conversion is needed, copy the data + * directly into user's buffer and bypass the rest of steps. If the source + * is a subset of the destination, the optimization is done in conversion + * function H5T_conv_struct_opt to protect the background data. + */ + if(H5T_SUBSET_DST == type_info->cmpd_subset) { + if(H5D_compound_opt_write(smine_nelmts, type_info) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") + } /* end if */ + else { + if(H5T_BKG_YES == type_info->need_bkg) { + n = H5D_gather_file(io_info, file_space, &bkg_iter, smine_nelmts, + type_info->bkg_buf/*out*/); + if(n != smine_nelmts) + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") + } /* end if */ + + /* + * Perform datatype conversion. + */ + if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, + smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, + type_info->bkg_buf, io_info->dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") + + /* Do the data transform after the type conversion (since we're using dataset->shared->type). */ + if(!type_info->is_xform_noop) + if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->dset_type) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + } /* end else */ + + /* + * Scatter the data out to the file. + */ + if(H5D_scatter_file(io_info, file_space, &file_iter, smine_nelmts, + type_info->tconv_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") + } /* end for */ + +done: + /* Release selection iterators */ + if(file_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&file_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + if(mem_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + if(bkg_iter_init) { + if(H5S_SELECT_ITER_RELEASE(&bkg_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_scatgath_write() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_compound_opt_read + * + * Purpose: A special optimization case when the source and + * destination members are a subset of each other, and + * the order is the same, and no conversion is needed. + * For example: + * struct source { struct destination { + * TYPE1 A; --> TYPE1 A; + * TYPE2 B; --> TYPE2 B; + * TYPE3 C; --> TYPE3 C; + * }; TYPE4 D; + * TYPE5 E; + * }; + * or + * struct destination { struct source { + * TYPE1 A; <-- TYPE1 A; + * TYPE2 B; <-- TYPE2 B; + * TYPE3 C; <-- TYPE3 C; + * }; TYPE4 D; + * TYPE5 E; + * }; + * The optimization is simply moving data to the appropriate + * places in the buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * 11 June 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_compound_opt_read(size_t nelmts, const H5S_t *space, + H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, + const H5D_type_info_t *type_info, void *user_buf/*out*/) +{ + uint8_t *ubuf = (uint8_t *)user_buf; /* Cast for pointer arithmetic */ + uint8_t *xdbuf; /* Pointer into dataset buffer */ + hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + hsize_t *off = NULL; /* Pointer to sequence offsets */ + size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t *len = NULL; /* Pointer to sequence lengths */ + size_t src_stride, dst_stride, type_size; + herr_t ret_value = SUCCEED; /*return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5D_compound_opt_read) + + /* Check args */ + HDassert(nelmts > 0); + HDassert(space); + HDassert(iter); + HDassert(dxpl_cache); + HDassert(type_info); + HDassert(user_buf); + + /* Allocate the vector I/O arrays */ + if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { + if(NULL == (len = H5FL_SEQ_MALLOC(size_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array") + if(NULL == (off = H5FL_SEQ_MALLOC(hsize_t, dxpl_cache->vec_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array") + } /* end if */ + else { + len = _len; + off = _off; + } /* end else */ + + /* Get source & destination strides */ + src_stride = type_info->src_type_size; + dst_stride = type_info->dst_type_size; + + if(H5T_SUBSET_SRC == type_info->cmpd_subset) + type_size = src_stride; + else { + HDassert(H5T_SUBSET_DST == type_info->cmpd_subset); + type_size = dst_stride; + } /* end else */ + + /* Loop until all elements are written */ + xdbuf = type_info->tconv_buf; + while(nelmts > 0) { + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being processed */ + size_t elmtno; /* Element counter */ + + /* Get list of sequences for selection to write */ + if(H5S_SELECT_GET_SEQ_LIST(space, 0, iter, dxpl_cache->vec_size, nelmts, &nseq, &elmtno, off, len) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed") + + /* Loop, while sequences left to process */ + for(curr_seq = 0; curr_seq < nseq; curr_seq++) { + size_t curr_off; /* Offset of bytes left to process in sequence */ + size_t curr_len; /* Length of bytes left to process in sequence */ + size_t curr_nelmts; /* Number of elements to process in sequence */ + uint8_t *xubuf; + size_t i; /* Local index variable */ + + /* Get the number of bytes and offset in sequence */ + curr_len = len[curr_seq]; + curr_off = off[curr_seq]; + + /* Decide the number of elements and position in the buffer. */ + curr_nelmts = curr_len / dst_stride; + xubuf = ubuf + curr_off; + + /* Copy the data into the right place. */ + for(i = 0; i < curr_nelmts; i++) { + HDmemmove(xubuf, xdbuf, type_size); + + /* Update pointers */ + xdbuf += src_stride; + xubuf += dst_stride; + } /* end for */ + } /* end for */ + + /* Decrement number of elements left to process */ + nelmts -= elmtno; + } /* end while */ + +done: + /* Release resources, if allocated */ + if(len && len != _len) + H5FL_SEQ_FREE(size_t, len); + if(off && off != _off) + H5FL_SEQ_FREE(hsize_t, off); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_compound_opt_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_compound_opt_write + * + * Purpose: A special optimization case when the source and + * destination members are a subset of each other, and + * the order is the same, and no conversion is needed. + * For example: + * struct source { struct destination { + * TYPE1 A; --> TYPE1 A; + * TYPE2 B; --> TYPE2 B; + * TYPE3 C; --> TYPE3 C; + * }; TYPE4 D; + * TYPE5 E; + * }; + * or + * struct destination { struct source { + * TYPE1 A; <-- TYPE1 A; + * TYPE2 B; <-- TYPE2 B; + * TYPE3 C; <-- TYPE3 C; + * }; TYPE4 D; + * TYPE5 E; + * }; + * The optimization is simply moving data to the appropriate + * places in the buffer. + * + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * 11 June 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) +{ + uint8_t *xsbuf, *xdbuf; /* Source & destination pointers into dataset buffer */ + size_t src_stride, dst_stride; /* Strides through source & destination datatypes */ + size_t i; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compound_opt_write) + + /* Check args */ + HDassert(nelmts > 0); + HDassert(type_info); + + /* Initialize values for loop */ + src_stride = type_info->src_type_size; + dst_stride = type_info->dst_type_size; + + /* Loop until all elements are written */ + xsbuf = (uint8_t *)type_info->tconv_buf; + xdbuf = (uint8_t *)type_info->tconv_buf; + for(i = 0; i < nelmts; i++) { + HDmemmove(xdbuf, xsbuf, dst_stride); + + /* Update pointers */ + xsbuf += src_stride; + xdbuf += dst_stride; + } /* end for */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5D_compound_opt_write() */ + diff --git a/src/H5Dselect.c b/src/H5Dselect.c index f08672f..947c81e 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -34,400 +34,37 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ + /****************/ /* Local Macros */ /****************/ + /******************/ /* Local Typedefs */ /******************/ + /********************/ /* Local Prototypes */ /********************/ -/* Struct for holding the vectorized I/O operation buffers "loosely" */ -typedef struct { - enum { - H5S_SELECT_READ, /* Read selection */ - H5S_SELECT_WRITE /* Write selection */ - } op_type; - union { - void *rbuf; /* Buffer for read */ - const void *wbuf; /* Buffer to write */ - } u; -} H5D_select_buf_t; /*********************/ /* Package Variables */ /*********************/ + /*******************/ /* Local Variables */ /*******************/ /* Declare a free list to manage sequences of size_t */ -H5FL_SEQ_DEFINE_STATIC(size_t); +H5FL_SEQ_DEFINE(size_t); /* Declare a free list to manage sequences of hsize_t */ -H5FL_SEQ_DEFINE_STATIC(hsize_t); - - -/*------------------------------------------------------------------------- - * Function: H5D_select_fscat - * - * Purpose: Scatters dataset elements from the type conversion buffer BUF - * to the file F where the data points are arranged according to - * the file dataspace FILE_SPACE and stored according to - * LAYOUT and EFL. Each element is ELMT_SIZE bytes. - * The caller is requesting that NELMTS elements are copied. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, June 20, 2002 - * - *------------------------------------------------------------------------- - */ -herr_t -H5D_select_fscat (H5D_io_info_t *io_info, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - haddr_t chunk_addr, void *chunk/*in*/, const void *_buf) -{ - const uint8_t *buf=_buf; /* Alias for pointer arithmetic */ - hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t *off=NULL; /* Pointer to sequence offsets */ - hsize_t mem_off; /* Offset in memory */ - size_t mem_curr_seq; /* "Current sequence" in memory */ - size_t dset_curr_seq; /* "Current sequence" in dataset */ - size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t *len=NULL; /* Array to store sequence lengths */ - size_t orig_mem_len, mem_len; /* Length of sequence in memory */ - size_t nseq; /* Number of sequences generated */ - size_t nelem; /* Number of elements used in sequences */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_select_fscat, FAIL); - - /* Check args */ - assert (io_info); - assert (space); - assert (iter); - assert (nelmts>0); - assert (_buf); - assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); - - /* Allocate the vector I/O arrays */ - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if((len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array"); - if((off = H5FL_SEQ_MALLOC(hsize_t,io_info->dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array"); - } /* end if */ - else { - len=_len; - off=_off; - } /* end else */ - - /* Loop until all elements are written */ - while(nelmts>0) { - /* Get list of sequences for selection to write */ - if(H5S_SELECT_GET_SEQ_LIST(space,H5S_GET_SEQ_LIST_SORTED,iter,io_info->dxpl_cache->vec_size,nelmts,&nseq,&nelem,off,len)<0) - HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed"); - - /* Reset the current sequence information */ - mem_curr_seq=dset_curr_seq=0; - orig_mem_len=mem_len=nelem*iter->elmt_size; - mem_off=0; - - /* Write sequence list out */ - if((*io_info->ops.writevv)(io_info, nseq, &dset_curr_seq, len, off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error"); - - /* Update buffer */ - buf += orig_mem_len; - - /* Decrement number of elements left to process */ - nelmts -= nelem; - } /* end while */ - -done: - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if(len!=NULL) - H5FL_SEQ_FREE(size_t,len); - if(off!=NULL) - H5FL_SEQ_FREE(hsize_t,off); - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} /* H5D_select_fscat() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_select_fgath - * - * Purpose: Gathers data points from file F and accumulates them in the - * type conversion buffer BUF. The LAYOUT argument describes - * how the data is stored on disk and EFL describes how the data - * is organized in external files. ELMT_SIZE is the size in - * bytes of a datum which this function treats as opaque. - * FILE_SPACE describes the dataspace of the dataset on disk - * and the elements that have been selected for reading (via - * hyperslab, etc). This function will copy at most NELMTS - * elements. - * - * Return: Success: Number of elements copied. - * Failure: 0 - * - * Programmer: Quincey Koziol - * Monday, June 24, 2002 - * - *------------------------------------------------------------------------- - */ -size_t -H5D_select_fgath (H5D_io_info_t *io_info, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - haddr_t chunk_addr, void *chunk/*in*/, void *_buf/*out*/) -{ - uint8_t *buf=(uint8_t*)_buf; /* Alias for pointer arithmetic */ - hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t *off=NULL; /* Pointer to sequence offsets */ - hsize_t mem_off; /* Offset in memory */ - size_t mem_curr_seq; /* "Current sequence" in memory */ - size_t dset_curr_seq; /* "Current sequence" in dataset */ - size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t *len=NULL; /* Pointer to sequence lengths */ - size_t orig_mem_len, mem_len; /* Length of sequence in memory */ - size_t nseq; /* Number of sequences generated */ - size_t nelem; /* Number of elements used in sequences */ - size_t ret_value=nelmts; /* Return value */ - - FUNC_ENTER_NOAPI(H5D_select_fgath, 0); - - /* Check args */ - assert (io_info); - assert (io_info->dset); - assert (io_info->store); - assert (space); - assert (iter); - assert (nelmts>0); - assert (_buf); - - /* Allocate the vector I/O arrays */ - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if((len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O length vector array"); - if((off = H5FL_SEQ_MALLOC(hsize_t,io_info->dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O offset vector array"); - } /* end if */ - else { - len=_len; - off=_off; - } /* end else */ - - /* Loop until all elements are read */ - while(nelmts>0) { - /* Get list of sequences for selection to read */ - if(H5S_SELECT_GET_SEQ_LIST(space,H5S_GET_SEQ_LIST_SORTED,iter,io_info->dxpl_cache->vec_size,nelmts,&nseq,&nelem,off,len)<0) - HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed"); - - /* Reset the current sequence information */ - mem_curr_seq=dset_curr_seq=0; - orig_mem_len=mem_len=nelem*iter->elmt_size; - mem_off=0; - - /* Read sequence list in */ - if((*io_info->ops.readvv)(io_info, nseq, &dset_curr_seq, len, off, (size_t)1, - &mem_curr_seq, &mem_len, &mem_off, chunk_addr, chunk, buf) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error"); - - /* Update buffer */ - buf += orig_mem_len; - - /* Decrement number of elements left to process */ - nelmts -= nelem; - } /* end while */ - -done: - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if(len!=NULL) - H5FL_SEQ_FREE(size_t,len); - if(off!=NULL) - H5FL_SEQ_FREE(hsize_t,off); - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} /* H5D_select_fgath() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_select_mscat - * - * Purpose: Scatters NELMTS data points from the scatter buffer - * TSCAT_BUF to the application buffer BUF. Each element is - * ELMT_SIZE bytes and they are organized in application memory - * according to SPACE. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Monday, July 8, 2002 - * - *------------------------------------------------------------------------- - */ -herr_t -H5D_select_mscat (const void *_tscat_buf, const H5S_t *space, - H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, - void *_buf/*out*/) -{ - uint8_t *buf=(uint8_t *)_buf; /* Get local copies for address arithmetic */ - const uint8_t *tscat_buf=(const uint8_t *)_tscat_buf; - hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t *off=NULL; /* Pointer to sequence offsets */ - size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t *len=NULL; /* Pointer to sequence lengths */ - size_t curr_len; /* Length of bytes left to process in sequence */ - size_t nseq; /* Number of sequences generated */ - size_t curr_seq; /* Current sequence being processed */ - size_t nelem; /* Number of elements used in sequences */ - herr_t ret_value=SUCCEED; /* Number of elements scattered */ - - FUNC_ENTER_NOAPI(H5D_select_mscat, FAIL); - - /* Check args */ - assert (tscat_buf); - assert (space); - assert (iter); - assert (nelmts>0); - assert (buf); - - /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if((len = H5FL_SEQ_MALLOC(size_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array"); - if((off = H5FL_SEQ_MALLOC(hsize_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array"); - } /* end if */ - else { - len=_len; - off=_off; - } /* end else */ - - /* Loop until all elements are written */ - while(nelmts>0) { - /* Get list of sequences for selection to write */ - if(H5S_SELECT_GET_SEQ_LIST(space,0,iter,dxpl_cache->vec_size,nelmts,&nseq,&nelem,off,len)<0) - HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed"); - - /* Loop, while sequences left to process */ - for(curr_seq=0; curr_seqvec_size != H5D_IO_VECTOR_SIZE) { - if(len!=NULL) - H5FL_SEQ_FREE(size_t,len); - if(off!=NULL) - H5FL_SEQ_FREE(hsize_t,off); - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} /* H5D_select_mscat() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_select_mgath - * - * Purpose: Gathers dataset elements from application memory BUF and - * copies them into the gather buffer TGATH_BUF. - * Each element is ELMT_SIZE bytes and arranged in application - * memory according to SPACE. - * The caller is requesting that at most NELMTS be gathered. - * - * Return: Success: Number of elements copied. - * Failure: 0 - * - * Programmer: Quincey Koziol - * Monday, June 24, 2002 - * - *------------------------------------------------------------------------- - */ -size_t -H5D_select_mgath (const void *_buf, const H5S_t *space, - H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, - void *_tgath_buf/*out*/) -{ - const uint8_t *buf=(const uint8_t *)_buf; /* Get local copies for address arithmetic */ - uint8_t *tgath_buf=(uint8_t *)_tgath_buf; - hsize_t _off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t *off=NULL; /* Pointer to sequence offsets */ - size_t _len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t *len=NULL; /* Pointer to sequence lengths */ - size_t curr_len; /* Length of bytes left to process in sequence */ - size_t nseq; /* Number of sequences generated */ - size_t curr_seq; /* Current sequence being processed */ - size_t nelem; /* Number of elements used in sequences */ - size_t ret_value=nelmts; /* Number of elements gathered */ - - FUNC_ENTER_NOAPI(H5D_select_mgath, 0); - - /* Check args */ - assert (buf); - assert (space); - assert (iter); - assert (nelmts>0); - assert (tgath_buf); - - /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if((len = H5FL_SEQ_MALLOC(size_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O length vector array"); - if((off = H5FL_SEQ_MALLOC(hsize_t,dxpl_cache->vec_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate I/O offset vector array"); - } /* end if */ - else { - len=_len; - off=_off; - } /* end else */ - - /* Loop until all elements are written */ - while(nelmts>0) { - /* Get list of sequences for selection to write */ - if(H5S_SELECT_GET_SEQ_LIST(space,0,iter,dxpl_cache->vec_size,nelmts,&nseq,&nelem,off,len)<0) - HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, 0, "sequence length generation failed"); - - /* Loop, while sequences left to process */ - for(curr_seq=0; curr_seqvec_size != H5D_IO_VECTOR_SIZE) { - if(len!=NULL) - H5FL_SEQ_FREE(size_t,len); - if(off!=NULL) - H5FL_SEQ_FREE(hsize_t,off); - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} /* H5D_select_mgath() */ /*------------------------------------------------------------------------- @@ -443,11 +80,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_select_io(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - haddr_t addr, void *chunk/*in*/, - const H5D_select_buf_t *io_buf) +H5D_select_io(const H5D_io_info_t *io_info, size_t elmt_size, + size_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { H5S_sel_iter_t mem_iter; /* Memory selection iteration info */ hbool_t mem_iter_init = 0; /* Memory selection iteration info has been initialized */ @@ -475,10 +109,10 @@ H5D_select_io(H5D_io_info_t *io_info, HDassert(io_info->dset); HDassert(io_info->store); HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER)); - HDassert(io_buf->u.rbuf); + HDassert(io_info->u.rbuf); /* Allocate the vector I/O arrays */ - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { + if(io_info->dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) { if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O length vector array") if(NULL == (mem_off = H5FL_SEQ_MALLOC(hsize_t,io_info->dxpl_cache->vec_size))) @@ -511,19 +145,17 @@ H5D_select_io(H5D_io_info_t *io_info, *file_len = *mem_len = elmt_size; /* Perform I/O on memory and file sequences */ - if(io_buf->op_type == H5S_SELECT_READ) { - if((tmp_file_len = (*io_info->ops.readvv)(io_info, + if(io_info->op_type == H5D_IO_OP_READ) { + if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info, file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off, - addr, chunk, io_buf->u.rbuf)) < 0) + mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { - HDassert(io_buf->op_type == H5S_SELECT_WRITE); - if((tmp_file_len = (*io_info->ops.writevv)(io_info, + HDassert(io_info->op_type == H5D_IO_OP_WRITE); + if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info, file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off, - addr, chunk, io_buf->u.wbuf)) < 0) + mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ @@ -571,19 +203,17 @@ H5D_select_io(H5D_io_info_t *io_info, } /* end if */ /* Perform I/O on memory and file sequences */ - if(io_buf->op_type == H5S_SELECT_READ) { - if((tmp_file_len = (*io_info->ops.readvv)(io_info, + if(io_info->op_type == H5D_IO_OP_READ) { + if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info, file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off, - addr, chunk, io_buf->u.rbuf)) < 0) + mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { - HDassert(io_buf->op_type == H5S_SELECT_WRITE); - if((tmp_file_len = (*io_info->ops.writevv)(io_info, + HDassert(io_info->op_type == H5D_IO_OP_WRITE); + if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info, file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off, - addr, chunk, io_buf->u.wbuf)) < 0) + mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ @@ -604,17 +234,15 @@ done: if(H5S_SELECT_ITER_RELEASE(&mem_iter) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") - /* Free vector arrays */ - if(io_info->dxpl_cache->vec_size != H5D_IO_VECTOR_SIZE) { - if(file_len != NULL) - H5FL_SEQ_FREE(size_t, file_len); - if(file_off != NULL) - H5FL_SEQ_FREE(hsize_t, file_off); - if(mem_len != NULL) - H5FL_SEQ_FREE(size_t, mem_len); - if(mem_off != NULL) - H5FL_SEQ_FREE(hsize_t, mem_off); - } /* end if */ + /* Release vector arrays, if allocated */ + if(file_len && file_len != _file_len) + H5FL_SEQ_FREE(size_t, file_len); + if(file_off && file_off != _file_off) + H5FL_SEQ_FREE(hsize_t, file_off); + if(mem_len && mem_len != _mem_len) + H5FL_SEQ_FREE(size_t, mem_len); + if(mem_off && mem_off != _mem_off) + H5FL_SEQ_FREE(hsize_t, mem_off); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_select_io() */ @@ -633,23 +261,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_select_read(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - haddr_t addr, void *chunk/*in*/, - void *buf/*out*/) +H5D_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { - H5D_select_buf_t io_buf; /* Selection I/O operation to perform */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5D_select_read, FAIL) - /* Construct proper I/O operation */ - io_buf.op_type = H5S_SELECT_READ; - io_buf.u.rbuf = buf; - /* Call generic selection operation */ - if(H5D_select_io(io_info, nelmts, elmt_size, file_space, mem_space, addr, chunk, &io_buf) < 0) + H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); + if(H5D_select_io(io_info, type_info->src_type_size, (size_t)nelmts, + file_space, mem_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") done: @@ -670,23 +292,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_select_write(H5D_io_info_t *io_info, - size_t nelmts, size_t elmt_size, - const H5S_t *file_space, const H5S_t *mem_space, - haddr_t addr, void *chunk/*in*/, - const void *buf/*out*/) +H5D_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, + hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { - H5D_select_buf_t io_buf; /* Selection I/O operation to perform */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5D_select_write, FAIL) - /* Construct proper I/O operation */ - io_buf.op_type = H5S_SELECT_WRITE; - io_buf.u.wbuf = buf; - /* Call generic selection operation */ - if(H5D_select_io(io_info, nelmts, elmt_size, file_space, mem_space, addr, chunk, &io_buf) < 0) + H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); + if(H5D_select_io(io_info, type_info->dst_type_size, (size_t)nelmts, + file_space, mem_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") done: diff --git a/src/H5F.c b/src/H5F.c index cb9e3b8..80c28bc 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -978,6 +978,9 @@ done: * Programmer: Robb Matzke * matzke@llnl.gov * Jul 18 1997 + * Modifications: + * Vailin Choi, April 2, 2008 + * Free f->extpath * *------------------------------------------------------------------------- */ @@ -1068,6 +1071,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Free the non-shared part of the file */ f->name = H5MM_xfree(f->name); + f->extpath = H5MM_xfree(f->extpath); f->mtab.child = H5MM_xfree(f->mtab.child); f->mtab.nalloc = 0; if(H5FO_top_dest(f) < 0) @@ -1078,6 +1082,8 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_dest() */ + + /*------------------------------------------------------------------------- * Function: H5F_open @@ -1157,6 +1163,9 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) * Modified H5F_flush call to take one flag instead of * multiple Boolean flags. * + * Vailin Choi, 2008-04-02 + * To formulate path for later searching of target file for external link + * via H5_build_extpath(). *------------------------------------------------------------------------- */ H5F_t * @@ -1353,6 +1362,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match") } /* end if */ + /* formulate the absolute path for later search of target file for external link */ + if (H5_build_extpath(name, &file->extpath) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to build extpath") + /* Success */ ret_value = file; @@ -2140,6 +2153,33 @@ H5F_get_intent(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_extpath + * + * Purpose: Retrieve the file's 'extpath' flags + * This is used by H5L_extern_traverse() to retrieve the main file's location + * when searching the target file. + * + * Return: 'extpath' on success/abort on failure (shouldn't fail) + * + * Programmer: Vailin Choi, April 2, 2008 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +char * +H5F_get_extpath(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_extpath) + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->extpath) +} /* end H5F_get_extpath() */ + + +/*------------------------------------------------------------------------- * Function: H5F_sizeof_addr * * Purpose: Quick and dirty routine to retrieve the size of the file's size_t @@ -3618,4 +3658,3 @@ H5Fget_info(hid_t obj_id, H5F_info_t *finfo) done: FUNC_LEAVE_API(ret_value) } /* end H5Fget_info() */ - diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 90aa0e2..0384018 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -42,14 +42,14 @@ typedef enum H5FD_mpio_xfer_t { H5FD_MPIO_COLLECTIVE } H5FD_mpio_xfer_t; -/* Type of I/O for data transfer properties */ +/* Type of chunked dataset I/O */ typedef enum H5FD_mpio_chunk_opt_t { H5FD_MPIO_CHUNK_DEFAULT = 0, H5FD_MPIO_CHUNK_ONE_IO, /*zero is the default*/ H5FD_MPIO_CHUNK_MULTI_IO } H5FD_mpio_chunk_opt_t; -/* Type of I/O for data transfer properties */ +/* Type of collective I/O */ typedef enum H5FD_mpio_collective_opt_t { H5FD_MPIO_COLLECTIVE_IO = 0, H5FD_MPIO_INDIVIDUAL_IO /*zero is the default*/ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index c8087bb..89a8637 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -572,15 +572,15 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl") /* Set the transfer mode */ - if (H5P_set(plist,H5D_XFER_MPIO_COLLECTIVE_OPT_NAME,&opt_mode)<0) + if(H5P_set(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") /* Initialize driver-specific properties */ - ret_value= H5P_set_driver(plist, H5FD_MPIO, NULL); + ret_value = H5P_set_driver(plist, H5FD_MPIO, NULL); done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Pset_dxpl_mpio_collective_opt() */ /*------------------------------------------------------------------------- @@ -1413,8 +1413,8 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add int type_size; /* MPI datatype used for I/O's size */ int io_size; /* Actual number of bytes requested */ H5P_genplist_t *plist; /* Property list pointer */ - unsigned use_view_this_time=0; - herr_t ret_value=SUCCEED; + hbool_t use_view_this_time = FALSE; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5FD_mpio_read, FAIL) @@ -1464,7 +1464,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add MPI_Datatype file_type; /* Remember that views are used */ - use_view_this_time=TRUE; + use_view_this_time = TRUE; /* prepare for a full-blown xfer using btype, ftype, and disp */ if(H5P_get(plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME,&buf_type)<0) @@ -1487,9 +1487,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add } /* end if */ /* Read the data. */ - if (use_view_this_time) { + if(use_view_this_time) { H5FD_mpio_collective_opt_t coll_opt_mode; - H5FD_mpio_collective_opt_t xfer_opt_mode; + #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_read: using MPIO collective mode\n"); @@ -1497,28 +1497,23 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add /* Peek the collective_opt property to check whether the application wants to do IO individually. */ coll_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME); - /* Peek the xfer_opt_mode property to check whether the application wants to do IO individually. */ - xfer_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_OPT_MODE_NAME); - - if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO && xfer_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { + if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - fprintf(stdout, "H5FD_mpio_read: doing MPI collective IO\n"); + if(H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "H5FD_mpio_read: doing MPI collective IO\n"); #endif -/* Temporarily change to read_at_all - if (MPI_SUCCESS!= (mpi_code=MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat )))*/ - if (MPI_SUCCESS!= (mpi_code=MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat ))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mpi_code) - } + if(MPI_SUCCESS != (mpi_code = MPI_File_read_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at_all failed", mpi_code) + } /* end if */ else { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - fprintf(stdout, "H5FD_mpio_read: doing MPI independent IO\n"); + if(H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "H5FD_mpio_read: doing MPI independent IO\n"); #endif - if (MPI_SUCCESS!= (mpi_code=MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat ))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code) - } + if(MPI_SUCCESS != (mpi_code = MPI_File_read_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_read_at failed", mpi_code) + } /* end else */ /* * Reset the file view when we used MPI derived types @@ -1700,7 +1695,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, int size_i, bytes_written; int type_size; /* MPI datatype used for I/O's size */ int io_size; /* Actual number of bytes requested */ - unsigned use_view_this_time=0; + hbool_t use_view_this_time = FALSE; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; @@ -1718,26 +1713,25 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, assert(buf); /* Portably initialize MPI status variable */ - HDmemset(&mpi_stat,0,sizeof(MPI_Status)); + HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); /* some numeric conversions */ - if (H5FD_mpi_haddr_to_MPIOff(addr, &mpi_off)<0) + if(H5FD_mpi_haddr_to_MPIOff(addr, &mpi_off) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off") size_i = (int)size; - if ((hsize_t)size_i != size) + if((hsize_t)size_i != size) HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i") #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) - fprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", - (long)mpi_off, size_i); + if(H5FD_mpio_Debug[(int)'w']) + fprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", (long)mpi_off, size_i); #endif /* Obtain the data transfer properties */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if(type==H5FD_MEM_DRAW) { + if(type == H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ /* Obtain the data transfer properties */ @@ -1749,114 +1743,71 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * us to test that btype=ftype=MPI_BYTE (or even MPI_TYPE_NULL, which * could mean "use MPI_BYTE" by convention). */ - if(xfer_mode==H5FD_MPIO_COLLECTIVE) { + if(xfer_mode == H5FD_MPIO_COLLECTIVE) { MPI_Datatype file_type; /* Remember that views are used */ - use_view_this_time=TRUE; + use_view_this_time = TRUE; /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME,&buf_type)<0) + if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME,&file_type)<0) + if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") /* * Set the file view when we are using MPI derived types */ /*OKAY: CAST DISCARDS CONST QUALIFIER*/ - if (MPI_SUCCESS != (mpi_code=MPI_File_set_view(file->f, mpi_off, MPI_BYTE, file_type, H5FD_mpi_native_g, file->info))) + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(file->f, mpi_off, MPI_BYTE, file_type, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) /* When using types, use the address as the displacement for * MPI_File_set_view and reset the address for the read to zero */ - mpi_off=0; + mpi_off = 0; } /* end if */ } /* end if */ else { - unsigned block_before_meta_write=0; /* Whether to block before a metadata write */ - - /* Check if we need to syncronize all processes before attempting metadata write - * (Prevents race condition where the process writing the metadata goes ahead - * and writes the metadata to the file before all the processes have - * read the data, "transmitting" data from the "future" to the reading - * process. -QAK ) - * - * The only time we don't want to block before a metadata write is when - * we are flushing out a bunch of metadata. Then, we block before the - * first write and don't block for further writes in the sequence. - */ - if(H5P_exist_plist(plist,H5AC_BLOCK_BEFORE_META_WRITE_NAME)>0) - if(H5P_get(plist,H5AC_BLOCK_BEFORE_META_WRITE_NAME,&block_before_meta_write)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property") - -#if 0 /* JRM */ - /* The metadata cache now only writes from process 0, which makes - * this synchronization incorrect. I'm leaving this code commented - * out instead of deleting it to remind us that we should re-write - * this function so that a metadata write from any other process - * should flag an error. - * -- JRM 9/1/05 - */ - if(block_before_meta_write) - if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(file->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) -#endif /* JRM */ - - /* Only one process will do the actual write if all procs in comm write same metadata */ - if (file->mpi_rank != H5_PAR_META_WRITE) { -#ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'w']) { - fprintf(stdout, - " proc %d: in H5FD_mpio_write (write omitted)\n", - file->mpi_rank ); - } -#endif + /* Only one process can do the actual metadata write */ + if(file->mpi_rank != H5_PAR_META_WRITE) +#ifdef LATER + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't write metadata from non-zero rank") +#else /* LATER */ HGOTO_DONE(SUCCEED) /* skip the actual write */ - } /* end if */ +#endif /* LATER */ } /* end if */ /* Write the data. */ - if (use_view_this_time) { - H5FD_mpio_collective_opt_t coll_opt_mode; - H5FD_mpio_collective_opt_t xfer_opt_mode; + if(use_view_this_time) { + H5FD_mpio_collective_opt_t coll_opt_mode; + #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) + if(H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_write: using MPIO collective mode\n"); #endif /* Peek the collective_opt property to check whether the application wants to do IO individually. */ - coll_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist,H5D_XFER_MPIO_COLLECTIVE_OPT_NAME); - - /* Peek the xfer_opt_mode property to check whether the application wants to do IO individually. */ - xfer_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist,H5D_XFER_IO_XFER_OPT_MODE_NAME); + coll_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME); /*OKAY: CAST DISCARDS CONST QUALIFIER*/ - if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO && xfer_opt_mode == H5FD_MPIO_COLLECTIVE_IO ) { + if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - fprintf(stdout, "H5FD_mpio_write: doing MPI collective IO\n"); + if(H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "H5FD_mpio_write: doing MPI collective IO\n"); #endif - /* Temporarily change to _at -if (MPI_SUCCESS != (mpi_code=MPI_File_write_at_all(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) -*/ - if (MPI_SUCCESS != (mpi_code=MPI_File_write_at_all(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) - } + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) + } /* end if */ else { #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) - fprintf(stdout, "H5FD_mpio_write: doing MPI independent IO\n"); + if(H5FD_mpio_Debug[(int)'t']) + fprintf(stdout, "H5FD_mpio_write: doing MPI independent IO\n"); #endif - - if (MPI_SUCCESS != (mpi_code=MPI_File_write_at(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) - } - + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) + } /* end else */ - /* - * Reset the file view when we used MPI derived types - */ + /* Reset the file view when we used MPI derived types */ /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) @@ -1872,48 +1823,31 @@ if (MPI_SUCCESS != (mpi_code=MPI_File_write_at_all(file->f, mpi_off, (void*)buf, * datatype in this call though... (We aren't because using it causes * the LANL "qsc" machine to dump core - 12/19/03) - QAK] */ - if (MPI_SUCCESS != (mpi_code=MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_written))) + if(MPI_SUCCESS != (mpi_code = MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_written))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code) /* Get the type's size */ - if (MPI_SUCCESS != (mpi_code=MPI_Type_size(buf_type,&type_size))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_size(buf_type, &type_size))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_size failed", mpi_code) /* Compute the actual number of bytes requested */ - io_size=type_size*size_i; + io_size = type_size * size_i; /* Check for write failure */ - if (bytes_written != io_size) + if(bytes_written != io_size) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Forget the EOF value (see H5FD_mpio_get_eof()) --rpm 1999-08-06 */ file->eof = HADDR_UNDEF; done: - -#if 0 /* JRM */ - /* Since metadata writes are now done by process 0 only, this broadcast - * is no longer needed. I leave it in and commented out to remind us - * that we need to re-work this function to reflect this reallity. - * - * -- JRM 9/1/05 - */ - /* if only one process writes, need to broadcast the ret_value to - * other processes - */ - if(type != H5FD_MEM_DRAW) { - if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&ret_value, (int)sizeof(ret_value), MPI_BYTE, H5_PAR_META_WRITE, file->comm))) - HMPI_DONE_ERROR(FAIL, "MPI_Bcast failed", mpi_code) - } /* end if */ -#endif /* JRM */ - #ifdef H5FDmpio_DEBUG - if (H5FD_mpio_Debug[(int)'t']) + if(H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "proc %d: Leaving H5FD_mpio_write with ret_value=%d\n", file->mpi_rank, ret_value ); #endif FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_mpio_write() */ /*------------------------------------------------------------------------- diff --git a/src/H5FScache.c b/src/H5FScache.c index 74a9aab..8ad9631 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -606,7 +606,7 @@ HDfprintf(stderr, "%s: fspace->addr = %a, fs_addr = %a\n", FUNC, fspace->addr, f unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = MAX(1, (H5V_log2_gen(fspace->serial_sect_count) + 7) / 8); + sect_cnt_size = H5V_limit_enc_size((uint64_t)fspace->serial_sect_count); #ifdef QAK HDfprintf(stderr, "%s: sect_cnt_size = %u\n", FUNC, sect_cnt_size); HDfprintf(stderr, "%s: fspace->sect_len_size = %u\n", FUNC, fspace->sect_len_size); @@ -905,7 +905,7 @@ HDfprintf(stderr, "%s: sinfo->fspace->addr = %a\n", FUNC, sinfo->fspace->addr); /* Set up user data for iterator */ udata.sinfo = sinfo; udata.p = &p; - udata.sect_cnt_size = MAX(1, (H5V_log2_gen(sinfo->fspace->serial_sect_count) + 7) / 8); + udata.sect_cnt_size = H5V_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); #ifdef QAK HDfprintf(stderr, "%s: udata.sect_cnt_size = %u\n", FUNC, udata.sect_cnt_size); #endif /* QAK */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index c589aa0..34da067 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -147,7 +147,7 @@ H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace) sinfo->nbins = H5V_log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = (H5V_log2_gen(fspace->max_sect_size) + 7) / 8; + sinfo->sect_len_size = H5V_limit_enc_size((uint64_t)fspace->max_sect_size); sinfo->fspace = fspace; #ifdef QAK HDfprintf(stderr, "%s: sinfo->nbins = %u\n", FUNC, sinfo->nbins); @@ -1300,7 +1300,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", FUNC, fspace-> HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", FUNC, fspace->sinfo->serial_size_count); HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count); #endif /* QAK */ - sect_buf_size += fspace->sinfo->serial_size_count * MAX(1, ((H5V_log2_gen(fspace->serial_sect_count) + 7) / 8)); + sect_buf_size += fspace->sinfo->serial_size_count * H5V_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 3f10e1a..288ef8a 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -142,6 +142,7 @@ typedef struct H5F_mtab_t { struct H5F_t { unsigned intent; /* The flags passed to H5F_open()*/ char *name; /* Name used to open file */ + char *extpath; /* Path for searching target external link file */ H5F_file_t *shared; /* The shared file info */ unsigned nopen_objs; /* Number of open object headers*/ H5FO_t *obj_count; /* # of time each object is opened through top file structure */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 1044b14..27b45f2 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -265,6 +265,7 @@ typedef struct H5F_t H5F_t; #define H5F_GC_REF(F) ((F)->shared->gc_ref) #define H5F_USE_LATEST_FORMAT(F) ((F)->shared->latest_format) #define H5F_INTENT(F) ((F)->intent) +#define H5F_EXTPATH(F) ((F)->extpath) #define H5F_GET_FC_DEGREE(F) ((F)->shared->fc_degree) #define H5F_STORE_MSG_CRT_IDX(F) ((F)->shared->store_msg_crt_idx) #define H5F_GET_FILENO(F,FILENUM) ((FILENUM) = (F)->shared->lf->fileno) @@ -284,6 +285,7 @@ typedef struct H5F_t H5F_t; #define H5F_GC_REF(F) (H5F_gc_ref(F)) #define H5F_USE_LATEST_FORMAT(F) (H5F_use_latest_format(F)) #define H5F_INTENT(F) (H5F_get_intent(F)) +#define H5F_EXTPATH(F) (H5F_get_extpath(F)) #define H5F_GET_FC_DEGREE(F) (H5F_get_fc_degree(F)) #define H5F_STORE_MSG_CRT_IDX(F) (H5F_store_msg_crt_idx(F)) #define H5F_GET_FILENO(F,FILENUM) (H5F_get_filenum((F), &(FILENUM))) @@ -417,6 +419,7 @@ H5_DLL herr_t H5F_try_close(H5F_t *f); H5_DLL hid_t H5F_get_driver_id(const H5F_t *f); H5_DLL hid_t H5F_get_access_plist(H5F_t *f); H5_DLL unsigned H5F_get_intent(const H5F_t *f); +H5_DLL char *H5F_get_extpath(const H5F_t *f); H5_DLL herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum); H5_DLL hid_t H5F_get_id(H5F_t *file); H5_DLL unsigned H5F_get_obj_count(const H5F_t *f, unsigned types); diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index c1b856b..60d5002 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -225,7 +225,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Set the size of heap IDs */ hdr->heap_len_size = MIN(hdr->man_dtable.max_dir_blk_off_size, - ((H5V_log2_gen((uint64_t)hdr->max_man_size) + 7) / 8)); + H5V_limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 70133aa..7fedc48 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -1591,7 +1591,7 @@ done: */ herr_t H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_addr, - unsigned nrows, hsize_t *heap_size) + unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ hbool_t did_protect; /* Whether we protected the indirect block or not */ @@ -1608,7 +1608,7 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad HDassert(heap_size); /* Protect the indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, NULL, 0, FALSE, H5AC_READ, &did_protect))) + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC_READ, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Accumulate size of this indirect block */ @@ -1624,13 +1624,14 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; first_row_bits = H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + H5V_log2_of2(hdr->man_dtable.cparam.width); - num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = + (H5V_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ for(v = 0; v < hdr->man_dtable.cparam.width; v++, entry++) if(H5F_addr_defined(iblock->ents[entry].addr)) - if(H5HF_man_iblock_size(f, dxpl_id, hdr, iblock->ents[entry].addr, num_indirect_rows, heap_size) < 0) + if(H5HF_man_iblock_size(f, dxpl_id, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to get fractal heap storage info for indirect block") } /* end for */ } /* end if */ @@ -1639,6 +1640,7 @@ done: /* Release the indirect block */ if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") + iblock = NULL; FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_man_iblock_size() */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 702ce08..fd332e5 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -601,7 +601,7 @@ H5_DLL herr_t H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); H5_DLL herr_t H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, - haddr_t iblock_addr, unsigned nrows, hsize_t *heap_size/*out*/); + haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/); /* Direct block routines */ H5_DLL herr_t H5HF_man_dblock_new(H5HF_hdr_t *fh, hid_t dxpl_id, size_t request, diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 2e3e189..d151b47 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -128,6 +128,7 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) { H5HF_hdr_t *hdr; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ + hsize_t meta_size = 0; /* free space storage size */ FUNC_ENTER_NOAPI(H5HF_size, FAIL) @@ -147,7 +148,7 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) /* Check for indirect blocks for managed objects */ if(H5F_addr_defined(hdr->man_dtable.table_addr) && hdr->man_dtable.curr_root_rows != 0) - if(H5HF_man_iblock_size(hdr->f, dxpl_id, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, heap_size) < 0) + if(H5HF_man_iblock_size(hdr->f, dxpl_id, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get fractal heap storage info for indirect block") /* Get B-tree storage for huge objects in fractal heap */ @@ -172,9 +173,11 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) } /* end if */ /* Get storage for free-space tracking info */ - if(H5F_addr_defined(hdr->fs_addr)) - if(H5HF_space_size(hdr, dxpl_id, heap_size) < 0) + if(H5F_addr_defined(hdr->fs_addr)) { + if(H5HF_space_size(hdr, dxpl_id, &meta_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info") + *heap_size += meta_size; + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 5a8eb33..4e355bb 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -76,6 +76,81 @@ H5L_init_extern_interface(void) } /* H5L_init_extern_interface() */ + +/*-------------------------------------------------------------------------- + * Function: H5L_getenv_prefix_name -- + * + * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, + * which is separated by the environment delimiter. + * ENV_PREFIX is modified to point to the remaining pathnames + * in the list. + * + * Return: A pointer to a pathname + * + * Programmer: Vailin Choi, April 2, 2008 + * +--------------------------------------------------------------------------*/ +static char * +H5L_getenv_prefix_name(char **env_prefix/*in,out*/) +{ + char *retptr=NULL; + char *strret=NULL; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_getenv_prefix_name) + + strret = HDstrchr(*env_prefix, COLON_SEPC); + if (strret == NULL) { + retptr = *env_prefix; + *env_prefix = strret; + } else { + retptr = *env_prefix; + *env_prefix = strret + 1; + *strret = '\0'; + } + return(retptr); + FUNC_LEAVE_NOAPI(retptr) +} + + +/*-------------------------------------------------------------------------- + * Function: H5L_build_name + * + * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi, April 2, 2008 + * +--------------------------------------------------------------------------*/ +static herr_t +H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) +{ + size_t prefix_len; /* length of prefix */ + size_t fname_len; /* Length of external link file name */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5L_build_name) + + prefix_len = HDstrlen(prefix); + fname_len = HDstrlen(file_name); + + /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ + if(NULL == (*full_name = H5MM_malloc(prefix_len + fname_len + 2))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") + + /* Copy the prefix into the buffer */ + HDstrcpy(*full_name, prefix); + if (!CHECK_DELIMITER(prefix[prefix_len-1])) + HDstrcat(*full_name, DIR_SEPS); + + /* Add the external link's filename to the prefix supplied */ + HDstrcat(*full_name, file_name); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5L_build_name() */ + + /*------------------------------------------------------------------------- * Function: H5L_extern_traverse * @@ -92,6 +167,10 @@ H5L_init_extern_interface(void) * * Programmer: James Laird * Monday, July 10, 2006 + * Modifications: + * Vailin Choi, April 2, 2008 + * Add handling to search for the target file + * See description in RM: H5Lcreate_external * *------------------------------------------------------------------------- */ @@ -114,6 +193,11 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, hid_t ext_obj = -1; /* ID for external link's object */ hid_t ret_value; /* Return value */ + char *tempname=NULL, *ptr=NULL, *extpath=NULL; + char *env_prefix=NULL, *tmp_env_prefix=NULL; + char *out_prefix_name=NULL, *pp=NULL; + + FUNC_ENTER_NOAPI(H5L_extern_traverse, FAIL) /* Sanity checks */ @@ -135,28 +219,6 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, if(NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the current prefix */ - if(H5P_get(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") - - /* Check for prefix being set, if so, prepend it to the filename */ - if(my_prefix) { - size_t prefix_len = HDstrlen(my_prefix); - - /* Allocate a buffer to hold the filename plus prefix */ - if(NULL == (full_name = H5MM_malloc(prefix_len + fname_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - - /* Copy the prefix into the buffer */ - HDstrcpy(full_name, my_prefix); - - /* Add the external link's filename to the prefix supplied */ - HDstrcat(full_name, (const char *)p); - - /* Point to name w/prefix */ - file_name = full_name; - } /* end if */ - /* Get the location for the group holding the external link */ if(H5G_loc(cur_group, &loc) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get object location") @@ -183,10 +245,92 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") } /* end if */ - /* Open the external file */ - /* (extra work with file intent to mask off inappropriate flags) */ - if(NULL == (ext_file = H5F_open(file_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) - HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file") + /* + * Start searching for the target file + */ + if ((tempname=H5MM_strdup(file_name)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* target file_name is an absolute pathname: see RM for detailed description */ + if (CHECK_ABSOLUTE(file_name) || CHECK_ABS_PATH(file_name)) { + if(NULL == (ext_file = H5F_open(file_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { + H5E_clear_stack(NULL); + /* get last component of file_name */ + GET_LAST_DELIMITER(file_name, ptr) + HDassert(ptr); + HDstrcpy(tempname, ++ptr); + } + } else if (CHECK_ABS_DRIVE(file_name)) { + if(NULL == (ext_file = H5F_open(file_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { + H5E_clear_stack(NULL); + /* strip ":" */ + HDstrcpy(tempname, &file_name[2]); + } + } + + /* try searching from paths set in the environment variable */ + if ((ext_file == NULL) && (env_prefix=HDgetenv("HDF5_EXT_PREFIX"))) { + + tmp_env_prefix = H5MM_strdup(env_prefix); + pp = tmp_env_prefix; + + while ((tmp_env_prefix) && (*tmp_env_prefix)) { + out_prefix_name = H5L_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + if ((out_prefix_name) && (*out_prefix_name)) { + + if (H5L_build_name(out_prefix_name, tempname, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") + + ext_file = H5F_open(full_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id); + if (full_name) + H5MM_xfree(full_name); + if (ext_file != NULL) + break; + H5E_clear_stack(NULL); + } + } /* end while */ + if (pp) + H5MM_xfree(pp); + } + + /* try searching from property list */ + if (ext_file == NULL) { + if(H5P_get(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") + if (my_prefix) { + if (H5L_build_name(my_prefix, tempname, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") + if ((ext_file=H5F_open(full_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id)) == NULL) + H5E_clear_stack(NULL); + if (full_name) + H5MM_xfree(full_name); + } + } + + /* try searching from main file's "extpath":see description in H5F_open() & H5_build_extpath() */ + if ((ext_file == NULL) && (extpath=H5F_EXTPATH(loc.oloc->file))) { + if (H5L_build_name(extpath, tempname, &full_name/*out*/) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") + if ((ext_file = H5F_open(full_name, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id)) == NULL) + H5E_clear_stack(NULL); + if (full_name) + H5MM_xfree(full_name); + } + + /* try the relative file_name stored in tempname */ + if (ext_file == NULL) { + if ((ext_file=H5F_open(tempname, ((intent & H5F_ACC_RDWR) ? H5F_ACC_RDWR : H5F_ACC_RDONLY), + H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file") + } + + if (tempname) + H5MM_xfree(tempname); /* Increment the number of open objects, to hold the file open */ H5F_incr_nopen_objs(ext_file); @@ -219,10 +363,6 @@ done: if(ext_file && H5F_try_close(ext_file) < 0) HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, FAIL, "problem closing external file") - /* Free full_name if it's been allocated */ - if(full_name) - H5MM_xfree(full_name); - /* Close object if it's open and something failed */ if(ret_value < 0 && ext_obj >= 0 && H5I_dec_ref(ext_obj) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for external object") diff --git a/src/H5Odtype.c b/src/H5Odtype.c index ac07edf..ba343bc 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -232,10 +232,11 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) case H5T_COMPOUND: { unsigned offset_nbytes; /* Size needed to encode member offsets */ + size_t max_memb_pos = 0; /* Maximum member covered, so far */ unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = (H5V_log2_gen((uint64_t)dt->shared->size) + 7) / 8; + offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -336,6 +337,18 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Set the field datatype (finally :-) */ dt->shared->u.compnd.memb[i].type = temp_type; + /* Check if this field overlaps with a prior field */ + /* (probably indicates that the file is corrupt) */ + if(i > 0 && dt->shared->u.compnd.memb[i].offset < max_memb_pos) { + for(j = 0; j < i; j++) + if(dt->shared->u.compnd.memb[i].offset >= dt->shared->u.compnd.memb[j].offset + && dt->shared->u.compnd.memb[i].offset < (dt->shared->u.compnd.memb[j].offset + dt->shared->u.compnd.memb[j].size)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "member overlaps with previous member") + } /* end if */ + + /* Update the maximum member position covered */ + max_memb_pos = MAX(max_memb_pos, (dt->shared->u.compnd.memb[i].offset + dt->shared->u.compnd.memb[i].size)); + /* Check if the datatype stayed packed */ if(dt->shared->u.compnd.packed) { /* Check if the member type is packed */ @@ -734,7 +747,7 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = (H5V_log2_gen((uint64_t)dt->shared->size) + 7) / 8; + offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -1097,7 +1110,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = (H5V_log2_gen((uint64_t)dt->shared->size) + 7) / 8; + offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 6affcad..8bc263a 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -90,9 +90,6 @@ /* Definitions for I/O transfer mode property */ #define H5D_XFER_IO_XFER_MODE_SIZE sizeof(H5FD_mpio_xfer_t) #define H5D_XFER_IO_XFER_MODE_DEF H5FD_MPIO_INDEPENDENT -/* Definitions for I/O optimization transfer mode property(using MPI-IO independent IO with file set view) */ -#define H5D_XFER_IO_XFER_OPT_MODE_SIZE sizeof(H5FD_mpio_collective_opt_t) -#define H5D_XFER_IO_XFER_OPT_MODE_DEF H5FD_MPIO_COLLECTIVE_IO /* Definitions for optimization of MPI-IO transfer mode property */ #define H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE sizeof(H5FD_mpio_collective_opt_t) #define H5D_XFER_MPIO_COLLECTIVE_OPT_DEF H5FD_MPIO_COLLECTIVE_IO @@ -199,7 +196,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */ #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t def_io_xfer_mode = H5D_XFER_IO_XFER_MODE_DEF; /* Default value for I/O transfer mode */ - H5FD_mpio_collective_opt_t def_io_xfer_opt_mode = H5D_XFER_IO_XFER_OPT_MODE_DEF; H5FD_mpio_chunk_opt_t def_mpio_chunk_opt_mode = H5D_XFER_MPIO_CHUNK_OPT_HARD_DEF; H5FD_mpio_collective_opt_t def_mpio_collective_opt_mode = H5D_XFER_MPIO_COLLECTIVE_OPT_DEF; unsigned def_mpio_chunk_opt_num = H5D_XFER_MPIO_CHUNK_OPT_NUM_DEF; @@ -265,8 +261,6 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) /* Register the I/O transfer mode property */ if(H5P_register(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &def_io_xfer_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - if(H5P_register(pclass, H5D_XFER_IO_XFER_OPT_MODE_NAME, H5D_XFER_IO_XFER_OPT_MODE_SIZE, &def_io_xfer_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &def_mpio_collective_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register(pclass, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, H5D_XFER_MPIO_CHUNK_OPT_HARD_SIZE, &def_mpio_chunk_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) diff --git a/src/H5S.c b/src/H5S.c index 8a58cba..4996f1f 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -45,18 +45,6 @@ static herr_t H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc); static H5S_t *H5S_decode(const unsigned char *buf); static htri_t H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2); -#ifdef H5S_DEBUG -/* Names of the selection names, for debugging */ -static const char *H5S_sel_names[]={ - "none", "point", "hyperslab", "all" -}; - -/* The path table, variable length */ -static H5S_iostats_t **H5S_iostats_g = NULL; -static size_t H5S_aiostats_g = 0; /*entries allocated*/ -static size_t H5S_niostats_g = 0; /*entries used*/ -#endif /* H5S_DEBUG */ - #ifdef H5_HAVE_PARALLEL /* Global vars whose value can be set from environment variable also */ hbool_t H5S_mpi_opt_types_g = TRUE; @@ -87,9 +75,9 @@ DESCRIPTION static herr_t H5S_init_interface(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_init_interface); + FUNC_ENTER_NOAPI_NOINIT(H5S_init_interface) /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATASPACE, (size_t)H5I_DATASPACEID_HASHSIZE, H5S_RESERVED_ATOMS, (H5I_free_t)H5S_close) < 0) @@ -105,8 +93,8 @@ H5S_init_interface(void) #endif /* H5_HAVE_PARALLEL */ done: - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_init_interface() */ /*-------------------------------------------------------------------------- @@ -129,156 +117,26 @@ done: int H5S_term_interface(void) { - int n=0; -#ifdef H5S_DEBUG - size_t i; - int j, nprints=0; - H5S_iostats_t *path=NULL; - char buf[256]; -#endif /* H5S_DEBUG */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_term_interface); - - if (H5_interface_initialize_g) { - if ((n=H5I_nmembers(H5I_DATASPACE))) { - H5I_clear_type(H5I_DATASPACE, FALSE); - } else { -#ifdef H5S_DEBUG - /* - * Print statistics about each conversion path. - */ - if (H5DEBUG(S)) { - for (i=0; istats[j].gath_ncalls && - 0==path->stats[j].scat_ncalls && - 0==path->stats[j].bkg_ncalls && - 0==path->stats[j].read_ncalls && - 0==path->stats[j].write_ncalls) { - continue; - } - if (0==nprints++) { - fprintf(H5DEBUG(S), "H5S: data space conversion " - "statistics:\n"); - fprintf(H5DEBUG(S), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "Memory <> File", "Bytes", "Calls", - "User", "System", "Elapsed", "Bandwidth"); - fprintf(H5DEBUG(S), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "--------------", "-----", "-----", - "----", "------", "-------", "---------"); - } - - /* Summary */ - sprintf(buf, "%s %c %s", - H5S_sel_names[path->mtype], 0==j?'>':'<', H5S_sel_names[path->ftype]); - fprintf(H5DEBUG(S), " %-16s\n", buf); - - /* Gather */ - if (path->stats[j].gath_ncalls) { - H5_bandwidth(buf, - (double)(path->stats[j].gath_nbytes), - path->stats[j].gath_timer.etime); - HDfprintf(H5DEBUG(S), - " %16s %10Hu %10Hu %8.2f %8.2f %8.2f " - "%10s\n", "gather", - path->stats[j].gath_nbytes, - path->stats[j].gath_ncalls, - path->stats[j].gath_timer.utime, - path->stats[j].gath_timer.stime, - path->stats[j].gath_timer.etime, - buf); - } - - /* Scatter */ - if (path->stats[j].scat_ncalls) { - H5_bandwidth(buf, - (double)(path->stats[j].scat_nbytes), - path->stats[j].scat_timer.etime); - HDfprintf(H5DEBUG(S), - " %16s %10Hu %10Hu %8.2f %8.2f %8.2f " - "%10s\n", "scatter", - path->stats[j].scat_nbytes, - path->stats[j].scat_ncalls, - path->stats[j].scat_timer.utime, - path->stats[j].scat_timer.stime, - path->stats[j].scat_timer.etime, - buf); - } - - /* Background */ - if (path->stats[j].bkg_ncalls) { - H5_bandwidth(buf, - (double)(path->stats[j].bkg_nbytes), - path->stats[j].bkg_timer.etime); - HDfprintf(H5DEBUG(S), - " %16s %10Hu %10Hu %8.2f %8.2f %8.2f " - "%10s\n", "background", - path->stats[j].bkg_nbytes, - path->stats[j].bkg_ncalls, - path->stats[j].bkg_timer.utime, - path->stats[j].bkg_timer.stime, - path->stats[j].bkg_timer.etime, - buf); - } - - /* Read */ - if (path->stats[j].read_ncalls) { - H5_bandwidth(buf, - (double)(path->stats[j].read_nbytes), - path->stats[j].read_timer.etime); - HDfprintf(H5DEBUG(S), - " %16s %10Hu %10Hu %8.2f %8.2f %8.2f " - "%10s\n", "read", - path->stats[j].read_nbytes, - path->stats[j].read_ncalls, - path->stats[j].read_timer.utime, - path->stats[j].read_timer.stime, - path->stats[j].read_timer.etime, - buf); - } - - /* Write */ - if (path->stats[j].write_ncalls) { - H5_bandwidth(buf, - (double)(path->stats[j].write_nbytes), - path->stats[j].write_timer.etime); - HDfprintf(H5DEBUG(S), - " %16s %10Hu %10Hu %8.2f %8.2f %8.2f " - "%10s\n", "write", - path->stats[j].write_nbytes, - path->stats[j].write_ncalls, - path->stats[j].write_timer.utime, - path->stats[j].write_timer.stime, - path->stats[j].write_timer.etime, - buf); - } - } - } - } -#endif /* H5S_DEBUG */ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_term_interface) + if(H5_interface_initialize_g) { + if((n = H5I_nmembers(H5I_DATASPACE))) { + H5I_clear_type(H5I_DATASPACE, FALSE); + } /* end if */ + else { /* Free data types */ H5I_dec_type_ref(H5I_DATASPACE); -#ifdef H5S_DEBUG - /* Clear/free conversion table */ - for (i=0; iftype==H5S_GET_SELECT_TYPE(file_space) && - H5S_iostats_g[u]->mtype==H5S_GET_SELECT_TYPE(mem_space)) - HGOTO_DONE(H5S_iostats_g[u]); - - /* - * The path wasn't found. Create a new path. - */ - if (NULL==(path = H5MM_calloc(sizeof(*path)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for data space conversion path") - - /* Initialize file & memory conversion functions */ - path->ftype = H5S_GET_SELECT_TYPE(file_space); - path->mtype = H5S_GET_SELECT_TYPE(mem_space); - - /* - * Add the new path to the table. - */ - if (H5S_niostats_g>=H5S_aiostats_g) { - size_t n = MAX(10, 2*H5S_aiostats_g); - H5S_iostats_t **p = H5MM_realloc(H5S_iostats_g, n*sizeof(H5S_iostats_g[0])); - - if (NULL==p) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for data space conversion path table") - H5S_aiostats_g = n; - H5S_iostats_g = p; - } /* end if */ - H5S_iostats_g[H5S_niostats_g++] = path; - - /* Set the return value */ - ret_value=path; - -done: - if(ret_value==NULL) { - if(path!=NULL) - H5MM_xfree(path); - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value); -} /* end H5S_find() */ -#endif /* H5S_DEBUG */ - /*------------------------------------------------------------------------- * Function: H5Screate_simple diff --git a/src/H5Smpio.c b/src/H5Smpio.c index cc89b49..725b8fc 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -123,7 +123,7 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, *new_type = MPI_BYTE; H5_ASSIGN_OVERFLOW(*count, total_bytes, hsize_t, size_t); *extra_offset = 0; - *is_derived_type = 0; + *is_derived_type = FALSE; done: FUNC_LEAVE_NOAPI(ret_value); @@ -163,7 +163,7 @@ H5S_mpio_none_type( const H5S_t UNUSED *space, size_t UNUSED elmt_size, *new_type = MPI_BYTE; *count = 0; *extra_offset = 0; - *is_derived_type = 0; + *is_derived_type = FALSE; FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_mpio_none_type() */ @@ -456,7 +456,7 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, /* fill in the remaining return values */ *count = 1; /* only have to move one of these suckers! */ *extra_offset = 0; - *is_derived_type = 1; + *is_derived_type = TRUE; HGOTO_DONE(SUCCEED); empty: @@ -464,7 +464,7 @@ empty: *new_type = MPI_BYTE; *count = 0; *extra_offset = 0; - *is_derived_type = 0; + *is_derived_type = FALSE; done: /* Release selection iterator */ @@ -475,7 +475,7 @@ done: #ifdef H5S_DEBUG if(H5DEBUG(S)){ - HDfprintf(H5DEBUG(S), "Leave %s, count=%ld is_derived_type=%d\n", + HDfprintf(H5DEBUG(S), "Leave %s, count=%ld is_derived_type=%t\n", FUNC, *count, *is_derived_type ); } #endif @@ -556,7 +556,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space, /* fill in the remaining return values */ *count = 1; *extra_offset = 0; - *is_derived_type = 1; + *is_derived_type = TRUE; HGOTO_DONE(SUCCEED); @@ -565,7 +565,7 @@ empty: *new_type = MPI_BYTE; *count = 0; *extra_offset = 0; - *is_derived_type = 0; + *is_derived_type = FALSE; done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index bd27f09..8744872 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -115,31 +115,6 @@ typedef struct H5S_sel_iter_t { } u; } H5S_sel_iter_t; -#ifdef H5S_DEBUG -typedef struct H5S_iostats_t { - H5S_sel_type ftype; - H5S_sel_type mtype; - - struct { - H5_timer_t scat_timer; /*time spent scattering */ - hsize_t scat_nbytes; /*scatter throughput */ - hsize_t scat_ncalls; /*number of calls */ - H5_timer_t gath_timer; /*time spent gathering */ - hsize_t gath_nbytes; /*gather throughput */ - hsize_t gath_ncalls; /*number of calls */ - H5_timer_t bkg_timer; /*time for background */ - hsize_t bkg_nbytes; /*background throughput */ - hsize_t bkg_ncalls; /*number of calls */ - H5_timer_t read_timer; /*time for read calls */ - hsize_t read_nbytes; /*total bytes read */ - hsize_t read_ncalls; /*number of calls */ - H5_timer_t write_timer; /*time for write calls */ - hsize_t write_nbytes; /*total bytes written */ - hsize_t write_ncalls; /*number of calls */ - } stats[2]; /* 0=output, 1=input */ -} H5S_iostats_t; -#endif - /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5S_PACKAGE #define H5S_GET_EXTENT_TYPE(S) ((S)->extent.type) @@ -198,9 +173,6 @@ typedef struct H5S_iostats_t { /* Operations on dataspaces */ H5_DLL H5S_t *H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max); H5_DLL herr_t H5S_close(H5S_t *ds); -#ifdef H5S_DEBUG -H5_DLL H5S_iostats_t *H5S_find(const H5S_t *mem_space, const H5S_t *file_space); -#endif /* H5S_DEBUG */ H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds); H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds); H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds); diff --git a/src/H5T.c b/src/H5T.c index 04d6c0b..c726e5c 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4552,7 +4552,7 @@ H5T_path_compound_subset(const H5T_path_t *p) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_path_compound_subset); - assert(p); + HDassert(p); if(p->are_compounds) ret_value = H5T_conv_struct_subset(&(p->cdata)); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 0da4d53..7803d07 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1890,17 +1890,15 @@ H5T_subset_t H5T_conv_struct_subset(const H5T_cdata_t *cdata) { H5T_conv_struct_t *priv; - H5T_subset_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_conv_struct_subset) HDassert(cdata); HDassert(cdata->priv); - priv = (H5T_conv_struct_t*)(cdata->priv); - ret_value = priv->smembs_subset; + priv = (H5T_conv_struct_t *)(cdata->priv); - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(priv->smembs_subset) } /* end H5T_conv_struct_subset() */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index dfe2367..2fe4c3a 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -69,7 +69,7 @@ typedef struct H5T_conv_cb_t { /* Values for the optimization of compound data reading and writing. They indicate * whether the fields of the source and destination are subset of each other and - * there is no conversion needed. It's for the Chicago company. + * there is no conversion needed. */ typedef enum { H5T_SUBSET_BADVALUE = -1, /* Invalid value */ diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 94b3699..b92266c 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -410,5 +410,25 @@ H5V_log2_of2(uint32_t n) return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); } /* H5V_log2_of2() */ + +/*------------------------------------------------------------------------- + * Function: H5V_limit_enc_size + * + * Purpose: Determine the # of bytes needed to encode values within a + * range from 0 to a given limit + * + * Return: Number of bytes needed + * + * Programmer: Quincey Koziol + * Thursday, March 13, 2008 + * + *------------------------------------------------------------------------- + */ +static H5_inline unsigned UNUSED +H5V_limit_enc_size(uint64_t limit) +{ + return (H5V_log2_gen(limit) / 8) + 1; +} /* end H5V_limit_enc_size() */ + #endi