summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-20 14:05:37 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-20 14:05:37 (GMT)
commit7458db94f9643978e67102be2ef965f5cc84ae8d (patch)
tree8e09657c8cc8daebe414817273b244a05876b20e
parent8390bfb49662bb58fc0a0c6cf061044779f48046 (diff)
parentde2119f39e3254cd034e2f8734f8ffc68d5bea65 (diff)
downloadhdf5-7458db94f9643978e67102be2ef965f5cc84ae8d.zip
hdf5-7458db94f9643978e67102be2ef965f5cc84ae8d.tar.gz
hdf5-7458db94f9643978e67102be2ef965f5cc84ae8d.tar.bz2
Merge pull request #1878 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit 'de2119f39e3254cd034e2f8734f8ffc68d5bea65': Correct test logic Merge mostly whitespace changes from 1.10 branch Mostly whitespace plus fix broken perf_serial Cleanup of duplicate symbols
-rw-r--r--hl/c++/test/ptableTest.cpp126
-rw-r--r--hl/c++/test/ptableTest.h2
-rw-r--r--hl/src/H5DO.c17
-rw-r--r--hl/src/H5DS.c108
-rw-r--r--hl/src/H5IM.c22
-rw-r--r--hl/src/H5LT.c25
-rw-r--r--hl/test/gen_test_ds.c10
-rw-r--r--hl/test/h5hltest.h4
-rw-r--r--hl/test/test_ds.c280
-rw-r--r--hl/test/test_dset_opt.c36
-rw-r--r--hl/test/test_file_image.c76
-rw-r--r--hl/test/test_image.c112
-rw-r--r--hl/test/test_lite.c203
-rw-r--r--hl/test/test_packet.c30
-rw-r--r--hl/test/test_packet_vlen.c827
-rw-r--r--hl/test/test_table.c161
-rw-r--r--testpar/CMakeVFDTests.cmake68
-rw-r--r--testpar/t_cache.c2801
-rw-r--r--testpar/t_chunk_alloc.c114
-rw-r--r--testpar/t_dset.c1279
-rw-r--r--testpar/t_mdset.c96
-rw-r--r--testpar/t_mpi.c1544
-rw-r--r--testpar/t_pflush1.c264
-rw-r--r--testpar/t_pflush2.c265
-rw-r--r--testpar/t_shapesame.c1737
-rw-r--r--testpar/t_span_tree.c760
-rw-r--r--testpar/testphdf5.c493
-rw-r--r--tools/lib/h5diff.c19
-rw-r--r--tools/lib/h5diff_array.c8
-rw-r--r--tools/lib/h5tools.c6
-rw-r--r--tools/lib/h5tools.h1
-rw-r--r--tools/lib/h5tools_filters.c2
-rw-r--r--tools/lib/h5tools_str.c6
-rw-r--r--tools/lib/h5tools_utils.c46
-rw-r--r--tools/lib/h5tools_utils.h2
-rw-r--r--tools/lib/h5trav.c40
-rw-r--r--tools/perform/pio_standalone.c106
-rw-r--r--tools/perform/sio_engine.c48
-rw-r--r--tools/perform/sio_perf.c9
-rw-r--r--tools/perform/sio_perf.h30
-rw-r--r--tools/perform/sio_standalone.c119
41 files changed, 5776 insertions, 6126 deletions
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp
index 340912e..e873503 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -36,22 +36,22 @@ int main(void)
}
else {
- num_errors += BasicTest();
+ num_errors += BasicTest();
- num_errors += TestCompoundDatatype();
+ num_errors += TestCompoundDatatype();
- num_errors += TestGetPacket();
+ num_errors += TestGetPacket();
- num_errors += TestGetNext();
+ num_errors += TestGetNext();
- num_errors += TestCompress();
+ num_errors += TestCompress();
- num_errors += TestErrors();
+ num_errors += TestErrors();
- num_errors += SystemTest();
+ num_errors += SystemTest();
- /* Test data corruption in packed structs */
- num_errors += TestHDFFV_9758();
+ /* Test data corruption in packed structs */
+ num_errors += TestHDFFV_9758();
/* Terminate access to the file. */
err = H5Fclose(fileID);
@@ -81,7 +81,8 @@ int BasicTest()
hsize_t count;
int error;
- TESTING("basic functionality")
+ printf("Testing %-62s", "basic functionality");
+ HDfflush(stdout);
FL_PacketTable wrapper(fileID, H5P_DEFAULT, BASICTEST_PT, H5T_NATIVE_INT, 1);
if(! wrapper.IsValid())
@@ -137,7 +138,8 @@ int TestCompoundDatatype()
hsize_t count;
int error;
- TESTING("compound datatypes")
+ printf("Testing %-62s", "compound datatypes");
+ HDfflush(stdout);
/* Create compound datatype */
typedef struct compoundType
@@ -206,7 +208,8 @@ int TestGetNext()
int records[2];
int i;
- TESTING("GetNextPacket")
+ printf("Testing %-62s", "GetNextPacket");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, H5P_DEFAULT, GETNEXT_PT, H5T_NATIVE_INT, 500);
@@ -268,20 +271,21 @@ int TestCompress()
unsigned int config = 0;
size_t cd_nelemts = 0;
- TESTING("compression")
+ printf("Testing %-62s", "compression");
+ HDfflush(stdout);
#ifdef H5_HAVE_FILTER_DEFLATE
try {
- /* Prepare property list to set compression, randomly use deflate */
- DSetCreatPropList dscreatplist;
- dscreatplist.setDeflate(6);
+ /* Prepare property list to set compression, randomly use deflate */
+ DSetCreatPropList dscreatplist;
+ dscreatplist.setDeflate(6);
/* Create packet table with compression. */
FL_PacketTable wrapper(fileID, COMPRESS_PT, H5T_NATIVE_CHAR, 100, dscreatplist.getId());
- /* Close the property list */
- dscreatplist.close();
+ /* Close the property list */
+ dscreatplist.close();
- /* Verify that the deflate filter is set */
+ /* Verify that the deflate filter is set */
/* Create an HDF5 C++ file object */
H5File file;
@@ -293,10 +297,10 @@ int TestCompress()
DSetCreatPropList dcpl = dset.getCreatePlist();
- char filter_name[8];
+ char filter_name[8];
dcpl.getFilterById(H5Z_FILTER_DEFLATE, flags, cd_nelemts, NULL, 8, filter_name, config);
- if (HDstrncmp(filter_name, "deflate", 7) != 0)
- H5_FAILED()
+ if (HDstrncmp(filter_name, "deflate", 7) != 0)
+ H5_FAILED()
} catch (Exception e) {
H5_FAILED();
return 1;
@@ -304,7 +308,7 @@ int TestCompress()
PASSED();
#else
SKIPPED();
- puts(" deflate filter not enabled");
+ HDputs(" deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
return 0;
}
@@ -315,7 +319,8 @@ int TestGetPacket()
int record;
int theRecs[3];
int i;
- TESTING("GetPacket")
+ printf("Testing %-62s", "GetPacket");
+ HDfflush(stdout);
/* Create a dataset. Does not need to specify property list because
there is no compression. */
@@ -353,7 +358,8 @@ const char* PT_TESTERROR = "/TestErrors";
int TestErrors()
{
- TESTING("error conditions")
+ printf("Testing %-62s", "error conditions");
+ HDfflush(stdout);
/* Create a dataset */
FL_PacketTable wrapper(fileID, PT_TESTERROR, H5T_NATIVE_INT, 1);
@@ -464,7 +470,8 @@ const char* PT_SYSTEMTST1 = "/SystemTest1";
const char* PT_SYSTEMTST2 = "/SystemTest2";
int SystemTest()
{
- TESTING("multiple datatypes")
+ printf("Testing %-62s", "multiple datatypes");
+ HDfflush(stdout);
hid_t dtypeID1, dtypeID2;
hsize_t count;
@@ -560,16 +567,16 @@ error:
/*-------------------------------------------------------------------------
* TestHDFFV_9758(): Test that a packet table with compound datatype which
- * contains string type can be created and written correctly. (HDFFV-9758)
+ * contains string type can be created and written correctly. (HDFFV-9758)
*
* Notes:
- * Previously, data of the field that follows the string was read back
- * as garbage when #pragma pack(1) is used.
+ * Previously, data of the field that follows the string was read back
+ * as garbage when #pragma pack(1) is used.
* 2016/10/20 -BMR
* Updated:
- * #pragma pack(1) caused failure on Emu because Sparc cannot
- * access misaligned data. Changed it to pack() to do the
- * default alignment.
+ * #pragma pack(1) caused failure on Emu because Sparc cannot
+ * access misaligned data. Changed it to pack() to do the
+ * default alignment.
* 2016/10/25 -BMR
*-------------------------------------------------------------------------
*/
@@ -592,57 +599,58 @@ int TestHDFFV_9758()
};
s1_t s1[NUM_PACKETS];
-
+
for (hsize_t i = 0; i < NUM_PACKETS; i++)
{
s1[i].a = i;
s1[i].b = 1.f * static_cast<float>(i * i);
s1[i].c = 1. / (i + 1);
- sprintf(s1[i].d, "string%d", (int)i);
+ HDsprintf(s1[i].d, "string%d", (int)i);
s1[i].e = 100+i;
}
- TESTING("data corruption in packed structs (HDFFV-9758)")
+ printf("Testing %-62s", "data corruption in packed structs (HDFFV-9758)");
+ HDfflush(stdout);
// Build a compound datatype
compound_type = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
if (compound_type < 0)
- goto error;
-
+ goto error;
+
err = H5Tinsert(compound_type, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE);
if (err < 0)
- goto error;
+ goto error;
strtype = H5Tcopy (H5T_C_S1);
if (compound_type < 0)
- goto error;
+ goto error;
err = H5Tset_size (strtype, STRING_LENGTH); /* create string */
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "d_name", HOFFSET(s1_t, d), strtype);
if (err < 0)
- goto error;
+ goto error;
err = H5Tinsert(compound_type, "e_name", HOFFSET(s1_t, e), H5T_NATIVE_INT);
if (err < 0)
- goto error;
+ goto error;
{ // so ptable will go out of scope before PASSED
// Create a packet table
FL_PacketTable ptable(fileID, "/examplePacketTable", compound_type, 1);
if (!ptable.IsValid())
- goto error;
+ goto error;
// Add packets to the table
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- /* Appends one packet at the current position */
+ /* Appends one packet at the current position */
err = ptable.AppendPacket(s1 + i);
if (err < 0) goto error;
}
@@ -650,11 +658,11 @@ int TestHDFFV_9758()
// Check packet count
const hsize_t count = ptable.GetPacketCount(err);
if (err < 0)
- goto error;
-
+ goto error;
+
if (count != NUM_PACKETS)
{
- std::cerr
+ std::cerr
<< "Number of packets in packet table should be " << NUM_PACKETS
<< " but is " << count << endl;
}
@@ -663,16 +671,16 @@ int TestHDFFV_9758()
ptable.ResetIndex();
for (size_t i = 0; i < NUM_PACKETS; i++)
{
- s1_t s2;
- memset(&s2, 0, sizeof(s1_t));
- err = ptable.GetNextPacket(&s2);
- if (err < 0)
- goto error;
-
- if (s2.a != s1[i].a || s2.e != s1[i].e)
- goto error;
- else if (HDstrcmp(s2.d, s1[i].d))
- goto error;
+ s1_t s2;
+ HDmemset(&s2, 0, sizeof(s1_t));
+ err = ptable.GetNextPacket(&s2);
+ if (err < 0)
+ goto error;
+
+ if (s2.a != s1[i].a || s2.e != s1[i].e)
+ goto error;
+ else if (HDstrcmp(s2.d, s1[i].d))
+ goto error;
}
} // end of ptable block
diff --git a/hl/c++/test/ptableTest.h b/hl/c++/test/ptableTest.h
index 8af7bff..e1ba950 100644
--- a/hl/c++/test/ptableTest.h
+++ b/hl/c++/test/ptableTest.h
@@ -21,9 +21,9 @@
#ifndef PTABLETEST
#define PTABLETEST
+#include "h5hltest.h"
#include "H5PacketTable.h"
#include "H5Cpp.h"
-#include "h5hltest.h"
static hid_t fileID;
diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c
index f17e5d5..71dde78 100644
--- a/hl/src/H5DO.c
+++ b/hl/src/H5DO.c
@@ -11,11 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <stdio.h>
-
/* High-level library internal header file */
#include "H5HLprivate2.h"
@@ -25,14 +20,11 @@
/*-------------------------------------------------------------------------
- * Function: H5DOwrite_chunk
+ * Function: H5DOwrite_chunk
*
* Purpose: Writes an entire chunk to the file directly.
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Raymond Lu
- * 30 July 2012
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
@@ -104,10 +96,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Matthew Strong (GE Healthcare)
- * 14 February 2016
- *
- *------------ -------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
herr_t
H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters,
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 0778d3d..780b38d 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -241,7 +241,7 @@ herr_t H5DSattach_scale(hid_t did,
if (has_dimlist == 0)
{
- dims[0] = (hsize_t)rank;
+ dims[0] = (hsize_t)rank;
/* space for the attribute */
if((sid = H5Screate_simple(1, dims, NULL)) < 0)
@@ -556,9 +556,9 @@ out:
*
* Date: December 20, 2004
*
-* Comments:
+* Comments:
*
-* Modifications: Function didn't delete DIMENSION_LIST attribute, when
+* Modifications: Function didn't delete DIMENSION_LIST attribute, when
* all dimension scales were detached from a dataset; added.
* 2010/05/13 EIP
*
@@ -706,24 +706,24 @@ herr_t H5DSdetach_scale(hid_t did,
/* same object, reset */
if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr)
{
- /* If there are more than one reference in the VL element
+ /* If there are more than one reference in the VL element
and the reference we found is not the last one,
copy the last one to replace the found one since the order
- of the references doesn't matter according to the spec;
- reduce the size of the VL element by 1;
- if the length of the element becomes 0, free the pointer
+ of the references doesn't matter according to the spec;
+ reduce the size of the VL element by 1;
+ if the length of the element becomes 0, free the pointer
and reset to NULL */
size_t len = buf[idx].len;
- if(j < len - 1)
- ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
+ if(j < len - 1)
+ ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
len = --buf[idx].len;
if(len == 0) {
- HDfree(buf[idx].p);
+ HDfree(buf[idx].p);
buf[idx].p = NULL;
}
- /* Since a reference to a dim. scale can be inserted only once,
+ /* Since a reference to a dim. scale can be inserted only once,
we do not need to continue the search if it is found */
found_ds = 1;
break;
@@ -736,16 +736,16 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* Write the attribute, but check first, if we have any scales left,
- because if not, we should delete the attribute according to the spec */
+ because if not, we should delete the attribute according to the spec */
for(i = 0; i < rank; i++) {
if(buf[i].len > 0) {
have_ds = 1;
- break;
+ break;
}
}
- if(have_ds) {
+ if(have_ds) {
if(H5Awrite(aid, tid, buf) < 0)
- goto out;
+ goto out;
}
else {
if(H5Adelete(did, DIMENSION_LIST) < 0)
@@ -1123,7 +1123,7 @@ htri_t H5DSis_attached(hid_t did,
if (dsbuf == NULL)
goto out;
- if (H5Aread(aid,ntid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1445,7 +1445,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
if (H5I_DATASET != it)
return FAIL;
- if (label == NULL)
+ if (label == NULL)
return FAIL;
/* get dataset space */
@@ -1502,7 +1502,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
for (i = 0; i < (unsigned int) rank; i++)
- u.const_buf[i] = NULL;
+ u.const_buf[i] = NULL;
/* store the label information in the required index */
u.const_buf[idx] = label;
@@ -1532,7 +1532,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
else
{
-
+
if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
goto out;
@@ -1541,7 +1541,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* allocate and initialize */
u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *));
-
+
if (u.buf == NULL)
goto out;
@@ -1626,7 +1626,7 @@ out:
* Comments:
*
* Modifications:
-* JIRA HDFFV-7673: Added a check to see if the label name exists,
+* JIRA HDFFV-7673: Added a check to see if the label name exists,
* if not then returns zero. July 30, 2011. MSB
*
*-------------------------------------------------------------------------
@@ -1714,26 +1714,26 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
if (buf[idx] != NULL)
{
/* get the real string length */
- nbytes = strlen(buf[idx]);
+ nbytes = HDstrlen(buf[idx]);
- /* compute the string length which will fit into the user's buffer */
- copy_len = MIN(size-1, nbytes);
+ /* compute the string length which will fit into the user's buffer */
+ copy_len = MIN(size-1, nbytes);
- /* copy all/some of the name */
- if (label)
- {
- memcpy(label, buf[idx], copy_len);
-
- /* terminate the string */
- label[copy_len] = '\0';
- }
+ /* copy all/some of the name */
+ if (label)
+ {
+ HDmemcpy(label, buf[idx], copy_len);
+
+ /* terminate the string */
+ label[copy_len] = '\0';
+ }
}
/* free all the ptr's from the H5Aread() */
for (i = 0; i < rank; i++)
{
if (buf[i])
- HDfree(buf[i]);
+ HDfree(buf[i]);
}
/* close */
@@ -1867,7 +1867,7 @@ ssize_t H5DSget_scale_name(hid_t did,
/* copy all/some of the name */
if (name) {
- memcpy(name, buf, copy_len);
+ HDmemcpy(name, buf, copy_len);
/* terminate the string */
name[copy_len]='\0';
@@ -1883,7 +1883,7 @@ ssize_t H5DSget_scale_name(hid_t did,
if (buf)
HDfree(buf);
- return (ssize_t) MAX(0,nbytes-1);
+ return (ssize_t)(nbytes - 1);
/* error zone */
out:
@@ -1951,33 +1951,33 @@ htri_t H5DSis_scale(hid_t did)
if((tid = H5Aget_type(aid)) < 0)
goto out;
- /* check to make sure attribute is a string */
- if(H5T_STRING != H5Tget_class(tid))
- goto out;
+ /* check to make sure attribute is a string */
+ if(H5T_STRING != H5Tget_class(tid))
+ goto out;
- /* check to make sure string is null-terminated */
- if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
- goto out;
+ /* check to make sure string is null-terminated */
+ if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
+ goto out;
- /* allocate buffer large enough to hold string */
- if((storage_size = H5Aget_storage_size(aid)) == 0)
- goto out;
+ /* allocate buffer large enough to hold string */
+ if((storage_size = H5Aget_storage_size(aid)) == 0)
+ goto out;
- buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
- if(buf == NULL)
- goto out;
+ buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
+ if(buf == NULL)
+ goto out;
- /* Read the attribute */
+ /* Read the attribute */
if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ goto out;
- /* compare strings */
+ /* compare strings */
if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0)
is_ds = 1;
else
is_ds = 0;
- HDfree(buf);
+ HDfree(buf);
if(H5Tclose(tid) < 0)
goto out;
@@ -2236,8 +2236,8 @@ out:
static
hid_t H5DS_get_REFLIST_type(void)
{
- hid_t ntid_t = -1;
-
+ hid_t ntid_t = -1;
+
/* Build native type that corresponds to compound datatype
used to store ds_list_t structure in the REFERENCE_LIST
attribute */
@@ -2257,5 +2257,5 @@ out:
H5Tclose(ntid_t);
} H5E_END_TRY;
return FAIL;
-}
+}
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index f76f029..18aa133 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -250,12 +250,12 @@ herr_t H5IMget_image_info( hid_t loc_id,
char *interlace,
hssize_t *npals )
{
- hid_t did;
- hid_t sid;
+ hid_t did = -1;
+ hid_t sid = -1;
hsize_t dims[IMAGE24_RANK];
- hid_t aid;
- hid_t asid;
- hid_t atid;
+ hid_t aid = -1;
+ hid_t asid = -1;
+ hid_t atid = -1;
H5T_class_t aclass;
int has_pal;
int has_attr;
@@ -391,10 +391,14 @@ herr_t H5IMget_image_info( hid_t loc_id,
return 0;
out:
- H5Dclose( did );
- H5Aclose( aid );
- H5Sclose( asid );
- H5Tclose( atid );
+ if(did > 0)
+ H5Dclose( did );
+ if(aid > 0)
+ H5Aclose( aid );
+ if(asid > 0)
+ H5Sclose( asid );
+ if(atid > 0)
+ H5Tclose( atid );
return -1;
}
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index a9db3b4..0074d02 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -11,13 +11,12 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <string.h>
-#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "H5LTprivate.h"
-#include "H5private.h"
/* For Lex and Yacc */
#define COL 3
@@ -865,13 +864,13 @@ out:
*/
hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
{
- hid_t fapl, file_id; /* HDF5 identifiers */
- unsigned file_open_flags;/* Flags for image open */
- char file_name[64]; /* Filename buffer */
- size_t alloc_incr; /* Buffer allocation increment */
- size_t min_incr = 65536; /* Minimum buffer increment */
- double buf_prcnt = 0.1f; /* Percentage of buffer size to set
- as increment */
+ hid_t fapl=-1, file_id=-1; /* HDF5 identifiers */
+ unsigned file_open_flags; /* Flags for image open */
+ char file_name[64]; /* Filename buffer */
+ size_t alloc_incr; /* Buffer allocation increment */
+ size_t min_incr = 65536; /* Minimum buffer increment */
+ double buf_prcnt = 0.1f; /* Percentage of buffer size to set
+ as increment */
static long file_name_counter;
H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy,
&image_realloc, &image_free,
@@ -893,8 +892,8 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
/* set allocation increment to a percentage of the supplied buffer size, or
* a pre-defined minimum increment value, whichever is larger
*/
- if ((buf_prcnt * buf_size) > min_incr)
- alloc_incr = (size_t)(buf_prcnt * buf_size);
+ if ((size_t)(buf_prcnt * (double)buf_size) > min_incr)
+ alloc_incr = (size_t)(buf_prcnt * (double)buf_size);
else
alloc_incr = min_incr;
@@ -3356,7 +3355,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id,
*
* Date: June 17, 2005
*
-* Comments: This funstion was added to suuport INTEGER*8 Fortran types
+* Comments: This function was added to support INTEGER*8 Fortran types
*
* Modifications:
*
diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c
index f8f1d39..273e393 100644
--- a/hl/test/gen_test_ds.c
+++ b/hl/test/gen_test_ds.c
@@ -281,7 +281,7 @@ static int test_long_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -342,7 +342,7 @@ static int test_duplicatelong_attachscales(const char *filename)
strcpy(dsname, DATASET_NAME);
strcat(dsname, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
@@ -406,7 +406,7 @@ static int test_long_scalenames(const char *filename) {
if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -483,7 +483,7 @@ static int test_samelong_scalenames(const char *filename) {
if((fid = open_test_file(filename)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
strcpy(scalename, DS_1_NAME);
strcat(scalename, "al");
@@ -554,7 +554,7 @@ static int test_foreign_scaleattached(const char *filename)
hid_t did = -1;
hid_t dsid = -1;
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index f368b8e..85f47bd 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -28,8 +28,8 @@
#include "H5HLprivate2.h"
/* Macros used in HL tests */
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-#define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);}
+#define HL_TESTING2(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
+#define HL_TESTING3(WHAT) {HDprintf("Testing %-62s", WHAT); HDfflush(stdout);}
/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0)
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index f2d4b8f..9389a0d 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -387,7 +387,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
int rank = 4;
int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE,DIM4_SIZE};
- long buf[DIM1_SIZE*DIM2_SIZE*DIM3_SIZE*DIM4_SIZE];
+ long *buf;
hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE};
@@ -407,6 +407,10 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
long s43_wbuf[DIM4_SIZE] = {180,180};
long s44_wbuf[DIM4_SIZE] = {280,280};
+ /* Allocate buffer */
+ if(NULL == (buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE)))
+ return FAIL;
+
/* make a dataset */
if(H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) {
if(fulldims==0) {
@@ -442,6 +446,9 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
}
else
return FAIL;
+
+ HDfree(buf);
+
return SUCCEED;
}
@@ -1103,10 +1110,10 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)HDmalloc((name_len+1) * sizeof (char));
+ name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) {
- if(HDstrcmp(scalename,name_out)==0) {
+ if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) {
ret_value = SUCCEED;
}
HDfree(name_out);
@@ -1139,7 +1146,7 @@ static int test_detachscales(void)
and detach them to check that at the end there is no attributes
REFERENCE_LIST on a dimension scale and DIMENSION_LIST on a dataset */
- TESTING2("test_detachscales");
+ HL_TESTING2("test_detachscales");
if((fid = H5Fcreate("test_detach.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -1273,7 +1280,7 @@ static int test_char_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac");
- TESTING2("test_char_attachscales");
+ HL_TESTING2("test_char_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1326,7 +1333,7 @@ static int test_short_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as");
- TESTING2("test_short_attachscales");
+ HL_TESTING2("test_short_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1403,7 +1410,7 @@ static int test_int_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_int_attachscales");
+ HL_TESTING2("test_int_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1464,7 +1471,7 @@ static int test_long_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al");
- TESTING2("test_long_attachscales");
+ HL_TESTING2("test_long_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1521,7 +1528,7 @@ static int test_duplicatelong_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2");
- TESTING2("test_duplicatelong_attachscales");
+ HL_TESTING2("test_duplicatelong_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1578,7 +1585,7 @@ static int test_float_attachscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af");
- TESTING2("test_float_attachscales");
+ HL_TESTING2("test_float_attachscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1640,7 +1647,7 @@ static int test_numberofscales(const char *fileext)
HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a");
- TESTING2("test_numberofscales");
+ HL_TESTING2("test_numberofscales");
if((fid = open_test_file(fileext)) < 0)
goto out;
@@ -1722,7 +1729,7 @@ static int test_char_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set char scale/cmp scale name");
+ HL_TESTING2("set char scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac");
@@ -1782,7 +1789,7 @@ static int test_short_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set short scale/cmp scale name");
+ HL_TESTING2("set short scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as");
@@ -1890,7 +1897,7 @@ static int test_int_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set int scale/cmp scale name");
+ HL_TESTING2("set int scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a");
@@ -1966,7 +1973,7 @@ static int test_long_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set long scale/cmp scale name");
+ HL_TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al");
@@ -2034,7 +2041,7 @@ static int test_samelong_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set same long scale/cmp scale name");
+ HL_TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al");
HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al");
@@ -2102,7 +2109,7 @@ static int test_float_scalenames(const char *fileext) {
if((fid = open_test_file(fileext)) < 0)
goto out;
- TESTING2("set float scale/cmp scale name");
+ HL_TESTING2("set float scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af");
HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af");
@@ -2172,17 +2179,9 @@ static int test_foreign_scaleattached(const char *fileforeign)
hid_t fid = -1;
hid_t did = -1;
hid_t dsid = -1;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char filename[512]=""; /* buffer to hold name of existing file */
+ const char *filename = H5_get_srcdir_filename(fileforeign);
- /* compose the name of the file to open, using the srcdir, if appropriate */
- if (srcdir) {
- HDstrcpy(filename,srcdir);
- HDstrcat(filename,"/");
- }
- HDstrcat(filename, fileforeign);
-
- TESTING2("test_foreign_scaleattached");
+ HL_TESTING2("test_foreign_scaleattached");
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
goto out;
@@ -2427,7 +2426,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scales ");
+ HL_TESTING2("detach scales ");
/*-------------------------------------------------------------------------
@@ -3014,7 +3013,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -3104,7 +3103,7 @@ static int test_simple(void)
*/
- TESTING2("set scale/get scale name");
+ HL_TESTING2("set scale/get scale name");
if((dsid = H5Dopen2(fid,"ds_a_1", H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"Latitude set 0") < 0)
@@ -3124,7 +3123,7 @@ static int test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char*)HDmalloc((name_len+1) * sizeof (char));
+ name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
if(name_out == NULL)
goto out;
@@ -3206,7 +3205,7 @@ static int test_simple(void)
*/
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -3772,7 +3771,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset to itself");
+ HL_TESTING2("attach a dataset to itself");
if(H5DSattach_scale(did, did, 0) == SUCCEED)
goto out;
@@ -3783,7 +3782,7 @@ static int test_errors(void)
* attempt to attach a group with a dataset, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a group with a dataset");
+ HL_TESTING2("attach a group with a dataset");
if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
goto out;
@@ -3794,7 +3793,7 @@ static int test_errors(void)
* attempt to attach a dataset with a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("attach a dataset with a group");
+ HL_TESTING2("attach a dataset with a group");
if(H5DSattach_scale(did,gid,0)==SUCCEED)
goto out;
@@ -3805,7 +3804,7 @@ static int test_errors(void)
* attempt to set scale for a group, it should fail
*-------------------------------------------------------------------------
*/
- TESTING2("set scale for a group");
+ HL_TESTING2("set scale for a group");
if(H5DSset_scale(gid,"scale 1")==SUCCEED)
goto out;
@@ -3835,7 +3834,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scale that has scales");
+ HL_TESTING2("attach a scale that has scales");
/* create the data space for the scale */
if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
@@ -3904,7 +3903,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a scale");
+ HL_TESTING2("attach to a dataset that is a scale");
/* open the previous written "ds_b", that is a scale */
if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
@@ -3931,7 +3930,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach to a dataset that is a reserved class dataset");
+ HL_TESTING2("attach to a dataset that is a reserved class dataset");
/* make an image */
if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
@@ -3966,7 +3965,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("is scale");
+ HL_TESTING2("is scale");
/* open a non scale dataset */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4000,7 +3999,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from dataset it is not attached to");
+ HL_TESTING2("detach scale from dataset it is not attached to");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4028,7 +4027,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale from group");
+ HL_TESTING2("detach scale from group");
/* open the previous written "ds_a" */
if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
@@ -4056,7 +4055,7 @@ static int test_errors(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach scale when scale is group");
+ HL_TESTING2("detach scale when scale is group");
/* open the previous written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4148,7 +4147,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate when the dataset has no scales ");
+ HL_TESTING2("iterate when the dataset has no scales ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4170,7 +4169,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on dimension that is outside the rank ");
+ HL_TESTING2("iterate on dimension that is outside the rank ");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4191,7 +4190,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate for dimension with many scales ");
+ HL_TESTING2("iterate for dimension with many scales ");
/* open the previously written "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4228,7 +4227,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate on group ");
+ HL_TESTING2("iterate on group ");
/* open */
if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
@@ -4250,7 +4249,7 @@ static int test_iterators(void)
*-------------------------------------------------------------------------
*/
- TESTING2("iterate in deleted scales ");
+ HL_TESTING2("iterate in deleted scales ");
if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
goto out;
@@ -4344,7 +4343,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach");
+ HL_TESTING2("attach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4372,7 +4371,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("detach");
+ HL_TESTING2("detach");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4398,7 +4397,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach, set, get names, labels");
+ HL_TESTING2("attach, set, get names, labels");
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
@@ -4437,7 +4436,7 @@ static int test_rank(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attach a scalar scale");
+ HL_TESTING2("attach a scalar scale");
/* create the data space for the dataset */
if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
@@ -4550,7 +4549,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("floating point and short scales");
+ HL_TESTING2("floating point and short scales");
/* get the dataset id for "dset_a" */
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
@@ -4613,7 +4612,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
- TESTING2("string scales");
+ HL_TESTING2("string scales");
/* get the dataset id for "dset_b" */
if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
@@ -4710,7 +4709,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("generating scales");
+ HL_TESTING2("generating scales");
/*-------------------------------------------------------------------------
* create datasets: 1 "data" dataset and 2 dimension scales
@@ -4866,18 +4865,9 @@ static int read_data( const char* fname,
size_t nelms;
FILE *f;
float val;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]; /* buffer to hold name of existing data file */
-
- HDstrcpy(data_file, "");
- /* compose the name of the file to open, using the srcdir, if appropriate */
- if(srcdir) {
- HDstrcpy(data_file, srcdir);
- HDstrcat(data_file, "/");
- }
- /* read first data file */
- HDstrcat(data_file,fname);
+ const char *data_file = H5_get_srcdir_filename(fname);
+ /* read first data file */
f = HDfopen(data_file, "r");
if( f == NULL ) {
printf( "Could not open file %s\n", data_file );
@@ -4885,22 +4875,34 @@ static int read_data( const char* fname,
}
for(i=0, nelms=1; i < ndims; i++) {
- fscanf( f, "%s %u", str, &j);
- fscanf( f, "%d",&n );
+ if(fscanf( f, "%s %u", str, &j) && HDferror(f)) {
+ HDprintf( "fscanf error in file %s\n", data_file );
+ HDfclose(f);
+ return -1;
+ } /* end if */
+ if(fscanf( f, "%d",&n ) < 0 && HDferror(f)) {
+ HDprintf( "fscanf error in file %s\n", data_file );
+ HDfclose(f);
+ return -1;
+ } /* end if */
dims[i] = (hsize_t)n;
nelms *= (size_t)n;
}
*buf = (float*) HDmalloc (nelms * sizeof( float ));
- if (*buf == NULL) {
+ if ( *buf == NULL ) {
printf( "memory allocation failed\n" );
HDfclose(f);
return -1;
}
for(j = 0; j < nelms; j++) {
- fscanf( f, "%f",&val );
+ if(fscanf( f, "%f",&val ) < 0 && HDferror(f)) {
+ HDprintf( "fscanf error in file %s\n", data_file );
+ HDfclose(f);
+ return -1;
+ } /* end if */
(*buf)[j] = val;
}
HDfclose(f);
@@ -4952,7 +4954,7 @@ static int test_errors2(void)
goto out;
- TESTING2("attach scales");
+ HL_TESTING2("attach scales");
/*-------------------------------------------------------------------------
@@ -4975,7 +4977,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("detach scales");
+ HL_TESTING2("detach scales");
/*-------------------------------------------------------------------------
* detach with invalid indices
@@ -4996,7 +4998,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("set/get label");
+ HL_TESTING2("set/get label");
/*-------------------------------------------------------------------------
* set/get label invalid indices
@@ -5012,7 +5014,7 @@ static int test_errors2(void)
goto out;
if ((label_len=H5DSget_label(did,0,NULL,0)) < 0)
goto out;
- if (label_len != HDstrlen("label"))
+ if ( label_len != HDstrlen("label") )
goto out;
if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0)
goto out;
@@ -5021,7 +5023,7 @@ static int test_errors2(void)
PASSED();
- TESTING2("iterate scales");
+ HL_TESTING2("iterate scales");
/*-------------------------------------------------------------------------
@@ -5120,131 +5122,131 @@ static int test_attach_detach(void)
hid_t var1_id, var2_id, var3_id; /* DS component name */
hsize_t dims[RANK1] = {DIM1};
- TESTING2("permutations of attaching and detaching");
+ HL_TESTING2("permutations of attaching and detaching");
if((fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ goto out;
if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
- goto out;
+ goto out;
/* Create dimension scale. */
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto out;
+ goto out;
if((sid = H5Screate_simple(1, dims, dims)) < 0)
- goto out;
+ goto out;
if((dsid = H5Dcreate2(gid, DS_3_NAME, H5T_IEEE_F32BE, sid,
- H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
- goto out;
+ H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto out;
if(H5Sclose(sid) < 0)
- goto out;
+ goto out;
if(H5Pclose(dcpl_id) < 0)
- goto out;
+ goto out;
if(H5DSset_scale(dsid, DS_3_NAME) < 0)
- goto out;
+ goto out;
/* Create a variable that uses this dimension scale. */
if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
- goto out;
+ goto out;
if((var1_id = H5Dcreate2(gid, DS_31_NAME, H5T_NATIVE_FLOAT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ goto out;
if(H5Sclose(sid) < 0)
- goto out;
+ goto out;
if(H5DSattach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Create another variable that uses this dimension scale. */
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto out;
+ goto out;
if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
- goto out;
+ goto out;
if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
- goto out;
+ goto out;
if((var2_id = H5Dcreate2(gid, DS_32_NAME, H5T_NATIVE_FLOAT, sid,
H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
+ goto out;
if(H5Pclose(dcpl_id) < 0)
- goto out;
+ goto out;
if(H5Sclose(sid) < 0)
- goto out;
+ goto out;
/* Create 3rd variable that uses this dimension scale. */
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto out;
+ goto out;
if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
- goto out;
+ goto out;
if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
- goto out;
+ goto out;
if((var3_id = H5Dcreate2(gid, DS_33_NAME, H5T_NATIVE_FLOAT, sid,
H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
+ goto out;
if(H5Pclose(dcpl_id) < 0)
- goto out;
+ goto out;
if(H5Sclose(sid) < 0)
- goto out;
+ goto out;
/* Attached var2 scale */
if(H5DSattach_scale(var2_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Detach the var2 scale */
if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) == 0) /* should still be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
/* Detach the var1 scale */
if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
/* Attach the DS again and remove them in the opposite order */
if(H5DSattach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
if(H5DSattach_scale(var2_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Detach the var1 scale */
if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) == 0) /* should still be attached */
- goto out;
+ goto out;
/* Detach the var2 scale */
if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
@@ -5252,60 +5254,60 @@ static int test_attach_detach(void)
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
/***************************************************
* Attach Three DS and remove the middle one first
*****************************************************/
if(H5DSattach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
if(H5DSattach_scale(var2_id, dsid, 0) < 0)
- goto out;
+ goto out;
if(H5DSattach_scale(var3_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Detach the var2 scale */
if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) == 0) /* should still be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var3_id, dsid, 0) == 0) /* should still be attached */
- goto out;
+ goto out;
/* Detach the var3 scale */
if(H5DSdetach_scale(var3_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) == 0) /* should still be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var3_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
/* Detach the var1 scale */
if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
- goto out;
+ goto out;
/* Check if in correct state of detached and attached */
if(H5DSis_attached(var1_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var2_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
if(H5DSis_attached(var3_id, dsid, 0) != 0) /* should not be attached */
- goto out;
+ goto out;
/*-------------------------------------------------------------------------
* close
@@ -5313,17 +5315,17 @@ static int test_attach_detach(void)
*/
if(H5Dclose(var1_id) < 0)
- goto out;
+ goto out;
if(H5Dclose(var2_id) < 0)
- goto out;
+ goto out;
if(H5Dclose(var3_id) < 0)
- goto out;
+ goto out;
if(H5Dclose(dsid) < 0)
- goto out;
+ goto out;
if(H5Gclose(gid) < 0)
- goto out;
+ goto out;
if(H5Fclose(fid) < 0)
- goto out;
+ goto out;
PASSED();
@@ -5333,9 +5335,9 @@ static int test_attach_detach(void)
out:
H5E_BEGIN_TRY
{
- H5Dclose(var1_id);
- H5Dclose(var2_id);
- H5Dclose(var3_id);
+ H5Dclose(var1_id);
+ H5Dclose(var2_id);
+ H5Dclose(var3_id);
H5Dclose(dsid);
H5Gclose(gid);
H5Fclose(fid);
diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c
index fac2e89..f4183c8 100644
--- a/hl/test/test_dset_opt.c
+++ b/hl/test/test_dset_opt.c
@@ -153,7 +153,7 @@ test_direct_chunk_write (hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("basic functionality of H5DOwrite_chunk");
+ HL_TESTING2("basic functionality of H5DOwrite_chunk");
/*
* Create the data space with unlimited dimensions.
@@ -399,7 +399,7 @@ test_direct_chunk_overwrite_data(hid_t fid)
int16_t n;
int16_t read_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_2NX];
- TESTING("overwriting existing data with H5DOwrite_chunk");
+ HL_TESTING2("overwriting existing data with H5DOwrite_chunk");
/* Create the dataset's data space */
if ((sid = H5Screate_simple(OVERWRITE_NDIMS, dset_dims, dset_max_dims)) < 0)
@@ -473,7 +473,7 @@ error:
} /* end test_direct_chunk_overwrite_data() */
/*-------------------------------------------------------------------------
- * Function: test_skip_compress_write1
+ * Function: test_skip_compress_write1
*
* Purpose: Test skipping compression filter when it is the only filter
* for the dataset
@@ -514,7 +514,7 @@ test_skip_compress_write1(hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("skipping compression filter for H5DOwrite_chunk/H5DOread_chunk");
+ HL_TESTING2("skipping compression filter for H5DOwrite_chunk/H5DOread_chunk");
/*
* Create the data space with unlimited dimensions.
@@ -767,7 +767,7 @@ test_skip_compress_write2(hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("skipping compression filters but keep two other filters");
+ HL_TESTING2("skipping compression filters but keep two other filters");
/*
* Create the data space with unlimited dimensions.
@@ -968,7 +968,7 @@ test_data_conv(hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("data conversion for H5DOwrite_chunk/H5DOread_chunk");
+ HL_TESTING2("data conversion for H5DOwrite_chunk/H5DOread_chunk");
/*
* Create the data space with unlimited dimensions.
@@ -1181,7 +1181,7 @@ test_invalid_parameters(hid_t file)
hsize_t chunk_nbytes; /* Chunk size */
- TESTING("invalid parameters for H5DOwrite_chunk/H5DOread_chunk");
+ HL_TESTING2("invalid parameters for H5DOwrite_chunk/H5DOread_chunk");
/*
* Create the data space with unlimited dimensions.
@@ -1408,7 +1408,7 @@ test_direct_chunk_read_no_cache (hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("basic functionality of H5DOread_chunk (chunk cache disabled)");
+ HL_TESTING2("basic functionality of H5DOread_chunk (chunk cache disabled)");
/* Create the data space with unlimited dimensions. */
if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
@@ -1578,9 +1578,9 @@ test_direct_chunk_read_cache (hid_t file, hbool_t flush)
hsize_t block[2]; /* Block sizes */
if(flush) {
- TESTING("basic functionality of H5DOread_chunk (flush chunk cache)");
+ HL_TESTING2("basic functionality of H5DOread_chunk (flush chunk cache)");
} else {
- TESTING("basic functionality of H5DOread_chunk (does not flush chunk cache)");
+ HL_TESTING2("basic functionality of H5DOread_chunk (does not flush chunk cache)");
}
/* Create the data space with unlimited dimensions. */
@@ -1760,7 +1760,7 @@ test_read_unfiltered_dset(hid_t file)
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- TESTING("basic functionality of H5DOread_chunk on unfiltered datasets");
+ HL_TESTING2("basic functionality of H5DOread_chunk on unfiltered datasets");
/* Create the data space with unlimited dimensions. */
if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
@@ -1902,7 +1902,7 @@ test_read_unallocated_chunk (hid_t file)
int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5DOread and manually decompressed */
hsize_t offset[2]; /* chunk offset used for H5DOread_chunk */
- TESTING("H5DOread_chunk with unallocated chunks");
+ HL_TESTING2("H5DOread_chunk with unallocated chunks");
/* Create the data space with unlimited dimensions. */
if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
@@ -2015,7 +2015,7 @@ test_single_chunk(unsigned config)
int rdata[DIM0][DIM1]; /* Read buffer */
int i, j; /* Local index variable */
- TESTING("Single chunk I/O");
+ HL_TESTING2("Single chunk I/O");
/* Initialize data */
for (i=0; i<DIM0; i++) {
@@ -2133,15 +2133,15 @@ error:
} /* test_single_chunk_latest() */
/*-------------------------------------------------------------------------
- * Function: Main function
+ * Function: Main function
*
- * Purpose: Test direct chunk write function H5Dwrite_chunk and
+ * Purpose: Test direct chunk write function H5Dwrite_chunk and
* chunk direct read function H5Dread_chunk
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 30 November 2012
*
*-------------------------------------------------------------------------
diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c
index 0f079ca..5297e61 100644
--- a/hl/test/test_file_image.c
+++ b/hl/test/test_file_image.c
@@ -38,7 +38,7 @@
extend the image, and then performs writes that extend the images. The fifth
loop reads the extended images and verify that the content are correct. The
sixth and final loop closes the file images and deallocates the image
- buffers if appropriate. */
+ buffers if appropriate. */
/*-------------------------------------------------------------------------
* test file image operations
@@ -61,11 +61,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
void **buf_ptr; /* pointer to array of pointers to image buffers */
char **filename; /* pointer to array of pointers to filenames */
unsigned *input_flags; /* pointer to array of flag combinations */
- size_t i, j, k, nrow, n_values;
+ size_t i, j, k, nrow, n_values;
herr_t status1;
void *handle_ptr = NULL; /* pointers to driver buffer */
- unsigned char **core_buf_ptr_ptr = NULL;
-
+ unsigned char **core_buf_ptr_ptr = NULL;
+
VERIFY(open_images > 1 , "The number of open images must be greater than 1");
VERIFY(nflags > 0, "The number of flag combinations must be greater than 0");
@@ -94,7 +94,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (NULL == (dset_id = (hid_t *)HDmalloc(sizeof(hid_t) * open_images)))
FAIL_PUTS_ERROR("malloc() failed");
- TESTING("get file images");
+ HL_TESTING2("get file images");
/* create several file images */
for (i = 0; i < open_images; i++) {
@@ -112,11 +112,11 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Fcreate() failed");
- /* define dataspace for the dataset */
- if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
+ /* define dataspace for the dataset */
+ if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0)
FAIL_PUTS_ERROR("H5Screate_simple() failed");
- /* create dataset property list */
+ /* create dataset property list */
if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_PUTS_ERROR("H5Pcreate() failed");
@@ -127,8 +127,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* create and write an integer type dataset named "dset" */
if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dcreate() failed");
-
- /* dataset in open image 1 is written with "wrong" data */
+
+ /* dataset in open image 1 is written with "wrong" data */
if (i == 1) {
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
@@ -138,7 +138,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0)
FAIL_PUTS_ERROR("H5Dwrite() failed");
} /* end else */
-
+
/* flush into the file */
if (H5Fflush(file_id[i], H5F_SCOPE_LOCAL) < 0)
FAIL_PUTS_ERROR("H5Fflush() failed");
@@ -146,7 +146,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* close dataset property list */
if (H5Pclose(plist) < 0)
FAIL_PUTS_ERROR("H5Pclose() failed");
-
+
/* close dataspace */
if (H5Sclose(file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -156,7 +156,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
FAIL_PUTS_ERROR("H5Dclose() failed");
/* get size of the file image i */
- if ((buf_size[i] = H5Fget_file_image(file_id[i], NULL, 0)) < 0)
+ if ((buf_size[i] = H5Fget_file_image(file_id[i], NULL, (size_t)0)) < 0)
FAIL_PUTS_ERROR("H5Fget_file_image() failed");
/* allocate buffer for the file image i */
@@ -166,7 +166,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* buffer for file image 2 is filled with counter data (non-valid image) */
if (i == 2) {
for (j = 0; j < (size_t)buf_size[i]; j++)
- ((char*)(buf_ptr[i]))[j] = (char)j;
+ ((char*)(buf_ptr[i]))[j] = (char)j;
} /* end if */
/* buffers for the rest of the file images are filled with data from the respective files */
else {
@@ -181,14 +181,14 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("open file images and check image copies");
-
- /* open the file images with the core driver for data access */
+ HL_TESTING2("open file images and check image copies");
+
+ /* open the file images with the core driver for data access */
for (i = 0; i < open_images; i++) {
/* open file image 2 filled with counter data (non-valid image) */
if (i == 2) {
H5E_BEGIN_TRY {
- /* attempt to set file image in the core driver */
+ /* attempt to set file image in the core driver */
file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i]);
} H5E_END_TRY
@@ -196,7 +196,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
} /* end if */
/* open rest of valid file images */
else {
- /* set file image in the core driver */
+ /* set file image in the core driver */
if ((file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i])) < 0)
FAIL_PUTS_ERROR("H5LTopen_file_image() failed");
@@ -221,7 +221,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read file images");
+ HL_TESTING2("read file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -231,7 +231,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
continue;
} /* end if */
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -246,8 +246,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -269,15 +269,15 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if (data3[j * nrow + k ] != data1[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
} /* end else */
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
} /* end for */
- PASSED();
+ PASSED();
- TESTING("write and extend file images");
+ HL_TESTING2("write and extend file images");
/* write open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -337,7 +337,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
hid_t attr_space_id = -1;
hid_t attr_id = -1;
herr_t status2;
- size_t l;
+ size_t l;
if ((attr_space_id = H5Screate_simple(attr_rank, attr_dims, attr_dims)) < 0)
FAIL_PUTS_ERROR("attr_space H5Screate_simple() failed");
@@ -392,7 +392,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED();
- TESTING("read extended file images");
+ HL_TESTING2("read extended file images");
/* read open file images and verify data */
for (i = 0; i < open_images; i++) {
@@ -400,7 +400,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
if ((file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW )))
continue;
- /* open dataset in file image */
+ /* open dataset in file image */
if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0)
FAIL_PUTS_ERROR("H5Dopen() failed");
@@ -415,8 +415,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
/* read dataset */
if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0)
FAIL_PUTS_ERROR("H5Dread() failed");
-
- /* compute number of elements in dataset */
+
+ /* compute number of elements in dataset */
n_values = (size_t)(dims3[0] * dims3[1]);
/* determine the number of rows in dataset */
@@ -427,8 +427,8 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
for (k = 0; k < nrow; k++)
if (data3[j * nrow + k ] != data4[j * nrow + k ])
FAIL_PUTS_ERROR("comparison of image values with original data failed");
-
- /* close dataspace */
+
+ /* close dataspace */
if (H5Sclose (file_space) < 0)
FAIL_PUTS_ERROR("H5Sclose() failed");
@@ -439,7 +439,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
PASSED()
- TESTING("close file images");
+ HL_TESTING2("close file images");
/* close file images and release buffer if appropriate */
for (i = 0; i < open_images; i++) {
@@ -459,7 +459,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL");
HDfree(buf_ptr[i]);
} /* end if */
-
+
} /* end for */
/* release temporary working buffers */
@@ -491,8 +491,8 @@ int main( void )
size_t open_images = 10; /* number of open file images */
size_t nflags = 8; /* number of flag combinations */
unsigned flags[8]; /* array with flag combinations */
-
- /* set flag combinations for testing */
+
+ /* set flag combinations for testing */
flags[0] = 0;
flags[1] = H5LT_FILE_IMAGE_DONT_RELEASE;
flags[2] = H5LT_FILE_IMAGE_DONT_COPY;
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index ac818d0..e350533 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -169,7 +169,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("indexed image");
+ HL_TESTING2("indexed image");
/* Write image */
if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf1 ) < 0 )
@@ -205,7 +205,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("true color image");
+ HL_TESTING2("true color image");
/* Write image */
if ( H5IMmake_image_24bit( fid, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", buf2 ) )
@@ -232,7 +232,7 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- TESTING("pallete functions");
+ HL_TESTING2("pallete functions");
if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 )
goto out;
@@ -351,7 +351,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image");
+ HL_TESTING2("make indexed image");
/* read first data file */
if (read_data(DATA_FILE1,&width,&height)<0)
@@ -364,7 +364,7 @@ static int test_data(void)
PASSED();
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/*-------------------------------------------------------------------------
* palette #1. rainbow palette. data is contained in "pal_rgb.h"
@@ -464,7 +464,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with pixel interlace");
+ HL_TESTING2("make true color image with pixel interlace");
/* read second data file */
if ((read_data(DATA_FILE2,&width,&height))<0)
@@ -481,7 +481,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make true color image with plane interlace");
+ HL_TESTING2("make true color image with plane interlace");
/* read third data file */
if ((read_data(DATA_FILE3,&width,&height))<0)
@@ -538,13 +538,12 @@ static int test_generate(void)
{
hid_t fid;
hsize_t pal_dims[2] = { 256, 3 };
- float *data;
+ float *data = NULL;
int imax, jmax, kmax;
int n_elements;
float valex, xmin, xmax, value;
FILE *f = NULL;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]=""; /* buffer to hold name of existing data file */
+ const char *data_file = H5_get_srcdir_filename(DATA_FILE4);
int i;
int retval = FAIL;
@@ -555,17 +554,6 @@ static int test_generate(void)
printf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
- * compose the name of the file to open, using the srcdir, if appropriate
- *-------------------------------------------------------------------------
- */
- if ( srcdir )
- {
- HDstrcpy(data_file, srcdir);
- HDstrcat(data_file, "/");
- }
- HDstrcat(data_file,DATA_FILE4);
-
- /*-------------------------------------------------------------------------
* read data; the file data format is described below
*-------------------------------------------------------------------------
*/
@@ -613,8 +601,14 @@ static int test_generate(void)
*/
- fscanf( f, "%d %d %d", &imax, &jmax, &kmax );
- fscanf( f, "%f %f %f", &valex, &xmin, &xmax );
+ if(fscanf( f, "%d %d %d", &imax, &jmax, &kmax ) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+ if(fscanf( f, "%f %f %f", &valex, &xmin, &xmax ) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
/* Sanity check on scanned-in values */
if(imax < 1 || jmax < 1 || kmax < 1)
@@ -633,7 +627,7 @@ static int test_generate(void)
goto out;
if(n_elements > INT_MAX / (int)sizeof(float))
goto out;
-
+
data = (float *)HDmalloc((size_t)n_elements * sizeof(float));
if(NULL == data)
goto out;
@@ -643,7 +637,10 @@ static int test_generate(void)
for ( i = 0; i < n_elements; i++ )
{
- fscanf( f, "%f ", &value );
+ if(fscanf( f, "%f ", &value ) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
data[i] = value;
}
HDfclose(f);
@@ -655,7 +652,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from all the data");
+ HL_TESTING2("make indexed image from all the data");
for ( i = 0; i < n_elements; i++ )
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
@@ -672,7 +669,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from land data");
+ HL_TESTING2("make indexed image from land data");
for ( i = 0; i < n_elements; i++ )
{
@@ -694,7 +691,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("make indexed image from sea data");
+ HL_TESTING2("make indexed image from sea data");
for ( i = 0; i < n_elements; i++ )
{
@@ -715,7 +712,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- TESTING2("attaching palettes");
+ HL_TESTING2("attaching palettes");
/* make a palette */
if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0)
@@ -804,12 +801,35 @@ static int read_data(const char* fname, /*IN*/
goto out;
}
- fscanf(f, "%s", str);
- fscanf(f, "%d", &color_planes);
- fscanf(f, "%s", str);
- fscanf(f, "%d", &h);
- fscanf(f, "%s", str);
- fscanf(f, "%d", &w);
+ if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+
+ if(fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+
+ if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+
+ if(fscanf(f, "%d", &h) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+
+ if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
+
+ if(fscanf(f, "%d", &w) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
/* Check product for overflow */
if(w < 1 || h < 1 || color_planes < 1)
@@ -840,14 +860,17 @@ static int read_data(const char* fname, /*IN*/
/* Read data elements */
for(i = 0; i < n_elements; i++) {
- fscanf(f, "%d",&n);
+ if(fscanf(f, "%d", &n) < 0 && HDferror(f)) {
+ printf( "fscanf error in file %s.\n", data_file );
+ goto out;
+ } /* end if */
image_data[i] = (unsigned char)n;
} /* end for */
/* Indicate success */
ret_val = 1;
-out:
+out:
if(f)
HDfclose(f);
@@ -885,20 +908,7 @@ static int read_palette(const char* fname,
unsigned int green;
unsigned int blue;
unsigned nentries;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]; /* buffer to hold name of existing data file */
-
- /*-------------------------------------------------------------------------
- * compose the name of the file to open, using "srcdir", if appropriate
- *-------------------------------------------------------------------------
- */
- HDstrcpy(data_file, "");
- if (srcdir)
- {
- HDstrcpy(data_file, srcdir);
- HDstrcat(data_file, "/");
- }
- HDstrcat(data_file,fname);
+ const char *data_file = H5_get_srcdir_filename(fname);
/* ensure the given palette is valid */
if (!palette)
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 8d3d0b9..d6999ff 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -87,7 +87,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset");
+ HL_TESTING2("H5LTmake_dataset");
/* Make dataset */
if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 )
@@ -118,7 +118,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTread_dataset");
+ HL_TESTING2("H5LTread_dataset");
if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 )
goto out;
@@ -143,7 +143,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_char");
+ HL_TESTING2("H5LTmake_dataset_char");
/* Make dataset char */
if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 )
@@ -179,7 +179,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_short");
+ HL_TESTING2("H5LTmake_dataset_short");
/* Make dataset short */
if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 )
@@ -214,7 +214,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_int");
+ HL_TESTING2("H5LTmake_dataset_int");
/* Make dataset int */
if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 )
@@ -250,7 +250,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_long");
+ HL_TESTING2("H5LTmake_dataset_long");
/* Make dataset long */
if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 )
@@ -286,7 +286,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_float");
+ HL_TESTING2("H5LTmake_dataset_float");
/* Make dataset float */
if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 )
@@ -298,7 +298,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -309,7 +309,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -322,7 +322,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_double");
+ HL_TESTING2("H5LTmake_dataset_double");
/* Make dataset double */
if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 )
@@ -334,7 +334,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -345,7 +345,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -358,7 +358,7 @@ static int test_dsets( void )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTmake_dataset_string");
+ HL_TESTING2("H5LTmake_dataset_string");
/* Make dataset string */
if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 )
@@ -517,7 +517,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_string");
+ HL_TESTING2("H5LTset_attribute_string");
/* Set the attribute */
if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 )
@@ -530,7 +530,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_string");
+ HL_TESTING2("H5LTget_attribute_string");
/* Get the attribute */
@@ -550,7 +550,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_char");
+ HL_TESTING2("H5LTset_attribute_char");
/* Set the attribute */
if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 )
@@ -563,7 +563,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_char");
+ HL_TESTING2("H5LTget_attribute_char");
/* Get the attribute */
if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 )
@@ -594,7 +594,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_short");
+ HL_TESTING2("H5LTset_attribute_short");
/* Set the attribute */
if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 )
@@ -608,7 +608,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_short");
+ HL_TESTING2("H5LTget_attribute_short");
/* Get the attribute */
if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 )
@@ -640,7 +640,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_int");
+ HL_TESTING2("H5LTset_attribute_int");
/* Set the attribute */
if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 )
@@ -661,7 +661,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_int");
+ HL_TESTING2("H5LTget_attribute_int");
/* Get the attribute */
if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 )
@@ -712,7 +712,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_long");
+ HL_TESTING2("H5LTset_attribute_long");
/* Set the attribute */
if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 )
@@ -725,7 +725,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_long");
+ HL_TESTING2("H5LTget_attribute_long");
/* Get the attribute */
if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 )
@@ -756,7 +756,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uchar");
+ HL_TESTING2("H5LTset_attribute_uchar");
/* Set the attribute */
if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 )
@@ -769,7 +769,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uchar");
+ HL_TESTING2("H5LTget_attribute_uchar");
/* Get the attribute */
if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 )
@@ -800,7 +800,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ushort");
+ HL_TESTING2("H5LTset_attribute_ushort");
/* Set the attribute */
if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 )
@@ -814,7 +814,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ushort");
+ HL_TESTING2("H5LTget_attribute_ushort");
/* Get the attribute */
if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 )
@@ -846,7 +846,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_uint");
+ HL_TESTING2("H5LTset_attribute_uint");
/* Set the attribute */
if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 )
@@ -859,7 +859,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_uint");
+ HL_TESTING2("H5LTget_attribute_uint");
/* Get the attribute */
if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 )
@@ -890,7 +890,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_ulong");
+ HL_TESTING2("H5LTset_attribute_ulong");
/* Set the attribute */
if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 )
@@ -903,7 +903,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_ulong");
+ HL_TESTING2("H5LTget_attribute_ulong");
/* Get the attribute */
if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 )
@@ -935,7 +935,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_float");
+ HL_TESTING2("H5LTset_attribute_float");
/* Set the attribute */
if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 )
@@ -948,7 +948,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_float");
+ HL_TESTING2("H5LTget_attribute_float");
/* Get the attribute */
@@ -957,7 +957,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -968,7 +968,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
+ if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -980,7 +980,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTset_attribute_double");
+ HL_TESTING2("H5LTset_attribute_double");
/* Set the attribute */
if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 )
@@ -993,7 +993,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_double");
+ HL_TESTING2("H5LTget_attribute_double");
/* Get the attribute */
if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 )
@@ -1001,7 +1001,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@@ -1012,7 +1012,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
+ if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@@ -1026,7 +1026,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*/
- TESTING("H5LTget_attribute_ndims");
+ HL_TESTING2("H5LTget_attribute_ndims");
if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 )
return -1;
@@ -1042,7 +1042,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
*-------------------------------------------------------------------------
*/
- TESTING("H5LTget_attribute_info");
+ HL_TESTING2("H5LTget_attribute_info");
if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * (size_t)rank_out ))) return -1;
@@ -1050,7 +1050,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
HDfree( dims_out );
return -1;
}
-
+
for (i = 0; i < rank_out; i++) {
if ( dims_out[i] != 5 ) {
HDfree( dims_out );
@@ -1079,7 +1079,7 @@ static int test_integers(void)
char* dt_str;
size_t str_len;
- TESTING3("\n text for integer types");
+ HL_TESTING3("\n text for integer types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_INT\n", H5LT_DDL))<0)
goto out;
@@ -1136,7 +1136,7 @@ static int test_fps(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for floating-point types");
+ HL_TESTING3(" text for floating-point types");
if((dtype = H5LTtext_to_dtype("H5T_NATIVE_LDOUBLE\n", H5LT_DDL))<0)
goto out;
@@ -1152,7 +1152,7 @@ static int test_fps(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
-
+
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
@@ -1194,10 +1194,10 @@ static int test_strings(void)
H5T_str_t str_pad;
H5T_cset_t str_cset;
H5T_class_t type_class;
- char* dt_str;
+ char* dt_str = NULL;
size_t str_len;
- TESTING3(" text for string types");
+ HL_TESTING3(" text for string types");
if((dtype = H5LTtext_to_dtype("H5T_STRING { STRSIZE 13; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; }", H5LT_DDL))<0)
goto out;
@@ -1228,7 +1228,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1260,7 +1260,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1270,16 +1270,17 @@ static int test_strings(void)
str_len = str_len + 10;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
-
+
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len-1)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
+ HDfree(dt_str);
/* Length of the character buffer is smaller then needed */
str_len = 21;
@@ -1291,10 +1292,10 @@ static int test_strings(void)
goto out;
}
/* check the truncated string */
- if(strlen(dt_str) != str_len-1) goto out;
- str_len = strlen(dt_str);
+ if(HDstrlen(dt_str) != str_len-1) goto out;
+ str_len = HDstrlen(dt_str);
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1327,7 +1328,7 @@ static int test_opaques(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for opaque types");
+ HL_TESTING3(" text for opaque types");
if((dtype = H5LTtext_to_dtype("H5T_OPAQUE { OPQ_SIZE 19; OPQ_TAG \"This is a tag for opaque type\"; }", H5LT_DDL))<0)
goto out;
@@ -1351,7 +1352,7 @@ static int test_opaques(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1384,7 +1385,7 @@ static int test_enums(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for enum types");
+ HL_TESTING3(" text for enum types");
if((dtype = H5LTtext_to_dtype("H5T_ENUM { H5T_STD_I32LE; \"RED\" 5; \"GREEN\" 6; \"BLUE\" 7; \"WHITE\" 8; }", H5LT_DDL))<0)
goto out;
@@ -1427,7 +1428,7 @@ static int test_enums(void)
}
if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1456,7 +1457,7 @@ static int test_variables(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for variable types");
+ HL_TESTING3(" text for variable types");
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_NATIVE_CHAR }\n", H5LT_DDL))<0)
goto out;
@@ -1468,16 +1469,16 @@ static int test_variables(void)
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_VLEN { H5T_STD_I32BE } }", H5LT_DDL))<0)
goto out;
-
+
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
@@ -1487,15 +1488,15 @@ static int test_variables(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
PASSED();
return 0;
@@ -1517,7 +1518,7 @@ static int test_arrays(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for array types");
+ HL_TESTING3(" text for array types");
if((dtype = H5LTtext_to_dtype("H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }", H5LT_DDL))<0)
goto out;
@@ -1546,7 +1547,7 @@ static int test_arrays(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1578,7 +1579,7 @@ static int test_compounds(void)
char* dt_str;
size_t str_len;
- TESTING3(" text for compound types");
+ HL_TESTING3(" text for compound types");
if((dtype = H5LTtext_to_dtype("H5T_COMPOUND { H5T_STD_I16BE \"one_field\" : 2; H5T_STD_U8LE \"two_field\" : 6; }", H5LT_DDL))<0)
goto out;
@@ -1602,7 +1603,7 @@ static int test_compounds(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1636,7 +1637,7 @@ out:
}
/*-------------------------------------------------------------------------
-* subroutine for test_text_dtype(): test_compound_bug(). Test case for
+* subroutine for test_text_dtype(): test_compound_bug(). Test case for
* issue 7701.
*-------------------------------------------------------------------------
*/
@@ -1672,7 +1673,7 @@ static int test_compound_bug(void)
" } } \"sub\" : 8;\n"
"}\n";
- TESTING3(" text for compound type of bug fix");
+ HL_TESTING3(" text for compound type of bug fix");
if((dtype = H5LTtext_to_dtype(text, H5LT_DDL))<0)
goto out;
@@ -1762,22 +1763,14 @@ static int test_complicated_compound(void)
char *line = NULL;
FILE *fp = NULL;
size_t size = 1024;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char filename[1024]="";
+ const char *filename = H5_get_srcdir_filename(INPUT_FILE);
- TESTING3(" text for complicated compound types");
-
- /* compose the name of the file to open, using the srcdir, if appropriate */
- if(srcdir) {
- HDstrcpy(filename, srcdir);
- HDstrcat(filename, "/");
- }
- HDstrcat(filename, INPUT_FILE);
+ HL_TESTING3(" text for complicated compound types");
/* Open input file */
fp = HDfopen(filename, "r");
if(fp == NULL) {
- printf( "Could not find file %s. Try set $srcdir \n", filename);
+ HDprintf( "Could not find file %s. Try set $srcdir \n", filename);
goto out;
}
@@ -1841,7 +1834,7 @@ out:
*/
static int test_text_dtype(void)
{
- TESTING("H5LTtext_to_dtype");
+ HL_TESTING2("H5LTtext_to_dtype");
if(test_integers()<0)
goto out;
@@ -1888,9 +1881,9 @@ static int test_valid_path(void)
hid_t file_id, group;
htri_t path_valid;
const char *data_string_in = "test";
-
- TESTING("H5LTpath_valid");
-
+
+ HL_TESTING2("H5LTpath_valid");
+
/* Create a new file using default properties. */
/**************************************************************
@@ -1915,11 +1908,11 @@ static int test_valid_path(void)
* |
* |
* | --- Gcyc (soft link to /G1)
- * / \
- * / \
- * G5 \
+ * / \
+ * / \
+ * G5 \
* (soft link G6 (external link /G1 in FILENAME4)
- * to /G2)
+ * to /G2)
*
****************************************************************/
@@ -1948,7 +1941,7 @@ static int test_valid_path(void)
*/
if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0)
goto out;
-
+
/*
* Create a soft link
*/
@@ -2030,9 +2023,9 @@ static int test_valid_path(void)
* |
* |
* |
- * G1
+ * G1
* / \
- * / \
+ * / \
* DS1 G2
* (dangled soft link to /G1/G20)
*
@@ -2063,13 +2056,13 @@ static int test_valid_path(void)
goto out;
H5Fclose(file_id);
-
+
/* Open input file */
if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0)
goto out;
/**************************************
- * CHECK ABSOLUTE PATHS
+ * CHECK ABSOLUTE PATHS
**************************************/
if( (path_valid = H5LTpath_valid(file_id, "/", TRUE)) != FALSE) {
@@ -2083,7 +2076,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) {
goto out;
}
-
+
if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE)
goto out;
@@ -2101,7 +2094,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE)
goto out;
-
+
if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE)
goto out;
@@ -2121,9 +2114,9 @@ static int test_valid_path(void)
/* check soft links */
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE)
goto out;
-
+
/**************************************
- * CHECK RELATIVE PATHS
+ * CHECK RELATIVE PATHS
***************************************/
if( (group = H5Gopen2(file_id, "/", H5P_DEFAULT)) < 0)
@@ -2163,22 +2156,22 @@ static int test_valid_path(void)
goto out;
if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Check the "./" case */
if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE)
goto out;
if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE)
- goto out;
+ goto out;
if(H5Gclose(group)<0)
goto out;
@@ -2227,7 +2220,7 @@ static int test_valid_path(void)
PASSED();
return 0;
- out:
+ out:
H5_FAILED();
return -1;
}
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 7003b26..61aebc7 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -178,7 +178,7 @@ static int test_create_close(hid_t fid)
hid_t table;
hid_t part_t;
- TESTING("H5PTcreate_fl and H5PTclose");
+ HL_TESTING2("H5PTcreate_fl and H5PTclose");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -188,11 +188,11 @@ static int test_create_close(hid_t fid)
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
if (H5Tclose(part_t) < 0)
- goto error;
+ goto error;
if( H5PTis_valid(table) < 0)
- goto error;
+ goto error;
if( H5PTis_varlen(table) != 0)
- goto error;
+ goto error;
/* Close the table */
err = H5PTclose(table);
@@ -219,7 +219,7 @@ static int test_open(hid_t fid)
herr_t err;
hid_t table;
- TESTING("H5PTopen");
+ HL_TESTING2("H5PTopen");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -255,7 +255,7 @@ static int test_append(hid_t fid)
hid_t table;
hsize_t count = 0;
- TESTING("H5PTappend");
+ HL_TESTING2("H5PTappend");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -322,7 +322,7 @@ static int test_read(hid_t fid)
particle_t readBuf[NRECORDS];
size_t c;
- TESTING("H5PTread_packets");
+ HL_TESTING2("H5PTread_packets");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -383,7 +383,7 @@ static int test_get_next(hid_t fid)
particle_t readBuf2[NRECORDS];
size_t c;
- TESTING("H5PTget_next");
+ HL_TESTING2("H5PTget_next");
/* Open the table */
table = H5PTopen(fid, PT_NAME);
@@ -454,7 +454,7 @@ static int test_big_table(hid_t fid)
particle_t readPart;
hsize_t count;
- TESTING("large packet table");
+ HL_TESTING2("large packet table");
/* Create a datatype for the particle struct */
part_t = make_particle_type();
@@ -528,7 +528,7 @@ static int test_opaque(hid_t fid)
size_t c;
particle_t readBuf[NRECORDS];
- TESTING("opaque data");
+ HL_TESTING2("opaque data");
/* Create an opaque datatype for the particle struct */
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
@@ -602,7 +602,7 @@ test_compress(void)
particle_t readPart[1];
hsize_t count;
- TESTING("packet table compression");
+ HL_TESTING2("packet table compression");
/* Create a file. */
if((fid1 = H5Fcreate(TEST_COMPRESS_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
@@ -739,7 +739,7 @@ static int test_rw_nonnative_dt(hid_t fid)
int writeBuffer[5];
int readBuffer[5];
- TESTING("reading/writing non-native packet table");
+ HL_TESTING2("reading/writing non-native packet table");
/* Initialize buffers */
for(x=0; x<5; x++) {
@@ -794,7 +794,7 @@ static int test_rw_nonnative_dt(hid_t fid)
/* Close the packet table */
if( (err = H5PTclose(ptable)) < 0)
goto error;
-
+
PASSED();
return SUCCEED;
@@ -819,7 +819,7 @@ static int test_error(hid_t fid)
int id_open=0;
particle_t readBuf[1];
- TESTING("error conditions");
+ HL_TESTING2("error conditions");
/* Create a HL table */
if(create_hl_table(fid) < 0)
@@ -981,7 +981,7 @@ int main(void)
/* Close the file */
if (H5Fclose(fid) < 0)
- status = 1;
+ status = 1;
return status;
}
diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c
index 35bd43a..4d83ae6 100644
--- a/hl/test/test_packet_vlen.c
+++ b/hl/test/test_packet_vlen.c
@@ -46,24 +46,24 @@ static int verify_attribute(hid_t fid, const char *table_name, const char *attr_
/*-------------------------------------------------------------------------
* test_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -71,42 +71,42 @@ static int test_VLof_atomic(void)
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -114,33 +114,33 @@ static int test_VLof_atomic(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
- }
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -157,7 +157,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -169,18 +169,18 @@ static int test_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -188,7 +188,7 @@ static int test_VLof_comptype(void)
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -199,48 +199,48 @@ static int test_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate(fid, PT_VLEN_COMP, vltype, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -248,39 +248,39 @@ static int test_VLof_comptype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%d, readBuf[%u].len=%d\n", __LINE__, uu, (int)writeBuf[uu].len, uu, (int)readBuf[uu].len);
- continue;
- } /* write len != read len */
+ continue;
+ } /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%d]=%d, readBuf[uu].p[%d]=%d\n", vv, (int)((unsigned int *)writeBuf[uu].p)[vv], vv, (int)((unsigned int *)readBuf[uu].p)[vv]);
continue;
- } /* write value != read value */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -298,8 +298,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -310,23 +310,23 @@ static int test_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
- hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
- a VL of VL of atomic datatype */
- hsize_t count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
+ a VL of VL of atomic datatype */
+ hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ unsigned uu, vv, ww; /* Loop variables */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
- TESTING3(" with compound datatype containing vlen datatype");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -336,15 +336,15 @@ static int test_compound_VL_VLtype(void)
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -354,58 +354,58 @@ static int test_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -413,7 +413,7 @@ static int test_compound_VL_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -448,19 +448,19 @@ static int test_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -479,27 +479,27 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- unsigned uu, vv, ww; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ unsigned uu, vv, ww; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -510,12 +510,12 @@ static int test_VLof_VLtype(void)
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1=(hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv * 1;
for (ww = 0; ww < (vv * 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -525,39 +525,39 @@ static int test_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -565,24 +565,24 @@ static int test_VLof_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -600,41 +600,41 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_ptlengthtype() - helper function, verifies that the named packet
- * table is a fixed-length or variable-length as indicated by the last
- * argument.
+ * table is a fixed-length or variable-length as indicated by the last
+ * argument.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expected_value)
{
- hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
herr_t is_varlen = 0;
herr_t ret = FAIL;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
/* Verify the value returned from H5PTis_varlen is as expected */
is_varlen = H5PTis_varlen(ptable);
if (is_varlen == FAIL)
- goto error;
+ goto error;
else if (is_varlen == expected_value)
- ret = SUCCEED;
+ ret = SUCCEED;
else
{
- char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
- if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
- ret = FAIL;
+ char lenthtype[20];
+ HDstrcpy(lenthtype, "fixed-length");
+ if (expected_value == 1)
+ HDstrcpy(lenthtype, "variable-length");
+ fprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
+ ret = FAIL;
}
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return ret;
@@ -645,71 +645,71 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_H5PTis_varlen(): Test that H5PTis_varlen works correctly on both
- * fixed- and variable-length packet tables.
+ * fixed- and variable-length packet tables.
*
* Description:
- * - Added a fixed-length packet table to the file for variety
- * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
- * on each packet table.
+ * - Added a fixed-length packet table to the file for variety
+ * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen
+ * on each packet table.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_H5PTis_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- herr_t ret; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ herr_t ret; /* Returned status from a callee */
- TESTING("H5PTis_varlen");
+ HL_TESTING2("H5PTis_varlen");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a new table */
ptable = H5PTcreate(fid, PT_FIXED_LEN, H5T_STD_I32BE, (hsize_t)100, H5P_DEFAULT);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Open each packet table, and verify that H5PTis_varlen returns correct
type for each table */
ret = verify_ptlengthtype(fid, PT_VLEN_ATOMIC, 1); /* vlen of atomic */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_COMP, 1); /* vlen of compound */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_COMP_VLEN, 0); /* compound of vlen, no vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_VLEN_VLEN, 1); /* vlen of vlen */
if (ret < 0)
- goto error;
+ goto error;
ret = verify_ptlengthtype(fid, PT_FIXED_LEN, 0); /* no vlen */
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -722,11 +722,11 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* adding_attribute() - helper function, adds an attribute to the named
- * packet table.
+ * packet table.
* Note:
- * For simplicity, the attributes that are added to the packet tables
- * have the same characteristics except their names. They have the
- * same type, space, and values.
+ * For simplicity, the attributes that are added to the packet tables
+ * have the same characteristics except their names. They have the
+ * same type, space, and values.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -737,47 +737,47 @@ int attr_data[ATTR_DIM]={256,11945,-22107}; /* values to be written to attr */
static int adding_attribute(hid_t fid, const char *table_name, const char *attr_name)
{
- hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
- hid_t space_id = H5I_INVALID_HID; /* Dataspace for the attribute */
- hid_t attr_id = H5I_INVALID_HID; /* Attribute identifier */
- hid_t dset_id = H5I_INVALID_HID; /* Dataset identifier */
- hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
- int ret = FAIL; /* Returned status from a callee */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t space_id = H5I_INVALID_HID; /* Dataspace for the attribute */
+ hid_t attr_id = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t dset_id = H5I_INVALID_HID; /* Dataset identifier */
+ hsize_t dims[] = {ATTR_DIM}; /* Dimension for dataspace */
+ int ret = FAIL; /* Returned status from a callee */
/* Create dataspace for attribute */
space_id = H5Screate_simple(ATTR_RANK, dims, NULL);
if (space_id < 0)
- goto error;
+ goto error;
/* Open the named packet table */
if( (ptable = H5PTopen(fid, table_name)) < 0)
- goto error;
+ goto error;
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Add the specified attribute to it */
attr_id = H5Acreate2(dset_id, attr_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Write attribute values */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, attr_data);
if (ret < 0)
- goto error;
+ goto error;
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the dataspace */
if (H5Sclose(space_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -790,39 +790,39 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_attribute() - helper function, verifies the named attribute can
- * be read correctly.
+ * be read correctly.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static herr_t verify_attribute(hid_t fid, const char *table_name, const char *attr_name)
{
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
- hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
- int read_data[ATTR_DIM]; /* Output buffer */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
+ int read_data[ATTR_DIM]; /* Output buffer */
int ii;
- herr_t ret = FAIL; /* Returned status from a callee */
+ herr_t ret = FAIL; /* Returned status from a callee */
/* Open the named packet table */
ptable = H5PTopen(fid, table_name);
if (ptable < 0)
- goto error;
+ goto error;
/* Get the dataset id of this packet table */
dset_id = H5PTget_dataset(ptable);
if (dset_id < 0)
- goto error;
+ goto error;
/* Open first attribute for the dataset */
attr_id = H5Aopen(dset_id, attr_name, H5P_DEFAULT);
if (attr_id < 0)
- goto error;
+ goto error;
/* Read attribute values */
ret = H5Aread(attr_id, H5T_NATIVE_INT, read_data);
if (ret < 0)
- goto error;
+ goto error;
/* Verify values read in */
for (ii = 0; ii < ATTR_DIM; ii++)
@@ -831,11 +831,11 @@ static herr_t verify_attribute(hid_t fid, const char *table_name, const char *at
/* Close the attribute */
if (H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
@@ -849,58 +849,58 @@ error: /* An error has occurred. Clean up and exit. */
* test_attributes(): Test adding attributes to packet tables
*
* Description:
- * Added attributes to some random packet tables in the file.
+ * Added attributes to some random packet tables in the file.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_attributes(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t attr_id=H5I_INVALID_HID; /* Attribute identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("adding attributes to packet tables");
+ HL_TESTING2("adding attributes to packet tables");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Add an arbitrary attribute to a few packet tables, using helper func */
attr_id = adding_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (attr_id < 0)
- goto error;
+ goto error;
attr_id = adding_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (attr_id < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
/* Open the file again */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Read each attribute and verify the values, using helper function */
ret = verify_attribute(fid, PT_VLEN_ATOMIC, "Attribute 1");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_VLEN_COMP, "Attribute 2");
if (ret < 0)
- goto error;
+ goto error;
ret = verify_attribute(fid, PT_COMP_VLEN, "Attribute 3");
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return(ret);
@@ -913,79 +913,75 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* verify_accessors() - helper function, verifies that various info can be
- * retrieved correctly using the info returned by the accessor functions.
+ * retrieved correctly using the info returned by the accessor functions.
*
* Description:
- * Testing functions H5PTget_dataset and H5PTget_type
+ * Testing functions H5PTget_dataset and H5PTget_type
*
- * - Opens the named packet table
- * - Gets its associated dataset ID then calls a C function on that ID
- * to verify the dataset name
- * - Gets its associated datatype ID then calls a C function on that ID
- * to verify that the packet table is variable- or fixed-length as
- * indicated by the expected_value argument
+ * - Opens the named packet table
+ * - Gets its associated dataset ID then calls a C function on that ID
+ * to verify the dataset name
+ * - Gets its associated datatype ID then calls a C function on that ID
+ * to verify that the packet table is variable- or fixed-length as
+ * indicated by the expected_value argument
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
-static herr_t verify_accessors(hid_t fid, const char *table_name, herr_t expected_value)
+static herr_t verify_accessors(hid_t fid, const char *table_name, hbool_t uses_vlen_type)
{
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t dset_id=H5I_INVALID_HID; /* Dataset associated with the pt */
- hid_t dtype_id=H5I_INVALID_HID; /* Dataset identifier */
+ hid_t ptable = H5I_INVALID_HID; /* Packet table identifier */
+ hid_t dset_id = H5I_INVALID_HID; /* Dataset associated with the pt */
+ hid_t dtype_id = H5I_INVALID_HID; /* Dataset identifier */
char buf[NAME_BUF_SIZE];
ssize_t name_size;
- herr_t is_varlen = 0;
- herr_t ret = FAIL; /* Returned status from a callee */
+ htri_t vlen_check_result = -1;
/* Open the named packet table. */
- ptable = H5PTopen(fid, table_name);
- if (ptable < 0)
- goto error;
+ if((ptable = H5PTopen(fid, table_name)) < 0)
+ goto error;
/* Get the associated dataset ID. */
- dset_id = H5PTget_dataset(ptable);
- if (dset_id < 0)
- goto error;
+ if((dset_id = H5PTget_dataset(ptable)) < 0)
+ goto error;
/* Check if the packet table's name matches its associated dataset's. */
*buf = '\0';
- name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE);
- if (name_size < 0)
- goto error;
+ if((name_size = H5Iget_name(dset_id, (char*)buf, NAME_BUF_SIZE)) < 0)
+ goto error;
VERIFY(HDstrcmp(buf, table_name), "Names of dataset and packet table don't match");
/* Get the packet table's datatype ID */
- dtype_id = H5PTget_type(ptable);
- if (dtype_id < 0)
- goto error;
+ if((dtype_id = H5PTget_type(ptable)) < 0)
+ goto error;
/* Check if the type class matches that of the packet table. */
- is_varlen = H5Tdetect_class(dtype_id, H5T_VLEN);
- if (is_varlen == FAIL) /* failure occurred */
- goto error;
- else if (is_varlen == expected_value) /* length types match */
- ret = SUCCEED;
- else /* length types don't match */
- {
- /* Give lengthtype "fixed-length" or "variable-length" depending on the
- expected_value passed in, then print the error message. */
- char lenthtype[20];
- HDstrcpy(lenthtype, "fixed-length");
- if (expected_value == 1)
- HDstrcpy(lenthtype, "variable-length");
- fprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
- ret = FAIL;
+ if((vlen_check_result = H5Tdetect_class(dtype_id, H5T_VLEN)) < 0)
+ goto error;
+
+ /* Check if length types match */
+ if (vlen_check_result != (htri_t)uses_vlen_type) {
+ /* Give lengthtype "fixed-length" or "variable-length" depending on the
+ * expected_value passed in, then print the error message.
+ */
+ char lenthtype[20];
+ if (uses_vlen_type == TRUE)
+ HDstrcpy(lenthtype, "variable-length");
+ else
+ HDstrcpy(lenthtype, "fixed-length");
+ HDfprintf(stderr, "\nThe dataset '%s' should be %s but is not\n", table_name, lenthtype);
+ goto error;
}
/* Close the packet table */
if (H5PTclose(ptable) < 0)
- goto error;
+ goto error;
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
- if (H5PTis_valid(ptable) > 0) H5PTclose(ptable);
+ if (H5PTis_valid(ptable) > 0)
+ H5PTclose(ptable);
H5_FAILED();
return FAIL;
} /* verify_accessors */
@@ -994,72 +990,73 @@ error: /* An error has occurred. Clean up and exit. */
* test_accessors(): Test the accessor functions
*
* Description:
- * Retrieves the dataset and datatype IDs and verifies various info
- * to ensure these IDs are correct.
+ * Retrieves the dataset and datatype IDs and verifies various info
+ * to ensure these IDs are correct.
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int test_accessors(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
- herr_t ret = FAIL; /* Returned status from a callee */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
+ herr_t ret = FAIL; /* Returned status from a callee */
- TESTING("accessor functions");
+ HL_TESTING2("accessor functions");
/* Open the file */
fid = H5Fopen(TEST_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
ret = verify_accessors(fid, PT_VLEN_ATOMIC, TRUE);
if (ret < 0)
- goto error;
+ goto error;
ret = verify_accessors(fid, PT_FIXED_LEN, FALSE);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
error: /* An error has occurred. Clean up and exit. */
- if (fid > 0) H5Fclose(fid);
+ if (fid > 0)
+ H5Fclose(fid);
H5_FAILED();
return FAIL;
} /* test_accessors */
/**************************************************************************
- Test set for deprecated function H5PTcreate_fl
- Each test in this set is the same as the corresponding one in the
- set for H5PTcreate, as of Mar 2016
+ Test set for deprecated function H5PTcreate_fl
+ Each test in this set is the same as the corresponding one in the
+ set for H5PTcreate, as of Mar 2016
**************************************************************************/
/*-------------------------------------------------------------------------
* testfl_VLof_atomic(): Test that a packet table with VL datatypes of atomic
- * datatypes can be created and written correctly. (HDFFV-442)
+ * datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_atomic(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen of atomic");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen of atomic");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1067,42 +1064,42 @@ static int testfl_VLof_atomic(void)
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++)
- ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
+ ((unsigned int *)writeBuf[uu].p)[vv] = uu * 10 + vv;
} /* end for */
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a vlen type that uses an atomic datatype as its base type */
vltype = H5Tvlen_create (H5T_NATIVE_UINT);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of an atomic type */
ptable = H5PTcreate_fl(fid, PT_VLEN_ATOMIC, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Close the vlen datatype */
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1110,33 +1107,33 @@ static int testfl_VLof_atomic(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
for (uu = 0; uu < NRECORDS; uu++)
for (vv = 0; vv < (uu + 1); vv++)
{
- if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
- printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
- printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
- }
+ if (((unsigned int *)readBuf[uu].p)[vv] != ((unsigned int *)writeBuf[uu].p)[vv]) {
+ printf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
+ printf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
+ }
}
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf );
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1153,7 +1150,7 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_comptype(): Test that a packet table with VL datatypes of
- * compound datatypes can be created and written correctly. (HDFFV-442)
+ * compound datatypes can be created and written correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1165,18 +1162,18 @@ static int testfl_VLof_comptype(void)
unsigned u;
float f;
} VLcomp_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
- hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- hsize_t count; /* Number of records in the table */
- unsigned uu, vv; /* Loop variables */
- char msg[80]; /* For error message */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vltype=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t cmptype=H5I_INVALID_HID; /* Compound datatype */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ hsize_t count; /* Number of records in the table */
+ unsigned uu, vv; /* Loop variables */
+ char msg[80]; /* For error message */
herr_t ret;
- TESTING3(" with vlen of compound datatypes");
+ HL_TESTING3(" with vlen of compound datatypes");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1184,7 +1181,7 @@ static int testfl_VLof_comptype(void)
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].len = uu + 1;
for (vv = 0; vv < (uu + 1); vv++) {
((VLcomp_t *)writeBuf[uu].p)[vv].u = uu + vv;
@@ -1195,48 +1192,48 @@ static int testfl_VLof_comptype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create the base compound type */
cmptype = H5Tcreate(H5T_COMPOUND, sizeof(VLcomp_t));
if (cmptype < 0)
- goto error;
+ goto error;
/* Insert fields */
ret = H5Tinsert(cmptype, "u", HOFFSET(VLcomp_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(cmptype, "f", HOFFSET(VLcomp_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
/* Create a variable length type that uses the VLcomp_t as its base type */
vltype = H5Tvlen_create(cmptype);
if (vltype < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of compound datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_COMP, vltype, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release the datatypes */
if (H5Tclose(cmptype) < 0)
- goto error;
+ goto error;
if (H5Tclose(vltype) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1244,39 +1241,39 @@ static int testfl_VLof_comptype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].len != readBuf[uu].len) {
fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].len=%zu, readBuf[%u].len=%zu\n",__LINE__, uu, writeBuf[uu].len, uu, readBuf[uu].len);
- continue;
- } /* write len != read len */
+ continue;
+ } /* write len != read len */
for (vv = 0; vv < (uu + 1); vv++) {
if (((unsigned int *)writeBuf[uu].p)[vv] != ((unsigned int *)readBuf[uu].p)[vv] ) {
fprintf(stderr, "VL data values don't match!, writeBuf[uu].p[%u]=%u, readBuf[uu].p[%u]=%u\n", vv, ((unsigned int *)writeBuf[uu].p)[vv], vv, ((unsigned int *)readBuf[uu].p)[vv]);
continue;
- } /* write value != read value */
- }
+ } /* write value != read value */
+ }
} /* end for */
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1294,8 +1291,8 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_compound_VL_VL(): Test that a packet table of compound datatypes
- * containing VL datatypes can be created and written
- * correctly. (HDFFV-442)
+ * containing VL datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
@@ -1306,23 +1303,23 @@ static int testfl_compound_VL_VLtype(void)
typedef struct {
unsigned u;
float f;
- hvl_t v;
+ hvl_t v;
} compVLVL_t;
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
- hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
- a VL of VL of atomic datatype */
- hsize_t count; /* Number of records in the table */
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t comp_vlvl=H5I_INVALID_HID; /* ID of a compound datatype containing
+ a VL of VL of atomic datatype */
+ hsize_t count; /* Number of records in the table */
compVLVL_t writeBuf[NRECORDS];/* Buffer to hold data to be written */
compVLVL_t readBuf[NRECORDS]; /* Buffer to hold read data */
hvl_t *t1, *t2;
- unsigned uu, vv, ww; /* Loop variables */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
+ unsigned uu, vv, ww; /* Loop variables */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
- TESTING3(" with compound datatype containing vlen datatype");
+ HL_TESTING3(" with compound datatype containing vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1332,15 +1329,15 @@ static int testfl_compound_VL_VLtype(void)
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
- }
+ }
writeBuf[uu].v.len = uu + L1_INCM;
for (t1 = (hvl_t *)((writeBuf[uu].v).p), vv = 0; vv < (uu + L1_INCM); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + L2_INCM) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + L2_INCM;
for (ww = 0; ww < vv + L2_INCM; ww++)
((unsigned int*)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1350,58 +1347,58 @@ static int testfl_compound_VL_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
/* Create a VL datatype of the VL of atomic datatype */
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create the base compound type */
comp_vlvl = H5Tcreate(H5T_COMPOUND, sizeof(compVLVL_t));
if (comp_vlvl < 0)
- goto error;
+ goto error;
/* Insert fields: atomic, atomic, vlen */
ret = H5Tinsert(comp_vlvl, "u", HOFFSET(compVLVL_t, u), H5T_NATIVE_UINT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "f", HOFFSET(compVLVL_t, f), H5T_NATIVE_FLOAT);
if (ret < 0)
- goto error;
+ goto error;
ret = H5Tinsert(comp_vlvl, "v", HOFFSET(compVLVL_t, v), vlofvl);
if (ret < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a compound datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_COMP_VLEN, comp_vlvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
if (H5Tclose(comp_vlvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)NRECORDS, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1409,7 +1406,7 @@ static int testfl_compound_VL_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)NRECORDS, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1444,19 +1441,19 @@ static int testfl_compound_VL_VLtype(void)
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1475,27 +1472,27 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* testfl_VLof_VLtype(): Test that a packet table of VL datatype with VL
- * datatypes of atomic datatypes can be created and written
- * correctly. (HDFFV-442)
+ * datatypes of atomic datatypes can be created and written
+ * correctly. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
static int testfl_VLof_VLtype(void)
{
- hid_t fid=H5I_INVALID_HID; /* Test file identifier */
- hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
- hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
- hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
- hsize_t count; /* Number of records in the table */
- hvl_t *t1; /* pointer to advance */
- unsigned uu, vv, ww; /* Loop variables */
- hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
- hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
- char msg[80]; /* For error message */
- herr_t ret; /* Returned status from a callee */
-
- TESTING3(" with vlen datatype of vlen datatype");
+ hid_t fid=H5I_INVALID_HID; /* Test file identifier */
+ hid_t ptable=H5I_INVALID_HID; /* Packet table identifier */
+ hid_t vlatomic=H5I_INVALID_HID; /* Variable length datatype */
+ hid_t vlofvl=H5I_INVALID_HID; /* VL datatype of VL datatypes */
+ hsize_t count; /* Number of records in the table */
+ hvl_t *t1; /* pointer to advance */
+ unsigned uu, vv, ww; /* Loop variables */
+ hvl_t writeBuf[NRECORDS]; /* Buffer to hold data to be written */
+ hvl_t readBuf[NRECORDS]; /* Buffer to hold read data */
+ char msg[80]; /* For error message */
+ herr_t ret; /* Returned status from a callee */
+
+ HL_TESTING3(" with vlen datatype of vlen datatype");
/* Allocate and initialize VL data to write (copied from C test) */
for (uu = 0; uu < NRECORDS; uu++) {
@@ -1506,12 +1503,12 @@ static int testfl_VLof_VLtype(void)
} /* end if */
writeBuf[uu].len = uu + 1;
for (t1 = (hvl_t *)(writeBuf[uu].p), vv = 0; vv < (uu + 1); vv++, t1++)
- {
+ {
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
- if (t1->p == NULL) {
- fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
- goto error;
- }
+ if (t1->p == NULL) {
+ fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
+ goto error;
+ }
t1->len = vv + 1;
for (ww = 0; ww < (vv + 1); ww++)
((unsigned int *)t1->p)[ww] = uu * 100 + vv * 10 + ww;
@@ -1521,39 +1518,39 @@ static int testfl_VLof_VLtype(void)
/* Open the file */
fid = H5Fopen(TESTFL_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid < 0)
- goto error;
+ goto error;
/* Create a VL datatype of an atomic type */
vlatomic = H5Tvlen_create (H5T_NATIVE_UINT);
if (vlatomic < 0)
- goto error;
+ goto error;
vlofvl = H5Tvlen_create (vlatomic);
if (vlofvl < 0)
- goto error;
+ goto error;
/* Create a packet table that uses a vlen datatype of vlen datatype */
ptable = H5PTcreate_fl(fid, PT_VLEN_VLEN, vlofvl, (hsize_t)1, 0);
/* Ensure that PT is created successfully */
if (ptable == H5I_INVALID_HID)
- goto error;
+ goto error;
/* Release datatypes */
if (H5Tclose(vlatomic) < 0)
- goto error;
+ goto error;
if (H5Tclose(vlofvl) < 0)
- goto error;
+ goto error;
/* Write the entire buffer to the packet table */
ret = H5PTappend(ptable, (size_t)5, writeBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Get the number of packets in the packet table, should be NRECORDS. */
ret = H5PTget_num_packets(ptable, &count);
if (ret < 0)
- goto error;
+ goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
@@ -1561,24 +1558,24 @@ static int testfl_VLof_VLtype(void)
/* Read all five packets back */
ret = H5PTread_packets(ptable, (hsize_t)0, (size_t)5, (void*)readBuf );
if (ret < 0)
- goto error;
+ goto error;
/* Free the buffers */
ret = H5PTfree_vlen_buff(ptable, NRECORDS, readBuf);
if (ret < 0)
- goto error;
+ goto error;
ret = H5PTfree_vlen_buff(ptable, NRECORDS, writeBuf);
if (ret < 0)
- goto error;
+ goto error;
/* Close the packet table */
ret = H5PTclose(ptable);
if (ret < 0)
- goto error;
+ goto error;
/* Close the file */
if (H5Fclose(fid) < 0)
- goto error;
+ goto error;
PASSED();
return SUCCEED;
@@ -1596,25 +1593,25 @@ error: /* An error has occurred. Clean up and exit. */
/*-------------------------------------------------------------------------
* test_packet_table_with_varlen(): Invokes individual tests to ensure that
- * packet tables with variable length are created and written correctly
- * without the specific VL PT functionality. (HDFFV-442)
+ * packet tables with variable length are created and written correctly
+ * without the specific VL PT functionality. (HDFFV-442)
*
* 2016/01/27 -BMR
*-------------------------------------------------------------------------
*/
int test_packet_table_with_varlen(void)
{
- hid_t fid=H5I_INVALID_HID; /* File identifier */
+ hid_t fid=H5I_INVALID_HID; /* File identifier */
int status = SUCCEED;
/* Create a file using default properties */
fid = H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes");
@@ -1623,46 +1620,46 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (test_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (test_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (test_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (test_H5PTis_varlen() < 0)
- status = FAIL;
+ status = FAIL;
/* Test adding attributes to packet table */
if (test_attributes() < 0)
- status = FAIL;
+ status = FAIL;
/* Test accessor functions */
if (test_accessors() < 0)
- status = FAIL;
+ status = FAIL;
/**************************************************************************
- Calling test functions for deprecated function H5PTcreate_fl
- Mar 2016, -BMR
+ Calling test functions for deprecated function H5PTcreate_fl
+ Mar 2016, -BMR
**************************************************************************/
/* Create a file using default properties */
fid = H5Fcreate(TESTFL_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
- return FAIL;
+ return FAIL;
/* Close the file. The file will be opened by each test function below */
if (H5Fclose(fid) < 0)
- return FAIL;
+ return FAIL;
HDputs("Testing packet table with various variable-length datatypes - H5PTcreate_fl");
@@ -1671,19 +1668,19 @@ int test_packet_table_with_varlen(void)
/* Test variable length of a simple type */
if (testfl_VLof_atomic() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a compound type */
if (testfl_VLof_comptype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test compound type with variable length */
if (testfl_compound_VL_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
/* Test variable length of a variable length */
if (testfl_VLof_VLtype() < 0)
- status = FAIL;
+ status = FAIL;
return(status);
}
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index ff9c0eb..1d6bcec 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -51,8 +51,6 @@
#define NRECORDS 8
#define NRECORDS_ADD 3
-#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
-
/*-------------------------------------------------------------------------
* structure used for all tests, a particle with properties
*-------------------------------------------------------------------------
@@ -117,7 +115,7 @@ typedef struct particle3_t
*-------------------------------------------------------------------------
*/
-/* Push current alignment rule forcing 4-byte alignment boundary
+/* Push current alignment rule forcing 4-byte alignment boundary
* to the internal stack ...
*/
#pragma pack(push,4)
@@ -129,7 +127,7 @@ typedef struct particle3_t
float aty[3];
float rro[2];
} particle4_t;
-/*
+/*
* ... and restore original alignment rules from stack
*/
#pragma pack(pop)
@@ -143,16 +141,7 @@ static hid_t h5file_open(const char *fname, unsigned flags)
{
hid_t fid; /* identifier for the file */
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]=""; /* buffer to hold name of existing file */
-
- /* compose the name of the file to open, using the srcdir, if appropriate */
- if (srcdir)
- {
- HDstrcpy(data_file,srcdir);
- HDstrcat(data_file,"/");
- }
- HDstrcat(data_file,fname);
+ const char *data_file = H5_get_srcdir_filename(fname);
/* open */
if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0)
@@ -173,14 +162,14 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
- !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
- rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
+ rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
HDfprintf(stderr,"%s %ld %f %f %d\n",
- wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
+ wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
return 0;
@@ -433,7 +422,7 @@ static int test_table(hid_t fid, int do_write)
sizeof( rbuf[0].lati)
};
- const char *field_names4[NFIELDS+1] =
+ const char *field_names4[NFIELDS+1] =
{ "F1", "F2", "F3", "F4", "F5", "F6"};
hid_t field_type4[NFIELDS+1];
particle4_t fill_data[1] = { {9999999, -9999999, 999999, {999,999,999},{999,999,999}, {999,999}} };
@@ -467,7 +456,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("making table");
+ HL_TESTING2("making table");
if (H5TBmake_table(TITLE,fid,"table1",FIELDS,RECORDS,type_size_mem,
field_names,field_offset,field_type,
@@ -476,7 +465,7 @@ static int test_table(hid_t fid, int do_write)
PASSED();
}
- TESTING2("reading table");
+ HL_TESTING2("reading table");
/*-------------------------------------------------------------------------
* read the table
@@ -506,7 +495,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing records");
+ HL_TESTING2("writing records");
/* create an empty table */
if (H5TBmake_table(TITLE,fid,"table2",FIELDS,RECORDS,type_size_mem,
@@ -549,7 +538,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading records");
+ HL_TESTING2("reading records");
/*-------------------------------------------------------------------------
* read records, start at 0, read 8
@@ -593,7 +582,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("appending records");
+ HL_TESTING2("appending records");
/*-------------------------------------------------------------------------
* append 2 records
@@ -639,7 +628,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("inserting records");
+ HL_TESTING2("inserting records");
/*-------------------------------------------------------------------------
* insert 2 records
@@ -699,7 +688,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting records");
+ HL_TESTING2("deleting records");
/*-------------------------------------------------------------------------
* Create a table
@@ -892,54 +881,54 @@ static int test_table(hid_t fid, int do_write)
/*------------------------------------------------------------------------
* Functions tested:
*
- * H5TBdelete_record -- With differing memory layout from machine memory
+ * H5TBdelete_record -- With differing memory layout from machine memory
* layout. HDFFV-8055
*
*-------------------------------------------------------------------------
*/
if (do_write)
{
- TESTING2("deleting records (differing memory layout)");
+ HL_TESTING2("deleting records (differing memory layout)");
- dims = 3;
- arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 3;
+ arry3_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- dims = 2;
- arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
+ dims = 2;
+ arry2_32f = H5Tarray_create2(H5T_NATIVE_FLOAT, 1, &dims);
- /* Initialize the field field_type */
- field_type4[0] = H5T_NATIVE_UINT32;
- field_type4[1] = H5T_NATIVE_DOUBLE;
- field_type4[2] = H5T_NATIVE_DOUBLE;
- field_type4[3] = arry3_32f;
- field_type4[4] = arry3_32f;
- field_type4[5] = arry2_32f;
+ /* Initialize the field field_type */
+ field_type4[0] = H5T_NATIVE_UINT32;
+ field_type4[1] = H5T_NATIVE_DOUBLE;
+ field_type4[2] = H5T_NATIVE_DOUBLE;
+ field_type4[3] = arry3_32f;
+ field_type4[4] = arry3_32f;
+ field_type4[5] = arry2_32f;
- /* Make the table */
- if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
+ /* Make the table */
+ if (H5TBmake_table("Table Title",fid,"table",NFIELDS+1,(hsize_t)NRECORDS,
tbl_size, field_names4, tbl_offset, field_type4,
chunk_size, fill_data, compress, p_data)<0)
- goto out;
- /* Delete records */
- start = 3;
- nrecords = 3;
- if (H5TBdelete_record(fid, "table", start, nrecords)<0)
- goto out;;
- /* Get table info */
- if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
- goto out;
- /* check */
- if( (int)nfields_out != (int)NFIELDS+1)
- goto out;
-
- if( (int)nrecords_out != (int)NRECORDS-3)
- goto out;
-
- /* close type */
- H5Tclose(arry3_32f);
- H5Tclose(arry2_32f);
-
- PASSED();
+ goto out;
+ /* Delete records */
+ start = 3;
+ nrecords = 3;
+ if (H5TBdelete_record(fid, "table", start, nrecords)<0)
+ goto out;;
+ /* Get table info */
+ if (H5TBget_table_info(fid,"table", &nfields_out, &nrecords_out)<0)
+ goto out;
+ /* check */
+ if( (int)nfields_out != (int)NFIELDS+1)
+ goto out;
+
+ if( (int)nrecords_out != (int)NRECORDS-3)
+ goto out;
+
+ /* close type */
+ H5Tclose(arry3_32f);
+ H5Tclose(arry2_32f);
+
+ PASSED();
}
/*-------------------------------------------------------------------------
@@ -954,7 +943,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("adding records");
+ HL_TESTING2("adding records");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table4",FIELDS,RECORDS,type_size_mem,
@@ -1014,7 +1003,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("combining tables");
+ HL_TESTING2("combining tables");
/* create 2 tables */
if (H5TBmake_table(TITLE,fid,"table6",FIELDS,RECORDS,type_size_mem,
@@ -1109,7 +1098,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by name");
+ HL_TESTING2("writing fields by name");
/* make an empty table with fill values */
if (H5TBmake_table(TITLE,fid,"table9",FIELDS,RECORDS,type_size_mem,
@@ -1147,10 +1136,10 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
- rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
+ rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,(double)pressure_in[i],position_in[i].lati);
goto out;
@@ -1172,7 +1161,7 @@ static int test_table(hid_t fid, int do_write)
*
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by name");
+ HL_TESTING2("reading fields by name");
/*-------------------------------------------------------------------------
* write and read the "Pressure" field
@@ -1200,7 +1189,7 @@ static int test_table(hid_t fid, int do_write)
if ( H5TBread_fields_name(fid,"table10","DoesNotExist",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out) >=0)
goto out;
-
+
/* read the "Pressure" field */
if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords,
sizeof(float),0,field_sizes_pre,pressure_out)<0)
@@ -1209,7 +1198,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for ( i = 0; i < NRECORDS; i++ )
{
- if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
+ if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1272,7 +1261,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1301,7 +1290,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@@ -1320,7 +1309,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("writing fields by index");
+ HL_TESTING2("writing fields by index");
/* make an empty table */
if (H5TBmake_table(TITLE,fid,"table11",FIELDS,RECORDS,type_size_mem,
@@ -1360,7 +1349,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
+ !H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@@ -1378,7 +1367,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("reading fields by index");
+ HL_TESTING2("reading fields by index");
if (do_write)
{
@@ -1413,7 +1402,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
+ if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1479,8 +1468,8 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
- goto out;
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ goto out;
}
}
@@ -1510,7 +1499,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
- !FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
+ !H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@@ -1529,7 +1518,7 @@ static int test_table(hid_t fid, int do_write)
if (do_write)
{
- TESTING2("inserting fields");
+ HL_TESTING2("inserting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table13",FIELDS,RECORDS,type_size_mem,
@@ -1553,8 +1542,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
- !FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
- !DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
+ !H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
+ !H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@@ -1572,7 +1561,7 @@ static int test_table(hid_t fid, int do_write)
*/
if (do_write)
{
- TESTING2("deleting fields");
+ HL_TESTING2("deleting fields");
/* make a table */
if (H5TBmake_table(TITLE,fid,"table14",FIELDS,RECORDS,type_size_mem,
@@ -1594,7 +1583,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
- !DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
+ !H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}
@@ -1612,7 +1601,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting table info");
+ HL_TESTING2("getting table info");
/* get table info */
if ( H5TBget_table_info (fid, "table1", &rfields, &rrecords ) < 0 )
@@ -1633,7 +1622,7 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
- TESTING2("getting field info");
+ HL_TESTING2("getting field info");
/* alocate */
names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );
diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake
index 7db99de..0726da2 100644
--- a/testpar/CMakeVFDTests.cmake
+++ b/testpar/CMakeVFDTests.cmake
@@ -15,32 +15,32 @@
### T E S T I N G ###
##############################################################################
##############################################################################
- set (VFD_LIST
- sec2
- stdio
- core
- split
- multi
- family
- )
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+)
- set (H5P_VFD_TESTS
- t_pflush1
- t_pflush2
- )
+set (H5P_VFD_TESTS
+ t_pflush1
+ t_pflush2
+)
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
endforeach ()
- macro (ADD_VFD_TEST vfdname resultcode)
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- foreach (h5_test ${H5P_VFD_TESTS})
- add_test (
+macro (ADD_VFD_TEST vfdname resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ foreach (h5_test ${H5P_VFD_TESTS})
+ add_test (
NAME MPI_TEST_VFD-${vfdname}-${h5_test}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
@@ -51,16 +51,22 @@ endforeach ()
-D "TEST_OUTPUT=${vfdname}-${h5_test}.out"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (MPI_TEST_VFD-${vfdname}-${h5_test} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}
- )
- endforeach ()
- endif ()
- endmacro ()
+ )
+ set_tests_properties (MPI_TEST_VFD-${vfdname}-${h5_test} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR}/${vfdname}
+ )
+ endforeach ()
+ endif ()
+endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
- # Run test with different Virtual File Driver
- foreach (h5_vfd ${VFD_LIST})
- ADD_VFD_TEST (${h5_vfd} 0)
- endforeach ()
+# Run test with different Virtual File Driver
+foreach (h5_vfd ${VFD_LIST})
+ ADD_VFD_TEST (${h5_vfd} 0)
+endforeach ()
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 813fb43..10ee0f6 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -16,7 +16,6 @@
*
*/
-#include "h5test.h"
#include "testpar.h"
#include "H5Iprivate.h"
#include "H5ACprivate.h"
@@ -34,15 +33,9 @@
#include "H5Fpkg.h"
-int nerrors = 0;
-int failures = 0;
-hbool_t verbose = TRUE; /* used to control error messages */
-#if 0
-/* So far we haven't needed this, but that may change.
- * Keep it around for now
- */
-hid_t noblock_dxpl_id=(-1);
-#endif
+int nerrors = 0;
+int failures = 0;
+hbool_t verbose = TRUE; /* used to control error messages */
#define NFILENAME 2
#define PARATESTFILE filenames[0]
@@ -54,13 +47,13 @@ char filenames[NFILENAME][PATH_MAX];
hid_t fapl; /* file access property list */
-int world_mpi_size = -1;
-int world_mpi_rank = -1;
-int world_server_mpi_rank = -1;
-MPI_Comm world_mpi_comm = MPI_COMM_NULL;
-int file_mpi_size = -1;
-int file_mpi_rank = -1;
-MPI_Comm file_mpi_comm = MPI_COMM_NULL;
+int world_mpi_size = -1;
+int world_mpi_rank = -1;
+int world_server_mpi_rank = -1;
+MPI_Comm world_mpi_comm = MPI_COMM_NULL;
+int file_mpi_size = -1;
+int file_mpi_rank = -1;
+MPI_Comm file_mpi_comm = MPI_COMM_NULL;
/* the following globals are used to maintain rudementary statistics
@@ -73,122 +66,123 @@ long datum_destroys = 0;
long datum_flushes = 0;
long datum_pinned_flushes = 0;
long datum_loads = 0;
-long global_pins = 0;
-long global_dirty_pins = 0;
-long local_pins = 0;
+long global_pins = 0;
+long global_dirty_pins = 0;
+long local_pins = 0;
/* the following fields are used by the server process only */
-int total_reads = 0;
+int total_reads = 0;
int total_writes = 0;
/*****************************************************************************
* struct datum
*
- * Instances of struct datum are used to store information on entries
- * that may be loaded into the cache. The individual fields are
- * discussed below:
+ * Instances of struct datum are used to store information on entries
+ * that may be loaded into the cache. The individual fields are
+ * discussed below:
*
- * header: Instance of H5C_cache_entry_t used by the for its data.
- * This field is only used on the file processes, not on the
- * server process.
+ * header: Instance of H5C_cache_entry_t used by the for its data.
+ * This field is only used on the file processes, not on the
+ * server process.
*
- * This field MUST be the first entry in this structure.
+ * This field MUST be the first entry in this structure.
*
- * base_addr: Base address of the entry.
+ * base_addr: Base address of the entry.
*
- * len: Length of the entry.
+ * len: Length of the entry.
*
- * local_len: Length of the entry according to the cache. This
- * value must be positive, and may not be larger than len.
+ * local_len: Length of the entry according to the cache. This
+ * value must be positive, and may not be larger than len.
*
- * The field exists to allow us change the sizes of entries
- * in the cache without upsetting the server. This value
- * is only used locally, and is never sent to the server.
+ * The field exists to allow us change the sizes of entries
+ * in the cache without upsetting the server. This value
+ * is only used locally, and is never sent to the server.
*
- * ver: Version number of the entry. This number is initialize
- * to zero, and incremented each time the entry is modified.
+ * ver: Version number of the entry. This number is initialize
+ * to zero, and incremented each time the entry is modified.
*
- * dirty: Boolean flag indicating whether the entry is dirty.
+ * dirty: Boolean flag indicating whether the entry is dirty.
*
- * For current purposes, an entry is clean until it is
- * modified, and dirty until written to the server (cache
- * on process 0) or until it is marked clean (all other
- * caches).
+ * For current purposes, an entry is clean until it is
+ * modified, and dirty until written to the server (cache
+ * on process 0) or until it is marked clean (all other
+ * caches).
*
- * valid: Boolean flag indicating whether the entry contains
- * valid data. Attempts to read an entry whose valid
- * flag is not set should trigger an error.
+ * valid: Boolean flag indicating whether the entry contains
+ * valid data. Attempts to read an entry whose valid
+ * flag is not set should trigger an error.
*
- * locked: Boolean flag that is set to true iff the entry is in
- * the cache and locked.
+ * locked: Boolean flag that is set to true iff the entry is in
+ * the cache and locked.
*
- * global_pinned: Boolean flag that is set to true iff the entry has
- * been pinned collectively in all caches. Since writes must
- * be collective across all processes, only entries pinned
- * in this fashion may be marked dirty.
+ * global_pinned: Boolean flag that is set to true iff the entry has
+ * been pinned collectively in all caches. Since writes must
+ * be collective across all processes, only entries pinned
+ * in this fashion may be marked dirty.
*
- * local_pinned: Boolean flag that is set to true iff the entry
- * has been pinned in the local cache, but probably not all
- * caches. Such pins will typically not be consistant across
- * processes, and thus cannot be marked as dirty unless they
- * happen to overlap some collective operation.
+ * local_pinned: Boolean flag that is set to true iff the entry
+ * has been pinned in the local cache, but probably not all
+ * caches. Such pins will typically not be consistant across
+ * processes, and thus cannot be marked as dirty unless they
+ * happen to overlap some collective operation.
*
- * cleared: Boolean flag that is set to true whenever the entry is
- * dirty, and is cleared via a call to clear_datum().
+ * cleared: Boolean flag that is set to true whenever the entry is
+ * dirty, and is cleared via a call to datum_notify with the
+ * "entry cleaned" action.
*
- * flushed: Boolean flag that is set to true whenever the entry is
- * dirty, and is flushed via a call to flush_datum().
+ * flushed: Boolean flag that is set to true whenever the entry is
+ * dirty, and is flushed by the metadata cache.
*
- * reads: Integer field used to maintain a count of the number of
- * times this entry has been read from the server since
- * the last time the read and write counts were reset.
+ * reads: Integer field used to maintain a count of the number of
+ * times this entry has been read from the server since
+ * the last time the read and write counts were reset.
*
- * writes: Integer field used to maintain a count of the number of
- * times this entry has been written to the server since
- * the last time the read and write counts were reset.
+ * writes: Integer field used to maintain a count of the number of
+ * times this entry has been written to the server since
+ * the last time the read and write counts were reset.
*
- * index: Index of this instance of datum in the data_index[] array
- * discussed below.
+ * index: Index of this instance of datum in the data_index[] array
+ * discussed below.
*
*****************************************************************************/
struct datum
{
- H5C_cache_entry_t header;
- haddr_t base_addr;
- size_t len;
- size_t local_len;
- int ver;
- hbool_t dirty;
- hbool_t valid;
- hbool_t locked;
- hbool_t global_pinned;
- hbool_t local_pinned;
- hbool_t cleared;
- hbool_t flushed;
- int reads;
- int writes;
- int index;
+ H5C_cache_entry_t header;
+ haddr_t base_addr;
+ size_t len;
+ size_t local_len;
+ int ver;
+ hbool_t dirty;
+ hbool_t valid;
+ hbool_t locked;
+ hbool_t global_pinned;
+ hbool_t local_pinned;
+ hbool_t cleared;
+ hbool_t flushed;
+ int reads;
+ int writes;
+ int index;
};
/*****************************************************************************
* data array
*
- * The data array is an array of instances of datum of size
- * NUM_DATA_ENTRIES that is used to track the particulars of all
- * the entries that may be loaded into the cache.
+ * The data array is an array of instances of datum of size
+ * NUM_DATA_ENTRIES that is used to track the particulars of all
+ * the entries that may be loaded into the cache.
*
- * It exists on all processes, although the master copy is maintained
- * by the server process. If the cache is performing correctly, all
- * versions should be effectively identical. By that I mean that
- * the data received from the server should always match that in
- * the local version of the data array.
+ * It exists on all processes, although the master copy is maintained
+ * by the server process. If the cache is performing correctly, all
+ * versions should be effectively identical. By that I mean that
+ * the data received from the server should always match that in
+ * the local version of the data array.
*
*****************************************************************************/
-#define NUM_DATA_ENTRIES 100000
+#define NUM_DATA_ENTRIES 100000
struct datum data[NUM_DATA_ENTRIES];
@@ -207,10 +201,10 @@ struct datum data[NUM_DATA_ENTRIES];
* Further, this value must be consistant across all processes.
*/
-#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
-#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
+#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
+#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
/* Use a smaller test size to avoid creating huge MPE logfiles. */
-#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
+#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
int virt_num_data_entries = NUM_DATA_ENTRIES;
@@ -218,14 +212,14 @@ int virt_num_data_entries = NUM_DATA_ENTRIES;
/*****************************************************************************
* data_index array
*
- * The data_index array is an array of integer used to maintain a list
- * of instances of datum in the data array in increasing base_addr order.
+ * The data_index array is an array of integer used to maintain a list
+ * of instances of datum in the data array in increasing base_addr order.
*
- * This array is necessary, as move operations can swap the values
- * of the base_addr fields of two instances of datum. Without this
- * array, we would no longer be able to use a binary search on a sorted
- * list to find the indexes of instances of datum given the values of
- * their base_addr fields.
+ * This array is necessary, as move operations can swap the values
+ * of the base_addr fields of two instances of datum. Without this
+ * array, we would no longer be able to use a binary search on a sorted
+ * list to find the indexes of instances of datum given the values of
+ * their base_addr fields.
*
*****************************************************************************/
@@ -234,99 +228,99 @@ int data_index[NUM_DATA_ENTRIES];
/*****************************************************************************
* The following two #defines are used to control code that is in turn used
- * to force "POSIX" semantics on the server process used to simulate metadata
- * reads and writes. Without some such mechanism, the test code contains
+ * to force "POSIX" semantics on the server process used to simulate metadata
+ * reads and writes. Without some such mechanism, the test code contains
* race conditions that will frequently cause spurious failures.
*
* When set to TRUE, DO_WRITE_REQ_ACK forces the server to send an ack after
- * each write request, and the client to wait until the ack is received
+ * each write request, and the client to wait until the ack is received
* before proceeding. This was my first solution to the problem, and at
* first glance, it would seem to have a lot of unnecessary overhead.
*
* In an attempt to reduce the overhead, I implemented a second solution
- * in which no acks are sent after writes. Instead, the metadata cache is
- * provided with a callback function to call after each sequence of writes.
- * This callback simply causes the client to send the server process a
+ * in which no acks are sent after writes. Instead, the metadata cache is
+ * provided with a callback function to call after each sequence of writes.
+ * This callback simply causes the client to send the server process a
* "sync" message and and await an ack in reply.
*
- * Strangely, at least on Phoenix, the first solution runs faster by a
- * rather large margin. However, I can imagine this changing with
+ * Strangely, at least on Phoenix, the first solution runs faster by a
+ * rather large margin. However, I can imagine this changing with
* different OS's and MPI implementatins.
*
- * Thus I have left code supporting the second solution in place.
+ * Thus I have left code supporting the second solution in place.
*
- * Note that while one of these two #defines must be set to TRUE, there
- * should never be any need to set both of them to TRUE (although the
+ * Note that while one of these two #defines must be set to TRUE, there
+ * should never be any need to set both of them to TRUE (although the
* tests will still function with this setting).
*****************************************************************************/
-#define DO_WRITE_REQ_ACK TRUE
-#define DO_SYNC_AFTER_WRITE FALSE
+#define DO_WRITE_REQ_ACK TRUE
+#define DO_SYNC_AFTER_WRITE FALSE
/*****************************************************************************
* struct mssg
*
- * The mssg structure is used as a generic container for messages to
- * and from the server. Not all fields are used in all cases.
+ * The mssg structure is used as a generic container for messages to
+ * and from the server. Not all fields are used in all cases.
*
- * req: Integer field containing the type of the message.
+ * req: Integer field containing the type of the message.
*
- * src: World communicator MPI rank of the sending process.
+ * src: World communicator MPI rank of the sending process.
*
- * dest: World communicator MPI rank of the destination process.
+ * dest: World communicator MPI rank of the destination process.
*
- * mssg_num: Serial number assigned to the message by the sender.
+ * mssg_num: Serial number assigned to the message by the sender.
*
- * base_addr: Base address of a datum. Not used in all mssgs.
+ * base_addr: Base address of a datum. Not used in all mssgs.
*
- * len: Length of a datum (in bytes). Not used in all mssgs.
+ * len: Length of a datum (in bytes). Not used in all mssgs.
*
- * ver: Version number of a datum. Not used in all mssgs.
+ * ver: Version number of a datum. Not used in all mssgs.
*
- * count: Reported number of total/entry reads/writes. Not used
- * in all mssgs.
+ * count: Reported number of total/entry reads/writes. Not used
+ * in all mssgs.
*
- * magic: Magic number for error detection. Must be set to
- * MSSG_MAGIC.
+ * magic: Magic number for error detection. Must be set to
+ * MSSG_MAGIC.
*
*****************************************************************************/
-#define WRITE_REQ_CODE 0
-#define WRITE_REQ_ACK_CODE 1
-#define READ_REQ_CODE 2
-#define READ_REQ_REPLY_CODE 3
-#define SYNC_REQ_CODE 4
-#define SYNC_ACK_CODE 5
-#define REQ_TTL_WRITES_CODE 6
-#define REQ_TTL_WRITES_RPLY_CODE 7
-#define REQ_TTL_READS_CODE 8
-#define REQ_TTL_READS_RPLY_CODE 9
-#define REQ_ENTRY_WRITES_CODE 10
-#define REQ_ENTRY_WRITES_RPLY_CODE 11
-#define REQ_ENTRY_READS_CODE 12
-#define REQ_ENTRY_READS_RPLY_CODE 13
-#define REQ_RW_COUNT_RESET_CODE 14
-#define REQ_RW_COUNT_RESET_RPLY_CODE 15
-#define DONE_REQ_CODE 16
-#define MAX_REQ_CODE 16
-
-#define MSSG_MAGIC 0x1248
+#define WRITE_REQ_CODE 0
+#define WRITE_REQ_ACK_CODE 1
+#define READ_REQ_CODE 2
+#define READ_REQ_REPLY_CODE 3
+#define SYNC_REQ_CODE 4
+#define SYNC_ACK_CODE 5
+#define REQ_TTL_WRITES_CODE 6
+#define REQ_TTL_WRITES_RPLY_CODE 7
+#define REQ_TTL_READS_CODE 8
+#define REQ_TTL_READS_RPLY_CODE 9
+#define REQ_ENTRY_WRITES_CODE 10
+#define REQ_ENTRY_WRITES_RPLY_CODE 11
+#define REQ_ENTRY_READS_CODE 12
+#define REQ_ENTRY_READS_RPLY_CODE 13
+#define REQ_RW_COUNT_RESET_CODE 14
+#define REQ_RW_COUNT_RESET_RPLY_CODE 15
+#define DONE_REQ_CODE 16
+#define MAX_REQ_CODE 16
+
+#define MSSG_MAGIC 0x1248
struct mssg_t
{
- int req;
- int src;
- int dest;
- long int mssg_num;
- haddr_t base_addr;
- unsigned len;
- int ver;
- int count;
- unsigned magic;
+ int req;
+ int src;
+ int dest;
+ long int mssg_num;
+ haddr_t base_addr;
+ unsigned len;
+ int ver;
+ unsigned count;
+ unsigned magic;
};
-MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
+MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
/*****************************************************************************/
@@ -387,9 +381,9 @@ static void * load_datum(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
void H5_ATTR_UNUSED *udata);
static herr_t size_datum(H5F_t H5_ATTR_UNUSED * f, void * thing, size_t * size_ptr);
-#define DATUM_ENTRY_TYPE H5AC_TEST_ID
+#define DATUM_ENTRY_TYPE H5AC_TEST_ID
-#define NUMBER_OF_ENTRY_TYPES 1
+#define NUMBER_OF_ENTRY_TYPES 1
const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
{
@@ -429,9 +423,9 @@ static void pin_protected_entry(int32_t idx, hbool_t global);
static void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx);
static hbool_t reset_server_counts(void);
static void resize_entry(int32_t idx, size_t new_size);
-static hbool_t setup_cache_for_test(hid_t * fid_ptr,
+static hbool_t setup_cache_for_test(hid_t * fid_ptr,
H5F_t ** file_ptr_ptr,
- H5C_t ** cache_ptr_ptr,
+ H5C_t ** cache_ptr_ptr,
int metadata_write_strategy);
static void setup_rand(void);
static hbool_t take_down_cache(hid_t fid);
@@ -463,20 +457,20 @@ static hbool_t trace_file_check(int metadata_write_strategy);
#ifdef NOT_USED
/*****************************************************************************
*
- * Function: print_stats()
+ * Function: print_stats()
*
- * Purpose: Print the rudementary stats maintained by t_cache.
+ * Purpose: Print the rudementary stats maintained by t_cache.
*
- * This is a debugging function, which will not normally
- * be run as part of t_cache.
+ * This is a debugging function, which will not normally
+ * be run as part of t_cache.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 4/17/06
+ * Programmer: JRM -- 4/17/06
*
* Modifications:
*
- * None.
+ * None.
*
*****************************************************************************/
@@ -484,16 +478,16 @@ static void
print_stats(void)
{
HDfprintf(stdout,
- "%d: datum clears / pinned clears / destroys = %ld / %ld / %ld\n",
+ "%d: datum clears / pinned clears / destroys = %ld / %ld / %ld\n",
world_mpi_rank, datum_clears, datum_pinned_clears,
- datum_destroys );
+ datum_destroys );
HDfprintf(stdout,
- "%d: datum flushes / pinned flushes / loads = %ld / %ld / %ld\n",
+ "%d: datum flushes / pinned flushes / loads = %ld / %ld / %ld\n",
world_mpi_rank, datum_flushes, datum_pinned_flushes,
- datum_loads );
+ datum_loads );
HDfprintf(stdout,
- "%d: pins: global / global dirty / local = %ld / %ld / %ld\n",
- world_mpi_rank, global_pins, global_dirty_pins, local_pins);
+ "%d: pins: global / global dirty / local = %ld / %ld / %ld\n",
+ world_mpi_rank, global_pins, global_dirty_pins, local_pins);
HDfflush(stdout);
return;
@@ -501,19 +495,20 @@ print_stats(void)
} /* print_stats() */
#endif /* NOT_USED */
+
/*****************************************************************************
*
- * Function: reset_stats()
+ * Function: reset_stats()
*
- * Purpose: Reset the rudementary stats maintained by t_cache.
+ * Purpose: Reset the rudementary stats maintained by t_cache.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 4/17/06
+ * Programmer: JRM -- 4/17/06
*
* Modifications:
*
- * None.
+ * None.
*
*****************************************************************************/
@@ -526,9 +521,9 @@ reset_stats(void)
datum_flushes = 0;
datum_pinned_flushes = 0;
datum_loads = 0;
- global_pins = 0;
- global_dirty_pins = 0;
- local_pins = 0;
+ global_pins = 0;
+ global_dirty_pins = 0;
+ local_pins = 0;
return;
@@ -541,20 +536,20 @@ reset_stats(void)
/*****************************************************************************
*
- * Function: set_up_file_communicator()
+ * Function: set_up_file_communicator()
*
- * Purpose: Create the MPI communicator used to open a HDF5 file with.
- * In passing, also initialize the file_mpi... globals.
+ * Purpose: Create the MPI communicator used to open a HDF5 file with.
+ * In passing, also initialize the file_mpi... globals.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 11/16/05
+ * Programmer: JRM -- 11/16/05
*
* Modifications:
*
- * None.
+ * None.
*
*****************************************************************************/
@@ -577,7 +572,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
- if ( verbose ) {
+ if ( verbose ) {
fprintf(stdout,
"%d:%s: MPI_Comm_group() failed with error %d.\n",
world_mpi_rank, fcn_name, mpi_result);
@@ -694,16 +689,16 @@ set_up_file_communicator(void)
/*****************************************************************************
*
- * Function: addr_to_datum_index()
+ * Function: addr_to_datum_index()
*
- * Purpose: Given the base address of a datum, find and return its index
- * in the data array.
+ * Purpose: Given the base address of a datum, find and return its index
+ * in the data array.
*
- * Return: Success: index of target datum.
+ * Return: Success: index of target datum.
*
- * Failure: -1.
+ * Failure: -1.
*
- * Programmer: JRM -- 12/20/05
+ * Programmer: JRM -- 12/20/05
*
*****************************************************************************/
static int
@@ -742,16 +737,16 @@ addr_to_datum_index(haddr_t base_addr)
/*****************************************************************************
*
- * Function: init_data()
+ * Function: init_data()
*
- * Purpose: Initialize the data array, from which cache entries are
- * loaded.
+ * Purpose: Initialize the data array, from which cache entries are
+ * loaded.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/20/05
+ * Programmer: JRM -- 12/20/05
*
*****************************************************************************/
static void
@@ -787,13 +782,13 @@ init_data(void)
data[i].dirty = FALSE;
data[i].valid = FALSE;
data[i].locked = FALSE;
- data[i].global_pinned = FALSE;
- data[i].local_pinned = FALSE;
- data[i].cleared = FALSE;
- data[i].flushed = FALSE;
+ data[i].global_pinned = FALSE;
+ data[i].local_pinned = FALSE;
+ data[i].cleared = FALSE;
+ data[i].flushed = FALSE;
data[i].reads = 0;
data[i].writes = 0;
- data[i].index = i;
+ data[i].index = i;
data_index[i] = i;
@@ -814,22 +809,22 @@ init_data(void)
/*****************************************************************************
*
- * Function: do_express_test()
+ * Function: do_express_test()
*
- * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
- * by GetTestExpress() across all processes. Return this
- * value.
+ * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
+ * by GetTestExpress() across all processes. Return this
+ * value.
*
- * Envirmoment variables can be different across different
- * processes. This function ensures that all processes agree
- * on whether to do an express test.
+ * Envirmoment variables can be different across different
+ * processes. This function ensures that all processes agree
+ * on whether to do an express test.
*
- * Return: Success: Maximum of the values returned by
- * GetTestExpress() across all processes.
+ * Return: Success: Maximum of the values returned by
+ * GetTestExpress() across all processes.
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: JRM -- 4/25/06
+ * Programmer: JRM -- 4/25/06
*
*****************************************************************************/
static int
@@ -866,26 +861,21 @@ do_express_test(void)
/*****************************************************************************
*
- * Function: do_sync()
+ * Function: do_sync()
*
- * Purpose: Ensure that all messages sent by this process have been
- * processed before proceeding.
+ * Purpose: Ensure that all messages sent by this process have been
+ * processed before proceeding.
*
- * Do this by exchanging sync req / sync ack messages with
- * the server.
+ * Do this by exchanging sync req / sync ack messages with
+ * the server.
*
- * Do nothing if nerrors is greater than zero.
+ * Do nothing if nerrors is greater than zero.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 5/10/06
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 5/10/06
*
*****************************************************************************/
-
static void
do_sync(void)
{
@@ -896,7 +886,7 @@ do_sync(void)
if ( nerrors <= 0 ) {
/* compose the message */
- mssg.req = SYNC_REQ_CODE;
+ mssg.req = SYNC_REQ_CODE;
mssg.src = world_mpi_rank;
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
@@ -906,10 +896,10 @@ do_sync(void)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if ( ! send_mssg(&mssg, FALSE) ) {
+ if ( ! send_mssg(&mssg, FALSE) ) {
- nerrors++;
- if ( verbose ) {
+ nerrors++;
+ if ( verbose ) {
HDfprintf(stdout, "%d:%s: send_mssg() failed.\n",
world_mpi_rank, fcn_name);
}
@@ -918,24 +908,24 @@ do_sync(void)
if ( nerrors <= 0 ) {
- if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) {
+ if ( ! recv_mssg(&mssg, SYNC_ACK_CODE) ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n",
world_mpi_rank, fcn_name);
}
- } else if ( ( mssg.req != SYNC_ACK_CODE ) ||
+ } else if ( ( mssg.req != SYNC_ACK_CODE ) ||
( mssg.src != world_server_mpi_rank ) ||
( mssg.dest != world_mpi_rank ) ||
- ( mssg.magic != MSSG_MAGIC ) ) {
+ ( mssg.magic != MSSG_MAGIC ) ) {
nerrors++;
- if ( verbose ) {
+ if ( verbose ) {
HDfprintf(stdout, "%d:%s: Bad data in sync ack.\n",
world_mpi_rank, fcn_name);
}
- }
+ }
}
return;
@@ -945,24 +935,19 @@ do_sync(void)
/*****************************************************************************
*
- * Function: get_max_nerrors()
- *
- * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors
- * across all processes. Return this value.
+ * Function: get_max_nerrors()
*
- * Return: Success: Maximum of the nerrors global variables across
- * all processes.
+ * Purpose: Do an MPI_Allreduce to obtain the maximum value of nerrors
+ * across all processes. Return this value.
*
- * Failure: -1
+ * Return: Success: Maximum of the nerrors global variables across
+ * all processes.
*
- * Programmer: JRM -- 1/3/06
+ * Failure: -1
*
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 1/3/06
*
*****************************************************************************/
-
static int
get_max_nerrors(void)
{
@@ -998,29 +983,29 @@ get_max_nerrors(void)
/*****************************************************************************
*
- * Function: recv_mssg()
+ * Function: recv_mssg()
*
- * Purpose: Receive a message from any process in the provided instance
- * of struct mssg.
+ * Purpose: Receive a message from any process in the provided instance
+ * of struct mssg.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Added mssg_tag_offset parameter and supporting code.
+ * JRM -- 5/10/06
+ * Added mssg_tag_offset parameter and supporting code.
*
*****************************************************************************/
-#define CACHE_TEST_TAG 99 /* different from any used by the library */
+#define CACHE_TEST_TAG 99 /* different from any used by the library */
static hbool_t
recv_mssg(struct mssg_t *mssg_ptr,
- int mssg_tag_offset)
+ int mssg_tag_offset)
{
const char * fcn_name = "recv_mssg()";
hbool_t success = TRUE;
@@ -1083,29 +1068,28 @@ recv_mssg(struct mssg_t *mssg_ptr,
/*****************************************************************************
*
- * Function: send_mssg()
+ * Function: send_mssg()
*
- * Purpose: Send the provided instance of mssg to the indicated target.
+ * Purpose: Send the provided instance of mssg to the indicated target.
*
- * Note that all source and destination ranks are in the
- * global communicator.
+ * Note that all source and destination ranks are in the
+ * global communicator.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Added the add_req_to_tag parameter and supporting code.
+ * JRM -- 5/10/06
+ * Added the add_req_to_tag parameter and supporting code.
*
*****************************************************************************/
-
static hbool_t
send_mssg(struct mssg_t *mssg_ptr,
- hbool_t add_req_to_tag)
+ hbool_t add_req_to_tag)
{
const char * fcn_name = "send_mssg()";
hbool_t success = TRUE;
@@ -1134,10 +1118,10 @@ send_mssg(struct mssg_t *mssg_ptr,
mssg_ptr->mssg_num = mssg_num++;
- if ( add_req_to_tag ) {
+ if ( add_req_to_tag ) {
- mssg_tag += mssg_ptr->req;
- }
+ mssg_tag += mssg_ptr->req;
+ }
result = MPI_Send((void *)mssg_ptr, 1, mpi_mssg_t,
mssg_ptr->dest, mssg_tag, world_mpi_comm);
@@ -1157,19 +1141,19 @@ send_mssg(struct mssg_t *mssg_ptr,
} /* send_mssg() */
-
+
/*****************************************************************************
*
- * Function: setup_derived_types()
+ * Function: setup_derived_types()
*
- * Purpose: Set up the derived types used by the test bed. At present,
- * only the mpi_mssg derived type is needed.
+ * Purpose: Set up the derived types used by the test bed. At present,
+ * only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
static hbool_t
@@ -1250,23 +1234,18 @@ setup_derived_types(void)
/*****************************************************************************
*
- * Function: takedown_derived_types()
+ * Function: takedown_derived_types()
*
- * Purpose: take down the derived types used by the test bed. At present,
- * only the mpi_mssg derived type is needed.
+ * Purpose: take down the derived types used by the test bed. At present,
+ * only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
-
static hbool_t
takedown_derived_types(void)
{
@@ -1297,23 +1276,18 @@ takedown_derived_types(void)
/*****************************************************************************
*
- * Function: reset_server_counters()
- *
- * Purpose: Reset the counters maintained by the server, doing a
- * sanity check in passing.
+ * Function: reset_server_counters()
*
- * Return: Success: TRUE
+ * Purpose: Reset the counters maintained by the server, doing a
+ * sanity check in passing.
*
- * Failure: FALSE
+ * Return: Success: TRUE
*
- * Programmer: JRM -- 5/5/10
+ * Failure: FALSE
*
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
-
static hbool_t
reset_server_counters(void)
{
@@ -1344,7 +1318,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, fcn_name,
actual_total_reads, total_reads);
}
}
@@ -1355,7 +1329,7 @@ reset_server_counters(void)
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, fcn_name,
actual_total_writes, total_writes);
}
}
@@ -1370,28 +1344,27 @@ reset_server_counters(void)
/*****************************************************************************
*
- * Function: server_main()
+ * Function: server_main()
*
- * Purpose: Main function for the server process. This process exists
- * to provide an independant view of the data array.
+ * Purpose: Main function for the server process. This process exists
+ * to provide an independant view of the data array.
*
- * The function handles request from the other processes in
- * the test until the count of done messages received equals
- * the number of client processes.
+ * The function handles request from the other processes in
+ * the test until the count of done messages received equals
+ * the number of client processes.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
* Modifications:
*
- * JRM -- 5/10/06
- * Updated for sync message.
+ * JRM -- 5/10/06
+ * Updated for sync message.
*
*****************************************************************************/
-
static hbool_t
server_main(void)
{
@@ -1420,98 +1393,98 @@ server_main(void)
switch ( mssg.req )
{
- case WRITE_REQ_CODE:
- success = serve_write_request(&mssg);
- break;
+ case WRITE_REQ_CODE:
+ success = serve_write_request(&mssg);
+ break;
- case WRITE_REQ_ACK_CODE:
+ case WRITE_REQ_ACK_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received write ack?!?.\n", fcn_name);
- break;
+ break;
- case READ_REQ_CODE:
+ case READ_REQ_CODE:
success = serve_read_request(&mssg);
- break;
+ break;
- case READ_REQ_REPLY_CODE:
+ case READ_REQ_REPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received read req reply?!?.\n", fcn_name);
- break;
+ break;
- case SYNC_REQ_CODE:
+ case SYNC_REQ_CODE:
success = serve_sync_request(&mssg);
- break;
+ break;
- case SYNC_ACK_CODE:
+ case SYNC_ACK_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received sync ack?!?.\n", fcn_name);
- break;
+ break;
- case REQ_TTL_WRITES_CODE:
- success = serve_total_writes_request(&mssg);
- break;
+ case REQ_TTL_WRITES_CODE:
+ success = serve_total_writes_request(&mssg);
+ break;
- case REQ_TTL_WRITES_RPLY_CODE:
+ case REQ_TTL_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received total writes reply?!?.\n", fcn_name);
- break;
+ break;
- case REQ_TTL_READS_CODE:
- success = serve_total_reads_request(&mssg);
- break;
+ case REQ_TTL_READS_CODE:
+ success = serve_total_reads_request(&mssg);
+ break;
- case REQ_TTL_READS_RPLY_CODE:
+ case REQ_TTL_READS_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received total reads reply?!?.\n", fcn_name);
- break;
+ break;
- case REQ_ENTRY_WRITES_CODE:
- success = serve_entry_writes_request(&mssg);
- break;
+ case REQ_ENTRY_WRITES_CODE:
+ success = serve_entry_writes_request(&mssg);
+ break;
- case REQ_ENTRY_WRITES_RPLY_CODE:
+ case REQ_ENTRY_WRITES_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received entry writes reply?!?.\n", fcn_name);
- break;
+ break;
- case REQ_ENTRY_READS_CODE:
- success = serve_entry_reads_request(&mssg);
- break;
+ case REQ_ENTRY_READS_CODE:
+ success = serve_entry_reads_request(&mssg);
+ break;
- case REQ_ENTRY_READS_RPLY_CODE:
+ case REQ_ENTRY_READS_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received entry reads reply?!?.\n", fcn_name);
- break;
+ break;
- case REQ_RW_COUNT_RESET_CODE:
- success = serve_rw_count_reset_request(&mssg);
- break;
+ case REQ_RW_COUNT_RESET_CODE:
+ success = serve_rw_count_reset_request(&mssg);
+ break;
- case REQ_RW_COUNT_RESET_RPLY_CODE:
+ case REQ_RW_COUNT_RESET_RPLY_CODE:
success = FALSE;
if(verbose)
HDfprintf(stdout, "%s: Received RW count reset reply?!?.\n", fcn_name);
- break;
+ break;
- case DONE_REQ_CODE:
- done_count++;
- if(done_count >= file_mpi_size)
- done = TRUE;
- break;
+ case DONE_REQ_CODE:
+ done_count++;
+ if(done_count >= file_mpi_size)
+ done = TRUE;
+ break;
- default:
+ default:
nerrors++;
success = FALSE;
if(verbose)
- HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, fcn_name);
- break;
+ HDfprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, fcn_name);
+ break;
}
}
}
@@ -1520,23 +1493,23 @@ server_main(void)
} /* server_main() */
-
+
/*****************************************************************************
*
- * Function: serve_read_request()
+ * Function: serve_read_request()
*
- * Purpose: Serve a read request.
+ * Purpose: Serve a read request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * a copy of the indicated datum from the data array to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * a copy of the indicated datum from the data array to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/22/05
+ * Programmer: JRM -- 12/22/05
*
*****************************************************************************/
static hbool_t
@@ -1593,8 +1566,8 @@ serve_read_request(struct mssg_t * mssg_ptr)
"%d:%s: proc %d read invalid entry. idx/base_addr = %d/0x%llx.\n",
world_mpi_rank, fcn_name,
mssg_ptr->src,
- target_index,
- (long long)(data[target_index].base_addr));
+ target_index,
+ (long long)(data[target_index].base_addr));
}
} else {
@@ -1606,11 +1579,11 @@ serve_read_request(struct mssg_t * mssg_ptr)
reply.base_addr = data[target_index].base_addr;
reply.len = data[target_index].len;
reply.ver = data[target_index].ver;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
- /* and update the counters */
- total_reads++;
+ /* and update the counters */
+ total_reads++;
(data[target_index].reads)++;
}
}
@@ -1625,7 +1598,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d read 0x%llx. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
@@ -1633,13 +1606,13 @@ serve_read_request(struct mssg_t * mssg_ptr)
} else {
HDfprintf(stdout, "%d read 0x%llx FAILED. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
}
- }
+ }
return(success);
@@ -1648,30 +1621,25 @@ serve_read_request(struct mssg_t * mssg_ptr)
/*****************************************************************************
*
- * Function: serve_sync_request()
- *
- * Purpose: Serve a sync request.
+ * Function: serve_sync_request()
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends a
- * sync ack to the requesting process.
+ * Purpose: Serve a sync request.
*
- * This service exist to allow the sending process to ensure
- * that all previous messages have been processed before
- * proceeding.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends a
+ * sync ack to the requesting process.
*
- * Return: Success: TRUE
+ * This service exist to allow the sending process to ensure
+ * that all previous messages have been processed before
+ * proceeding.
*
- * Failure: FALSE
+ * Return: Success: TRUE
*
- * Programmer: JRM -- 5/10/06
+ * Failure: FALSE
*
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 5/10/06
*
*****************************************************************************/
-
static hbool_t
serve_sync_request(struct mssg_t * mssg_ptr)
{
@@ -1702,7 +1670,7 @@ serve_sync_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
}
@@ -1722,29 +1690,29 @@ serve_sync_request(struct mssg_t * mssg_ptr)
HDfprintf(stdout, "%d sync FAILED.\n", (int)(mssg_ptr->src));
}
- }
+ }
return(success);
} /* serve_sync_request() */
-
+
/*****************************************************************************
*
- * Function: serve_write_request()
+ * Function: serve_write_request()
*
- * Purpose: Serve a write request.
+ * Purpose: Serve a write request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it updates
- * the version number of the target data array entry as
- * specified in the message.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it updates
+ * the version number of the target data array entry as
+ * specified in the message.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/21/05
+ * Programmer: JRM -- 12/21/05
*
*****************************************************************************/
static hbool_t
@@ -1803,7 +1771,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
new_ver_num = mssg_ptr->ver;
/* this check should catch duplicate writes */
- if ( new_ver_num <= data[target_index].ver ) {
+ if ( new_ver_num <= data[target_index].ver ) {
nerrors++;
success = FALSE;
@@ -1817,12 +1785,12 @@ serve_write_request(struct mssg_t * mssg_ptr)
if ( success ) {
- /* process the write */
+ /* process the write */
data[target_index].ver = new_ver_num;
data[target_index].valid = TRUE;
/* and update the counters */
- total_writes++;
+ total_writes++;
(data[target_index].writes)++;
#if DO_WRITE_REQ_ACK
@@ -1838,7 +1806,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
reply.count = 0;
reply.magic = MSSG_MAGIC;
- /* and send it */
+ /* and send it */
success = send_mssg(&reply, TRUE);
#endif /* DO_WRITE_REQ_ACK */
@@ -1850,7 +1818,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d write 0x%llx. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
@@ -1858,36 +1826,36 @@ serve_write_request(struct mssg_t * mssg_ptr)
} else {
HDfprintf(stdout, "%d write 0x%llx FAILED. len = %d. ver = %d.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(int)(data[target_index].len),
(int)(data[target_index].ver));
}
- }
+ }
return(success);
} /* serve_write_request() */
-
+
/*****************************************************************************
*
- * Function: serve_total_writes_request()
+ * Function: serve_total_writes_request()
*
- * Purpose: Serve a request for the total number of writes recorded since
- * the last reset.
+ * Purpose: Serve a request for the total number of writes recorded since
+ * the last reset.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the current value of the total_writes global variable to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the current value of the total_writes global variable to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -1934,40 +1902,40 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request total writes %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_writes);
} else {
HDfprintf(stdout, "%d request total writes %ld -- FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_writes);
}
- }
+ }
return(success);
} /* serve_total_writes_request() */
-
+
/*****************************************************************************
*
- * Function: serve_total_reads_request()
+ * Function: serve_total_reads_request()
*
- * Purpose: Serve a request for the total number of reads recorded since
- * the last reset.
+ * Purpose: Serve a request for the total number of reads recorded since
+ * the last reset.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the current value of the total_reads global variable to
- * the requesting process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the current value of the total_reads global variable to
+ * the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2014,40 +1982,40 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request total reads %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_reads);
} else {
HDfprintf(stdout, "%d request total reads %ld -- FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
total_reads);
}
- }
+ }
return(success);
} /* serve_total_reads_request() */
-
+
/*****************************************************************************
*
- * Function: serve_entry_writes_request()
+ * Function: serve_entry_writes_request()
*
- * Purpose: Serve an entry writes request.
+ * Purpose: Serve an entry writes request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the number of times that the indicated datum has been
- * written since the last counter reset to the requesting
- * process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the number of times that the indicated datum has been
+ * written since the last counter reset to the requesting
+ * process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2095,7 +2063,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = data[target_index].writes;
+ reply.count = data[target_index].writes;
reply.magic = MSSG_MAGIC;
}
}
@@ -2110,42 +2078,42 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request entry 0x%llx writes = %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].writes));
} else {
HDfprintf(stdout, "%d request entry 0x%llx writes = %ld FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].writes));
}
- }
+ }
return(success);
} /* serve_entry_writes_request() */
-
+
/*****************************************************************************
*
- * Function: serve_entry_reads_request()
+ * Function: serve_entry_reads_request()
*
- * Purpose: Serve an entry reads request.
+ * Purpose: Serve an entry reads request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it sends
- * the number of times that the indicated datum has been
- * read since the last counter reset to the requesting
- * process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it sends
+ * the number of times that the indicated datum has been
+ * read since the last counter reset to the requesting
+ * process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2193,7 +2161,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = (long)(data[target_index].reads);
+ reply.count = (long)(data[target_index].reads);
reply.magic = MSSG_MAGIC;
}
}
@@ -2208,41 +2176,41 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
if ( success ) {
HDfprintf(stdout, "%d request entry 0x%llx reads = %ld.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].reads));
} else {
HDfprintf(stdout, "%d request entry 0x%llx reads = %ld FAILED.\n",
- (int)(mssg_ptr->src),
+ (int)(mssg_ptr->src),
(long long)(data[target_index].base_addr),
(long)(data[target_index].reads));
}
- }
+ }
return(success);
} /* serve_entry_reads_request() */
-
+
/*****************************************************************************
*
- * Function: serve_rw_count_reset_request()
+ * Function: serve_rw_count_reset_request()
*
- * Purpose: Serve read/write count reset request.
+ * Purpose: Serve read/write count reset request.
*
- * The function accepts a pointer to an instance of struct
- * mssg_t as input. If all sanity checks pass, it resets the
- * read/write counters, and sends a confirmation message to
- * the calling process.
+ * The function accepts a pointer to an instance of struct
+ * mssg_t as input. If all sanity checks pass, it resets the
+ * read/write counters, and sends a confirmation message to
+ * the calling process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/5/10
+ * Programmer: JRM -- 5/5/10
*
*****************************************************************************/
static hbool_t
@@ -2268,7 +2236,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
if ( success ) {
success = reset_server_counters();
- }
+ }
if ( success ) {
@@ -2302,7 +2270,7 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
(int)(mssg_ptr->src));
}
- }
+ }
return(success);
@@ -2313,12 +2281,12 @@ serve_rw_count_reset_request(struct mssg_t * mssg_ptr)
/**************************** Call back functions ****************************/
/*****************************************************************************/
-
+
/*-------------------------------------------------------------------------
* Function: clear_datum
*
* Purpose: Mark the datum as clean and destroy it if requested.
- * Do not write it to the server, or increment the version.
+ * Do not write it to the server, or increment the version.
*
* Return: SUCCEED
*
@@ -2348,7 +2316,7 @@ clear_datum(H5F_t * f,
HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
- ( entry_ptr->header.size == entry_ptr->local_len ) );
+ ( entry_ptr->header.size == entry_ptr->local_len ) );
HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty );
@@ -2371,20 +2339,20 @@ clear_datum(H5F_t * f,
if ( entry_ptr->header.is_pinned ) {
datum_pinned_clears++;
- HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned );
+ HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned );
}
return(SUCCEED);
} /* clear_datum() */
-
+
/*-------------------------------------------------------------------------
* Function: destroy_datum()
*
* Purpose: Destroy the entry. At present, this means do nothing other
- * than verify that the entry is clean. In particular, do not
- * write it to the server process.
+ * than verify that the entry is clean. In particular, do not
+ * write it to the server process.
*
* Return: SUCCEED
*
@@ -2413,7 +2381,7 @@ destroy_datum(H5F_t H5_ATTR_UNUSED * f,
HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
- ( entry_ptr->header.size == entry_ptr->local_len ) );
+ ( entry_ptr->header.size == entry_ptr->local_len ) );
HDassert( !(entry_ptr->dirty) );
HDassert( !(entry_ptr->header.is_dirty) );
@@ -2427,12 +2395,12 @@ destroy_datum(H5F_t H5_ATTR_UNUSED * f,
} /* destroy_datum() */
-
+
/*-------------------------------------------------------------------------
* Function: flush_datum
*
* Purpose: Flush the entry to the server process and mark it as clean.
- * Then destroy the entry if requested.
+ * Then destroy the entry if requested.
*
* Return: SUCCEED if successful, and FAIL otherwise.
*
@@ -2464,11 +2432,11 @@ flush_datum(H5F_t *f,
HDassert( f );
HDassert( f->shared );
HDassert( f->shared->cache );
-
+
cache_ptr = f->shared->cache;
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->aux_ptr );
+ HDassert( cache_ptr->aux_ptr );
aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr);
@@ -2487,9 +2455,9 @@ flush_datum(H5F_t *f,
HDassert( entry_ptr->header.is_dirty == entry_ptr->dirty );
- if ( ( file_mpi_rank != 0 ) &&
+ if ( ( file_mpi_rank != 0 ) &&
( entry_ptr->dirty ) &&
- ( aux_ptr->metadata_write_strategy ==
+ ( aux_ptr->metadata_write_strategy ==
H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY ) ) {
ret_value = FAIL;
@@ -2502,7 +2470,7 @@ flush_datum(H5F_t *f,
if ( entry_ptr->header.is_dirty ) {
- was_dirty = TRUE; /* so we will receive the ack if requested */
+ was_dirty = TRUE; /* so we will receive the ack if requested */
/* compose the message */
mssg.req = WRITE_REQ_CODE;
@@ -2675,55 +2643,55 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
world_mpi_rank, fcn_name);
}
#if 0 /* This has been useful debugging code -- keep it for now. */
- if ( mssg.req != READ_REQ_REPLY_CODE ) {
+ if ( mssg.req != READ_REQ_REPLY_CODE ) {
- HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n",
- world_mpi_rank, fcn_name);
- HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
- world_mpi_rank, fcn_name, (int)(mssg.req));
- }
+ HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n",
+ world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.req = %d.\n",
+ world_mpi_rank, fcn_name, (int)(mssg.req));
+ }
- if ( mssg.src != world_server_mpi_rank ) {
+ if ( mssg.src != world_server_mpi_rank ) {
- HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n",
- world_mpi_rank, fcn_name);
- }
+ HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n",
+ world_mpi_rank, fcn_name);
+ }
- if ( mssg.dest != world_mpi_rank ) {
+ if ( mssg.dest != world_mpi_rank ) {
- HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n",
+ world_mpi_rank, fcn_name);
}
- if ( mssg.base_addr != entry_ptr->base_addr ) {
+ if ( mssg.base_addr != entry_ptr->base_addr ) {
- HDfprintf(stdout,
- "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
- world_mpi_rank, fcn_name);
- HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
- world_mpi_rank, fcn_name, mssg.base_addr);
- HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n",
- world_mpi_rank, fcn_name, entry_ptr->base_addr);
+ HDfprintf(stdout,
+ "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
+ world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
+ world_mpi_rank, fcn_name, mssg.base_addr);
+ HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n",
+ world_mpi_rank, fcn_name, entry_ptr->base_addr);
}
- if ( mssg.len != entry_ptr->len ) {
+ if ( mssg.len != entry_ptr->len ) {
- HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n",
- world_mpi_rank, fcn_name);
- HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
- world_mpi_rank, fcn_name, mssg.len);
+ HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n",
+ world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
+ world_mpi_rank, fcn_name, mssg.len);
}
- if ( mssg.ver < entry_ptr->ver ) {
+ if ( mssg.ver < entry_ptr->ver ) {
- HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n",
+ world_mpi_rank, fcn_name);
}
- if ( mssg.magic != MSSG_MAGIC ) {
+ if ( mssg.magic != MSSG_MAGIC ) {
- HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n",
+ world_mpi_rank, fcn_name);
}
#endif /* JRM */
} else {
@@ -2750,7 +2718,7 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
* Function: size_datum
*
* Purpose: Get the size of the specified entry. Just look at the
- * local copy, as size can't change.
+ * local copy, as size can't change.
*
* Return: SUCCEED
*
@@ -2759,13 +2727,13 @@ load_datum(H5F_t H5_ATTR_UNUSED *f,
*
* Modifications:
*
- * JRM -- 7/11/06
- * Modified function to return the local_len field instead
- * of the len field. These two fields usually contain the
- * same value, but if the size of an entry is changed, we
- * store the altered size in local_len without changing
- * len. Note that local_len must be positive, and may
- * not exceed len.
+ * JRM -- 7/11/06
+ * Modified function to return the local_len field instead
+ * of the len field. These two fields usually contain the
+ * same value, but if the size of an entry is changed, we
+ * store the altered size in local_len without changing
+ * len. Note that local_len must be positive, and may
+ * not exceed len.
*
*-------------------------------------------------------------------------
*/
@@ -2809,21 +2777,16 @@ size_datum(H5F_t H5_ATTR_UNUSED * f,
* Function: expunge_entry()
*
* Purpose: Expunge the entry indicated by the type and index, mark it
- * as clean, and don't increment its version number.
+ * as clean, and don't increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
* Programmer: John Mainzer
* 07/11/06
*
- * Modifications:
- *
- * None.
- *
*****************************************************************************/
-
static void
expunge_entry(H5F_t * file_ptr,
int32_t idx)
@@ -2846,36 +2809,36 @@ expunge_entry(H5F_t * file_ptr,
if ( nerrors == 0 ) {
result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]),
- entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
+ entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_expunge_entry().\n",
+ world_mpi_rank, fcn_name);
}
}
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
- HDassert( ! ((entry_ptr->header).is_dirty) );
+ HDassert( ! ((entry_ptr->header).is_dirty) );
- result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr,
- NULL, &in_cache, NULL, NULL, NULL);
+ result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr,
+ NULL, &in_cache, NULL, NULL, NULL);
- if ( result < 0 ) {
+ if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: Error in H5C_get_entry_status().\n",
+ world_mpi_rank, fcn_name);
}
} else if ( in_cache ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: Expunged entry still in cache?!?\n",
+ world_mpi_rank, fcn_name);
}
}
}
@@ -2889,9 +2852,9 @@ expunge_entry(H5F_t * file_ptr,
* Function: insert_entry()
*
* Purpose: Insert the entry indicated by the type and index, mark it
- * as dirty, and increment its version number.
+ * as dirty, and increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
@@ -2906,7 +2869,6 @@ expunge_entry(H5F_t * file_ptr,
* any pins must be global pins.
*
*****************************************************************************/
-
static void
insert_entry(H5C_t * cache_ptr,
H5F_t * file_ptr,
@@ -2944,33 +2906,33 @@ insert_entry(H5C_t * cache_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: Error in H5AC_insert_entry().\n",
+ world_mpi_rank, fcn_name);
}
}
if ( ! (entry_ptr->header.is_dirty) ) {
- /* it is possible that we just exceeded the dirty bytes
- * threshold, triggering a write of the newly inserted
- * entry. Test for this, and only flag an error if this
- * is not the case.
- */
+ /* it is possible that we just exceeded the dirty bytes
+ * threshold, triggering a write of the newly inserted
+ * entry. Test for this, and only flag an error if this
+ * is not the case.
+ */
- struct H5AC_aux_t * aux_ptr;
+ struct H5AC_aux_t * aux_ptr;
- aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr));
+ aux_ptr = ((H5AC_aux_t *)(cache_ptr->aux_ptr));
- if ( ! ( ( aux_ptr != NULL ) &&
- ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
- ( aux_ptr->dirty_bytes == 0 ) ) ) {
+ if ( ! ( ( aux_ptr != NULL ) &&
+ ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
+ ( aux_ptr->dirty_bytes == 0 ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, fcn_name, idx,
+ HDfprintf(stdout, "%d:%s: data[%d].header.is_dirty = %d.\n",
+ world_mpi_rank, fcn_name, idx,
(int)(data[idx].header.is_dirty));
- }
+ }
}
}
@@ -2978,7 +2940,7 @@ insert_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->header.is_pinned );
entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
} else {
@@ -3009,16 +2971,13 @@ insert_entry(H5C_t * cache_ptr,
* Programmer: John Mainzer
* 4/12/06
*
- * Modifications:
- *
*****************************************************************************/
-
static void
local_pin_and_unpin_random_entries(H5F_t * file_ptr,
int min_idx,
int max_idx,
- int min_count,
- int max_count)
+ int min_count,
+ int max_count)
{
/* const char * fcn_name = "local_pin_and_unpin_random_entries()"; */
@@ -3034,40 +2993,40 @@ local_pin_and_unpin_random_entries(H5F_t * file_ptr,
HDassert( min_idx < max_idx );
HDassert( max_idx < NUM_DATA_ENTRIES );
HDassert( max_idx < virt_num_data_entries );
- HDassert( 0 <= min_count );
- HDassert( min_count < max_count );
+ HDassert( 0 <= min_count );
+ HDassert( min_count < max_count );
- count = (HDrand() % (max_count - min_count)) + min_count;
+ count = (HDrand() % (max_count - min_count)) + min_count;
- HDassert( min_count <= count );
- HDassert( count <= max_count );
+ HDassert( min_count <= count );
+ HDassert( count <= max_count );
- for ( i = 0; i < count; i++ )
- {
+ for ( i = 0; i < count; i++ )
+ {
local_pin_random_entry(file_ptr, min_idx, max_idx);
- }
+ }
- count = (HDrand() % (max_count - min_count)) + min_count;
+ count = (HDrand() % (max_count - min_count)) + min_count;
- HDassert( min_count <= count );
- HDassert( count <= max_count );
+ HDassert( min_count <= count );
+ HDassert( count <= max_count );
i = 0;
- idx = 0;
+ idx = 0;
- while ( ( i < count ) && ( idx >= 0 ) )
- {
- via_unprotect = ( (((unsigned)i) & 0x0001) == 0 );
- idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect);
- i++;
- }
+ while ( ( i < count ) && ( idx >= 0 ) )
+ {
+ via_unprotect = ( (((unsigned)i) & 0x0001) == 0 );
+ idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect);
+ i++;
+ }
}
return;
} /* local_pin_and_unpin_random_entries() */
-
+
/*****************************************************************************
* Function: local_pin_random_entry()
*
@@ -3100,13 +3059,13 @@ local_pin_random_entry(H5F_t * file_ptr,
HDassert( max_idx < NUM_DATA_ENTRIES );
HDassert( max_idx < virt_num_data_entries );
- do
- {
- idx = (HDrand() % (max_idx - min_idx)) + min_idx;
+ do
+ {
+ idx = (HDrand() % (max_idx - min_idx)) + min_idx;
HDassert( min_idx <= idx );
HDassert( idx <= max_idx );
- }
- while ( data[idx].global_pinned || data[idx].local_pinned );
+ }
+ while ( data[idx].global_pinned || data[idx].local_pinned );
pin_entry(file_ptr, idx, FALSE, FALSE);
}
@@ -3128,13 +3087,10 @@ local_pin_random_entry(H5F_t * file_ptr,
* Programmer: John Mainzer
* 4/12/06
*
- * Modifications:
- *
*****************************************************************************/
-
static void
local_unpin_all_entries(H5F_t * file_ptr,
- hbool_t via_unprotect)
+ hbool_t via_unprotect)
{
/* const char * fcn_name = "local_unpin_all_entries()"; */
@@ -3144,13 +3100,13 @@ local_unpin_all_entries(H5F_t * file_ptr,
HDassert( file_ptr );
- idx = 0;
+ idx = 0;
- while ( idx >= 0 )
- {
- idx = local_unpin_next_pinned_entry(file_ptr,
- idx, via_unprotect);
- }
+ while ( idx >= 0 )
+ {
+ idx = local_unpin_next_pinned_entry(file_ptr,
+ idx, via_unprotect);
+ }
}
return;
@@ -3162,7 +3118,7 @@ local_unpin_all_entries(H5F_t * file_ptr,
* Function: local_unpin_next_pinned_entry()
*
* Purpose: Find the next locally pinned entry after the specified
- * starting point, and unpin it.
+ * starting point, and unpin it.
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3173,14 +3129,11 @@ local_unpin_all_entries(H5F_t * file_ptr,
* Programmer: John Mainzer
* 4/12/06
*
- * Modifications:
- *
*****************************************************************************/
-
static int
local_unpin_next_pinned_entry(H5F_t * file_ptr,
int start_idx,
- hbool_t via_unprotect)
+ hbool_t via_unprotect)
{
/* const char * fcn_name = "local_unpin_next_pinned_entry()"; */
int i = 0;
@@ -3193,26 +3146,26 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr,
HDassert( start_idx < NUM_DATA_ENTRIES );
HDassert( start_idx < virt_num_data_entries );
- idx = start_idx;
+ idx = start_idx;
- while ( ( i < virt_num_data_entries ) &&
- ( ! ( data[idx].local_pinned ) ) )
- {
- i++;
- idx++;
- if ( idx >= virt_num_data_entries ) {
- idx = 0;
- }
- }
+ while ( ( i < virt_num_data_entries ) &&
+ ( ! ( data[idx].local_pinned ) ) )
+ {
+ i++;
+ idx++;
+ if ( idx >= virt_num_data_entries ) {
+ idx = 0;
+ }
+ }
- if ( data[idx].local_pinned ) {
+ if ( data[idx].local_pinned ) {
- unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
+ unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
- } else {
+ } else {
- idx = -1;
- }
+ idx = -1;
+ }
}
return(idx);
@@ -3224,8 +3177,8 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr,
* Function: lock_and_unlock_random_entries()
*
* Purpose: Obtain a random number in the closed interval [min_count,
- * max_count]. Then protect and unprotect that number of
- * random entries.
+ * max_count]. Then protect and unprotect that number of
+ * random entries.
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3234,10 +3187,7 @@ local_unpin_next_pinned_entry(H5F_t * file_ptr,
* Programmer: John Mainzer
* 1/12/06
*
- * Modifications:
- *
*****************************************************************************/
-
static void
lock_and_unlock_random_entries(H5F_t * file_ptr,
int min_idx,
@@ -3275,7 +3225,7 @@ lock_and_unlock_random_entries(H5F_t * file_ptr,
* Function: lock_and_unlock_random_entry()
*
* Purpose: Protect and then unprotect a random entry with index in
- * the data[] array in the close interval [min_idx, max_idx].
+ * the data[] array in the close interval [min_idx, max_idx].
*
* Do nothing if nerrors is non-zero on entry.
*
@@ -3284,10 +3234,7 @@ lock_and_unlock_random_entries(H5F_t * file_ptr,
* Programmer: John Mainzer
* 1/4/06
*
- * Modifications:
- *
*****************************************************************************/
-
static void
lock_and_unlock_random_entry(H5F_t * file_ptr,
int min_idx,
@@ -3309,8 +3256,8 @@ lock_and_unlock_random_entry(H5F_t * file_ptr,
HDassert( min_idx <= idx );
HDassert( idx <= max_idx );
- lock_entry(file_ptr, idx);
- unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, idx);
+ unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET);
}
return;
@@ -3332,12 +3279,11 @@ lock_and_unlock_random_entry(H5F_t * file_ptr,
*
* Modifications:
*
- * JRM -- 7/11/06
- * Modified asserts to handle the new local_len field in
- * datum.
+ * JRM -- 7/11/06
+ * Modified asserts to handle the new local_len field in
+ * datum.
*
*****************************************************************************/
-
static void
lock_entry(H5F_t * file_ptr,
int32_t idx)
@@ -3353,7 +3299,7 @@ lock_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( ! (entry_ptr->locked) );
+ HDassert( ! (entry_ptr->locked) );
cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, -1, &(types[0]),
entry_ptr->base_addr, NULL, H5AC_WRITE);
@@ -3361,19 +3307,19 @@ lock_entry(H5F_t * file_ptr,
if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
+ ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
( entry_ptr->base_addr != entry_ptr->header.addr ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: error in H5AC_protect().\n",
+ world_mpi_rank, fcn_name);
}
} else {
- entry_ptr->locked = TRUE;
+ entry_ptr->locked = TRUE;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
}
@@ -3396,7 +3342,6 @@ lock_entry(H5F_t * file_ptr,
* 4/14/06
*
*****************************************************************************/
-
static void
mark_entry_dirty(int32_t idx)
{
@@ -3412,26 +3357,26 @@ mark_entry_dirty(int32_t idx)
entry_ptr = &(data[idx]);
HDassert ( entry_ptr->locked || entry_ptr->global_pinned );
- HDassert ( ! (entry_ptr->local_pinned) );
+ HDassert ( ! (entry_ptr->local_pinned) );
(entry_ptr->ver)++;
entry_ptr->dirty = TRUE;
- result = H5AC_mark_entry_dirty( (void *)entry_ptr);
+ result = H5AC_mark_entry_dirty( (void *)entry_ptr);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: error in H5AC_mark_entry_dirty().\n",
world_mpi_rank, fcn_name);
}
}
- else if ( ! ( entry_ptr->locked ) )
- {
- global_dirty_pins++;
- }
+ else if ( ! ( entry_ptr->locked ) )
+ {
+ global_dirty_pins++;
+ }
}
return;
@@ -3451,15 +3396,12 @@ mark_entry_dirty(int32_t idx)
* Programmer: John Mainzer
* 4/11/06
*
- * Modifications:
- *
*****************************************************************************/
-
static void
pin_entry(H5F_t * file_ptr,
int32_t idx,
- hbool_t global,
- hbool_t dirty)
+ hbool_t global,
+ hbool_t dirty)
{
/* const char * fcn_name = "pin_entry()"; */
unsigned int flags = H5AC__PIN_ENTRY_FLAG;
@@ -3473,35 +3415,35 @@ pin_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert ( ! (entry_ptr->global_pinned) );
- HDassert ( ! (entry_ptr->local_pinned) );
- HDassert ( ! ( dirty && ( ! global ) ) );
+ HDassert ( ! (entry_ptr->global_pinned) );
+ HDassert ( ! (entry_ptr->local_pinned) );
+ HDassert ( ! ( dirty && ( ! global ) ) );
- lock_entry(file_ptr, idx);
+ lock_entry(file_ptr, idx);
- if ( dirty ) {
+ if ( dirty ) {
- flags |= H5AC__DIRTIED_FLAG;
- }
+ flags |= H5AC__DIRTIED_FLAG;
+ }
- unlock_entry(file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
HDassert( (entry_ptr->header).is_pinned );
- HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) );
+ HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) );
- if ( global ) {
+ if ( global ) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
- } else {
+ } else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = TRUE;
- local_pins++;
+ local_pins++;
- }
+ }
}
return;
@@ -3514,24 +3456,19 @@ pin_entry(H5F_t * file_ptr,
* Function: pin_protected_entry()
*
* Purpose: Insert the entry indicated by the type and index, mark it
- * as dirty, and increment its version number.
+ * as dirty, and increment its version number.
*
- * Do nothing if nerrors is non-zero on entry.
+ * Do nothing if nerrors is non-zero on entry.
*
* Return: void
*
* Programmer: John Mainzer
* 01/04/06
*
- * Modifications:
- *
- * None.
- *
*****************************************************************************/
-
static void
pin_protected_entry(int32_t idx,
- hbool_t global)
+ hbool_t global)
{
const char * fcn_name = "pin_protected_entry()";
herr_t result;
@@ -3546,36 +3483,36 @@ pin_protected_entry(int32_t idx,
if ( nerrors == 0 ) {
- result = H5AC_pin_protected_entry((void *)entry_ptr);
+ result = H5AC_pin_protected_entry((void *)entry_ptr);
if ( ( result < 0 ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) )||
+ ( entry_ptr->local_len != entry_ptr->header.size ) )||
( entry_ptr->base_addr != entry_ptr->header.addr ) ||
- ( ! ( (entry_ptr->header).is_pinned ) ) ) {
+ ( ! ( (entry_ptr->header).is_pinned ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: Error in H5AC_pin_protected entry().\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout,
+ "%d:%s: Error in H5AC_pin_protected entry().\n",
+ world_mpi_rank, fcn_name);
}
}
if ( global ) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = TRUE;
- global_pins++;
+ global_pins++;
- } else {
+ } else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = TRUE;
- local_pins++;
+ local_pins++;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
}
@@ -3585,16 +3522,16 @@ pin_protected_entry(int32_t idx,
} /* pin_protected_entry() */
#endif /* H5_METADATA_TRACE_FILE */
-
+
/*****************************************************************************
* Function: move_entry()
*
* Purpose: Move the entry indicated old_idx to the entry indicated
- * by new_idex. Touch up the data array so that flush will
- * not choke.
+ * by new_idex. Touch up the data array so that flush will
+ * not choke.
*
- * Do nothing if nerrors isn't zero, or if old_idx equals
- * new_idx.
+ * Do nothing if nerrors isn't zero, or if old_idx equals
+ * new_idx.
*
* Return: void
*
@@ -3609,8 +3546,8 @@ move_entry(H5F_t * file_ptr,
{
const char * fcn_name = "move_entry()";
herr_t result;
- int tmp;
- size_t tmp_len;
+ int tmp;
+ size_t tmp_len;
haddr_t old_addr = HADDR_UNDEF;
haddr_t new_addr = HADDR_UNDEF;
struct datum * old_entry_ptr;
@@ -3638,12 +3575,12 @@ move_entry(H5F_t * file_ptr,
/* Moving will mark the entry dirty if it is not already */
old_entry_ptr->dirty = TRUE;
- /* touch up versions, base_addrs, and data_index. Do this
- * now as it is possible that the rename will trigger a
+ /* touch up versions, base_addrs, and data_index. Do this
+ * now as it is possible that the rename will trigger a
* sync point.
*/
if(old_entry_ptr->ver < new_entry_ptr->ver)
- old_entry_ptr->ver = new_entry_ptr->ver;
+ old_entry_ptr->ver = new_entry_ptr->ver;
else
(old_entry_ptr->ver)++;
@@ -3657,11 +3594,11 @@ move_entry(H5F_t * file_ptr,
old_entry_ptr->index = new_entry_ptr->index;
new_entry_ptr->index = tmp;
- if(old_entry_ptr->local_len != new_entry_ptr->local_len) {
- tmp_len = old_entry_ptr->local_len;
- old_entry_ptr->local_len = new_entry_ptr->local_len;
- new_entry_ptr->local_len = tmp_len;
- } /* end if */
+ if(old_entry_ptr->local_len != new_entry_ptr->local_len) {
+ tmp_len = old_entry_ptr->local_len;
+ old_entry_ptr->local_len = new_entry_ptr->local_len;
+ new_entry_ptr->local_len = tmp_len;
+ } /* end if */
result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr);
@@ -3669,8 +3606,8 @@ move_entry(H5F_t * file_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: H5AC_move_entry() failed.\n",
+ world_mpi_rank, fcn_name);
}
} else {
@@ -3679,27 +3616,27 @@ move_entry(H5F_t * file_ptr,
if ( ! (old_entry_ptr->header.is_dirty) ) {
- /* it is possible that we just exceeded the dirty bytes
- * threshold, triggering a write of the newly inserted
- * entry. Test for this, and only flag an error if this
- * is not the case.
- */
+ /* it is possible that we just exceeded the dirty bytes
+ * threshold, triggering a write of the newly inserted
+ * entry. Test for this, and only flag an error if this
+ * is not the case.
+ */
- struct H5AC_aux_t * aux_ptr;
+ struct H5AC_aux_t * aux_ptr;
- aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr));
+ aux_ptr = ((H5AC_aux_t *)(file_ptr->shared->cache->aux_ptr));
- if ( ! ( ( aux_ptr != NULL ) &&
- ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
- ( aux_ptr->dirty_bytes == 0 ) ) ) {
+ if ( ! ( ( aux_ptr != NULL ) &&
+ ( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ) &&
+ ( aux_ptr->dirty_bytes == 0 ) ) ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: data[%d].header.is_dirty = %d.\n",
- world_mpi_rank, fcn_name, new_idx,
+ world_mpi_rank, fcn_name, new_idx,
(int)(data[new_idx].header.is_dirty));
- }
+ }
}
} else {
@@ -3710,19 +3647,19 @@ move_entry(H5F_t * file_ptr,
} /* move_entry() */
-
+
/*****************************************************************************
*
- * Function: reset_server_counts()
+ * Function: reset_server_counts()
*
- * Purpose: Send a message to the server process requesting it to reset
- * its counters. Await confirmation message.
+ * Purpose: Send a message to the server process requesting it to reset
+ * its counters. Await confirmation message.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -3778,7 +3715,7 @@ reset_server_counts(void)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: Bad data in req r/w counter reset reply.\n",
world_mpi_rank, fcn_name);
}
@@ -3794,25 +3731,20 @@ reset_server_counts(void)
* Function: resize_entry()
*
* Purpose: Resize the pinned entry indicated by idx to the new_size.
- * Note that new_size must be greater than 0, and must be
- * less than or equal to the original size of the entry.
+ * Note that new_size must be greater than 0, and must be
+ * less than or equal to the original size of the entry.
*
- * Do nothing if nerrors isn't zero.
+ * Do nothing if nerrors isn't zero.
*
* Return: void
*
* Programmer: John Mainzer
* 7/11/06
*
- * Modifications:
- *
- * None
- *
*****************************************************************************/
-
static void
resize_entry(int32_t idx,
- size_t new_size)
+ size_t new_size)
{
const char * fcn_name = "resize_entry()";
herr_t result;
@@ -3827,21 +3759,21 @@ resize_entry(int32_t idx,
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
HDassert( !(entry_ptr->locked) );
- HDassert( ( entry_ptr->global_pinned ) &&
- ( ! entry_ptr->local_pinned ) );
- HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
- ( entry_ptr->header.size == entry_ptr->local_len ) );
- HDassert( new_size > 0 );
- HDassert( new_size <= entry_ptr->len );
+ HDassert( ( entry_ptr->global_pinned ) &&
+ ( ! entry_ptr->local_pinned ) );
+ HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
+ ( entry_ptr->header.size == entry_ptr->local_len ) );
+ HDassert( new_size > 0 );
+ HDassert( new_size <= entry_ptr->len );
- result = H5AC_resize_entry((void *)entry_ptr, new_size);
+ result = H5AC_resize_entry((void *)entry_ptr, new_size);
if ( result < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n",
- world_mpi_rank, fcn_name);
+ HDfprintf(stdout, "%d:%s: H5AC_resize_entry() failed.\n",
+ world_mpi_rank, fcn_name);
}
} else {
@@ -3851,7 +3783,7 @@ resize_entry(int32_t idx,
HDassert( entry_ptr->header.size == new_size );
entry_ptr->dirty = TRUE;
- entry_ptr->local_len = new_size;
+ entry_ptr->local_len = new_size;
/* touch up version. */
@@ -3863,24 +3795,24 @@ resize_entry(int32_t idx,
} /* resize_entry() */
-
+
/*****************************************************************************
*
- * Function: setup_cache_for_test()
+ * Function: setup_cache_for_test()
*
- * Purpose: Setup the parallel cache for a test, and return the file id
- * and a pointer to the cache's internal data structures.
+ * Purpose: Setup the parallel cache for a test, and return the file id
+ * and a pointer to the cache's internal data structures.
*
- * To do this, we must create a file, flush it (so that we
- * don't have to worry about entries in the metadata cache),
- * look up the address of the metadata cache, and then instruct
- * the cache to omit sanity checks on dxpl IDs.
+ * To do this, we must create a file, flush it (so that we
+ * don't have to worry about entries in the metadata cache),
+ * look up the address of the metadata cache, and then instruct
+ * the cache to omit sanity checks on dxpl IDs.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/4/06
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
static hbool_t
@@ -3907,13 +3839,13 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( fid < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fcreate() failed.\n",
world_mpi_rank, fcn_name);
}
} else if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, fcn_name);
}
} else {
@@ -3923,7 +3855,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( file_ptr == NULL ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n",
+ HDfprintf(stdout, "%d:%s: Can't get file_ptr.\n",
world_mpi_rank, fcn_name);
}
} else {
@@ -3933,13 +3865,13 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( cache_ptr == NULL ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n",
+ HDfprintf(stdout, "%d:%s: Can't get cache_ptr.\n",
world_mpi_rank, fcn_name);
}
} else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n",
+ HDfprintf(stdout, "%d:%s: Bad cache_ptr magic.\n",
world_mpi_rank, fcn_name);
}
} else {
@@ -3957,7 +3889,7 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
!= SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(1) failed.\n",
world_mpi_rank, fcn_name);
@@ -3967,9 +3899,9 @@ setup_cache_for_test(hid_t * fid_ptr,
config.metadata_write_strategy = metadata_write_strategy;
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
world_mpi_rank, fcn_name);
@@ -3992,15 +3924,15 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n",
+ HDfprintf(stdout, "%d:%s: cache_ptr->aux_ptr == NULL.\n",
world_mpi_rank, fcn_name);
}
- } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic !=
+ } else if ( ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic !=
H5AC__H5AC_AUX_T_MAGIC ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: cache_ptr->aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC.\n",
world_mpi_rank, fcn_name);
}
@@ -4009,14 +3941,14 @@ setup_cache_for_test(hid_t * fid_ptr,
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: bad cache_ptr->aux_ptr->metadata_write_strategy\n",
world_mpi_rank, fcn_name);
}
}
}
- /* also verify that the expected metadata write strategy is reported
+ /* also verify that the expected metadata write strategy is reported
* when we get the current configuration.
*/
@@ -4027,18 +3959,18 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( H5AC_get_cache_auto_resize_config(cache_ptr, &test_config)
!= SUCCEED ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: H5AC_get_cache_auto_resize_config(2) failed.\n",
world_mpi_rank, fcn_name);
- } else if ( test_config.metadata_write_strategy !=
+ } else if ( test_config.metadata_write_strategy !=
metadata_write_strategy ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: unexpected metadata_write_strategy.\n",
world_mpi_rank, fcn_name);
}
@@ -4050,68 +3982,68 @@ setup_cache_for_test(hid_t * fid_ptr,
if ( success ) {
- if ( H5AC_set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) {
+ if ( H5AC_set_write_done_callback(cache_ptr, do_sync) != SUCCEED ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: H5C_set_write_done_callback failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5C_set_write_done_callback failed.\n",
world_mpi_rank, fcn_name);
}
- }
+ }
}
#endif /* DO_SYNC_AFTER_WRITE */
if ( success ) {
- if ( H5AC_set_sync_point_done_callback(cache_ptr, verify_writes) !=
+ if ( H5AC_set_sync_point_done_callback(cache_ptr, verify_writes) !=
SUCCEED ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: H5AC_set_sync_point_done_callback failed.\n",
+ HDfprintf(stdout,
+ "%d:%s: H5AC_set_sync_point_done_callback failed.\n",
world_mpi_rank, fcn_name);
}
- }
+ }
}
return(success);
} /* setup_cache_for_test() */
-
+
/*****************************************************************************
*
- * Function: verify_writes()
+ * Function: verify_writes()
*
- * Purpose: Verify that the indicated entries have been written exactly
- * once each, and that the indicated total number of writes
- * has been processed by the server process. Flag an error if
- * discrepency is noted. Finally reset the counters maintained
- * by the server process.
+ * Purpose: Verify that the indicated entries have been written exactly
+ * once each, and that the indicated total number of writes
+ * has been processed by the server process. Flag an error if
+ * discrepency is noted. Finally reset the counters maintained
+ * by the server process.
*
- * This function should only be called by the metadata cache
- * as the "sync point done" function, as it must do some
- * synchronization to avoid false positives.
+ * This function should only be called by the metadata cache
+ * as the "sync point done" function, as it must do some
+ * synchronization to avoid false positives.
*
- * Note that at present, this function does not allow for the
- * case in which one or more of the indicated entries should
- * have been written more than once since the last time the
- * server process's counters were reset. That is fine for now,
- * as with the current metadata write strategies, no entry
- * should be written more than once per sync point. If this
- * changes this limitation will have to be revisited.
+ * Note that at present, this function does not allow for the
+ * case in which one or more of the indicated entries should
+ * have been written more than once since the last time the
+ * server process's counters were reset. That is fine for now,
+ * as with the current metadata write strategies, no entry
+ * should be written more than once per sync point. If this
+ * changes this limitation will have to be revisited.
*
- * Return: void.
+ * Return: void.
*
- * Programmer: JRM -- 5/9/10
+ * Programmer: JRM -- 5/9/10
*
*****************************************************************************/
static void
verify_writes(int num_writes,
- haddr_t * written_entries_tbl)
+ haddr_t * written_entries_tbl)
{
const char * fcn_name = "verify_writes()";
const hbool_t report = FALSE;
@@ -4139,12 +4071,10 @@ verify_writes(int num_writes,
}
}
- if ( proceed ) {
-
+ if(proceed)
proceed = verify_total_writes(num_writes);
- }
- while ( ( proceed ) && ( i < num_writes ) )
+ while ( ( proceed ) && ( i < num_writes ) )
{
proceed = verify_entry_writes(written_entries_tbl[i], 1);
i++;
@@ -4188,7 +4118,7 @@ verify_writes(int num_writes,
}
/* final barrier to ensure that all processes think that the server
- * counters have been reset before we leave the sync point. This
+ * counters have been reset before we leave the sync point. This
* barrier is probaby not necessary at this point in time (5/9/10),
* but I can think of at least one likely change to the metadata write
* strategies that will require it -- hence its insertion now.
@@ -4213,24 +4143,23 @@ verify_writes(int num_writes,
/*****************************************************************************
*
- * Function: setup_rand()
+ * Function: setup_rand()
*
- * Purpose: Use gettimeofday() to obtain a seed for rand(), print the
- * seed to stdout, and then pass it to srand().
+ * Purpose: Use gettimeofday() to obtain a seed for rand(), print the
+ * seed to stdout, and then pass it to srand().
*
- * Increment nerrors if any errors are detected.
+ * Increment nerrors if any errors are detected.
*
- * Return: void.
+ * Return: void.
*
- * Programmer: JRM -- 1/12/06
+ * Programmer: JRM -- 1/12/06
*
* Modifications:
*
- * JRM -- 5/9/06
- * Modified function to facilitate setting predefined seeds.
+ * JRM -- 5/9/06
+ * Modified function to facilitate setting predefined seeds.
*
*****************************************************************************/
-
static void
setup_rand(void)
{
@@ -4244,13 +4173,13 @@ setup_rand(void)
if ( ( use_predefined_seeds ) &&
( world_mpi_size == num_predefined_seeds ) ) {
- HDassert( world_mpi_rank >= 0 );
- HDassert( world_mpi_rank < world_mpi_size );
+ HDassert( world_mpi_rank >= 0 );
+ HDassert( world_mpi_rank < world_mpi_size );
seed = predefined_seeds[world_mpi_rank];
- HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n",
+ HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n",
world_mpi_rank, fcn_name, seed);
- fflush(stdout);
+ fflush(stdout);
HDsrand(seed);
} else {
@@ -4259,7 +4188,7 @@ setup_rand(void)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n",
+ HDfprintf(stdout, "%d:%s: gettimeofday() failed.\n",
world_mpi_rank, fcn_name);
}
} else {
@@ -4280,25 +4209,20 @@ setup_rand(void)
/*****************************************************************************
*
- * Function: take_down_cache()
- *
- * Purpose: Take down the parallel cache after a test.
+ * Function: take_down_cache()
*
- * To do this, we must close the file, and delete if if
- * possible.
+ * Purpose: Take down the parallel cache after a test.
*
- * Return: Success: TRUE
+ * To do this, we must close the file, and delete if if
+ * possible.
*
- * Failure: FALSE
+ * Return: Success: TRUE
*
- * Programmer: JRM -- 1/4/06
+ * Failure: FALSE
*
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
-
static hbool_t
take_down_cache(hid_t fid)
{
@@ -4325,7 +4249,7 @@ take_down_cache(hid_t fid)
}
} else {
- success = TRUE;
+ success = TRUE;
}
} else {
@@ -4336,19 +4260,19 @@ take_down_cache(hid_t fid)
} /* take_down_cache() */
-
+
/*****************************************************************************
* Function: verify_entry_reads
*
- * Purpose: Query the server to determine the number of times the
- * indicated entry has been read since the last time the
- * server counters were reset.
+ * Purpose: Query the server to determine the number of times the
+ * indicated entry has been read since the last time the
+ * server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
- * number of reads matches the number of reads reported by
- * the server process.
+ * Return TRUE if successful, and if the supplied expected
+ * number of reads matches the number of reads reported by
+ * the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return FALSE and flag an error otherwise.
*
* Return: TRUE if successful, FALSE otherwise.
*
@@ -4432,31 +4356,31 @@ verify_entry_reads(haddr_t addr,
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n",
world_mpi_rank, fcn_name, (long long)addr,
reported_entry_reads, expected_entry_reads);
}
- }
+ }
}
return(success);
} /* verify_entry_reads() */
-
+
/*****************************************************************************
* Function: verify_entry_writes
*
- * Purpose: Query the server to determine the number of times the
- * indicated entry has been written since the last time the
- * server counters were reset.
+ * Purpose: Query the server to determine the number of times the
+ * indicated entry has been written since the last time the
+ * server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
- * number of reads matches the number of reads reported by
- * the server process.
+ * Return TRUE if successful, and if the supplied expected
+ * number of reads matches the number of reads reported by
+ * the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return FALSE and flag an error otherwise.
*
* Return: TRUE if successful, FALSE otherwise.
*
@@ -4540,36 +4464,36 @@ verify_entry_writes(haddr_t addr,
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: rep/exp entry 0x%llx writes mismatch (%ld/%ld).\n",
world_mpi_rank, fcn_name, (long long)addr,
reported_entry_writes, expected_entry_writes);
}
- }
+ }
}
return(success);
} /* verify_entry_writes() */
-
+
/*****************************************************************************
*
- * Function: verify_total_reads()
+ * Function: verify_total_reads()
*
- * Purpose: Query the server to obtain the total reads since the last
- * server counter reset, and compare this value with the supplied
- * expected value.
+ * Purpose: Query the server to obtain the total reads since the last
+ * server counter reset, and compare this value with the supplied
+ * expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return TRUE.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return FALSE.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -4641,9 +4565,9 @@ verify_total_reads(int expected_total_reads)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: reported/expected total reads mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, fcn_name,
reported_total_reads, expected_total_reads);
}
@@ -4654,24 +4578,24 @@ verify_total_reads(int expected_total_reads)
} /* verify_total_reads() */
-
+
/*****************************************************************************
*
- * Function: verify_total_writes()
+ * Function: verify_total_writes()
*
- * Purpose: Query the server to obtain the total writes since the last
- * server counter reset, and compare this value with the supplied
- * expected value.
+ * Purpose: Query the server to obtain the total writes since the last
+ * server counter reset, and compare this value with the supplied
+ * expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return TRUE.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return FALSE.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/6/10
+ * Programmer: JRM -- 5/6/10
*
*****************************************************************************/
static hbool_t
@@ -4743,9 +4667,9 @@ verify_total_writes(int expected_total_writes)
nerrors++;
success = FALSE;
if ( verbose ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d:%s: reported/expected total writes mismatch (%ld/%ld).\n",
- world_mpi_rank, fcn_name,
+ world_mpi_rank, fcn_name,
reported_total_writes, expected_total_writes);
}
}
@@ -4770,8 +4694,8 @@ verify_total_writes(int expected_total_writes)
*
* Modifications:
*
- * 7/11/06
- * Updated for the new local_len field in datum.
+ * 7/11/06
+ * Updated for the new local_len field in datum.
*
*****************************************************************************/
@@ -4793,7 +4717,7 @@ unlock_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( entry_ptr->locked );
+ HDassert( entry_ptr->locked );
dirtied = ((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG );
@@ -4809,7 +4733,7 @@ unlock_entry(H5F_t * file_ptr,
if ( ( result < 0 ) ||
( entry_ptr->header.type != &(types[0]) ) ||
( ( entry_ptr->len != entry_ptr->header.size ) &&
- ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
+ ( entry_ptr->local_len != entry_ptr->header.size ) ) ||
( entry_ptr->base_addr != entry_ptr->header.addr ) ) {
nerrors++;
@@ -4821,7 +4745,7 @@ unlock_entry(H5F_t * file_ptr,
entry_ptr->locked = FALSE;
- }
+ }
HDassert( ((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE );
@@ -4857,11 +4781,10 @@ unlock_entry(H5F_t * file_ptr,
*
* Modifications:
*
- * JRM -- 8/15/06
- * Added assertion that entry is pinned on entry.
+ * JRM -- 8/15/06
+ * Added assertion that entry is pinned on entry.
*
*****************************************************************************/
-
static void
unpin_entry(H5F_t * file_ptr,
int32_t idx,
@@ -4882,54 +4805,54 @@ unpin_entry(H5F_t * file_ptr,
entry_ptr = &(data[idx]);
- HDassert( (entry_ptr->header).is_pinned );
- HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) );
- HDassert ( ( global && entry_ptr->global_pinned ) ||
- ( ! global && entry_ptr->local_pinned ) );
- HDassert ( ! ( dirty && ( ! global ) ) );
+ HDassert( (entry_ptr->header).is_pinned );
+ HDassert ( ! ( entry_ptr->global_pinned && entry_ptr->local_pinned) );
+ HDassert ( ( global && entry_ptr->global_pinned ) ||
+ ( ! global && entry_ptr->local_pinned ) );
+ HDassert ( ! ( dirty && ( ! global ) ) );
- if ( via_unprotect ) {
+ if ( via_unprotect ) {
- lock_entry(file_ptr, idx);
+ lock_entry(file_ptr, idx);
- if ( dirty ) {
+ if ( dirty ) {
- flags |= H5AC__DIRTIED_FLAG;
- }
+ flags |= H5AC__DIRTIED_FLAG;
+ }
- unlock_entry(file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
- } else {
+ } else {
- if ( dirty ) {
+ if ( dirty ) {
- mark_entry_dirty(idx);
+ mark_entry_dirty(idx);
- }
+ }
- result = H5AC_unpin_entry(entry_ptr);
+ result = H5AC_unpin_entry(entry_ptr);
- if ( result < 0 ) {
+ if ( result < 0 ) {
nerrors++;
if ( verbose ) {
HDfprintf(stdout, "%d:%s: error in H5AC_unpin_entry().\n",
- world_mpi_rank, fcn_name);
+ world_mpi_rank, fcn_name);
}
- }
- }
+ }
+ }
HDassert( ! ((entry_ptr->header).is_pinned) );
- if ( global ) {
+ if ( global ) {
- entry_ptr->global_pinned = FALSE;
+ entry_ptr->global_pinned = FALSE;
- } else {
+ } else {
- entry_ptr->local_pinned = FALSE;
+ entry_ptr->local_pinned = FALSE;
- }
+ }
}
return;
@@ -4941,18 +4864,18 @@ unpin_entry(H5F_t * file_ptr,
/****************************** test functions *******************************/
/*****************************************************************************/
-
+
/*****************************************************************************
*
- * Function: server_smoke_check()
+ * Function: server_smoke_check()
*
- * Purpose: Quick smoke check for the server process.
+ * Purpose: Quick smoke check for the server process.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 12/21/05
+ * Programmer: JRM -- 12/21/05
*
*****************************************************************************/
static hbool_t
@@ -4974,12 +4897,12 @@ server_smoke_check(void)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5045,9 +4968,9 @@ server_smoke_check(void)
#endif /* DO_WRITE_REQ_ACK */
- do_sync();
+ do_sync();
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5062,12 +4985,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
@@ -5079,7 +5002,7 @@ server_smoke_check(void)
success = verify_total_reads(0);
}
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5151,7 +5074,7 @@ server_smoke_check(void)
}
}
- /* barrier to allow all writes to complete */
+ /* barrier to allow all writes to complete */
if ( MPI_SUCCESS != MPI_Barrier(file_mpi_comm) ) {
success = FALSE;
@@ -5166,12 +5089,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 1);
- }
+ }
if ( success ) {
@@ -5215,12 +5138,12 @@ server_smoke_check(void)
if ( success ) {
success = verify_entry_writes(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
success = verify_entry_reads(data[world_mpi_rank].base_addr, 0);
- }
+ }
if ( success ) {
@@ -5273,9 +5196,9 @@ server_smoke_check(void)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5290,18 +5213,18 @@ server_smoke_check(void)
} /* server_smoke_check() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_1()
+ * Function: smoke_check_1()
*
- * Purpose: First smoke check for the parallel cache.
+ * Purpose: First smoke check for the parallel cache.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/4/06
+ * Programmer: JRM -- 1/4/06
*
*****************************************************************************/
static hbool_t
@@ -5318,23 +5241,23 @@ smoke_check_1(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- process 0 only md write strategy");
+ TESTING("smoke check #1 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- distributed md write strategy");
+ TESTING("smoke check #1 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #1 -- unknown md write strategy");
+ TESTING("smoke check #1 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -5343,12 +5266,12 @@ smoke_check_1(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5362,7 +5285,7 @@ smoke_check_1(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5374,24 +5297,24 @@ smoke_check_1(int metadata_write_strategy)
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
}
/* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
if ( fid >= 0 ) {
@@ -5400,7 +5323,7 @@ smoke_check_1(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5446,9 +5369,9 @@ smoke_check_1(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5463,21 +5386,21 @@ smoke_check_1(int metadata_write_strategy)
} /* smoke_check_1() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_2()
+ * Function: smoke_check_2()
*
- * Purpose: Second smoke check for the parallel cache.
+ * Purpose: Second smoke check for the parallel cache.
*
- * Introduce random reads, but keep all processes with roughly
- * the same work load.
+ * Introduce random reads, but keep all processes with roughly
+ * the same work load.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/12/06
+ * Programmer: JRM -- 1/12/06
*
*****************************************************************************/
static hbool_t
@@ -5494,23 +5417,23 @@ smoke_check_2(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- process 0 only md write strategy");
+ TESTING("smoke check #2 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- distributed md write strategy");
+ TESTING("smoke check #2 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #2 -- unknown md write strategy");
+ TESTING("smoke check #2 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -5519,12 +5442,12 @@ smoke_check_2(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5538,7 +5461,7 @@ smoke_check_2(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5549,73 +5472,73 @@ smoke_check_2(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10);
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10);
}
}
- for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
- {
- /* Make sure we don't step on any locally pinned entries */
- if ( data[i].local_pinned ) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
- }
+ for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
+ {
+ /* Make sure we don't step on any locally pinned entries */
+ if ( data[i].local_pinned ) {
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ }
- pin_entry(file_ptr, i, TRUE, FALSE);
- }
+ pin_entry(file_ptr, i, TRUE, FALSE);
+ }
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
- 0, 100);
- local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 4),
- 0, 3);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
+ 0, 100);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 4),
+ 0, 3);
}
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 10),
- 0, 100);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 10),
+ 0, 100);
}
- /* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ /* we can't move pinned entries, so release any local pins now. */
+ local_unpin_all_entries(file_ptr, FALSE);
/* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- ((virt_num_data_entries / 50) - 1),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ ((virt_num_data_entries / 50) - 1),
0, 100);
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 100),
- 0, 100);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 100),
+ 0, 100);
}
- for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
- {
- hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 );
- hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 );
+ for ( i = 0; i < (virt_num_data_entries / 2); i+=61 )
+ {
+ hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 );
+ hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 );
- unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
- }
+ unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
+ }
if ( fid >= 0 ) {
@@ -5623,7 +5546,7 @@ smoke_check_2(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5669,9 +5592,9 @@ smoke_check_2(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -5686,24 +5609,24 @@ smoke_check_2(int metadata_write_strategy)
} /* smoke_check_2() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_3()
+ * Function: smoke_check_3()
*
- * Purpose: Third smoke check for the parallel cache.
+ * Purpose: Third smoke check for the parallel cache.
*
- * Use random reads to vary the loads on the diffferent
- * processors. Also force different cache size adjustments.
+ * Use random reads to vary the loads on the diffferent
+ * processors. Also force different cache size adjustments.
*
- * In this test, load process 0 heavily, and the other
- * processes lightly.
+ * In this test, load process 0 heavily, and the other
+ * processes lightly.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/13/06
+ * Programmer: JRM -- 1/13/06
*
*****************************************************************************/
static hbool_t
@@ -5726,23 +5649,23 @@ smoke_check_3(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- process 0 only md write strategy");
+ TESTING("smoke check #3 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- distributed md write strategy");
+ TESTING("smoke check #3 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #3 -- unknown md write strategy");
+ TESTING("smoke check #3 -- unknown md write strategy");
}
- break;
+ break;
}
/* 0 */
@@ -5757,12 +5680,12 @@ smoke_check_3(int metadata_write_strategy)
/* 1 */
if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5782,7 +5705,7 @@ smoke_check_3(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5799,7 +5722,7 @@ smoke_check_3(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -5812,51 +5735,51 @@ smoke_check_3(int metadata_write_strategy)
max_count = min_count + 50;
for ( i = (virt_num_data_entries / 4);
- i < (virt_num_data_entries / 2);
- i++ )
+ i < (virt_num_data_entries / 2);
+ i++ )
{
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- if ( i % 59 == 0 ) {
+ if ( i % 59 == 0 ) {
- hbool_t dirty = ( (i % 2) == 0);
+ hbool_t dirty = ( (i % 2) == 0);
- if ( data[i].local_pinned ) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
- }
+ if ( data[i].local_pinned ) {
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ }
- pin_entry(file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, TRUE, dirty);
- HDassert( !dirty || data[i].header.is_dirty );
- HDassert( data[i].header.is_pinned );
- HDassert( data[i].global_pinned );
- HDassert( ! data[i].local_pinned );
- }
+ HDassert( !dirty || data[i].header.is_dirty );
+ HDassert( data[i].header.is_pinned );
+ HDassert( data[i].global_pinned );
+ HDassert( ! data[i].local_pinned );
+ }
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
- local_pin_and_unpin_random_entries(file_ptr, 0,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
virt_num_data_entries / 4,
- 0, (file_mpi_rank + 2));
+ 0, (file_mpi_rank + 2));
- }
+ }
/* 4 */
if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
- /* flush the file to be sure that we have no problems flushing
- * pinned entries
- */
+ /* flush the file to be sure that we have no problems flushing
+ * pinned entries
+ */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -5875,27 +5798,27 @@ smoke_check_3(int metadata_write_strategy)
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) {
+ if ( ( i >= (virt_num_data_entries / 4) ) && ( i % 59 == 0 ) ) {
hbool_t via_unprotect = ( (((unsigned)i) & 0x02) == 0 );
- hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 );
-
- HDassert( data[i].global_pinned );
- HDassert( ! data[i].local_pinned );
-
- unpin_entry(file_ptr, i, TRUE, dirty,
- via_unprotect);
- }
- if ( i % 2 == 0 ) {
-
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- local_pin_and_unpin_random_entries(file_ptr, 0,
- virt_num_data_entries / 2,
- 0, 2);
- lock_and_unlock_random_entries(file_ptr,
+ hbool_t dirty = ( (((unsigned)i) & 0x04) == 0 );
+
+ HDassert( data[i].global_pinned );
+ HDassert( ! data[i].local_pinned );
+
+ unpin_entry(file_ptr, i, TRUE, dirty,
+ via_unprotect);
+ }
+ if ( i % 2 == 0 ) {
+
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ virt_num_data_entries / 2,
+ 0, 2);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
- }
+ }
}
/* 6 */
@@ -5911,9 +5834,9 @@ smoke_check_3(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
@@ -5929,11 +5852,11 @@ smoke_check_3(int metadata_write_strategy)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
min_count, max_count);
}
@@ -5943,11 +5866,11 @@ smoke_check_3(int metadata_write_strategy)
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 40),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 40),
min_count, max_count);
}
@@ -5962,16 +5885,16 @@ smoke_check_3(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 2),
- 0, 5);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 2),
+ 0, 5);
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -5988,7 +5911,7 @@ smoke_check_3(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -6041,9 +5964,9 @@ smoke_check_3(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6058,24 +5981,24 @@ smoke_check_3(int metadata_write_strategy)
} /* smoke_check_3() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_4()
+ * Function: smoke_check_4()
*
- * Purpose: Fourth smoke check for the parallel cache.
+ * Purpose: Fourth smoke check for the parallel cache.
*
- * Use random reads to vary the loads on the diffferent
- * processors. Also force different cache size adjustments.
+ * Use random reads to vary the loads on the diffferent
+ * processors. Also force different cache size adjustments.
*
- * In this test, load process 0 lightly, and the other
- * processes heavily.
+ * In this test, load process 0 lightly, and the other
+ * processes heavily.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 1/13/06
+ * Programmer: JRM -- 1/13/06
*
*****************************************************************************/
static hbool_t
@@ -6096,23 +6019,23 @@ smoke_check_4(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- process 0 only md write strategy");
+ TESTING("smoke check #4 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- distributed md write strategy");
+ TESTING("smoke check #4 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #4 -- unknown md write strategy");
+ TESTING("smoke check #4 -- unknown md write strategy");
}
- break;
+ break;
}
nerrors = 0;
@@ -6121,12 +6044,12 @@ smoke_check_4(int metadata_write_strategy)
if ( world_mpi_rank == world_server_mpi_rank ) {
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -6140,7 +6063,7 @@ smoke_check_4(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -6155,7 +6078,7 @@ smoke_check_4(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6164,23 +6087,23 @@ smoke_check_4(int metadata_write_strategy)
max_count = min_count + 100;
for ( i = (virt_num_data_entries / 4);
- i < (virt_num_data_entries / 2);
- i++ )
+ i < (virt_num_data_entries / 2);
+ i++ )
{
- if ( i % 2 == 0 ) {
+ if ( i % 2 == 0 ) {
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- } else {
+ } else {
- /* Insert some entries pinned, and then unpin them
- * immediately. We have tested pinned entries elsewhere,
- * so it should be sufficient to verify that the
- * entries are in fact pinned (which unpin_entry() should do).
- */
+ /* Insert some entries pinned, and then unpin them
+ * immediately. We have tested pinned entries elsewhere,
+ * so it should be sufficient to verify that the
+ * entries are in fact pinned (which unpin_entry() should do).
+ */
insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG);
unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
- }
+ }
if ( i % 59 == 0 ) {
@@ -6200,19 +6123,19 @@ smoke_check_4(int metadata_write_strategy)
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
local_pin_and_unpin_random_entries(file_ptr, 0,
- (virt_num_data_entries / 4),
+ (virt_num_data_entries / 4),
0, (file_mpi_rank + 2));
}
/* flush the file to be sure that we have no problems flushing
- * pinned entries
- */
+ * pinned entries
+ */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
@@ -6239,13 +6162,13 @@ smoke_check_4(int metadata_write_strategy)
unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
}
- if ( i % 2 == 0 ) {
+ if ( i % 2 == 0 ) {
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
- }
+ }
}
min_idx = 0;
@@ -6254,14 +6177,14 @@ smoke_check_4(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
- /* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ /* we can't move pinned entries, so release any local pins now. */
+ local_unpin_all_entries(file_ptr, FALSE);
min_count = 10 * (file_mpi_rank % 4);
max_count = min_count + 100;
@@ -6269,22 +6192,22 @@ smoke_check_4(int metadata_write_strategy)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 20),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 20),
min_count, max_count);
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(file_ptr, 0,
- (virt_num_data_entries / 40),
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
+ (virt_num_data_entries / 40),
min_count, max_count);
}
@@ -6296,12 +6219,12 @@ smoke_check_4(int metadata_write_strategy)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(file_ptr, (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -6312,7 +6235,7 @@ smoke_check_4(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -6359,9 +6282,9 @@ smoke_check_4(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6376,19 +6299,19 @@ smoke_check_4(int metadata_write_strategy)
} /* smoke_check_4() */
-
+
/*****************************************************************************
*
- * Function: smoke_check_5()
+ * Function: smoke_check_5()
*
- * Purpose: Similar to smoke check 1, but modified to verify that
- * H5AC_mark_entry_dirty() works in the parallel case.
+ * Purpose: Similar to smoke check 1, but modified to verify that
+ * H5AC_mark_entry_dirty() works in the parallel case.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 5/18/06
+ * Programmer: JRM -- 5/18/06
*
*****************************************************************************/
static hbool_t
@@ -6407,23 +6330,23 @@ smoke_check_5(int metadata_write_strategy)
switch ( metadata_write_strategy ) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- process 0 only md write strategy");
+ TESTING("smoke check #5 -- process 0 only md write strategy");
}
- break;
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- distributed md write strategy");
+ TESTING("smoke check #5 -- distributed md write strategy");
}
- break;
+ break;
default:
if ( world_mpi_rank == 0 ) {
- TESTING("smoke check #5 -- unknown md write strategy");
+ TESTING("smoke check #5 -- unknown md write strategy");
}
- break;
+ break;
}
@@ -6438,22 +6361,22 @@ smoke_check_5(int metadata_write_strategy)
/* 1 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
- if ( ! server_main() ) {
+ if ( ! server_main() ) {
/* some error occured in the server -- report failure */
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n",
world_mpi_rank, fcn_name);
}
}
/* 2 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
}
else /* run the clients */
@@ -6461,7 +6384,7 @@ smoke_check_5(int metadata_write_strategy)
/* 1 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr,
@@ -6471,14 +6394,14 @@ smoke_check_5(int metadata_write_strategy)
fid = -1;
cache_ptr = NULL;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
world_mpi_rank, fcn_name);
}
}
/* 2 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
@@ -6488,78 +6411,78 @@ smoke_check_5(int metadata_write_strategy)
/* 3 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
- /* flush the file so we can lock known clean entries. */
+ /* flush the file so we can lock known clean entries. */
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
world_mpi_rank, fcn_name);
}
}
/* 4 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
for ( i = 0; i < (virt_num_data_entries / 4); i++ )
{
- lock_entry(file_ptr, i);
+ lock_entry(file_ptr, i);
- if ( i % 2 == 0 )
- {
- mark_entry_dirty(i);
- }
+ if ( i % 2 == 0 )
+ {
+ mark_entry_dirty(i);
+ }
- unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
- if ( i % 2 == 1 )
- {
- if ( i % 4 == 1 ) {
+ if ( i % 2 == 1 )
+ {
+ if ( i % 4 == 1 ) {
- lock_entry(file_ptr, i);
- unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
- }
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ }
- expunge_entry(file_ptr, i);
- }
+ expunge_entry(file_ptr, i);
+ }
}
/* 5 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
for ( i = (virt_num_data_entries / 2) - 1;
i >= (virt_num_data_entries / 4);
- i-- )
+ i-- )
{
- pin_entry(file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, TRUE, FALSE);
- if ( i % 2 == 0 )
- {
- if ( i % 8 <= 4 ) {
+ if ( i % 2 == 0 )
+ {
+ if ( i % 8 <= 4 ) {
- resize_entry(i, data[i].len / 2);
- }
+ resize_entry(i, data[i].len / 2);
+ }
mark_entry_dirty(i);
- if ( i % 8 <= 4 ) {
+ if ( i % 8 <= 4 ) {
- resize_entry(i, data[i].len);
- }
- }
+ resize_entry(i, data[i].len);
+ }
+ }
- unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
}
/* 6 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
if ( fid >= 0 ) {
@@ -6568,7 +6491,7 @@ smoke_check_5(int metadata_write_strategy)
nerrors++;
if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -6576,7 +6499,7 @@ smoke_check_5(int metadata_write_strategy)
/* 7 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
/* verify that all instance of datum are back where the started
@@ -6591,7 +6514,7 @@ smoke_check_5(int metadata_write_strategy)
/* 8 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
/* compose the done message */
@@ -6621,7 +6544,7 @@ smoke_check_5(int metadata_write_strategy)
/* 9 */
if ( verbose ) {
- HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
+ HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);
}
}
@@ -6629,9 +6552,9 @@ smoke_check_5(int metadata_write_strategy)
if ( world_mpi_rank == 0 ) {
- if ( max_nerrors == 0 ) {
+ if ( max_nerrors == 0 ) {
- PASSED();
+ PASSED();
} else {
@@ -6646,10 +6569,10 @@ smoke_check_5(int metadata_write_strategy)
} /* smoke_check_5() */
-
+
/*****************************************************************************
*
- * Function: trace_file_check()
+ * Function: trace_file_check()
*
* Purpose: A basic test of the trace file capability. In essence,
* we invoke all operations that generate trace file output,
@@ -6679,11 +6602,11 @@ smoke_check_5(int metadata_write_strategy)
*
* This test is skipped if H5_METADATA_TRACE_FILE is undefined.
*
- * Return: Success: TRUE
+ * Return: Success: TRUE
*
- * Failure: FALSE
+ * Failure: FALSE
*
- * Programmer: JRM -- 6/13/06
+ * Programmer: JRM -- 6/13/06
*
*****************************************************************************/
static hbool_t
@@ -6767,27 +6690,23 @@ trace_file_check(int metadata_write_strategy)
#endif /* H5_METADATA_TRACE_FILE */
- switch ( metadata_write_strategy ) {
+ switch(metadata_write_strategy) {
- case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
+ case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY:
#ifdef H5_METADATA_TRACE_FILE
expected_output = &expected_output_0;
#endif /* H5_METADATA_TRACE_FILE */
- if ( world_mpi_rank == 0 ) {
- TESTING(
- "trace file collection -- process 0 only md write strategy");
- }
- break;
+ if(world_mpi_rank == 0)
+ TESTING("trace file collection -- process 0 only md write strategy");
+ break;
- case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
+ case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED:
#ifdef H5_METADATA_TRACE_FILE
expected_output = &expected_output_1;
#endif /* H5_METADATA_TRACE_FILE */
- if ( world_mpi_rank == 0 ) {
- TESTING(
- "trace file collection -- distributed md write strategy");
- }
- break;
+ if(world_mpi_rank == 0)
+ TESTING("trace file collection -- distributed md write strategy");
+ break;
default:
#ifdef H5_METADATA_TRACE_FILE
@@ -6796,11 +6715,10 @@ trace_file_check(int metadata_write_strategy)
*/
expected_output = &expected_output_0;
#endif /* H5_METADATA_TRACE_FILE */
- if ( world_mpi_rank == 0 ) {
- TESTING("trace file collection -- unknown md write strategy");
- }
- break;
- }
+ if(world_mpi_rank == 0)
+ TESTING("trace file collection -- unknown md write strategy");
+ break;
+ } /* end switch */
#ifdef H5_METADATA_TRACE_FILE
@@ -6808,145 +6726,115 @@ trace_file_check(int metadata_write_strategy)
init_data();
reset_stats();
- if ( world_mpi_rank == world_server_mpi_rank ) {
+ if(world_mpi_rank == world_server_mpi_rank) {
- if ( ! server_main() ) {
+ if(!server_main()) {
/* some error occured in the server -- report failure */
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: server_main() failed.\n",
- world_mpi_rank, fcn_name);
- }
+ if ( verbose )
+ HDfprintf(stdout, "%d:%s: server_main() failed.\n", world_mpi_rank, fcn_name);
}
}
- else /* run the clients */
- {
+ else {
+ /* run the clients */
- if ( ! setup_cache_for_test(&fid, &file_ptr, &cache_ptr,
- metadata_write_strategy) ) {
+ if(!setup_cache_for_test(&fid, &file_ptr, &cache_ptr, metadata_write_strategy) ) {
nerrors++;
fid = -1;
cache_ptr = NULL;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n",
- world_mpi_rank, fcn_name);
- }
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: setup_cache_for_test() failed.\n", world_mpi_rank, fcn_name);
}
- if ( nerrors == 0 ) {
+ if(nerrors == 0) {
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
-
- nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
-
- } else {
-
+ if(H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
+ nerrors++;
+ HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, fcn_name);
+ }
+ else {
config.open_trace_file = TRUE;
- strcpy(config.trace_file_name, "t_cache_trace.txt");
+ strcpy(config.trace_file_name, "t_cache_trace.txt");
- if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
-
- nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ if(H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
+ nerrors++;
+ HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, fcn_name);
}
}
- }
+ } /* end if */
- insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
- insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
+ insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
- lock_entry(file_ptr, 0);
- mark_entry_dirty(0);
- unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, 0);
+ mark_entry_dirty(0);
+ unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
- lock_entry(file_ptr, 1);
+ lock_entry(file_ptr, 1);
pin_protected_entry(1, TRUE);
- unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
+ unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE);
expunge_entry(file_ptr, 1);
- lock_entry(file_ptr, 2);
+ lock_entry(file_ptr, 2);
pin_protected_entry(2, TRUE);
- unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
- mark_entry_dirty(2);
+ unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
+ mark_entry_dirty(2);
resize_entry(2, data[2].len / 2);
resize_entry(2, data[2].len);
unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE);
- move_entry(file_ptr, 0, 20);
- move_entry(file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
- if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n",
- world_mpi_rank, fcn_name);
- }
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, fcn_name);
}
- if ( nerrors == 0 ) {
-
+ if(nerrors == 0) {
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if ( H5AC_get_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
-
- nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
-
- } else {
-
+ if(H5AC_get_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
+ nerrors++;
+ HDfprintf(stdout, "%d:%s: H5AC_get_cache_auto_resize_config() failed.\n", world_mpi_rank, fcn_name);
+ }
+ else {
config.open_trace_file = FALSE;
config.close_trace_file = TRUE;
- config.trace_file_name[0] = '\0';
+ config.trace_file_name[0] = '\0';
- if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
-
- nerrors++;
- HDfprintf(stdout,
- "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
- world_mpi_rank, fcn_name);
+ if(H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
+ nerrors++;
+ HDfprintf(stdout, "%d:%s: H5AC_set_cache_auto_resize_config() failed.\n", world_mpi_rank, fcn_name);
}
}
- }
-
- if ( fid >= 0 ) {
+ } /* end if */
- if ( ! take_down_cache(fid) ) {
+ if(fid >= 0) {
+ if(!take_down_cache(fid)) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n",
- world_mpi_rank, fcn_name);
- }
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: take_down_cache() failed.\n", world_mpi_rank, fcn_name);
}
- }
+ } /* end if */
/* verify that all instance of datum are back where the started
* and are clean.
*/
- for ( i = 0; i < NUM_DATA_ENTRIES; i++ )
- {
- HDassert( data_index[i] == i );
- HDassert( ! (data[i].dirty) );
+ for(i = 0; i < NUM_DATA_ENTRIES; i++) {
+ HDassert(data_index[i] == i);
+ HDassert(!(data[i].dirty));
}
/* compose the done message */
@@ -6960,113 +6848,92 @@ trace_file_check(int metadata_write_strategy)
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
- if ( success ) {
-
+ if(success) {
success = send_mssg(&mssg, FALSE);
- if ( ! success ) {
-
+ if(!success) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n",
- world_mpi_rank, fcn_name);
- }
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, fcn_name);
}
- }
+ } /* end if */
- if ( nerrors == 0 ) {
+ nerrors++;
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: send_mssg() failed on done.\n", world_mpi_rank, fcn_name);
- sprintf(trace_file_name, "t_cache_trace.txt.%d",
- (int)file_mpi_rank);
+ if(nerrors == 0) {
+ HDsprintf(trace_file_name, "t_cache_trace.txt.%d", (int)file_mpi_rank);
- if ( (trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) {
+ if((trace_file_ptr = HDfopen(trace_file_name, "r")) == NULL ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: HDfopen failed.\n",
- world_mpi_rank, fcn_name);
- }
+ if(verbose)
+ HDfprintf(stdout, "%d:%s: HDfopen failed.\n", world_mpi_rank, fcn_name);
}
- }
-
- i = 0;
- while ( ( nerrors == 0 ) && ( ! done ) )
- {
- if ( (*expected_output)[i] == NULL ) {
-
- expected_line_len = 0;
-
- } else {
-
- expected_line_len = HDstrlen((*expected_output)[i]);
- }
-
- if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) {
-
- actual_line_len = strlen(buffer);
-
- } else {
-
- actual_line_len = 0;
- }
+ }
- if ( ( actual_line_len == 0 ) && ( expected_line_len == 0 ) ) {
+ i = 0;
+ while((nerrors == 0) && (!done)) {
+ /* Get lines of actual and expected data */
+ if((*expected_output)[i] == NULL)
+ expected_line_len = (size_t)0;
+ else
+ expected_line_len = HDstrlen((*expected_output)[i]);
- done = TRUE;
+ if(HDfgets(buffer, 255, trace_file_ptr) != NULL)
+ actual_line_len = HDstrlen(buffer);
+ else
+ actual_line_len = (size_t)0;
- } else if ( ( actual_line_len != expected_line_len ) ||
- ( HDstrcmp(buffer, (*expected_output)[i]) != 0 ) ) {
+ /* Compare the lines */
+ /* Handle running out of data */
+ if((actual_line_len == 0) || (expected_line_len == 0)) {
+ done = TRUE;
+ }
+ else if((actual_line_len != expected_line_len) || (HDstrcmp(buffer, (*expected_output)[i]) != 0)) {
- nerrors++;
- if ( verbose ) {
- HDfprintf(stdout,
- "%d:%s: Unexpected data in trace file line %d.\n",
- world_mpi_rank, fcn_name, i);
- HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n",
- world_mpi_rank, fcn_name, (*expected_output)[i],
- expected_line_len);
- HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n",
- world_mpi_rank, fcn_name, buffer,
- actual_line_len);
+ nerrors++;
+ if(verbose) {
+ HDfprintf(stdout, "%d:%s: Unexpected data in trace file line %d.\n", world_mpi_rank, fcn_name, i);
+ HDfprintf(stdout, "%d:%s: expected = \"%s\" %d\n", world_mpi_rank, fcn_name, (*expected_output)[i], expected_line_len);
+ HDfprintf(stdout, "%d:%s: actual = \"%s\" %d\n", world_mpi_rank, fcn_name, buffer, actual_line_len);
}
- } else {
- i++;
- }
- }
-
- if ( trace_file_ptr != NULL ) {
+ }
+ else {
+ i++;
+ }
+ }
- HDfclose(trace_file_ptr);
- trace_file_ptr = NULL;
+ /* Clean up the trace file */
+ if(trace_file_ptr != NULL) {
+ HDfclose(trace_file_ptr);
+ trace_file_ptr = NULL;
#if 1
- HDremove(trace_file_name);
+ HDremove(trace_file_name);
#endif
}
}
max_nerrors = get_max_nerrors();
- if ( world_mpi_rank == 0 ) {
-
- if ( max_nerrors == 0 ) {
-
- PASSED();
-
- } else {
+ if(world_mpi_rank == 0) {
+ if(max_nerrors == 0) {
+ PASSED();
+ }
+ else {
failures++;
H5_FAILED();
}
}
- success = ( ( success ) && ( max_nerrors == 0 ) );
+ success = ((success) && (max_nerrors == 0));
#else /* H5_METADATA_TRACE_FILE */
- if ( world_mpi_rank == 0 ) {
-
+ if(world_mpi_rank == 0) {
SKIPPED();
-
HDfprintf(stdout, " trace file support disabled.\n");
}
@@ -7079,22 +6946,17 @@ trace_file_check(int metadata_write_strategy)
/*****************************************************************************
*
- * Function: main()
- *
- * Purpose: Main function for the parallel cache test.
+ * Function: main()
*
- * Return: Success: 0
+ * Purpose: Main function for the parallel cache test.
*
- * Failure: 1
+ * Return: Success: 0
*
- * Programmer: JRM -- 12/23/05
+ * Failure: 1
*
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 12/23/05
*
*****************************************************************************/
-
int
main(int argc, char **argv)
{
@@ -7120,7 +6982,8 @@ main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ printf("%d:Failed to turn off atexit processing. Continue.\n",
+ mpi_rank);
};
H5open();
@@ -7130,32 +6993,32 @@ main(int argc, char **argv)
#endif /* JRM */
if ( express_test ) {
- virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES;
+ virt_num_data_entries = EXPRESS_VIRT_NUM_DATA_ENTRIES;
} else {
- virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES;
+ virt_num_data_entries = STD_VIRT_NUM_DATA_ENTRIES;
}
#ifdef H5_HAVE_MPE
- if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
+ if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
virt_num_data_entries = MPE_VIRT_NUM_DATA_ENTIES;
#endif /* H5_HAVE_MPE */
if (MAINPROCESS){
- printf("===================================\n");
- printf("Parallel metadata cache tests\n");
- printf(" mpi_size = %d\n", mpi_size);
- printf(" express_test = %d\n", express_test);
- printf("===================================\n");
+ printf("===================================\n");
+ printf("Parallel metadata cache tests\n");
+ printf(" mpi_size = %d\n", mpi_size);
+ printf(" express_test = %d\n", express_test);
+ printf("===================================\n");
}
if ( mpi_size < 3 ) {
if ( MAINPROCESS ) {
- printf(" Need at least 3 processes. Exiting.\n");
+ printf(" Need at least 3 processes. Exiting.\n");
}
goto finish;
}
@@ -7174,8 +7037,8 @@ main(int argc, char **argv)
/* setup file access property list with the world communicator */
if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 1.\n",
world_mpi_rank, fcn_name);
}
}
@@ -7207,8 +7070,8 @@ main(int argc, char **argv)
/* close the fapl before we set it up again */
if ( H5Pclose(fapl) < 0 ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pclose() failed.\n",
world_mpi_rank, fcn_name);
}
}
@@ -7218,9 +7081,9 @@ main(int argc, char **argv)
/* setup file access property list */
if ( FAIL == (fapl = H5Pcreate(H5P_FILE_ACCESS)) ) {
- nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n",
+ nerrors++;
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pcreate() failed 2.\n",
world_mpi_rank, fcn_name);
}
}
@@ -7228,8 +7091,8 @@ main(int argc, char **argv)
if ( H5Pset_fapl_mpio(fapl, file_mpi_comm, MPI_INFO_NULL) < 0 ) {
nerrors++;
- if ( verbose ) {
- HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n",
+ if ( verbose ) {
+ HDfprintf(stdout, "%d:%s: H5Pset_fapl_mpio() failed 2.\n",
world_mpi_rank, fcn_name);
}
}
@@ -7247,7 +7110,7 @@ main(int argc, char **argv)
HDfprintf(stdout, "Errors in test initialization. Exiting.\n");
}
- goto finish;
+ goto finish;
}
/* run the tests */
@@ -7284,16 +7147,16 @@ finish:
* and exit.
*/
MPI_Barrier(MPI_COMM_WORLD);
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (failures){
- printf("***metadata cache tests detected %d failures***\n",
+ if (MAINPROCESS){ /* only process 0 reports */
+ printf("===================================\n");
+ if (failures){
+ printf("***metadata cache tests detected %d failures***\n",
failures);
- }
- else{
- printf("metadata cache tests finished with no failures\n");
- }
- printf("===================================\n");
+ }
+ else{
+ printf("metadata cache tests finished with no failures\n");
+ }
+ printf("===================================\n");
}
takedown_derived_types();
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index 8b3ede5..bfa0bfe 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -20,23 +20,23 @@
*/
#include "testphdf5.h"
-static int mpi_size, mpi_rank;
+static int mpi_size, mpi_rank;
#define DSET_NAME "ExtendibleArray"
-#define CHUNK_SIZE 1000 /* #elements per chunk */
-#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */
+#define CHUNK_SIZE 1000 /* #elements per chunk */
+#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */
#define CLOSE 1
#define NO_CLOSE 0
static MPI_Offset
get_filesize(const char *filename)
{
- int mpierr;
- MPI_File fd;
- MPI_Offset filesize;
+ int mpierr;
+ MPI_File fd;
+ MPI_Offset filesize;
- mpierr = MPI_File_open(MPI_COMM_SELF, (char*)filename, MPI_MODE_RDONLY,
- MPI_INFO_NULL, &fd);
+ mpierr = MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_RDONLY,
+ MPI_INFO_NULL, &fd);
VRFY((mpierr == MPI_SUCCESS), "");
mpierr = MPI_File_get_size(fd, &filesize);
@@ -85,15 +85,15 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
long nchunks;
herr_t hrc;
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
+ MPI_Offset filesize, /* actual file size */
+ est_filesize; /* estimated file size */
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* Only MAINPROCESS should create the file. Others just wait. */
- if (MAINPROCESS) {
+ if (MAINPROCESS){
nchunks=chunk_factor*mpi_size;
dims[0]=nchunks*CHUNK_SIZE;
/* Create the data space with unlimited dimensions. */
@@ -103,10 +103,9 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
memspace = H5Screate_simple(1, chunk_dims, NULL);
VRFY((memspace >= 0), "");
- /* Create a new file. If file exists its contents will be overwritten. */
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT);
- VRFY((file_id >= 0), "H5Fcreate");
+ /* Create a new file. If file exists its contents will be overwritten. */
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((file_id >= 0), "H5Fcreate");
/* Modify dataset creation properties, i.e. enable chunking */
cparms = H5Pcreate(H5P_DATASET_CREATE);
@@ -131,7 +130,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
offset[0] = (nchunks-2)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
- VRFY((hrc >= 0), "");
+ VRFY((hrc >= 0), "");
/* Write sec_last chunk */
hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
@@ -200,8 +199,8 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
int i;
long nchunks;
/* MPI Gubbins */
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
+ MPI_Offset filesize, /* actual file size */
+ est_filesize; /* estimated file size */
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -241,19 +240,19 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
/* all chunks are written by all the processes in an interleaved way*/
case write_all:
- memset(buffer, mpi_rank+1, CHUNK_SIZE);
- count[0] = 1;
- stride[0] = 1;
- block[0] = chunk_dims[0];
- for (i=0; i<nchunks/mpi_size; i++){
- offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
+ HDmemset(buffer, mpi_rank+1, CHUNK_SIZE);
+ count[0] = 1;
+ stride[0] = 1;
+ block[0] = chunk_dims[0];
+ for (i=0; i<nchunks/mpi_size; i++) {
+ offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
- hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
- VRFY((hrc >= 0), "");
+ hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
+ VRFY((hrc >= 0), "");
- /* Write the buffer out */
- hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
- VRFY((hrc >= 0), "H5Dwrite");
+ /* Write the buffer out */
+ hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
+ VRFY((hrc >= 0), "H5Dwrite");
}
break;
@@ -273,8 +272,9 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
/* only opens the *dataset */
case open_only:
-
break;
+ default:
+ HDassert(0);
}
/* Close up */
@@ -317,7 +317,8 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
* interleaved pattern.
*/
static void
-verify_data(const char *filename, int chunk_factor, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
+verify_data(const char *filename, int chunk_factor, write_type write_pattern, int vclose,
+ hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
hid_t dataspace, memspace; /* HDF5 file identifier */
@@ -332,7 +333,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
/* Variables used in reading data back */
char buffer[CHUNK_SIZE];
int value, i;
- int index;
+ int index_l;
long nchunks;
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -370,8 +371,8 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
stride[0] = 1;
block[0] = chunk_dims[0];
for (i=0; i<nchunks; i++){
- /* reset buffer values */
- memset(buffer, -1, CHUNK_SIZE);
+ /* reset buffer values */
+ HDmemset(buffer, -1, CHUNK_SIZE);
offset[0] = i*chunk_dims[0];
@@ -383,37 +384,40 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
VRFY((hrc >= 0), "H5Dread");
/* set expected value according the write pattern */
- switch (write_pattern) {
- case all:
- value = i%mpi_size + 1;
- break;
- case none:
- value = 0;
- break;
- case sec_last:
- if (i==nchunks-2)
- value = 100;
- else
- value = 0;
- }
+ switch (write_pattern) {
+ case all:
+ value = i%mpi_size + 1;
+ break;
+ case none:
+ value = 0;
+ break;
+ case sec_last:
+ if (i==nchunks-2)
+ value = 100;
+ else
+ value = 0;
+ break;
+ default:
+ HDassert(0);
+ }
/* verify content of the chunk */
- for (index = 0; index < CHUNK_SIZE; index++)
- VRFY((buffer[index] == value), "data verification");
+ for (index_l = 0; index_l < CHUNK_SIZE; index_l++)
+ VRFY((buffer[index_l] == value), "data verification");
}
hrc = H5Sclose (dataspace);
- VRFY((hrc >= 0), "");
+ VRFY((hrc >= 0), "");
- hrc = H5Sclose (memspace);
- VRFY((hrc >= 0), "");
+ hrc = H5Sclose (memspace);
+ VRFY((hrc >= 0), "");
/* Can close some plists */
hrc = H5Pclose(access_plist);
VRFY((hrc >= 0), "");
/* Close up */
- if (close){
+ if (vclose){
hrc = H5Dclose(*dataset);
VRFY((hrc >= 0), "");
*dataset = -1;
@@ -462,9 +466,9 @@ test_chunk_alloc(void)
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
- filename = GetTestParameters();
+ filename = (const char*)GetTestParameters();
if (VERBOSE_MED)
- printf("Extend Chunked allocation test on file %s\n", filename);
+ HDprintf("Extend Chunked allocation test on file %s\n", filename);
/* Case 1 */
/* Create chunked dataset without writing anything.*/
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 29d6dcf..68f96da 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -36,83 +36,91 @@
* Setup the dimensions of the hyperslab.
* Two modes--by rows or by columns.
* Assume dimension rank is 2.
- * BYROW divide into slabs of rows
- * BYCOL divide into blocks of columns
- * ZROW same as BYROW except process 0 gets 0 rows
- * ZCOL same as BYCOL except process 0 gets 0 columns
+ * BYROW divide into slabs of rows
+ * BYCOL divide into blocks of columns
+ * ZROW same as BYROW except process 0 gets 0 rows
+ * ZCOL same as BYCOL except process 0 gets 0 columns
*/
static void
slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
- hsize_t stride[], hsize_t block[], int mode)
+ hsize_t stride[], hsize_t block[], int mode)
{
- switch (mode){
+ switch (mode) {
case BYROW:
- /* Each process takes a slabs of rows. */
- block[0] = dim0/mpi_size;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = mpi_rank*block[0];
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set BYROW\n");
- break;
+ /* Each process takes a slabs of rows. */
+ block[0] = dim0 / mpi_size;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = mpi_rank * block[0];
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYROW\n");
+ break;
case BYCOL:
- /* Each process takes a block of columns. */
- block[0] = dim0;
- block[1] = dim1/mpi_size;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = mpi_rank*block[1];
-if(VERBOSE_MED) printf("slab_set BYCOL\n");
- break;
+ /* Each process takes a block of columns. */
+ block[0] = dim0;
+ block[1] = dim1 / mpi_size;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = mpi_rank * block[1];
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYCOL\n");
+ break;
case ZROW:
- /* Similar to BYROW except process 0 gets 0 row */
- block[0] = (mpi_rank ? dim0/mpi_size : 0);
- block[1] = dim1;
- stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = (mpi_rank? mpi_rank*block[0] : 0);
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set ZROW\n");
- break;
+ /* Similar to BYROW except process 0 gets 0 row */
+ block[0] = (mpi_rank ? dim0 / mpi_size : 0);
+ block[1] = dim1;
+ stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = (mpi_rank ? mpi_rank * block[0] : 0);
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZROW\n");
+ break;
case ZCOL:
- /* Similar to BYCOL except process 0 gets 0 column */
- block[0] = dim0;
- block[1] = (mpi_rank ? dim1/mpi_size : 0);
- stride[0] = block[0];
- stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = (mpi_rank? mpi_rank*block[1] : 0);
-if(VERBOSE_MED) printf("slab_set ZCOL\n");
- break;
+ /* Similar to BYCOL except process 0 gets 0 column */
+ block[0] = dim0;
+ block[1] = (mpi_rank ? dim1 / mpi_size : 0);
+ stride[0] = block[0];
+ stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZCOL\n");
+ break;
default:
- /* Unknown mode. Set it to cover the whole dataset. */
- printf("unknown slab_set mode (%d)\n", mode);
- block[0] = dim0;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set wholeset\n");
- break;
+ /* Unknown mode. Set it to cover the whole dataset. */
+ HDprintf("unknown slab_set mode (%d)\n", mode);
+ block[0] = dim0;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set wholeset\n");
+ break;
}
-if(VERBOSE_MED){
- printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
- (unsigned long)(block[0]*block[1]*count[0]*count[1]));
+ if (VERBOSE_MED) {
+ HDprintf(
+ "start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long) start[0], (unsigned long) start[1],
+ (unsigned long) count[0], (unsigned long) count[1],
+ (unsigned long) stride[0], (unsigned long) stride[1],
+ (unsigned long) block[0], (unsigned long) block[1],
+ (unsigned long) (block[0] * block[1] * count[0] * count[1]));
}
}
@@ -123,7 +131,7 @@ void point_set(hsize_t start[],
hsize_t count[],
hsize_t stride[],
hsize_t block[],
- size_t num_points,
+ size_t num_points,
hsize_t coords[],
int order)
{
@@ -153,13 +161,13 @@ void point_set(hsize_t start[],
}
if(VERBOSE_MED) {
- printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
+ HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0] * block[1] * count[0] * count[1]));
k = 0;
for(i = 0; i < num_points ; i++) {
- printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
+ HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
k += 2;
}
}
@@ -177,10 +185,10 @@ dataset_fill(hsize_t start[], hsize_t block[], DATATYPE * dataset)
/* put some trivial data in the data_array */
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
- dataptr++;
- }
+ for (j=0; j < block[1]; j++){
+ *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
+ dataptr++;
+ }
}
}
@@ -195,19 +203,19 @@ dataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
hsize_t i, j;
/* print the column heading */
- printf("%-8s", "Cols:");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
- for (j=0; j < block[1]; j++){
- printf("%03d ", *dataptr++);
- }
- printf("\n");
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ for (j=0; j < block[1]; j++){
+ HDprintf("%03d ", *dataptr++);
+ }
+ HDprintf("\n");
}
}
@@ -223,35 +231,35 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
/* print it if VERBOSE_MED */
if(VERBOSE_MED) {
- printf("dataset_vrfy dumping:::\n");
- printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
- (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
- printf("original values:\n");
- dataset_print(start, block, original);
- printf("compared values:\n");
- dataset_print(start, block, dataset);
+ HDprintf("dataset_vrfy dumping:::\n");
+ HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("original values:\n");
+ dataset_print(start, block, original);
+ HDprintf("compared values:\n");
+ dataset_print(start, block, dataset);
}
vrfyerrs = 0;
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- if(*dataset != *original){
- if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
- (unsigned long)i, (unsigned long)j,
- (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
- *(original), *(dataset));
- }
- dataset++;
- original++;
- }
- }
+ for (j=0; j < block[1]; j++){
+ if(*dataset != *original){
+ if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
+ HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
+ (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ *(original), *(dataset));
+ }
+ dataset++;
+ original++;
+ }
+ }
}
if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(vrfyerrs)
- printf("%d errors found in dataset_vrfy\n", vrfyerrs);
+ HDprintf("%d errors found in dataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
@@ -272,20 +280,20 @@ void
dataset_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -293,7 +301,7 @@ dataset_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent write test on file %s\n", filename);
+ HDprintf("Independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -332,12 +340,12 @@ dataset_writeInd(void)
/* create a dataset collectively */
dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another dataset collectively */
dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
@@ -366,28 +374,28 @@ dataset_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to write with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeInd by some with zero row\n");
+ HDprintf("writeInd by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeInd by some with zero row");
if((mpi_rank/2)*2 != mpi_rank){
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
}
#ifdef BARRIER_CHECKS
@@ -418,19 +426,19 @@ void
dataset_readInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -438,7 +446,7 @@ dataset_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent read test on file %s\n", filename);
+ HDprintf("Independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -455,7 +463,7 @@ dataset_readInd(void)
VRFY((acc_tpl >= 0), "");
/* open the file collectively */
- fid=H5Fopen(filename,H5F_ACC_RDONLY,acc_tpl);
+ fid = H5Fopen(filename, H5F_ACC_RDONLY, acc_tpl);
VRFY((fid >= 0), "");
/* Release file-access template */
@@ -489,7 +497,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -498,7 +506,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -540,28 +548,28 @@ void
dataset_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */
hid_t dataset5, dataset6, dataset7; /* Dataset ID */
- hid_t datatype; /* Datatype ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t datatype; /* Datatype ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -569,7 +577,7 @@ dataset_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective write test on file %s\n", filename);
+ HDprintf("Collective write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -669,8 +677,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -679,31 +687,31 @@ dataset_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* write data collectively */
MESG("writeAll by Row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* setup dimensions again to writeAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero row\n");
+ HDprintf("writeAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
/* release all temporary handles. */
@@ -720,8 +728,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a file dataspace independently */
@@ -738,8 +746,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -748,30 +756,30 @@ dataset_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to writeAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero col\n");
+ HDprintf("writeAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero col");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZCOL succeeded");
/* release all temporary handles. */
@@ -789,8 +797,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset3);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -801,16 +809,16 @@ dataset_writeAll(void)
mem_dataspace = H5Screate_simple (RANK, block, NULL);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
} /* end if */
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -819,21 +827,21 @@ dataset_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* write data collectively */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* release all temporary handles. */
@@ -850,8 +858,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset4);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(file_dataspace);
@@ -862,8 +870,8 @@ dataset_writeAll(void)
mem_dataspace = H5Screate(H5S_SCALAR);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(mem_dataspace);
@@ -874,8 +882,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -884,20 +892,20 @@ dataset_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* write data collectively */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* release all temporary handles. */
@@ -907,7 +915,7 @@ dataset_writeAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
@@ -922,15 +930,15 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* Dataset5: point selection in File - Hyperslab selection in Memory*/
/* create a file dataspace independently */
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset5);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1005,7 +1013,7 @@ dataset_writeAll(void)
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1075,25 +1083,25 @@ void
dataset_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i,j,k;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1101,7 +1109,7 @@ dataset_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective read test on file %s\n", filename);
+ HDprintf("Collective read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1174,8 +1182,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1184,14 +1192,14 @@ dataset_readAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 succeeded");
/* verify the read data with original expected data */
@@ -1200,18 +1208,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero col\n");
+ HDprintf("readAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero col");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZCOL succeeded");
/* verify the read data with original expected data */
@@ -1242,8 +1250,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1252,14 +1260,14 @@ dataset_readAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset2 succeeded");
/* verify the read data with original expected data */
@@ -1268,18 +1276,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero row\n");
+ HDprintf("readAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero row");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZROW succeeded");
/* verify the read data with original expected data */
@@ -1293,9 +1301,9 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
if(data_origin1) free(data_origin1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
@@ -1310,8 +1318,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* Dataset5: point selection in memory - Hyperslab selection in file*/
@@ -1335,8 +1343,8 @@ dataset_readAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* read data collectively */
@@ -1344,7 +1352,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset5 succeeded");
-
+
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
if(ret) nerrors++;
@@ -1355,7 +1363,7 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
@@ -1400,7 +1408,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1488,25 +1496,25 @@ void
extend_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1514,7 +1522,7 @@ extend_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1567,7 +1575,7 @@ extend_writeInd(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -1603,8 +1611,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1625,7 +1633,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1643,8 +1651,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1664,7 +1672,7 @@ extend_writeInd(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -1685,7 +1693,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1719,25 +1727,25 @@ extend_writeInd2(void)
{
const char *filename;
hid_t fid; /* HDF5 file ID */
- hid_t fapl; /* File access templates */
- hid_t fs; /* File dataspace ID */
- hid_t ms; /* Memory dataspace ID */
- hid_t dataset; /* Dataset ID */
- hsize_t orig_size=10; /* Original dataset dim size */
- hsize_t new_size=20; /* Extended dataset dim size */
+ hid_t fapl; /* File access templates */
+ hid_t fs; /* File dataspace ID */
+ hid_t ms; /* Memory dataspace ID */
+ hid_t dataset; /* Dataset ID */
+ hsize_t orig_size=10; /* Original dataset dim size */
+ hsize_t new_size=20; /* Extended dataset dim size */
hsize_t one=1;
- hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
- hsize_t chunk_size = 16384; /* chunk size */
- hid_t dcpl; /* dataset create prop. list */
+ hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
+ hsize_t chunk_size = 16384; /* chunk size */
+ hid_t dcpl; /* dataset create prop. list */
int written[10], /* Data to write */
retrieved[10]; /* Data read in */
int mpi_size, mpi_rank; /* MPI settings */
int i; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test #2 on file %s\n", filename);
+ HDprintf("Extend independent write test #2 on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1794,10 +1802,10 @@ extend_writeInd2(void)
written[i] = i;
MESG("data array initialized");
if(VERBOSE_MED) {
- MESG("writing at offset zero: ");
+ MESG("writing at offset zero: ");
for(i = 0; i < (int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Dwrite(dataset, H5T_NATIVE_INT, ms, fs, H5P_DEFAULT, written);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -1809,15 +1817,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset zero: ");
+ MESG("read at offset zero: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
/* -------------------------
@@ -1837,10 +1845,10 @@ extend_writeInd2(void)
written[i] = orig_size + i;
MESG("data array re-initialized");
if(VERBOSE_MED) {
- MESG("writing at offset 10: ");
+ MESG("writing at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, &orig_size, NULL, &one, &orig_size);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
@@ -1854,15 +1862,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset 10: ");
+ MESG("read at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
@@ -1879,22 +1887,22 @@ extend_writeInd2(void)
void
extend_readInd(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1902,7 +1910,7 @@ extend_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1974,13 +1982,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2009,13 +2017,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2058,26 +2066,26 @@ void
extend_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2085,7 +2093,7 @@ extend_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2138,7 +2146,7 @@ extend_writeAll(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2174,8 +2182,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2200,14 +2208,14 @@ extend_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2226,8 +2234,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2240,8 +2248,8 @@ extend_writeAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
@@ -2258,7 +2266,7 @@ extend_writeAll(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -2279,7 +2287,7 @@ extend_writeAll(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2308,23 +2316,23 @@ extend_writeAll(void)
void
extend_readAll(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2332,7 +2340,7 @@ extend_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2404,8 +2412,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2414,14 +2422,14 @@ extend_readAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2451,8 +2459,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2461,14 +2469,14 @@ extend_readAll(void)
ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2505,25 +2513,25 @@ void
compress_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hid_t dcpl; /* Dataset creation property list */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t dataspace; /* Dataspace ID */
- hid_t dataset; /* Dataset ID */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t dataspace; /* Dataspace ID */
+ hid_t dataset; /* Dataset ID */
int rank=1; /* Dataspace rank */
hsize_t dim=dim0; /* Dataspace dimensions */
unsigned u; /* Local index variable */
- DATATYPE *data_read = NULL; /* data buffer */
+ DATATYPE *data_read = NULL; /* data buffer */
DATATYPE *data_orig = NULL; /* expected data buffer */
const char *filename;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
int mpi_size, mpi_rank;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective chunked dataset read test on file %s\n", filename);
+ HDprintf("Collective chunked dataset read test on file %s\n", filename);
/* Retrieve MPI parameters */
MPI_Comm_size(comm,&mpi_size);
@@ -2539,101 +2547,101 @@ compress_readAll(void)
for(u=0; u<dim;u++)
data_orig[u]=u;
- /* Process zero creates the file with a compressed, chunked dataset */
- if(mpi_rank==0) {
- hsize_t chunk_dim; /* Chunk dimensions */
-
- /* Create the file */
- fid = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- VRFY((fid > 0), "H5Fcreate succeeded");
-
- /* Create property list for chunking and compression */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- VRFY((dcpl > 0), "H5Pcreate succeeded");
-
- ret = H5Pset_layout(dcpl, H5D_CHUNKED);
- VRFY((ret >= 0), "H5Pset_layout succeeded");
-
- /* Use eight chunks */
- chunk_dim = dim / 8;
- ret = H5Pset_chunk(dcpl, rank, &chunk_dim);
- VRFY((ret >= 0), "H5Pset_chunk succeeded");
+ /* Process zero creates the file with a compressed, chunked dataset */
+ if(mpi_rank==0) {
+ hsize_t chunk_dim; /* Chunk dimensions */
+
+ /* Create the file */
+ fid = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((fid > 0), "H5Fcreate succeeded");
+
+ /* Create property list for chunking and compression */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ VRFY((dcpl > 0), "H5Pcreate succeeded");
+
+ ret = H5Pset_layout(dcpl, H5D_CHUNKED);
+ VRFY((ret >= 0), "H5Pset_layout succeeded");
+
+ /* Use eight chunks */
+ chunk_dim = dim / 8;
+ ret = H5Pset_chunk(dcpl, rank, &chunk_dim);
+ VRFY((ret >= 0), "H5Pset_chunk succeeded");
+
+ ret = H5Pset_deflate(dcpl, 9);
+ VRFY((ret >= 0), "H5Pset_deflate succeeded");
+
+ /* Create dataspace */
+ dataspace = H5Screate_simple(rank, &dim, NULL);
+ VRFY((dataspace > 0), "H5Screate_simple succeeded");
+
+ /* Create dataset */
+ dataset = H5Dcreate2(fid, "compressed_data", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY((dataset > 0), "H5Dcreate2 succeeded");
+
+ /* Write compressed data */
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig);
+ VRFY((ret >= 0), "H5Dwrite succeeded");
+
+ /* Close objects */
+ ret = H5Pclose(dcpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+ ret = H5Sclose(dataspace);
+ VRFY((ret >= 0), "H5Sclose succeeded");
+ ret = H5Dclose(dataset);
+ VRFY((ret >= 0), "H5Dclose succeeded");
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+ }
- ret = H5Pset_deflate(dcpl, 9);
- VRFY((ret >= 0), "H5Pset_deflate succeeded");
+ /* Wait for file to be created */
+ MPI_Barrier(comm);
- /* Create dataspace */
- dataspace = H5Screate_simple(rank, &dim, NULL);
- VRFY((dataspace > 0), "H5Screate_simple succeeded");
+ /* -------------------
+ * OPEN AN HDF5 FILE
+ * -------------------*/
- /* Create dataset */
- dataset = H5Dcreate2(fid, "compressed_data", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- VRFY((dataset > 0), "H5Dcreate2 succeeded");
+ /* setup file access template */
+ acc_tpl = create_faccess_plist(comm, info, facc_type);
+ VRFY((acc_tpl >= 0), "");
- /* Write compressed data */
- ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig);
- VRFY((ret >= 0), "H5Dwrite succeeded");
+ /* open the file collectively */
+ fid=H5Fopen(filename,H5F_ACC_RDWR,acc_tpl);
+ VRFY((fid > 0), "H5Fopen succeeded");
- /* Close objects */
- ret = H5Pclose(dcpl);
+ /* Release file-access template */
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "H5Pclose succeeded");
- ret = H5Sclose(dataspace);
- VRFY((ret >= 0), "H5Sclose succeeded");
- ret = H5Dclose(dataset);
- VRFY((ret >= 0), "H5Dclose succeeded");
- ret = H5Fclose(fid);
- VRFY((ret >= 0), "H5Fclose succeeded");
- }
-
- /* Wait for file to be created */
- MPI_Barrier(comm);
-
- /* -------------------
- * OPEN AN HDF5 FILE
- * -------------------*/
-
- /* setup file access template */
- acc_tpl = create_faccess_plist(comm, info, facc_type);
- VRFY((acc_tpl >= 0), "");
-
- /* open the file collectively */
- fid=H5Fopen(filename,H5F_ACC_RDWR,acc_tpl);
- VRFY((fid > 0), "H5Fopen succeeded");
-
- /* Release file-access template */
- ret = H5Pclose(acc_tpl);
- VRFY((ret >= 0), "H5Pclose succeeded");
- /* Open dataset with compressed chunks */
- dataset = H5Dopen2(fid, "compressed_data", H5P_DEFAULT);
- VRFY((dataset > 0), "H5Dopen2 succeeded");
+ /* Open dataset with compressed chunks */
+ dataset = H5Dopen2(fid, "compressed_data", H5P_DEFAULT);
+ VRFY((dataset > 0), "H5Dopen2 succeeded");
- /* Try reading & writing data */
- if(dataset>0) {
- /* Create dataset transfer property list */
- xfer_plist = H5Pcreate(H5P_DATASET_XFER);
- VRFY((xfer_plist > 0), "H5Pcreate succeeded");
+ /* Try reading & writing data */
+ if(dataset>0) {
+ /* Create dataset transfer property list */
+ xfer_plist = H5Pcreate(H5P_DATASET_XFER);
+ VRFY((xfer_plist > 0), "H5Pcreate succeeded");
- ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
- VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
- if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
- VRFY((ret>= 0),"set independent IO collectively succeeded");
- }
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
+ if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
+ ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ VRFY((ret>= 0),"set independent IO collectively succeeded");
+ }
- /* Try reading the data */
- ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
- VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
+ /* Try reading the data */
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
+ VRFY((ret >= 0), "H5Dread succeeded");
- /* Verify data read */
- for(u=0; u<dim; u++)
- if(data_orig[u]!=data_read[u]) {
- printf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
- (unsigned)u,data_orig[u],(unsigned)u,data_read[u]);
- nerrors++;
- }
+ /* Verify data read */
+ for(u=0; u<dim; u++)
+ if(data_orig[u]!=data_read[u]) {
+ HDprintf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
+ (unsigned)u,data_orig[u],(unsigned)u,data_read[u]);
+ nerrors++;
+ }
/* Writing to the compressed, chunked dataset in parallel should fail */
H5E_BEGIN_TRY {
@@ -2641,14 +2649,15 @@ compress_readAll(void)
} H5E_END_TRY;
VRFY((ret < 0), "H5Dwrite failed");
- ret = H5Pclose(xfer_plist);
- VRFY((ret >= 0), "H5Pclose succeeded");
- ret = H5Dclose(dataset);
- VRFY((ret >= 0), "H5Dclose succeeded");
- } /* end if */
+ ret = H5Pclose(xfer_plist);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+ ret = H5Dclose(dataset);
+ VRFY((ret >= 0), "H5Dclose succeeded");
+ } /* end if */
- ret = H5Fclose(fid);
- VRFY((ret >= 0), "H5Fclose succeeded");
+ /* Close file */
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
/* release data buffers */
if(data_read) HDfree(data_read);
@@ -2672,26 +2681,26 @@ void
none_selection_chunk(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_origin = NULL; /* data buffer */
- DATATYPE *data_array = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
-
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK]; /* for hyperslab setting */
- hsize_t stride[RANK]; /* for hyperslab setting */
- hsize_t block[RANK]; /* for hyperslab setting */
- hsize_t mstart[RANK]; /* for data buffer in memory */
-
- herr_t ret; /* Generic return value */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_origin = NULL; /* data buffer */
+ DATATYPE *data_array = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
+
+ hsize_t start[RANK]; /* for hyperslab setting */
+ hsize_t count[RANK]; /* for hyperslab setting */
+ hsize_t stride[RANK]; /* for hyperslab setting */
+ hsize_t block[RANK]; /* for hyperslab setting */
+ hsize_t mstart[RANK]; /* for data buffer in memory */
+
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2699,7 +2708,7 @@ none_selection_chunk(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2730,7 +2739,7 @@ none_selection_chunk(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2774,8 +2783,8 @@ none_selection_chunk(void)
dataset_fill(mstart, block, data_origin);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(mstart, block, data_origin);
+ MESG("data_array created");
+ dataset_print(mstart, block, data_origin);
}
}
@@ -2809,12 +2818,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2831,12 +2840,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2868,20 +2877,20 @@ none_selection_chunk(void)
if(data_array) HDfree(data_array);
}
-
+
/* Function: test_actual_io_mode
*
- * Purpose: tests one specific case of collective I/O and checks that the
+ * Purpose: tests one specific case of collective I/O and checks that the
* actual_chunk_opt_mode property and the actual_io_mode
* properties in the DXPL have the correct values.
*
* Input: selection_mode: changes the way processes select data from the space, as well
* as some dxpl flags to get collective I/O to break in different ways.
- *
+ *
* The relevant I/O function and expected response for each mode:
* TEST_ACTUAL_IO_MULTI_CHUNK_IND:
* H5D_mpi_chunk_collective_io, each process reports independent I/O
- *
+ *
* TEST_ACTUAL_IO_MULTI_CHUNK_COL:
* H5D_mpi_chunk_collective_io, each process reports collective I/O
*
@@ -2893,7 +2902,7 @@ none_selection_chunk(void)
* collective, the rest report independent I/O
*
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
- * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
+ * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
* Set directly go to multi-chunk-io without num threshold calc.
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL:
* Same test TEST_ACTUAL_IO_MULTI_CHUNK_COL.
@@ -2918,20 +2927,20 @@ none_selection_chunk(void)
*
* Note: DIRECT_MULTI_CHUNK_MIX and DIRECT_MULTI_CHUNK_MIX_DISAGREE
* is not needed as they are covered by DIRECT_CHUNK_MIX and
- * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
+ * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
* path way to multi-chunk-io by H5FD_MPIO_CHUNK_MULTI_IO insted of num-threshold.
*
* Modification:
- * - Refctore to remove multi-chunk-without-opimization test and update for
- * testing direct to multi-chunk-io
+ * - Refctore to remove multi-chunk-without-opimization test and update for
+ * testing direct to multi-chunk-io
* Programmer: Jonathan Kim
* Date: 2012-10-10
*
- *
+ *
* Programmer: Jacob Gruber
* Date: 2011-04-06
*/
-static void
+static void
test_actual_io_mode(int selection_mode) {
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_write = -1;
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_read = -1;
@@ -2945,7 +2954,7 @@ test_actual_io_mode(int selection_mode) {
hbool_t multi_chunk_io;
hbool_t is_chunked;
hbool_t is_collective;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -2970,12 +2979,12 @@ test_actual_io_mode(int selection_mode) {
hsize_t block[RANK];
char message[256];
herr_t ret;
-
+
/* Set up some flags to make some future if statements slightly more readable */
direct_multi_chunk_io = (
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND ||
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL );
-
+
/* Note: RESET performs the same tests as MULTI_CHUNK_MIX_DISAGREE and then
* tests independent I/O
*/
@@ -2985,11 +2994,11 @@ test_actual_io_mode(int selection_mode) {
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX ||
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE ||
selection_mode == TEST_ACTUAL_IO_RESET );
-
+
is_chunked = (
selection_mode != TEST_ACTUAL_IO_CONTIGUOUS &&
selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE);
-
+
is_collective = selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE;
/* Set up MPI parameters */
@@ -2997,7 +3006,7 @@ test_actual_io_mode(int selection_mode) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3014,7 +3023,7 @@ test_actual_io_mode(int selection_mode) {
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((fid >= 0), "H5Fcreate succeeded");
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
@@ -3042,10 +3051,10 @@ test_actual_io_mode(int selection_mode) {
file_space = H5Dget_space(dataset);
VRFY((file_space >= 0), "H5Dget_space succeeded");
- /* Choose a selection method based on the type of I/O we want to occur,
+ /* Choose a selection method based on the type of I/O we want to occur,
* and also set up some selection-dependeent test info. */
switch(selection_mode) {
-
+
/* Independent I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_IND:
case TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
@@ -3054,7 +3063,7 @@ test_actual_io_mode(int selection_mode) {
* independent.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Multi Chunk - Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
@@ -3068,7 +3077,7 @@ test_actual_io_mode(int selection_mode) {
* selections to each chunk, the operation is purely collective.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
-
+
test_name = "Multi Chunk - Collective";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1)
@@ -3076,7 +3085,7 @@ test_actual_io_mode(int selection_mode) {
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
break;
-
+
/* Mixed I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX:
/* A chunk will be assigned collective I/O only if it is selected by each
@@ -3087,7 +3096,7 @@ test_actual_io_mode(int selection_mode) {
* assigned independent I/O. Each process will access one chunk collectively
* and at least one chunk independently, reporting mixed I/O.
*/
-
+
if(mpi_rank == 0) {
/* Select the first column */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
@@ -3102,7 +3111,7 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
test_name = "Multi Chunk - Mixed";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED;
@@ -3112,7 +3121,7 @@ test_actual_io_mode(int selection_mode) {
* performed. To acheive this, we have RESET perform collective I/O (which would change
* the values from the defaults) followed by independent I/O (which should report the
* default values). RESET doesn't need to have a unique selection, so we reuse
- * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
+ * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
* on all builds. The independent section of RESET can be found at the end of this function.
*/
case TEST_ACTUAL_IO_RESET:
@@ -3121,7 +3130,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE:
/* A chunk will be assigned collective I/O only if it is selected by each
* process. To get mixed I/O with disagreement, assign process n to the
- * first chunk and the nth chunk. The first chunk, selected by all, is
+ * first chunk and the nth chunk. The first chunk, selected by all, is
* assgigned collective I/O, while each other process gets independent I/O.
* Since the root process with only access the first chunk, it will report
* collective I/O. The subsequent processes will access the first chunk
@@ -3143,13 +3152,13 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
/* If the testname was not already set by the RESET case */
if (selection_mode == TEST_ACTUAL_IO_RESET)
test_name = "RESET";
else
test_name = "Multi Chunk - Mixed (Disagreement)";
-
+
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1) {
if(mpi_rank == 0)
@@ -3159,14 +3168,14 @@ test_actual_io_mode(int selection_mode) {
}
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
-
- break;
+
+ break;
/* Linked Chunk I/O */
- case TEST_ACTUAL_IO_LINK_CHUNK:
+ case TEST_ACTUAL_IO_LINK_CHUNK:
/* Nothing special; link chunk I/O is forced in the dxpl settings. */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Link Chunk";
actual_chunk_opt_mode_expected = H5D_MPIO_LINK_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE;
@@ -3177,7 +3186,7 @@ test_actual_io_mode(int selection_mode) {
/* A non overlapping, regular selection in a contiguous dataset leads to
* collective I/O */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Contiguous";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_CONTIGUOUS_COLLECTIVE;
@@ -3185,7 +3194,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_NO_COLLECTIVE:
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE;
@@ -3200,13 +3209,13 @@ test_actual_io_mode(int selection_mode) {
ret = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
-
+
/* Create a memory dataspace mirroring the dataset and select the same hyperslab
- * as in the file space.
+ * as in the file space.
*/
mem_space = H5Screate_simple (RANK, dims, NULL);
VRFY((mem_space >= 0), "mem_space created");
-
+
ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
@@ -3215,22 +3224,22 @@ test_actual_io_mode(int selection_mode) {
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
/* Set collective I/O properties in the dxpl. */
if(is_collective) {
/* Request collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
- /* Set the threshold number of processes per chunk to twice mpi_size.
- * This will prevent the threshold from ever being met, thus forcing
+
+ /* Set the threshold number of processes per chunk to twice mpi_size.
+ * This will prevent the threshold from ever being met, thus forcing
* multi chunk io instead of link chunk io.
* This is via deault.
*/
@@ -3268,12 +3277,12 @@ test_actual_io_mode(int selection_mode) {
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_write, &actual_chunk_opt_mode_write);
VRFY((ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
/* Read */
ret = H5Dread(dataset, data_type, mem_space, file_space, dxpl_read, buffer);
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Retreive Actual io values */
ret = H5Pget_mpio_actual_io_mode(dxpl_read, &actual_io_mode_read);
VRFY((ret >= 0), "retriving actual io mode succeeded" );
@@ -3289,9 +3298,9 @@ test_actual_io_mode(int selection_mode) {
/* Test values */
if(actual_chunk_opt_mode_expected != (unsigned) -1 && actual_io_mode_expected != (unsigned) -1) {
- sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
VRFY((actual_chunk_opt_mode_write == actual_chunk_opt_mode_expected), message);
- sprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
VRFY((actual_io_mode_write == actual_io_mode_expected), message);
} else {
HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank,
@@ -3323,7 +3332,7 @@ test_actual_io_mode(int selection_mode) {
"actual_chunk_opt_mode has correct value for reset write (independent)");
VRFY(actual_io_mode_write == H5D_MPIO_NO_COLLECTIVE,
"actual_io_mode has correct value for reset write (independent)");
-
+
/* Read */
ret = H5Dread(dataset, data_type, H5S_ALL, H5S_ALL, dxpl_read, buffer);
VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded");
@@ -3333,7 +3342,7 @@ test_actual_io_mode(int selection_mode) {
VRFY( (ret >= 0), "retriving actual io mode succeeded" );
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_read, &actual_chunk_opt_mode_read);
VRFY( (ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
VRFY(actual_chunk_opt_mode_read == H5D_MPIO_NO_CHUNK_OPTIMIZATION,
"actual_chunk_opt_mode has correct value for reset read (independent)");
VRFY(actual_io_mode_read == H5D_MPIO_NO_COLLECTIVE,
@@ -3355,10 +3364,10 @@ test_actual_io_mode(int selection_mode) {
return;
}
-
+
/* Function: actual_io_mode_tests
*
- * Purpose: Tests all possible cases of the actual_io_mode property.
+ * Purpose: Tests all possible cases of the actual_io_mode property.
*
* Programmer: Jacob Gruber
* Date: 2011-04-06
@@ -3369,10 +3378,10 @@ actual_io_mode_tests(void) {
int mpi_rank = -1;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE);
-
- /*
+
+ /*
* Test multi-chunk-io via proc_num threshold
*/
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_IND);
@@ -3383,10 +3392,10 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX);
else
HDfprintf(stdout, "Multi Chunk Mixed test requires 3 proceses minimum\n");
-
+
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE);
- /*
+ /*
* Test multi-chunk-io via setting direct property
*/
test_actual_io_mode(TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND);
@@ -3394,31 +3403,31 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_LINK_CHUNK);
test_actual_io_mode(TEST_ACTUAL_IO_CONTIGUOUS);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_RESET);
return;
}
-/*
+/*
* Function: test_no_collective_cause_mode
*
- * Purpose:
- * tests cases for broken collective I/O and checks that the
+ * Purpose:
+ * tests cases for broken collective I/O and checks that the
* H5Pget_mpio_no_collective_cause properties in the DXPL have the correct values.
*
- * Input:
+ * Input:
* selection_mode: various mode to cause broken collective I/O
* Note: Originally, each TEST case is supposed to be used alone.
* After some discussion, this is updated to take multiple TEST cases
- * with '|'. However there is no error check for any of combined
+ * with '|'. However there is no error check for any of combined
* test cases, so a tester is responsible to understand and feed
* proper combination of TESTs if needed.
*
- *
+ *
* TEST_COLLECTIVE:
* Test for regular collective I/O without cause of breaking.
* Just to test normal behavior.
- *
+ *
* TEST_SET_INDEPENDENT:
* Test for Independent I/O as the cause of breaking collective I/O.
*
@@ -3430,7 +3439,7 @@ actual_io_mode_tests(void) {
*
* TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES:
* Test for NULL dataspace as the cause of breaking collective I/O.
- *
+ *
* TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT:
* Test for Compact layout as the cause of breaking collective I/O.
*
@@ -3439,17 +3448,17 @@ actual_io_mode_tests(void) {
*
* TEST_FILTERS:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ *
*
- *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
#define DSET_NOCOLCAUSE "nocolcause"
#define NELM 2
#define FILE_EXTERNAL "nocolcause_extern.data"
-static void
-test_no_collective_cause_mode(int selection_mode)
+static void
+test_no_collective_cause_mode(int selection_mode)
{
uint32_t no_collective_cause_local_write = 0;
uint32_t no_collective_cause_local_read = 0;
@@ -3463,7 +3472,7 @@ test_no_collective_cause_mode(int selection_mode)
const char * test_name;
hbool_t is_chunked=1;
hbool_t is_independent=0;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3487,7 +3496,7 @@ test_no_collective_cause_mode(int selection_mode)
H5Z_filter_t filter_info;
#endif /* LATER */
/* set to global value as default */
- int l_facc_type = facc_type;
+ int l_facc_type = facc_type;
char message[256];
/* Set up MPI parameters */
@@ -3549,7 +3558,7 @@ test_no_collective_cause_mode(int selection_mode)
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
}
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3574,20 +3583,19 @@ test_no_collective_cause_mode(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
- /*
- * Set expected causes and some tweaks based on the type of test
+ /*
+ * Set expected causes and some tweaks based on the type of test
*/
if (selection_mode & TEST_DATATYPE_CONVERSION) {
test_name = "Broken Collective I/O - Datatype Conversion";
no_collective_cause_local_expected |= H5D_MPIO_DATATYPE_CONVERSION;
no_collective_cause_global_expected |= H5D_MPIO_DATATYPE_CONVERSION;
/* set different sign to trigger type conversion */
- data_type = H5T_NATIVE_UINT;
+ data_type = H5T_NATIVE_UINT;
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
@@ -3652,14 +3660,14 @@ test_no_collective_cause_mode(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if(is_independent) {
/* Set Independent I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_INDEPENDENT);
@@ -3669,17 +3677,17 @@ test_no_collective_cause_mode(int selection_mode)
/* Set Collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
+
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
- ret = H5Pset_data_transform (dxpl_write, "x+1");
+ ret = H5Pset_data_transform (dxpl_write, "x+1");
VRFY((ret >= 0), "H5Pset_data_transform succeeded");
}
/*---------------------
* Test Write access
- *---------------------*/
+ *---------------------*/
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl_write, buffer);
@@ -3694,7 +3702,7 @@ test_no_collective_cause_mode(int selection_mode)
/*---------------------
* Test Read access
- *---------------------*/
+ *---------------------*/
/* Make a copy of the dxpl to test the read operation */
dxpl_read = H5Pcopy(dxpl_write);
@@ -3705,7 +3713,7 @@ test_no_collective_cause_mode(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl_read, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
@@ -3715,13 +3723,13 @@ test_no_collective_cause_mode(int selection_mode)
"reading and writing are the same for local cause of Broken Collective I/O");
VRFY((no_collective_cause_global_read == no_collective_cause_global_write),
"reading and writing are the same for global cause of Broken Collective I/O");
-
+
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_write == no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_write == no_collective_cause_global_expected), message);
/* Release some resources */
@@ -3753,28 +3761,28 @@ test_no_collective_cause_mode(int selection_mode)
}
-/*
+/*
* Function: test_no_collective_cause_mode_filter
*
- * Purpose:
- * Test specific for using filter as a caus of broken collective I/O and
+ * Purpose:
+ * Test specific for using filter as a caus of broken collective I/O and
* checks that the H5Pget_mpio_no_collective_cause properties in the DXPL
* have the correct values.
*
- * NOTE:
- * This is a temporary function.
+ * NOTE:
+ * This is a temporary function.
* test_no_collective_cause_mode(TEST_FILTERS) will replace this when
* H5Dcreate and H5write support for mpio and filter feature.
*
- * Input:
+ * Input:
* TEST_FILTERS_READ:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- *
+ *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-static void
-test_no_collective_cause_mode_filter(int selection_mode)
+static void
+test_no_collective_cause_mode_filter(int selection_mode)
{
uint32_t no_collective_cause_local_read = 0;
uint32_t no_collective_cause_local_expected = 0;
@@ -3784,7 +3792,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
const char * filename;
const char * test_name;
hbool_t is_chunked=1;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3814,7 +3822,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3840,12 +3848,12 @@ test_no_collective_cause_mode_filter(int selection_mode)
VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ.");
}
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3868,8 +3876,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
#ifdef LATER /* fletcher32 */
@@ -3892,16 +3899,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if (selection_mode == TEST_FILTERS_READ) {
- /* To test read in collective I/O mode , write in independent mode
+ /* To test read in collective I/O mode , write in independent mode
* because write fails with mpio + filter */
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_INDEPENDENT);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
@@ -3911,7 +3918,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
}
-
+
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl, buffer);
@@ -3952,17 +3959,17 @@ test_no_collective_cause_mode_filter(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_read == (uint32_t)no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_read == (uint32_t)no_collective_cause_global_expected), message);
/* Release some resources */
@@ -3988,16 +3995,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Function: no_collective_cause_tests
*
- * Purpose: Tests cases for broken collective IO.
+ * Purpose: Tests cases for broken collective IO.
*
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-void
-no_collective_cause_tests(void)
+void
+no_collective_cause_tests(void)
{
- /*
- * Test individual cause
+ /*
+ * Test individual cause
*/
test_no_collective_cause_mode (TEST_COLLECTIVE);
test_no_collective_cause_mode (TEST_SET_INDEPENDENT);
@@ -4007,15 +4014,15 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
#ifdef LATER /* fletcher32 */
- /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
+ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
* H5Dwrite is ready for mpio + filter feature.
*/
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter (TEST_FILTERS_READ);
-#endif /* LATER */
+#endif /* LATER */
- /*
- * Test combined causes
+ /*
+ * Test combined causes
*/
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL | TEST_DATATYPE_CONVERSION);
test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS);
@@ -4039,22 +4046,22 @@ void
dataset_atomicity(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t dataset1; /* Dataset IDs */
- hsize_t dims[RANK]; /* dataset dim sizes */
- int *write_buf = NULL; /* data buffer */
- int *read_buf = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t dataset1; /* Dataset IDs */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ int *write_buf = NULL; /* data buffer */
+ int *read_buf = NULL; /* data buffer */
int buf_size;
hid_t dataset2;
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* Memory dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* Memory dataspace ID */
hsize_t start[RANK];
hsize_t stride[RANK];
hsize_t count[RANK];
hsize_t block[RANK];
const char *filename;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
int i, j, k;
hbool_t atomicity = FALSE;
@@ -4064,11 +4071,11 @@ dataset_atomicity(void)
dim0 = 64; dim1 = 32;
filename = GetTestParameters();
if (facc_type != FACC_MPIO) {
- printf("Atomicity tests will not work without the MPIO VFD\n");
+ HDprintf("Atomicity tests will not work without the MPIO VFD\n");
return;
}
if(VERBOSE_MED)
- printf("atomic writes to file %s\n", filename);
+ HDprintf("atomic writes to file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -4119,7 +4126,7 @@ dataset_atomicity(void)
H5P_DEFAULT, write_buf);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
}
-
+
ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose succeeded");
ret = H5Dclose(dataset2);
@@ -4132,16 +4139,20 @@ dataset_atomicity(void)
MPI_Barrier (comm);
/* make sure setting atomicity fails on a serial file ID */
- /* open the file collectively */
- fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
- VRFY((fid >= 0), "H5Fopen succeeed");
+ /* file locking allows only one file open (serial) for writing */
+ if(MAINPROCESS){
+ fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
+ VRFY((fid >= 0), "H5Fopen succeeed");
+ }
/* should fail */
ret = H5Fset_mpi_atomicity (fid , TRUE);
VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
- ret = H5Fclose(fid);
- VRFY((ret >= 0), "H5Fclose succeeded");
+ if(MAINPROCESS){
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+ }
MPI_Barrier (comm);
@@ -4196,23 +4207,23 @@ dataset_atomicity(void)
if(VERBOSE_MED) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
}
/* The processes that read the dataset must either read all values
as 0 (read happened before process 0 wrote to dataset 1), or 5
(read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare = read_buf[0];
- VRFY((compare == 0 || compare == 5),
+ VRFY((compare == 0 || compare == 5),
"Atomicity Test Failed Process %d: Value read should be 0 or 5\n");
for (i=1; i<buf_size; i++) {
if (read_buf[i] != compare) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
nerrors ++;
}
}
@@ -4294,17 +4305,17 @@ dataset_atomicity(void)
if (mpi_rank == 1) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
- printf ("\n");
+ HDprintf ("\n");
}
}
/* The processes that read the dataset must either read all values
as 5 (read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare;
i=0;j=0;k=0;
@@ -4328,7 +4339,7 @@ dataset_atomicity(void)
continue;
}
else if (compare != read_buf[k]) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
nerrors++;
}
k ++;
@@ -4359,8 +4370,8 @@ dataset_atomicity(void)
* Programmer: Quincey Koziol
* Date: April, 2013
*/
-void
-test_dense_attr(void)
+void
+test_dense_attr(void)
{
int mpi_size, mpi_rank;
hid_t fpid, fid;
@@ -4398,7 +4409,7 @@ test_dense_attr(void)
status = H5Pclose(gpid);
VRFY((status >= 0), "H5Pclose succeeded");
- atFileSpace = H5Screate_simple(1, atDims, NULL);
+ atFileSpace = H5Screate_simple(1, atDims, NULL);
VRFY((atFileSpace > 0), "H5Screate_simple succeeded");
atid = H5Acreate2(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT);
VRFY((atid > 0), "H5Acreate succeeded");
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 81461f3..c510d45 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -12,6 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "testphdf5.h"
+#include "H5Dprivate.h"
#define DIM 2
#define SIZE 32
@@ -311,7 +312,6 @@ void compact_dataset(void)
VRFY((ret>= 0),"set independent IO collectively succeeded");
}
-
dataset = H5Dopen2(iof, dname, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dopen2 succeeded");
@@ -603,7 +603,7 @@ void dataset_fillvalue(void)
hsize_t req_count[4] = {1, 6, 7, 8};
hsize_t dset_size; /* Dataset size */
int *rdata, *wdata; /* Buffers for data to read and write */
- int *twdata, *trdata; /* Temporary pointer into buffer */
+ int *twdata, *trdata; /* Temporary pointer into buffer */
int acc, i, j, k, l; /* Local index variables */
herr_t ret; /* Generic return value */
const char *filename;
@@ -645,27 +645,29 @@ void dataset_fillvalue(void)
/*
* Read dataset before any data is written.
*/
- /* set entire read buffer with the constant 2 */
- HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
- /* Independently read the entire dataset back */
- ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- VRFY((ret >= 0), "H5Dread succeeded");
+ /* set entire read buffer with the constant 2 */
+ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
- /* Verify all data read are the fill value 0 */
- trdata = rdata;
- err_num = 0;
- for(i = 0; i < (int)dset_dims[0]; i++)
+ /* Independently read the entire dataset back */
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ VRFY((ret >= 0), "H5Dread succeeded");
+
+ /* Verify all data read are the fill value 0 */
+ trdata = rdata;
+ err_num = 0;
+ for(i = 0; i < (int)dset_dims[0]; i++)
for(j = 0; j < (int)dset_dims[1]; j++)
- for(k = 0; k < (int)dset_dims[2]; k++)
- for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
- if(*trdata != 0)
- if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata);
- if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
+ for(k = 0; k < (int)dset_dims[2]; k++)
+ for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
+ if(*trdata != 0)
+ if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
+ printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata);
+ if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
- if(err_num){
+ if(err_num) {
printf("%d errors found in check_value\n", err_num);
- nerrors++;
+ nerrors++;
+ }
}
/* Barrier to ensure all processes have completed the above test. */
@@ -711,36 +713,38 @@ void dataset_fillvalue(void)
/*
* Read dataset after partial write.
*/
- /* set entire read buffer with the constant 2 */
- HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
- /* Independently read the entire dataset back */
- ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- VRFY((ret >= 0), "H5Dread succeeded");
- /* Verify correct data read */
- twdata=wdata;
- trdata=rdata;
- err_num=0;
- for(i=0; i<(int)dset_dims[0]; i++)
+ /* set entire read buffer with the constant 2 */
+ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
+
+ /* Independently read the entire dataset back */
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ VRFY((ret >= 0), "H5Dread succeeded");
+
+ /* Verify correct data read */
+ twdata=wdata;
+ trdata=rdata;
+ err_num=0;
+ for(i=0; i<(int)dset_dims[0]; i++)
for(j=0; j<(int)dset_dims[1]; j++)
- for(k=0; k<(int)dset_dims[2]; k++)
- for(l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++)
- if(i<mpi_size) {
- if(*twdata != *trdata )
- if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata);
- } /* end if */
- else {
- if(*trdata != 0)
- if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
- } /* end else */
- if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
+ for(k=0; k<(int)dset_dims[2]; k++)
+ for(l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++)
+ if(i<mpi_size) {
+ if(*twdata != *trdata )
+ if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
+ printf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata);
+ } /* end if */
+ else {
+ if(*trdata != 0)
+ if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
+ printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
+ } /* end else */
+ if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
- if(err_num){
+ if(err_num){
printf("%d errors found in check_value\n", err_num);
- nerrors++;
- }
+ nerrors++;
+ }
/* Close all file objects */
ret = H5Dclose(dataset);
@@ -856,7 +860,7 @@ void collective_group_write(void)
if(!((m+1) % 10)) {
printf("created %d groups\n", m+1);
MPI_Barrier(MPI_COMM_WORLD);
- }
+ }
#endif /* BARRIER_CHECKS */
}
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index de255cd..94ecbfa 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -28,149 +28,143 @@
#include "testpar.h"
/* FILENAME and filenames must have the same number of names */
-const char *FILENAME[2]={
- "MPItest",
- NULL};
-char filenames[2][200];
-int nerrors = 0;
-hid_t fapl; /* file access property list */
+const char *FILENAME[2] = { "MPItest", NULL };
+char filenames[2][200];
+int nerrors = 0;
+hid_t fapl; /* file access property list */
/* protocols */
static int errors_sum(int nerrs);
#define MPIO_TEST_WRITE_SIZE 1024*1024 /* 1 MB */
-static int
-test_mpio_overlap_writes(char *filename)
-{
+static int test_mpio_overlap_writes(char *filename) {
int mpi_size, mpi_rank;
MPI_Comm comm;
MPI_Info info = MPI_INFO_NULL;
int color, mrc;
- MPI_File fh;
+ MPI_File fh;
int i;
int vrfyerrs, nerrs;
- unsigned char buf[4093]; /* use some prime number for size */
+ unsigned char buf[4093]; /* use some prime number for size */
int bufsize = sizeof(buf);
- MPI_Offset stride;
- MPI_Offset mpi_off;
- MPI_Status mpi_stat;
-
+ MPI_Offset stride;
+ MPI_Offset mpi_off;
+ MPI_Status mpi_stat;
if (VERBOSE_MED)
- printf("MPIO independent overlapping writes test on file %s\n",
- filename);
+ printf("MPIO independent overlapping writes test on file %s\n",
+ filename);
nerrs = 0;
/* set up MPI parameters */
- MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
- MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* Need at least 2 processes */
if (mpi_size < 2) {
- if (MAINPROCESS)
- printf("Need at least 2 processes to run MPIO test.\n");
- printf(" -SKIP- \n");
- return 0;
+ if (MAINPROCESS)
+ printf("Need at least 2 processes to run MPIO test.\n");
+ printf(" -SKIP- \n");
+ return 0;
}
/* splits processes 0 to n-2 into one comm. and the last one into another */
color = ((mpi_rank < (mpi_size - 1)) ? 0 : 1);
- mrc = MPI_Comm_split (MPI_COMM_WORLD, color, mpi_rank, &comm);
- VRFY((mrc==MPI_SUCCESS), "Comm_split succeeded");
-
- if (color==0){
- /* First n-1 processes (color==0) open a file and write it */
- mrc = MPI_File_open(comm, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- stride = 1;
- mpi_off = mpi_rank*stride;
- while (mpi_off < MPIO_TEST_WRITE_SIZE){
- /* make sure the write does not exceed the TEST_WRITE_SIZE */
- if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
- stride = MPIO_TEST_WRITE_SIZE - mpi_off;
-
- /* set data to some trivial pattern for easy verification */
- for (i=0; i<stride; i++)
- buf[i] = (unsigned char)(mpi_off+i);
- mrc = MPI_File_write_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
- &mpi_stat);
- VRFY((mrc==MPI_SUCCESS), "");
-
- /* move the offset pointer to last byte written by all processes */
- mpi_off += (mpi_size - 1 - mpi_rank) * stride;
-
- /* Increase chunk size without exceeding buffer size. */
- /* Then move the starting offset for next write. */
- stride *= 2;
- if (stride > bufsize)
- stride = bufsize;
- mpi_off += mpi_rank*stride;
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
- mrc = MPI_Comm_free(&comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
-
- /* sync with the other waiting processes */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
- }else{
- /* last process waits till writes are done,
- * then opens file to verify data.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
-
- mrc = MPI_File_open(comm, filename, MPI_MODE_RDONLY,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- stride = bufsize;
- for (mpi_off=0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize){
- /* make sure it does not read beyond end of data */
- if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
- stride = MPIO_TEST_WRITE_SIZE - mpi_off;
- mrc = MPI_File_read_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
- &mpi_stat);
- VRFY((mrc==MPI_SUCCESS), "");
- vrfyerrs=0;
- for (i=0; i<stride; i++){
- unsigned char expected;
- expected = (unsigned char)(mpi_off+i);
- if ((expected != buf[i]) &&
- (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
- printf("proc %d: found data error at [%ld], expect %u, got %u\n",
- mpi_rank, (long)(mpi_off+i), expected, buf[i]);
- }
- }
- if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("proc %d: [more errors ...]\n", mpi_rank);
-
- nerrs += vrfyerrs;
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
- mrc = MPI_Comm_free(&comm);
- VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free");
+ mrc = MPI_Comm_split(MPI_COMM_WORLD, color, mpi_rank, &comm);
+ VRFY((mrc == MPI_SUCCESS), "Comm_split succeeded");
+
+ if (color == 0) {
+ /* First n-1 processes (color==0) open a file and write it */
+ mrc = MPI_File_open(comm, filename, MPI_MODE_CREATE | MPI_MODE_RDWR,
+ info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ stride = 1;
+ mpi_off = mpi_rank * stride;
+ while (mpi_off < MPIO_TEST_WRITE_SIZE) {
+ /* make sure the write does not exceed the TEST_WRITE_SIZE */
+ if (mpi_off + stride > MPIO_TEST_WRITE_SIZE)
+ stride = MPIO_TEST_WRITE_SIZE - mpi_off;
+
+ /* set data to some trivial pattern for easy verification */
+ for (i = 0; i < stride; i++)
+ buf[i] = (unsigned char) (mpi_off + i);
+ mrc = MPI_File_write_at(fh, mpi_off, buf, (int) stride, MPI_BYTE,
+ &mpi_stat);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ /* move the offset pointer to last byte written by all processes */
+ mpi_off += (mpi_size - 1 - mpi_rank) * stride;
+
+ /* Increase chunk size without exceeding buffer size. */
+ /* Then move the starting offset for next write. */
+ stride *= 2;
+ if (stride > bufsize)
+ stride = bufsize;
+ mpi_off += mpi_rank * stride;
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+ mrc = MPI_Comm_free(&comm);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
+
+ /* sync with the other waiting processes */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+ } else {
+ /* last process waits till writes are done,
+ * then opens file to verify data.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+
+ mrc = MPI_File_open(comm, filename, MPI_MODE_RDONLY, info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ stride = bufsize;
+ for (mpi_off = 0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize) {
+ /* make sure it does not read beyond end of data */
+ if (mpi_off + stride > MPIO_TEST_WRITE_SIZE)
+ stride = MPIO_TEST_WRITE_SIZE - mpi_off;
+ mrc = MPI_File_read_at(fh, mpi_off, buf, (int) stride, MPI_BYTE,
+ &mpi_stat);
+ VRFY((mrc == MPI_SUCCESS), "");
+ vrfyerrs = 0;
+ for (i = 0; i < stride; i++) {
+ unsigned char expected;
+ expected = (unsigned char) (mpi_off + i);
+ if ((expected != buf[i])
+ && (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
+ printf(
+ "proc %d: found data error at [%ld], expect %u, got %u\n",
+ mpi_rank, (long) (mpi_off + i), expected, buf[i]);
+ }
+ }
+ if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
+ printf("proc %d: [more errors ...]\n", mpi_rank);
+
+ nerrs += vrfyerrs;
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+ mrc = MPI_Comm_free(&comm);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free");
}
/*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
return (nerrs);
}
-
#define MB 1048576 /* 1024*1024 == 2**20 */
#define GB 1073741824 /* 1024**3 == 2**30 */
#define TWO_GB_LESS1 2147483647 /* 2**31 - 1 */
@@ -186,30 +180,28 @@ test_mpio_overlap_writes(char *filename)
* Then reads the file back in by reverse order, that is process 0
* reads the data of process n-1 and vice versa.
*/
-static int
-test_mpio_gb_file(char *filename)
-{
+static int test_mpio_gb_file(char *filename) {
int mpi_size, mpi_rank;
MPI_Info info = MPI_INFO_NULL;
int mrc;
- MPI_File fh;
+ MPI_File fh;
int i, j, n;
int vrfyerrs;
- int writerrs; /* write errors */
+ int writerrs; /* write errors */
int nerrs;
- int ntimes; /* how many times */
- char *buf = NULL;
- char expected;
- MPI_Offset size;
- MPI_Offset mpi_off;
- MPI_Offset mpi_off_old;
- MPI_Status mpi_stat;
+ int ntimes; /* how many times */
+ char *buf = NULL;
+ char expected;
+ MPI_Offset size;
+ MPI_Offset mpi_off;
+ MPI_Offset mpi_off_old;
+ MPI_Status mpi_stat;
int is_signed, sizeof_mpi_offset;
nerrs = 0;
/* set up MPI parameters */
- MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
- MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if (VERBOSE_MED)
printf("MPI_Offset range test\n");
@@ -217,196 +209,207 @@ test_mpio_gb_file(char *filename)
/* figure out the signness and sizeof MPI_Offset */
mpi_off = 0;
is_signed = ((MPI_Offset)(mpi_off - 1)) < 0;
- sizeof_mpi_offset = (int)(sizeof(MPI_Offset));
+ sizeof_mpi_offset = (int) (sizeof(MPI_Offset));
/*
- * Verify the sizeof MPI_Offset and correctness of handling multiple GB
- * sizes.
- */
- if (MAINPROCESS){ /* only process 0 needs to check it*/
- printf("MPI_Offset is %s %d bytes integeral type\n",
- is_signed ? "signed" : "unsigned", (int)sizeof(MPI_Offset));
- if (sizeof_mpi_offset <= 4 && is_signed){
- printf("Skipped 2GB range test "
- "because MPI_Offset cannot support it\n");
- }else {
- /* verify correctness of assigning 2GB sizes */
- mpi_off = 2 * 1024 * (MPI_Offset)MB;
- INFO((mpi_off>0), "2GB OFFSET assignment no overflow");
- INFO((mpi_off-1)==TWO_GB_LESS1, "2GB OFFSET assignment succeed");
-
- /* verify correctness of increasing from below 2 GB to above 2GB */
- mpi_off = TWO_GB_LESS1;
- for (i=0; i < 3; i++){
- mpi_off_old = mpi_off;
- mpi_off = mpi_off + 1;
- /* no overflow */
- INFO((mpi_off>0), "2GB OFFSET increment no overflow");
- /* correct inc. */
- INFO((mpi_off-1)==mpi_off_old, "2GB OFFSET increment succeed");
- }
- }
-
- if (sizeof_mpi_offset <= 4){
- printf("Skipped 4GB range test "
- "because MPI_Offset cannot support it\n");
- }else {
- /* verify correctness of assigning 4GB sizes */
- mpi_off = 4 * 1024 * (MPI_Offset)MB;
- INFO((mpi_off>0), "4GB OFFSET assignment no overflow");
- INFO((mpi_off-1)==FOUR_GB_LESS1, "4GB OFFSET assignment succeed");
-
- /* verify correctness of increasing from below 4 GB to above 4 GB */
- mpi_off = FOUR_GB_LESS1;
- for (i=0; i < 3; i++){
- mpi_off_old = mpi_off;
- mpi_off = mpi_off + 1;
- /* no overflow */
- INFO((mpi_off>0), "4GB OFFSET increment no overflow");
- /* correct inc. */
- INFO((mpi_off-1)==mpi_off_old, "4GB OFFSET increment succeed");
- }
- }
+ * Verify the sizeof MPI_Offset and correctness of handling multiple GB
+ * sizes.
+ */
+ if (MAINPROCESS) { /* only process 0 needs to check it*/
+ printf("MPI_Offset is %s %d bytes integeral type\n",
+ is_signed ? "signed" : "unsigned", (int) sizeof(MPI_Offset));
+ if (sizeof_mpi_offset <= 4 && is_signed) {
+ printf("Skipped 2GB range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ /* verify correctness of assigning 2GB sizes */
+ mpi_off = 2 * 1024 * (MPI_Offset) MB;
+ INFO((mpi_off > 0), "2GB OFFSET assignment no overflow");
+ INFO((mpi_off-1)==TWO_GB_LESS1, "2GB OFFSET assignment succeed");
+
+ /* verify correctness of increasing from below 2 GB to above 2GB */
+ mpi_off = TWO_GB_LESS1;
+ for (i = 0; i < 3; i++) {
+ mpi_off_old = mpi_off;
+ mpi_off = mpi_off + 1;
+ /* no overflow */
+ INFO((mpi_off > 0), "2GB OFFSET increment no overflow");
+ /* correct inc. */
+ INFO((mpi_off - 1) == mpi_off_old,
+ "2GB OFFSET increment succeed");
+ }
+ }
+
+ if (sizeof_mpi_offset <= 4) {
+ printf("Skipped 4GB range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ /* verify correctness of assigning 4GB sizes */
+ mpi_off = 4 * 1024 * (MPI_Offset) MB;
+ INFO((mpi_off > 0), "4GB OFFSET assignment no overflow");
+ INFO((mpi_off-1)==FOUR_GB_LESS1, "4GB OFFSET assignment succeed");
+
+ /* verify correctness of increasing from below 4 GB to above 4 GB */
+ mpi_off = FOUR_GB_LESS1;
+ for (i = 0; i < 3; i++) {
+ mpi_off_old = mpi_off;
+ mpi_off = mpi_off + 1;
+ /* no overflow */
+ INFO((mpi_off > 0), "4GB OFFSET increment no overflow");
+ /* correct inc. */
+ INFO((mpi_off - 1) == mpi_off_old,
+ "4GB OFFSET increment succeed");
+ }
+ }
}
/*
- * Verify if we can write to a file of multiple GB sizes.
- */
+ * Verify if we can write to a file of multiple GB sizes.
+ */
if (VERBOSE_MED)
- printf("MPIO GB file test %s\n", filename);
-
- if (sizeof_mpi_offset <= 4){
- printf("Skipped GB file range test "
- "because MPI_Offset cannot support it\n");
- }else{
- buf = HDmalloc(MB);
- VRFY((buf!=NULL), "malloc succeed");
-
- /* open a new file. Remove it first in case it exists. */
- /* Must delete because MPI_File_open does not have a Truncate mode. */
- /* Don't care if it has error. */
- MPI_File_delete(filename, MPI_INFO_NULL);
- MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
-
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_CREATE|MPI_MODE_RDWR,
- info, &fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_OPEN");
-
- printf("MPIO GB file write test %s\n", filename);
-
- /* instead of writing every bytes of the file, we will just write
- * some data around the 2 and 4 GB boundaries. That should cover
- * potential integer overflow and filesystem size limits.
- */
- writerrs = 0;
- for (n=2; n <= 4; n+=2){
- ntimes = GB/MB*n/mpi_size + 1;
- for (i=ntimes-2; i <= ntimes; i++){
- mpi_off = (i*mpi_size + mpi_rank)*(MPI_Offset)MB;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: write to mpi_off=%016llx, %lld\n",
- mpi_rank, mpi_off, mpi_off);
- /* set data to some trivial pattern for easy verification */
- for (j=0; j<MB; j++)
- *(buf+j) = i*mpi_size + mpi_rank;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: writing %d bytes at offset %lld\n",
- mpi_rank, MB, mpi_off);
- mrc = MPI_File_write_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat);
- INFO((mrc==MPI_SUCCESS), "GB size file write");
- if (mrc!=MPI_SUCCESS)
- writerrs++;
- }
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
-
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync after writes");
-
- /*
- * Verify if we can read the multiple GB file just created.
- */
- /* open it again to verify the data written */
- /* but only if there was no write errors */
- printf("MPIO GB file read test %s\n", filename);
- if (errors_sum(writerrs)>0){
- printf("proc %d: Skip read test due to previous write errors\n",
- mpi_rank);
- goto finish;
- }
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
-
- /* Only read back parts of the file that have been written. */
- for (n=2; n <= 4; n+=2){
- ntimes = GB/MB*n/mpi_size + 1;
- for (i=ntimes-2; i <= ntimes; i++){
- mpi_off = (i*mpi_size + (mpi_size - mpi_rank - 1))*(MPI_Offset)MB;
- if (VERBOSE_MED)
- HDfprintf(stdout,"proc %d: read from mpi_off=%016llx, %lld\n",
- mpi_rank, mpi_off, mpi_off);
- mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat);
- INFO((mrc==MPI_SUCCESS), "GB size file read");
- expected = i*mpi_size + (mpi_size - mpi_rank - 1);
- vrfyerrs=0;
- for (j=0; j<MB; j++){
- if ((*(buf+j) != expected) &&
- (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)){
- printf("proc %d: found data error at [%ld+%d], expect %d, got %d\n",
- mpi_rank, (long)mpi_off, j, expected, *(buf+j));
- }
- }
- if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("proc %d: [more errors ...]\n", mpi_rank);
-
- nerrs += vrfyerrs;
- }
- }
-
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
-
- /*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
+ printf("MPIO GB file test %s\n", filename);
+
+ if (sizeof_mpi_offset <= 4) {
+ printf("Skipped GB file range test "
+ "because MPI_Offset cannot support it\n");
+ } else {
+ buf = (char *) HDmalloc(MB);
+ VRFY((buf != NULL), "malloc succeed");
+
+ /* open a new file. Remove it first in case it exists. */
+ /* Must delete because MPI_File_open does not have a Truncate mode. */
+ /* Don't care if it has error. */
+ MPI_File_delete(filename, MPI_INFO_NULL);
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
+
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, info, &fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_OPEN");
+
+ printf("MPIO GB file write test %s\n", filename);
+
+ /* instead of writing every bytes of the file, we will just write
+ * some data around the 2 and 4 GB boundaries. That should cover
+ * potential integer overflow and filesystem size limits.
+ */
+ writerrs = 0;
+ for (n = 2; n <= 4; n += 2) {
+ ntimes = GB / MB * n / mpi_size + 1;
+ for (i = ntimes - 2; i <= ntimes; i++) {
+ mpi_off = (i * mpi_size + mpi_rank) * (MPI_Offset) MB;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: write to mpi_off=%016llx, %lld\n",
+ mpi_rank, mpi_off, mpi_off);
+ /* set data to some trivial pattern for easy verification */
+ for (j = 0; j < MB; j++)
+ *(buf + j) = i * mpi_size + mpi_rank;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: writing %d bytes at offset %lld\n",
+ mpi_rank, MB, mpi_off);
+ mrc = MPI_File_write_at(fh, mpi_off, buf, MB, MPI_BYTE,
+ &mpi_stat);
+ INFO((mrc == MPI_SUCCESS), "GB size file write");
+ if (mrc != MPI_SUCCESS)
+ writerrs++;
+ }
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after writes");
+
+ /*
+ * Verify if we can read the multiple GB file just created.
+ */
+ /* open it again to verify the data written */
+ /* but only if there was no write errors */
+ printf("MPIO GB file read test %s\n", filename);
+ if (errors_sum(writerrs) > 0) {
+ printf("proc %d: Skip read test due to previous write errors\n",
+ mpi_rank);
+ goto finish;
+ }
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info,
+ &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
+
+ /* Only read back parts of the file that have been written. */
+ for (n = 2; n <= 4; n += 2) {
+ ntimes = GB / MB * n / mpi_size + 1;
+ for (i = ntimes - 2; i <= ntimes; i++) {
+ mpi_off = (i * mpi_size + (mpi_size - mpi_rank - 1))
+ * (MPI_Offset) MB;
+ if (VERBOSE_MED)
+ HDfprintf(stdout,
+ "proc %d: read from mpi_off=%016llx, %lld\n",
+ mpi_rank, mpi_off, mpi_off);
+ mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
+ &mpi_stat);
+ INFO((mrc == MPI_SUCCESS), "GB size file read");
+ expected = i * mpi_size + (mpi_size - mpi_rank - 1);
+ vrfyerrs = 0;
+ for (j = 0; j < MB; j++) {
+ if ((*(buf + j) != expected)
+ && (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
+ printf(
+ "proc %d: found data error at [%ld+%d], expect %d, got %d\n",
+ mpi_rank, (long) mpi_off, j, expected,
+ *(buf + j));
+ }
+ }
+ if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
+ printf("proc %d: [more errors ...]\n", mpi_rank);
+
+ nerrs += vrfyerrs;
+ }
+ }
+
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
+
+ /*
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
printf("Test if MPI_File_get_size works correctly with %s\n", filename);
- mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info, &fh);
- VRFY((mrc==MPI_SUCCESS), "");
+ mrc = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY, info,
+ &fh);
+ VRFY((mrc == MPI_SUCCESS), "");
- if (MAINPROCESS){ /* only process 0 needs to check it*/
+ if (MAINPROCESS) { /* only process 0 needs to check it*/
mrc = MPI_File_get_size(fh, &size);
- VRFY((mrc==MPI_SUCCESS), "");
- VRFY((size == mpi_off+MB), "MPI_File_get_size doesn't return correct file size.");
+ VRFY((mrc == MPI_SUCCESS), "");
+ VRFY((size == mpi_off+MB),
+ "MPI_File_get_size doesn't return correct file size.");
}
- /* close file and free the communicator */
- mrc = MPI_File_close(&fh);
- VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE");
+ /* close file and free the communicator */
+ mrc = MPI_File_close(&fh);
+ VRFY((mrc == MPI_SUCCESS), "MPI_FILE_CLOSE");
- /*
- * one more sync to ensure all processes have done reading
- * before ending this test.
- */
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc==MPI_SUCCESS), "Sync before leaving test");
+ /*
+ * one more sync to ensure all processes have done reading
+ * before ending this test.
+ */
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync before leaving test");
}
-finish:
- if (buf)
- HDfree(buf);
+ finish: if (buf)
+ HDfree(buf);
return (nerrs);
}
-
/*
* MPI-IO Test: One writes, Many reads.
* Verify if only one process writes some data and then all other
@@ -424,191 +427,190 @@ finish:
* Each process writes something, then reads all data back.
*/
-#define DIMSIZE 32 /* Dimension size. */
+#define DIMSIZE 32 /* Dimension size. */
#define PRINTID printf("Proc %d: ", mpi_rank)
#define USENONE 0
-#define USEATOM 1 /* request atomic I/O */
-#define USEFSYNC 2 /* request file_sync */
-
+#define USEATOM 1 /* request atomic I/O */
+#define USEFSYNC 2 /* request file_sync */
-static int
-test_mpio_1wMr(char *filename, int special_request)
-{
+static int test_mpio_1wMr(char *filename, int special_request) {
char hostname[128];
- int mpi_size, mpi_rank;
+ int mpi_size, mpi_rank;
MPI_File fh;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
+ int mpi_err_strlen;
+ int mpi_err;
unsigned char writedata[DIMSIZE], readdata[DIMSIZE];
unsigned char expect_val;
- int i, irank;
- int nerrs = 0; /* number of errors */
- int atomicity;
- MPI_Offset mpi_off;
- MPI_Status mpi_stat;
+ int i, irank;
+ int nerrs = 0; /* number of errors */
+ int atomicity;
+ MPI_Offset mpi_off;
+ MPI_Status mpi_stat;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
- if (MAINPROCESS && VERBOSE_MED){
+ if (MAINPROCESS && VERBOSE_MED) {
printf("Testing one process writes, all processes read.\n");
- printf("Using %d processes accessing file %s\n", mpi_size, filename);
+ printf("Using %d processes accessing file %s\n", mpi_size, filename);
printf(" (Filename can be specified via program argument)\n");
}
/* show the hostname so that we can tell where the processes are running */
- if (VERBOSE_DEF){
- if (gethostname(hostname, 128) < 0){
- PRINTID;
- printf("gethostname failed\n");
- return 1;
- }
- PRINTID;
- printf("hostname=%s\n", hostname);
+ if (VERBOSE_DEF) {
+#ifdef H5_HAVE_GETHOSTNAME
+ if(HDgethostname(hostname, sizeof(hostname)) < 0) {
+ printf("gethostname failed\n");
+ hostname[0] = '\0';
+ }
+#else
+ printf("gethostname unavailable\n");
+ hostname[0] = '\0';
+#endif
+ PRINTID;
+ printf("hostname=%s\n", hostname);
}
/* Delete any old file in order to start anew. */
/* Must delete because MPI_File_open does not have a Truncate mode. */
/* Don't care if it has error. */
MPI_File_delete(filename, MPI_INFO_NULL);
- MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
+ MPI_Barrier(MPI_COMM_WORLD); /* prevent racing condition */
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE ,
- MPI_INFO_NULL, &fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
-if (special_request & USEATOM){
- /* ==================================================
- * Set atomcity to true (1). A POSIX compliant filesystem
- * should not need this.
- * ==================================================*/
- if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
- }
- if (VERBOSE_HI)
- printf("Initial atomicity = %d\n", atomicity);
- if ((mpi_err = MPI_File_set_atomicity(fh, 1)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_set_atomicity failed (%s)\n", mpi_err_str);
- }
- if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ if (special_request & USEATOM) {
+ /* ==================================================
+ * Set atomcity to true (1). A POSIX compliant filesystem
+ * should not need this.
+ * ==================================================*/
+ if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if (VERBOSE_HI)
+ printf("Initial atomicity = %d\n", atomicity);
+ if ((mpi_err = MPI_File_set_atomicity(fh, 1)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_set_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if ((mpi_err = MPI_File_get_atomicity(fh, &atomicity)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
+ }
+ if (VERBOSE_HI)
+ printf("After set_atomicity atomicity = %d\n", atomicity);
}
- if (VERBOSE_HI)
- printf("After set_atomicity atomicity = %d\n", atomicity);
-}
/* This barrier is not necessary but do it anyway. */
MPI_Barrier(MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("between MPI_Barrier and MPI_File_write_at\n");
+ if (VERBOSE_HI) {
+ PRINTID;
+ printf("between MPI_Barrier and MPI_File_write_at\n");
}
/* ==================================================
- * Each process calculates what to write but
- * only process irank(0) writes.
- * ==================================================*/
- irank=0;
- for (i=0; i < DIMSIZE; i++)
- writedata[i] = irank*DIMSIZE + i;
- mpi_off = irank*DIMSIZE;
+ * Each process calculates what to write but
+ * only process irank(0) writes.
+ * ==================================================*/
+ irank = 0;
+ for (i = 0; i < DIMSIZE; i++)
+ writedata[i] = irank * DIMSIZE + i;
+ mpi_off = irank * DIMSIZE;
/* Only one process writes */
- if (mpi_rank==irank){
- if (VERBOSE_HI){
- PRINTID; printf("wrote %d bytes at %ld\n", DIMSIZE, (long)mpi_off);
- }
- if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
- MPI_BYTE, &mpi_stat))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, DIMSIZE, mpi_err_str);
- return 1;
- };
+ if (mpi_rank == irank) {
+ if (VERBOSE_HI) {
+ PRINTID;
+ printf("wrote %d bytes at %ld\n", DIMSIZE, (long) mpi_off);
+ }
+ if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
+ MPI_BYTE, &mpi_stat)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, DIMSIZE, mpi_err_str);
+ return 1;
+ };
};
/* Bcast the return code and */
/* make sure all writing are done before reading. */
MPI_Bcast(&mpi_err, 1, MPI_INT, irank, MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("MPI_Bcast: mpi_err = %d\n", mpi_err);
+ if (VERBOSE_HI) {
+ PRINTID;
+ printf("MPI_Bcast: mpi_err = %d\n", mpi_err);
}
-if (special_request & USEFSYNC){
- /* ==================================================
- * Do a file sync. A POSIX compliant filesystem
- * should not need this.
- * ==================================================*/
- if (VERBOSE_HI)
- printf("Apply MPI_File_sync\n");
- /* call file_sync to force the write out */
- if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_sync failed (%s)\n", mpi_err_str);
- }
- MPI_Barrier(MPI_COMM_WORLD);
- /* call file_sync to force the write out */
- if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ if (special_request & USEFSYNC) {
+ /* ==================================================
+ * Do a file sync. A POSIX compliant filesystem
+ * should not need this.
+ * ==================================================*/
+ if (VERBOSE_HI)
+ printf("Apply MPI_File_sync\n");
+ /* call file_sync to force the write out */
+ if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ }
+ MPI_Barrier(MPI_COMM_WORLD);
+ /* call file_sync to force the write out */
+ if ((mpi_err = MPI_File_sync(fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_sync failed (%s)\n", mpi_err_str);
+ }
}
-}
/* This barrier is not necessary because the Bcase or File_sync above */
/* should take care of it. Do it anyway. */
MPI_Barrier(MPI_COMM_WORLD);
- if (VERBOSE_HI){
- PRINTID;
- printf("after MPI_Barrier\n");
+ if (VERBOSE_HI) {
+ PRINTID;
+ printf("after MPI_Barrier\n");
}
/* ==================================================
- * Each process reads what process 0 wrote and verify.
- * ==================================================*/
- irank=0;
- mpi_off = irank*DIMSIZE;
+ * Each process reads what process 0 wrote and verify.
+ * ==================================================*/
+ irank = 0;
+ mpi_off = irank * DIMSIZE;
if ((mpi_err = MPI_File_read_at(fh, mpi_off, readdata, DIMSIZE, MPI_BYTE,
- &mpi_stat))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- PRINTID;
- printf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, DIMSIZE, mpi_err_str);
- return 1;
+ &mpi_stat)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ PRINTID;
+ printf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
+ (long) mpi_off, DIMSIZE, mpi_err_str);
+ return 1;
};
- for (i=0; i < DIMSIZE; i++){
- expect_val = irank*DIMSIZE + i;
- if (readdata[i] != expect_val){
- PRINTID;
- printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
- readdata[i], expect_val);
- nerrs++;
- }
+ for (i = 0; i < DIMSIZE; i++) {
+ expect_val = irank * DIMSIZE + i;
+ if (readdata[i] != expect_val) {
+ PRINTID;
+ printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
+ readdata[i], expect_val);
+ nerrs++;
+ }
}
MPI_File_close(&fh);
- if (VERBOSE_HI){
- PRINTID;
- printf("%d data errors detected\n", nerrs);
+ if (VERBOSE_HI) {
+ PRINTID;
+ printf("%d data errors detected\n", nerrs);
}
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
@@ -617,273 +619,268 @@ if (special_request & USEFSYNC){
/*
-Function: test_mpio_derived_dtype
-
-Test Whether the Displacement of MPI derived datatype
-(+ File_set_view + MPI_write)works or not on this MPI-IO package
-and this platform.
-
-1. Details for the test:
-1) Create two derived datatypes with MPI_Type_hindexed:
- datatype1:
- count = 1, blocklens = 1, offsets = 0,
- base type = MPI_BYTE(essentially a char)
- datatype2:
- count = 1, blocklens = 1, offsets = 1(byte),
- base type = MPI_BYTE
-
-2) Using these two derived datatypes,
- Build another derived datatype with MPI_Type_struct:
- advtype: derived from datatype1 and datatype2
- advtype:
- count = 2, blocklens[0] = 1, blocklens[1]=1,
- offsets[0] = 0, offsets[1] = 1(byte),
- bas_type[0]=datatype1,
- bas_type[1] = datatype2;
-
-3) Setting MPI file view with advtype
-4) Writing 2 bytes 1 to 2 using MPI_File_write to a file
-5) File content:
-Suppose the fill value of the file is 0(most machines indeed do so)
-and Fill value is embraced with "() in the following output:
-Expected output should be:
-1,0,2
-
-
-
-However, at some platforms, for example, IBM AIX(at March 23rd, 2005):
-the following values were obtained:
-1,2,0
-
-The problem is that the displacement of the second derived datatype(datatype2) which formed the final derived datatype(advtype)
+ Function: test_mpio_derived_dtype
+
+ Test Whether the Displacement of MPI derived datatype
+ (+ File_set_view + MPI_write)works or not on this MPI-IO package
+ and this platform.
+
+ 1. Details for the test:
+ 1) Create two derived datatypes with MPI_Type_create_hindexed:
+ datatype1:
+ count = 1, blocklens = 1, offsets = 0,
+ base type = MPI_BYTE(essentially a char)
+ datatype2:
+ count = 1, blocklens = 1, offsets = 1(byte),
+ base type = MPI_BYTE
+
+ 2) Using these two derived datatypes,
+ Build another derived datatype with MPI_Type_create_struct:
+ advtype: derived from datatype1 and datatype2
+ advtype:
+ count = 2, blocklens[0] = 1, blocklens[1]=1,
+ offsets[0] = 0, offsets[1] = 1(byte),
+ bas_type[0]=datatype1,
+ bas_type[1] = datatype2;
+
+ 3) Setting MPI file view with advtype
+ 4) Writing 2 bytes 1 to 2 using MPI_File_write to a file
+ 5) File content:
+ Suppose the fill value of the file is 0(most machines indeed do so)
+ and Fill value is embraced with "() in the following output:
+ Expected output should be:
+ 1,0,2
+
+
+
+ However, at some platforms, for example, IBM AIX(at March 23rd, 2005):
+ the following values were obtained:
+ 1,2,0
+
+ The problem is that the displacement of the second derived datatype(datatype2) which formed the final derived datatype(advtype)
has been put after the basic datatype(MPI_BYTE) of datatype2. This is a bug.
-2. This test will verify whether the complicated derived datatype is working on
-the current platform.
+ 2. This test will verify whether the complicated derived datatype is working on
+ the current platform.
-If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
-the configuration specific file of HDF5 so that we can change our configurationsetting to support collective IO for irregular selections.
+ If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
+ the configuration specific file of HDF5 so that we can change our configurationsetting to support collective IO for irregular selections.
-If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
-we can turn off collective IO support for irregular selections.
-*/
+ If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
+ we can turn off collective IO support for irregular selections.
+ */
static int test_mpio_derived_dtype(char *filename) {
MPI_File fh;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
- int i;
- int nerrors = 0; /* number of errors */
- MPI_Datatype etype,filetype;
- MPI_Datatype adv_filetype,bas_filetype[2];
- MPI_Datatype etypenew, filetypenew;
- MPI_Offset disp;
- MPI_Status Status;
- MPI_Aint adv_disp[2];
- MPI_Aint offsets[1];
- int blocklens[1],adv_blocklens[2];
- int count,outcount;
- int retcode;
-
- int mpi_rank,mpi_size;
-
- char buf[3],outbuf[3] = {0};
+ int mpi_err_strlen;
+ int mpi_err;
+ int i;
+ MPI_Datatype etype, filetype;
+ MPI_Datatype adv_filetype, bas_filetype[2];
+ MPI_Datatype filetypenew;
+ MPI_Offset disp;
+ MPI_Status Status;
+ MPI_Aint adv_disp[2];
+ MPI_Aint offsets[1];
+ int blocklens[1], adv_blocklens[2];
+ int count, outcount;
+ int retcode;
+
+ int mpi_rank, mpi_size;
+
+ char buf[3], outbuf[3] = { 0 };
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
retcode = 0;
- for(i=0;i<3;i++)
- buf[i] = i+1;
-
+ for (i = 0; i < 3; i++)
+ buf[i] = i + 1;
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE,
- MPI_INFO_NULL, &fh))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
- disp = 0;
+ disp = 0;
etype = MPI_BYTE;
count = 1;
blocklens[0] = 1;
- offsets[0] = 0;
+ offsets[0] = 0;
- if((mpi_err= MPI_Type_hindexed(count,blocklens,offsets,MPI_BYTE,&filetype))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_Type_create_hindexed(count, blocklens, offsets, MPI_BYTE,
+ &filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&filetype))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
count = 1;
- blocklens[0]=1;
+ blocklens[0] = 1;
offsets[0] = 1;
- if((mpi_err= MPI_Type_hindexed(count,blocklens,offsets,MPI_BYTE,&filetypenew))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_Type_create_hindexed(count, blocklens, offsets, MPI_BYTE,
+ &filetypenew)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&filetypenew))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&filetypenew)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
- outcount = 2;
+ outcount = 2;
adv_blocklens[0] = 1;
adv_blocklens[1] = 1;
- adv_disp[0] = 0;
- adv_disp[1] = 1;
- bas_filetype[0] = filetype;
- bas_filetype[1] = filetypenew;
-
- if((mpi_err= MPI_Type_struct(outcount,adv_blocklens,adv_disp,bas_filetype,&adv_filetype))
- != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_struct failed (%s)\n", mpi_err_str);
- return 1;
+ adv_disp[0] = 0;
+ adv_disp[1] = 1;
+ bas_filetype[0] = filetype;
+ bas_filetype[1] = filetypenew;
+
+ if ((mpi_err = MPI_Type_create_struct(outcount, adv_blocklens, adv_disp,
+ bas_filetype, &adv_filetype)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_Type_create_struct failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err=MPI_Type_commit(&adv_filetype))!=MPI_SUCCESS){
+ if ((mpi_err = MPI_Type_commit(&adv_filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
- return 1;
+ printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_set_view(fh,disp,etype,adv_filetype,"native",MPI_INFO_NULL))!= MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_set_view(fh, disp, etype, adv_filetype, "native",
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_write(fh,buf,3,MPI_BYTE,&Status))!= MPI_SUCCESS){
+ if ((mpi_err = MPI_File_write(fh, buf, 3, MPI_BYTE, &Status))
+ != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_write failed (%s)\n", mpi_err_str);
- return 1;
- ;
+ printf("MPI_File_write failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_close failed (%s)\n", mpi_err_str);
+ return 1;
}
-
- if((mpi_err = MPI_File_open(MPI_COMM_WORLD,filename,MPI_MODE_RDONLY,MPI_INFO_NULL,&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_open failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY,
+ MPI_INFO_NULL, &fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_open failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_set_view(fh,0,MPI_BYTE,MPI_BYTE,"native",MPI_INFO_NULL))!= MPI_SUCCESS){
+ if ((mpi_err = MPI_File_set_view(fh, 0, MPI_BYTE, MPI_BYTE, "native",
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
- return 1;
+ printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
+ return 1;
}
- if((mpi_err = MPI_File_read(fh,outbuf,3,MPI_BYTE,&Status))!=MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_read failed (%s)\n", mpi_err_str);
- return 1;
+ if ((mpi_err = MPI_File_read(fh, outbuf, 3, MPI_BYTE, &Status))
+ != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_read failed (%s)\n", mpi_err_str);
+ return 1;
}
- if(outbuf[2]==2) {
- retcode = 0;
- }
- else {
-/* if(mpi_rank == 0) {
- printf("complicated derived datatype is NOT working at this platform\n");
- printf("go back to hdf5/config and find the corresponding\n");
- printf("configure-specific file and change ?????\n");
- }
-*/
- retcode = -1;
- }
-
- if((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS){
- MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
- printf("MPI_File_close failed (%s)\n", mpi_err_str);
- return 1;
+ if (outbuf[2] == 2) {
+ retcode = 0;
+ } else {
+ /* if(mpi_rank == 0) {
+ printf("complicated derived datatype is NOT working at this platform\n");
+ printf("go back to hdf5/config and find the corresponding\n");
+ printf("configure-specific file and change ?????\n");
+ }
+ */
+ retcode = -1;
}
+ if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) {
+ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
+ printf("MPI_File_close failed (%s)\n", mpi_err_str);
+ return 1;
+ }
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
- if(retcode == -1) {
- if(mpi_rank == 0) {
- printf("Complicated derived datatype is NOT working at this platform\n");
- printf(" Please report to help@hdfgroup.org about this problem.\n");
- }
- retcode = 1;
+ if (retcode == -1) {
+ if (mpi_rank == 0) {
+ printf(
+ "Complicated derived datatype is NOT working at this platform\n");
+ printf(" Please report to help@hdfgroup.org about this problem.\n");
+ }
+ retcode = 1;
}
return retcode;
}
/*
-Function: test_mpio_special_collective
+ Function: test_mpio_special_collective
-Test Whether collective IO is still working when more than one process
-has no contribution to IO. To properly test this case, at least FOUR
-processes are needed.
+ Test Whether collective IO is still working when more than one process
+ has no contribution to IO. To properly test this case, at least FOUR
+ processes are needed.
-1. Details for the test:
-1) Create one derived datatype with MPI_Type_hindexed:
+ 1. Details for the test:
+ 1) Create one derived datatype with MPI_Type_create_hindexed:
-2) Choosing at least two processes to contribute none for IO with
- the buf size inside MPI_Write_at_all to 0.
-3) Choosing at least two processes to have real contributions for IO.
-4) Do collective IO.
+ 2) Choosing at least two processes to contribute none for IO with
+ the buf size inside MPI_Write_at_all to 0.
+ 3) Choosing at least two processes to have real contributions for IO.
+ 4) Do collective IO.
-2. This test will fail with the MPI-IO package that doesn't support this. For example,
-mpich 1.2.6.
+ 2. This test will fail with the MPI-IO package that doesn't support this. For example,
+ mpich 1.2.6.
-If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
-the configuration specific file of HDF5 so that we can change our configurationsetting to support special collective IO; currently only special collective IO.
+ If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change
+ the configuration specific file of HDF5 so that we can change our configurationsetting to support special collective IO; currently only special collective IO.
-If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
-we can turn off the support for special collective IO; currently only special collective IO.
-*/
+ If it turns out that the previous working MPI-IO package no longer works, this test will also issue a message to inform the corresponding failure so that
+ we can turn off the support for special collective IO; currently only special collective IO.
+ */
-static int
-test_mpio_special_collective(char *filename)
-{
- int mpi_size, mpi_rank;
+static int test_mpio_special_collective(char *filename) {
+ int mpi_size, mpi_rank;
MPI_File fh;
- MPI_Datatype etype,buftype,filetype;
+ MPI_Datatype etype, buftype, filetype;
char mpi_err_str[MPI_MAX_ERROR_STRING];
- int mpi_err_strlen;
- int mpi_err;
- char writedata[2*DIMSIZE];
+ int mpi_err_strlen;
+ int mpi_err;
+ char writedata[2 * DIMSIZE];
char filerep[7] = "native";
- int i;
- int count,bufcount;
+ int i;
+ int count, bufcount;
int blocklens[2];
MPI_Aint offsets[2];
- MPI_Offset mpi_off = 0;
- MPI_Status mpi_stat;
- int retcode = 0;
+ MPI_Offset mpi_off = 0;
+ MPI_Status mpi_stat;
+ int retcode = 0;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* create MPI data type */
etype = MPI_BYTE;
- if(mpi_rank == 0 || mpi_rank == 1) {
+ if (mpi_rank == 0 || mpi_rank == 1) {
count = DIMSIZE;
bufcount = 1;
} /* end if */
@@ -893,38 +890,32 @@ test_mpio_special_collective(char *filename)
} /* end else */
blocklens[0] = count;
- offsets[0] = mpi_rank*count;
+ offsets[0] = mpi_rank * count;
blocklens[1] = count;
- offsets[1] = (mpi_size+mpi_rank)*count;
-
- if(count !=0) {
- if((mpi_err = MPI_Type_hindexed(2,
- blocklens,
- offsets,
- etype,
- &filetype)) != MPI_SUCCESS) {
+ offsets[1] = (mpi_size + mpi_rank) * count;
+
+ if (count != 0) {
+ if ((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype,
+ &filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_hindexed(2,
- blocklens,
- offsets,
- etype,
- &buftype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype,
+ &buftype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
- if((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
@@ -932,46 +923,36 @@ test_mpio_special_collective(char *filename)
} /* end if */
else {
filetype = MPI_BYTE;
- buftype = MPI_BYTE;
+ buftype = MPI_BYTE;
} /* end else */
/* Open a file */
- if ((mpi_err = MPI_File_open(MPI_COMM_WORLD,
- filename,
- MPI_MODE_RDWR | MPI_MODE_CREATE,
- MPI_INFO_NULL,
- &fh)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
+ MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
+ != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_File_open failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
/* each process writes some data */
- for (i=0; i < 2*DIMSIZE; i++)
- writedata[i] = (char)(mpi_rank*DIMSIZE + i);
+ for (i = 0; i < 2 * DIMSIZE; i++)
+ writedata[i] = (char) (mpi_rank * DIMSIZE + i);
/* Set the file view */
- if((mpi_err = MPI_File_set_view(fh,
- mpi_off,
- MPI_BYTE,
- filetype,
- filerep,
- MPI_INFO_NULL)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_set_view(fh, mpi_off, MPI_BYTE, filetype, filerep,
+ MPI_INFO_NULL)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
/* Collectively write into the file */
- if ((mpi_err = MPI_File_write_at_all(fh,
- mpi_off,
- writedata,
- bufcount,
- buftype,
- &mpi_stat)) != MPI_SUCCESS) {
+ if ((mpi_err = MPI_File_write_at_all(fh, mpi_off, writedata, bufcount,
+ buftype, &mpi_stat)) != MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
- (long) mpi_off, bufcount, mpi_err_str);
+ (long) mpi_off, bufcount, mpi_err_str);
return 1;
} /* end if */
@@ -984,8 +965,8 @@ test_mpio_special_collective(char *filename)
/* Perform a barrier */
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
- if(retcode != 0) {
- if(mpi_rank == 0) {
+ if (retcode != 0) {
+ if (mpi_rank == 0) {
printf("special collective IO is NOT working at this platform\n");
printf(" Please report to help@hdfgroup.org about this problem.\n");
} /* end if */
@@ -999,71 +980,69 @@ test_mpio_special_collective(char *filename)
/*
* parse the command line options
*/
-static int
-parse_options(int argc, char **argv)
-{
- while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'v': if (*((*argv+1)+1))
- ParseTestVerbosity((*argv+1)+1);
- else
- SetTestVerbosity(VERBO_MED);
- break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: nerrors++;
- return(1);
- }
- }
+static int parse_options(int argc, char **argv) {
+ while (--argc) {
+ if (**(++argv) != '-') {
+ break;
+ } else {
+ switch (*(*argv + 1)) {
+ case 'v':
+ if (*((*argv + 1) + 1))
+ ParseTestVerbosity((*argv + 1) + 1);
+ else
+ SetTestVerbosity(VERBO_MED);
+ break;
+ case 'f':
+ if (--argc < 1) {
+ nerrors++;
+ return (1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return (1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return (1);
+ default:
+ nerrors++;
+ return (1);
+ }
+ }
} /*while*/
/* compose the test filenames */
{
- int i, n;
- hid_t plist;
-
- plist = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_fapl_mpio(plist, MPI_COMM_WORLD, MPI_INFO_NULL);
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],plist,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- H5Pclose(plist);
- if (VERBOSE_MED){
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
- }
+ int i, n;
+ hid_t plist;
+
+ plist = H5Pcreate(H5P_FILE_ACCESS);
+ H5Pset_fapl_mpio(plist, MPI_COMM_WORLD, MPI_INFO_NULL);
+ n = sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i = 0; i < n; i++)
+ if (h5_fixname(FILENAME[i], plist, filenames[i],
+ sizeof(filenames[i])) == NULL) {
+ printf("h5_fixname failed\n");
+ nerrors++;
+ return (1);
+ }
+ H5Pclose(plist);
+ if (VERBOSE_MED) {
+ printf("Test filenames are:\n");
+ for (i = 0; i < n; i++)
+ printf(" %s\n", filenames[i]);
+ }
}
- return(0);
+ return (0);
}
-
/*
* Show command usage
*/
-static void
-usage(void)
-{
+static void usage(void) {
printf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
printf("\t-v<verbosity>\tset verbose level (0-9,l,m,h)\n");
printf("\t-f <prefix>\tfilename prefix\n");
@@ -1073,19 +1052,14 @@ usage(void)
/*
* return the sum of all errors.
*/
-static int
-errors_sum(int nerrs)
-{
+static int errors_sum(int nerrs) {
int temp;
MPI_Allreduce(&nerrs, &temp, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
- return(temp);
+ return (temp);
}
-
-int
-main(int argc, char **argv)
-{
- int mpi_size, mpi_rank; /* mpi variables */
+int main(int argc, char **argv) {
+ int mpi_size, mpi_rank; /* mpi variables */
int ret_code;
MPI_Init(&argc, &argv);
@@ -1093,78 +1067,76 @@ main(int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* Attempt to turn off atexit post processing so that in case errors
- * happen during the test and the process is aborted, it will not get
- * hang in the atexit post processing in which it may try to make MPI
- * calls. By then, MPI calls may not work.
- */
- if (H5dont_atexit() < 0){
- printf("Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ * happen during the test and the process is aborted, it will not get
+ * hang in the atexit post processing in which it may try to make MPI
+ * calls. By then, MPI calls may not work.
+ */
+ if (H5dont_atexit() < 0) {
+ printf("Failed to turn off atexit processing. Continue.\n");
};
H5open();
- if (parse_options(argc, argv) != 0){
- if (MAINPROCESS)
- usage();
- goto finish;
+ if (parse_options(argc, argv) != 0) {
+ if (MAINPROCESS)
+ usage();
+ goto finish;
}
- if (MAINPROCESS){
- printf("===================================\n");
- printf("MPI functionality tests\n");
- printf("===================================\n");
+ if (MAINPROCESS) {
+ printf("===================================\n");
+ printf("MPI functionality tests\n");
+ printf("===================================\n");
}
if (VERBOSE_MED)
- h5_show_hostname();
+ h5_show_hostname();
- fapl = H5Pcreate (H5P_FILE_ACCESS);
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL);
/* set alarm. */
ALARM_ON;
-
/*=======================================
- * MPIO 1 write Many read test
- *=======================================*/
+ * MPIO 1 write Many read test
+ *=======================================*/
MPI_BANNER("MPIO 1 write Many read test...");
ret_code = test_mpio_1wMr(filenames[0], USENONE);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/* test atomicity and file sync in high verbose mode only */
/* since they often hang when broken and PHDF5 does not use them. */
- if (VERBOSE_HI){
- MPI_BANNER("MPIO 1 write Many read test with atomicity...");
- ret_code = test_mpio_1wMr(filenames[0], USEATOM);
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
- }
-
- MPI_BANNER("MPIO 1 write Many read test with file sync...");
- ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
- }
- }
+ if (VERBOSE_HI) {
+ MPI_BANNER("MPIO 1 write Many read test with atomicity...");
+ ret_code = test_mpio_1wMr(filenames[0], USEATOM);
+ ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
+ }
+ MPI_BANNER("MPIO 1 write Many read test with file sync...");
+ ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
+ ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
+ }
+ }
/*=======================================
- * MPIO MPIO File size range test
- *=======================================*/
+ * MPIO MPIO File size range test
+ *=======================================*/
MPI_BANNER("MPIO File size range test...");
#ifndef H5_HAVE_WIN32_API
ret_code = test_mpio_gb_file(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
#else
if (mpi_rank==0)
@@ -1172,30 +1144,30 @@ main(int argc, char **argv)
#endif
/*=======================================
- * MPIO independent overlapping writes
- *=======================================*/
+ * MPIO independent overlapping writes
+ *=======================================*/
MPI_BANNER("MPIO independent overlapping writes...");
ret_code = test_mpio_overlap_writes(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/*=======================================
- * MPIO complicated derived datatype test
- *=======================================*/
+ * MPIO complicated derived datatype test
+ *=======================================*/
MPI_BANNER("MPIO complicated derived datatype test...");
ret_code = test_mpio_derived_dtype(filenames[0]);
ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
/*=======================================
- * MPIO special collective IO test
- *=======================================*/
+ * MPIO special collective IO test
+ *=======================================*/
if (mpi_size < 4) {
MPI_BANNER("MPIO special collective io test SKIPPED.");
if (mpi_rank == 0)
@@ -1207,28 +1179,26 @@ main(int argc, char **argv)
MPI_BANNER("MPIO special collective io test...");
ret_code = test_mpio_special_collective(filenames[0]);
-sc_finish:
- ret_code = errors_sum(ret_code);
- if (mpi_rank==0 && ret_code > 0){
- printf("***FAILED with %d total errors\n", ret_code);
- nerrors += ret_code;
+ sc_finish: ret_code = errors_sum(ret_code);
+ if (mpi_rank == 0 && ret_code > 0) {
+ printf("***FAILED with %d total errors\n", ret_code);
+ nerrors += ret_code;
}
-
-finish:
+ finish:
/* make sure all processes are finished before final report, cleanup
- * and exit.
- */
+ * and exit.
+ */
MPI_Barrier(MPI_COMM_WORLD);
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors){
- printf("***MPI tests detected %d errors***\n", nerrors);
- }
- else{
- printf("MPI tests finished with no errors\n");
- }
- printf("===================================\n");
+ if (MAINPROCESS) { /* only process 0 reports */
+ printf("===================================\n");
+ if (nerrors) {
+ printf("***MPI tests detected %d errors***\n", nerrors);
+ }
+ else {
+ printf("MPI tests finished with no errors\n");
+ }
+ printf("===================================\n");
}
/* turn off alarm */
@@ -1241,6 +1211,6 @@ finish:
MPI_Finalize();
/* cannot just return (nerrors) because exit code is limited to 1byte */
- return(nerrors!=0);
+ return (nerrors != 0);
}
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index 0782f3d..27b561b 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -15,13 +15,12 @@
* Programmer: Leon Arber <larber@uiuc.edu>
* Sept. 28, 2006.
*
- * Purpose: This is the first half of a two-part test that makes sure
- * that a file can be read after a parallel application crashes as long
- * as the file was flushed first. We simulate a crash by
- * calling _exit(0) since this doesn't flush HDF5 caches but
- * still exits with success.
+ * Purpose: This is the first half of a two-part test that makes sure
+ * that a file can be read after a parallel application crashes
+ * as long as the file was flushed first. We simulate a crash by
+ * calling _exit() since this doesn't flush HDF5 caches but
+ * still exits with success.
*/
-#include <mpi.h>
#include "h5test.h"
const char *FILENAME[] = {
@@ -30,171 +29,190 @@ const char *FILENAME[] = {
NULL
};
-static double the_data[100][100];
+static int data_g[100][100];
+#define N_GROUPS 100
+
+
/*-------------------------------------------------------------------------
- * Function: create_file
- *
- * Purpose: Creates file used in part 1 of the test
+ * Function: create_test_file
*
- * Return: Success: 0
+ * Purpose: Creates the file used in part 1 of the test
*
- * Failure: 1
+ * Return: Success: A valid file ID
+ * Failure: H5I_INVALID_HID
*
- * Programmer: Leon Arber
+ * Programmer: Leon Arber
* Sept. 26, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hid_t
-create_file(char* name, hid_t fapl)
+create_test_file(char *name, hid_t fapl_id)
{
- hid_t file, dcpl, space, dset, groups, grp, plist;
- hsize_t ds_size[2] = {100, 100};
- hsize_t ch_size[2] = {5, 5};
- hsize_t i, j;
-
-
-
- if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t top_level_gid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t dxpl_id = H5I_INVALID_HID;
+ hsize_t dims[2] = {100, 100};
+ hsize_t chunk_dims[2] = {5, 5};
+ hsize_t i, j;
+
+ if((fid = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Create a chunked dataset */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error;
- if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error;
- if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
-
- plist = H5Pcreate(H5P_DATASET_XFER);
- H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE);
-
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0)
+ goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+ if(H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0)
+ goto error;
/* Write some data */
- for(i = 0; i < ds_size[0]; i++) {
- /*
- * The extra cast in the following statement is a bug workaround
- * for the Win32 version 5.0 compiler.
- * 1998-11-06 ptl
- */
- for(j = 0; j < ds_size[1]; j++)
- the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1);
- }
- if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error;
+ for(i = 0; i < dims[0]; i++)
+ for(j = 0; j < dims[1]; j++)
+ data_g[i][j] = (int)(i + (i * j) + j);
+
+ if(H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data_g) < 0)
+ goto error;
/* Create some groups */
- if((groups = H5Gcreate2(file, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- for(i = 0; i < 100; i++) {
- sprintf(name, "grp%02u", (unsigned)i);
- if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(grp) < 0) goto error;
+ if((top_level_gid = H5Gcreate2(fid, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ for(i = 0; i < N_GROUPS; i++) {
+ HDsprintf(name, "grp%02u", (unsigned)i);
+ if((gid = H5Gcreate2(top_level_gid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
}
- return file;
+ return fid;
error:
- HD_exit(1);
-}
+ return H5I_INVALID_HID;
+} /* end create_test_file() */
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Part 1 of a two-part H5Fflush() test.
+ * Purpose: Part 1 of a two-part parallel H5Fflush() test.
*
- * Return: Success: 0
+ * Return: EXIT_FAILURE (always)
*
- * Failure: 1
- *
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, October 23, 1998
*
- * Modifications:
- * Leon Arber
- * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called.
- *
- *
*-------------------------------------------------------------------------
*/
int
main(int argc, char* argv[])
{
- hid_t file1, file2, fapl;
- MPI_File *mpifh_p = NULL;
- char name[1024];
- const char *envval = NULL;
- int mpi_size, mpi_rank;
- MPI_Comm comm = MPI_COMM_WORLD;
- MPI_Info info = MPI_INFO_NULL;
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ MPI_File *mpifh_p = NULL;
+ char name[1024];
+ const char *envval = NULL;
+ int mpi_size;
+ int mpi_rank;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(comm, &mpi_size);
MPI_Comm_rank(comm, &mpi_rank);
- fapl = H5Pcreate(H5P_FILE_ACCESS);
- H5Pset_fapl_mpio(fapl, comm, info);
-
if(mpi_rank == 0)
- TESTING("H5Fflush (part1)");
+ TESTING("H5Fflush (part1)");
+
+ /* Don't run using the split VFD */
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
envval = "nomatch";
- if(HDstrcmp(envval, "split")) {
- /* Create the file */
- h5_fixname(FILENAME[0], fapl, name, sizeof name);
- file1 = create_file(name, fapl);
- /* Flush and exit without closing the library */
- if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
-
- /* Create the other file which will not be flushed */
- h5_fixname(FILENAME[1], fapl, name, sizeof name);
- file2 = create_file(name, fapl);
-
-
- if(mpi_rank == 0)
- PASSED();
- fflush(stdout);
- fflush(stderr);
- } /* end if */
- else {
- SKIPPED();
- puts(" Test not compatible with current Virtual File Driver");
- } /* end else */
-
- /*
- * Some systems like AIX do not like files not closed when MPI_Finalize
+
+ if(!HDstrcmp(envval, "split")) {
+ if(mpi_rank == 0) {
+ SKIPPED();
+ HDputs(" Test not compatible with current Virtual File Driver");
+ }
+ MPI_Finalize();
+ HDexit(EXIT_FAILURE);
+ }
+
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_fapl_mpio(fapl_id, comm, info) < 0)
+ goto error;
+
+ /* Create the file */
+ h5_fixname(FILENAME[0], fapl_id, name, sizeof(name));
+ if((fid1 = create_test_file(name, fapl_id)) < 0)
+ goto error;
+ /* Flush and exit without closing the library */
+ if(H5Fflush(fid1, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Create the other file which will not be flushed */
+ h5_fixname(FILENAME[1], fapl_id, name, sizeof(name));
+ if((fid2 = create_test_file(name, fapl_id)) < 0)
+ goto error;
+
+ if(mpi_rank == 0)
+ PASSED();
+
+ HDfflush(stdout);
+ HDfflush(stderr);
+
+ /* Some systems like AIX do not like files not being closed when MPI_Finalize
* is called. So, we need to get the MPI file handles, close them by hand.
* Then the _exit is still needed to stop at_exit from happening in some systems.
* Note that MPIO VFD returns the address of the file-handle in the VFD struct
* because MPI_File_close wants to modify the file-handle variable.
*/
- /* close file1 */
- if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) {
- printf("H5Fget_vfd_handle for file1 failed\n");
- goto error;
- } /* end if */
- if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
- printf("MPI_File_close for file1 failed\n");
- goto error;
- } /* end if */
- /* close file2 */
- if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) {
- printf("H5Fget_vfd_handle for file2 failed\n");
- goto error;
- } /* end if */
- if(MPI_File_close(mpifh_p) != MPI_SUCCESS) {
- printf("MPI_File_close for file2 failed\n");
- goto error;
- } /* end if */
-
- fflush(stdout);
- fflush(stderr);
- HD_exit(0);
+ /* Close file 1 */
+ if(H5Fget_vfd_handle(fid1, fapl_id, (void **)&mpifh_p) < 0)
+ goto error;
+ if(MPI_File_close(mpifh_p) != MPI_SUCCESS)
+ goto error;
+
+ /* Close file 2 */
+ if(H5Fget_vfd_handle(fid2, fapl_id, (void **)&mpifh_p) < 0)
+ goto error;
+ if(MPI_File_close(mpifh_p) != MPI_SUCCESS)
+ goto error;
+
+ HDfflush(stdout);
+ HDfflush(stderr);
+
+ /* Always exit with a failure code!
+ *
+ * In accordance with the standard, not having all processes
+ * call MPI_Finalize() can be considered an error, so mpiexec
+ * et al. may indicate failure on return. It's much easier to
+ * always ignore the failure condition than to handle some
+ * platforms returning success and others failure.
+ */
+ HD_exit(EXIT_FAILURE);
error:
- fflush(stdout);
- fflush(stderr);
- HD_exit(1);
-}
+ HDfflush(stdout);
+ HDfflush(stderr);
+ HDprintf("*** ERROR ***\n");
+ HDprintf("THERE WAS A REAL ERROR IN t_pflush1.\n");
+ HD_exit(EXIT_FAILURE);
+} /* end main() */
diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c
index bd8ce78..f58e5a5 100644
--- a/testpar/t_pflush2.c
+++ b/testpar/t_pflush2.c
@@ -30,118 +30,124 @@ const char *FILENAME[] = {
NULL
};
-static double the_data[100][100];
+static int data_g[100][100];
+#define N_GROUPS 100
/*-------------------------------------------------------------------------
- * Function: check_file
+ * Function: check_test_file
*
- * Purpose: Part 2 of a two-part H5Fflush() test.
+ * Purpose: Part 2 of a two-part H5Fflush() test.
*
- * Return: Success: 0
+ * Return: SUCCEED/FAIL
*
- * Failure: 1
- *
- * Programmer: Leon Arber
+ * Programmer: Leon Arber
* Sept. 26, 2006.
*
*-------------------------------------------------------------------------
*/
-static int
-check_file(char* name, hid_t fapl)
+static herr_t
+check_test_file(char* name, hid_t fapl_id)
{
- hid_t file, space, dset, groups, grp, plist;
- hsize_t ds_size[2];
- double error;
- hsize_t i, j;
-
- plist = H5Pcreate(H5P_DATASET_XFER);
- H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE);
- if((file = H5Fopen(name, H5F_ACC_RDONLY, fapl)) < 0) goto error;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t top_level_gid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t dxpl_id = H5I_INVALID_HID;
+ hsize_t dims[2];
+ int val;
+ hsize_t i, j;
+
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+ if(H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0)
+ goto error;
+ if((fid = H5Fopen(name, H5F_ACC_RDONLY, fapl_id)) < 0)
+ goto error;
/* Open the dataset */
- if((dset = H5Dopen2(file, "dset", H5P_DEFAULT)) < 0) goto error;
- if((space = H5Dget_space(dset)) < 0) goto error;
- if(H5Sget_simple_extent_dims(space, ds_size, NULL) < 0) goto error;
- assert(100==ds_size[0] && 100==ds_size[1]);
+ if((did = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0)
+ goto error;
+ if((sid = H5Dget_space(did)) < 0)
+ goto error;
+ if(H5Sget_simple_extent_dims(sid, dims, NULL) < 0)
+ goto error;
+ HDassert(100 == dims[0] && 100 == dims[1]);
/* Read some data */
- if (H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, plist,
- the_data) < 0) goto error;
- for (i=0; i<ds_size[0]; i++) {
- for (j=0; j<ds_size[1]; j++) {
- /*
- * The extra cast in the following statement is a bug workaround
- * for the Win32 version 5.0 compiler.
- * 1998-11-06 ptl
- */
- error = fabs(the_data[i][j]-(double)(hssize_t)i/((hssize_t)j+1));
- if (error>0.0001) {
- H5_FAILED();
- printf(" dset[%lu][%lu] = %g\n",
- (unsigned long)i, (unsigned long)j, the_data[i][j]);
- printf(" should be %g\n",
- (double)(hssize_t)i/(hssize_t)(j+1));
- goto error;
- }
- }
+ if(H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data_g) < 0)
+ goto error;
+ for(i = 0; i < dims[0]; i++) {
+ for(j = 0; j < dims[1]; j++) {
+ val = (int)(i + (i * j) + j);
+ if(data_g[i][j] != val) {
+ H5_FAILED();
+ HDprintf(" data_g[%lu][%lu] = %d\n", (unsigned long)i, (unsigned long)j, data_g[i][j]);
+ HDprintf(" should be %d\n", val);
+ }
+ }
}
/* Open some groups */
- if((groups = H5Gopen2(file, "some_groups", H5P_DEFAULT)) < 0) goto error;
- for(i = 0; i < 100; i++) {
- sprintf(name, "grp%02u", (unsigned)i);
- if((grp = H5Gopen2(groups, name, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(grp) < 0) goto error;
+ if((top_level_gid = H5Gopen2(fid, "some_groups", H5P_DEFAULT)) < 0)
+ goto error;
+ for(i = 0; i < N_GROUPS; i++) {
+ HDsprintf(name, "grp%02u", (unsigned)i);
+ if((gid = H5Gopen2(top_level_gid, name, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
}
- if(H5Gclose(groups) < 0) goto error;
- if(H5Dclose(dset) < 0) goto error;
- if(H5Fclose(file) < 0) goto error;
- if(H5Pclose(plist) < 0) goto error;
- if(H5Sclose(space) < 0) goto error;
+ if(H5Gclose(top_level_gid) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+ if(H5Fclose(fid) < 0)
+ goto error;
+ if(H5Pclose(dxpl_id) < 0)
+ goto error;
+ if(H5Sclose(sid) < 0)
+ goto error;
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Pclose(plist);
- H5Gclose(groups);
- H5Dclose(dset);
- H5Fclose(file);
- H5Sclose(space);
+ H5Pclose(dxpl_id);
+ H5Gclose(top_level_gid);
+ H5Dclose(did);
+ H5Fclose(fid);
+ H5Sclose(sid);
+ H5Gclose(gid);
} H5E_END_TRY;
- return 1;
-}
+ return FAIL;
+} /* end check_test_file() */
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Part 2 of a two-part H5Fflush() test.
+ * Function: main
*
- * Return: Success: 0
+ * Purpose: Part 2 of a two-part H5Fflush() test.
*
- * Failure: 1
+ * Return: EXIT_SUCCESS/EXIT_FAIL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, October 23, 1998
*
- * Modifications:
- * Leon Arber
- * Sept. 26, 2006, expand to check for case where the was file not flushed.
- *
*-------------------------------------------------------------------------
*/
int
-main(int argc, char* argv[])
+main(int argc, char *argv[])
{
- hid_t fapl1, fapl2;
+ hid_t fapl_id1 = H5I_INVALID_HID;
+ hid_t fapl_id2 = H5I_INVALID_HID;
H5E_auto2_t func;
-
- char name[1024];
+ char name[1024];
const char *envval = NULL;
- int mpi_size, mpi_rank;
+ int mpi_size;
+ int mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
@@ -149,72 +155,71 @@ main(int argc, char* argv[])
MPI_Comm_size(comm, &mpi_size);
MPI_Comm_rank(comm, &mpi_rank);
- fapl1 = H5Pcreate(H5P_FILE_ACCESS);
- H5Pset_fapl_mpio(fapl1, comm, info);
-
- fapl2 = H5Pcreate(H5P_FILE_ACCESS);
- H5Pset_fapl_mpio(fapl2, comm, info);
-
-
if(mpi_rank == 0)
- TESTING("H5Fflush (part2 with flush)");
+ TESTING("H5Fflush (part2 with flush)");
- /* Don't run this test using the core or split file drivers */
+ /* Don't run using the split VFD */
envval = HDgetenv("HDF5_DRIVER");
- if (envval == NULL)
+ if(envval == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split")) {
- /* Check the case where the file was flushed */
- h5_fixname(FILENAME[0], fapl1, name, sizeof name);
- if(check_file(name, fapl1))
- {
- H5_FAILED()
- goto error;
- }
- else if(mpi_rank == 0)
- {
- PASSED()
- }
-
- /* Check the case where the file was not flushed. This should give an error
- * so we turn off the error stack temporarily */
- if(mpi_rank == 0)
- TESTING("H5Fflush (part2 without flush)");
- H5Eget_auto2(H5E_DEFAULT,&func,NULL);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
-
- h5_fixname(FILENAME[1], fapl2, name, sizeof name);
- if(check_file(name, fapl2))
- {
- if(mpi_rank == 0)
- {
- PASSED()
- }
- }
- else
- {
- H5_FAILED()
- goto error;
- }
- H5Eset_auto2(H5E_DEFAULT, func, NULL);
-
-
- h5_clean_files(&FILENAME[0], fapl1);
- h5_clean_files(&FILENAME[1], fapl2);
+
+ if(!HDstrcmp(envval, "split")) {
+ if(mpi_rank == 0) {
+ SKIPPED();
+ HDputs(" Test not compatible with current Virtual File Driver");
+ }
+ MPI_Finalize();
+ HDexit(EXIT_FAILURE);
}
- else
- {
- SKIPPED();
- puts(" Test not compatible with current Virtual File Driver");
+
+ if((fapl_id1 = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_fapl_mpio(fapl_id1, comm, info) < 0)
+ goto error;
+
+ if((fapl_id2 = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_fapl_mpio(fapl_id2, comm, info) < 0)
+ goto error;
+
+ /* Check the case where the file was flushed */
+ h5_fixname(FILENAME[0], fapl_id1, name, sizeof(name));
+ if(check_test_file(name, fapl_id1)) {
+ H5_FAILED()
+ goto error;
+ }
+ else if(mpi_rank == 0) {
+ PASSED()
}
- MPI_Finalize();
- return 0;
+ /* Check the case where the file was not flushed. This should give an error
+ * so we turn off the error stack temporarily.
+ */
+ if(mpi_rank == 0)
+ TESTING("H5Fflush (part2 without flush)");
+ H5Eget_auto2(H5E_DEFAULT,&func, NULL);
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+
+ h5_fixname(FILENAME[1], fapl_id2, name, sizeof(name));
+ if(check_test_file(name, fapl_id2)) {
+ if(mpi_rank == 0)
+ PASSED()
+ }
+ else {
+ H5_FAILED()
+ goto error;
+ }
+
+ H5Eset_auto2(H5E_DEFAULT, func, NULL);
- error:
- return 1;
-}
+ h5_clean_files(&FILENAME[0], fapl_id1);
+ h5_clean_files(&FILENAME[1], fapl_id2);
+ MPI_Finalize();
+ HDexit(EXIT_SUCCESS);
+error:
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 4c139b3..caaf14c 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -12,7 +12,7 @@
/*
This program will test independant and collective reads and writes between
- selections of different rank that non-the-less are deemed as having the
+ selections of different rank that non-the-less are deemed as having the
same shape by H5Sselect_shape_same().
*/
@@ -31,24 +31,24 @@
/* On Lustre (and perhaps other parallel file systems?), we have severe
* slow downs if two or more processes attempt to access the same file system
* block. To minimize this problem, we set alignment in the shape same tests
- * to the default Lustre block size -- which greatly reduces contention in
+ * to the default Lustre block size -- which greatly reduces contention in
* the chunked dataset case.
*/
-#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024))
+#define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024))
-#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */
+#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */
struct hs_dr_pio_test_vars_t
{
- int mpi_size;
+ int mpi_size;
int mpi_rank;
MPI_Comm mpi_comm;
- MPI_Info mpi_info;
+ MPI_Info mpi_info;
int test_num;
int edge_size;
- int checker_edge_size;
+ int checker_edge_size;
int chunk_edge_size;
int small_rank;
int large_rank;
@@ -64,13 +64,13 @@ struct hs_dr_pio_test_vars_t
int small_ds_offset;
int large_ds_offset;
hid_t fid; /* HDF5 file ID */
- hid_t xfer_plist;
+ hid_t xfer_plist;
hid_t full_mem_small_ds_sid;
hid_t full_file_small_ds_sid;
hid_t mem_small_ds_sid;
hid_t file_small_ds_sid_0;
hid_t file_small_ds_sid_1;
- hid_t small_ds_slice_sid;
+ hid_t small_ds_slice_sid;
hid_t full_mem_large_ds_sid;
hid_t full_file_large_ds_sid;
hid_t mem_large_ds_sid;
@@ -78,7 +78,7 @@ struct hs_dr_pio_test_vars_t
hid_t file_large_ds_sid_1;
hid_t file_large_ds_process_slice_sid;
hid_t mem_large_ds_process_slice_sid;
- hid_t large_ds_slice_sid;
+ hid_t large_ds_slice_sid;
hid_t small_dataset; /* Dataset ID */
hid_t large_dataset; /* Dataset ID */
size_t small_ds_size;
@@ -96,25 +96,21 @@ struct hs_dr_pio_test_vars_t
hsize_t * count_ptr;
hsize_t * block_ptr;
int skips;
- int max_skips;
- int64_t total_tests;
- int64_t tests_run;
- int64_t tests_skipped;
+ int max_skips;
+ int64_t total_tests;
+ int64_t tests_run;
+ int64_t tests_skipped;
};
/*-------------------------------------------------------------------------
- * Function: hs_dr_pio_test__setup()
+ * Function: hs_dr_pio_test__setup()
*
- * Purpose: Do setup for tests of I/O to/from hyperslab selections of
- * different rank in the parallel case.
+ * Purpose: Do setup for tests of I/O to/from hyperslab selections of
+ * different rank in the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/9/11
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 8/9/11
*
*-------------------------------------------------------------------------
*/
@@ -133,21 +129,21 @@ hs_dr_pio_test__setup(const int test_num,
const int express_test,
struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
const char *fcnName = "hs_dr_pio_test__setup()";
#endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */
const char *filename;
- hbool_t mis_match = FALSE;
- int i;
+ hbool_t mis_match = FALSE;
+ int i;
int mrc;
- int mpi_rank; /* needed by the VRFY macro */
- uint32_t expected_value;
+ int mpi_rank; /* needed by the VRFY macro */
+ uint32_t expected_value;
uint32_t * ptr_0;
uint32_t * ptr_1;
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hid_t small_ds_dcpl_id = H5P_DEFAULT;
hid_t large_ds_dcpl_id = H5P_DEFAULT;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
HDassert( edge_size >= 6 );
HDassert( edge_size >= chunk_edge_size );
@@ -219,7 +215,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size);
VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded");
- tv_ptr->small_ds_slice_buf =
+ tv_ptr->small_ds_slice_buf =
(uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded");
@@ -232,7 +228,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size);
VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded");
- tv_ptr->large_ds_slice_buf =
+ tv_ptr->large_ds_slice_buf =
(uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size);
VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded");
@@ -256,21 +252,21 @@ hs_dr_pio_test__setup(const int test_num,
filename = (const char *)GetTestParameters();
HDassert( filename != NULL );
-#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "%d: test num = %d.\n", tv_ptr->mpi_rank, tv_ptr->test_num);
HDfprintf(stdout, "%d: mpi_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->mpi_size);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%d: small/large rank = %d/%d, use_collective_io = %d.\n",
- tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank,
+ tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank,
(int)use_collective_io);
HDfprintf(stdout, "%d: edge_size = %d, chunk_edge_size = %d.\n",
tv_ptr->mpi_rank, tv_ptr->edge_size, tv_ptr->chunk_edge_size);
HDfprintf(stdout, "%d: checker_edge_size = %d.\n",
tv_ptr->mpi_rank, tv_ptr->checker_edge_size);
HDfprintf(stdout, "%d: small_ds_size = %d, large_ds_size = %d.\n",
- tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size),
+ tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size),
(int)(tv_ptr->large_ds_size));
HDfprintf(stdout, "%d: filename = %s.\n", tv_ptr->mpi_rank, filename);
}
@@ -305,78 +301,78 @@ hs_dr_pio_test__setup(const int test_num,
/* setup dims: */
tv_ptr->dims[0] = (hsize_t)(tv_ptr->mpi_size + 1);
- tv_ptr->dims[1] = tv_ptr->dims[2] =
+ tv_ptr->dims[1] = tv_ptr->dims[2] =
tv_ptr->dims[3] = tv_ptr->dims[4] = (hsize_t)(tv_ptr->edge_size);
/* Create small ds dataspaces */
- tv_ptr->full_mem_small_ds_sid =
+ tv_ptr->full_mem_small_ds_sid =
H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_mem_small_ds_sid != 0),
+ VRFY((tv_ptr->full_mem_small_ds_sid != 0),
"H5Screate_simple() full_mem_small_ds_sid succeeded");
- tv_ptr->full_file_small_ds_sid =
+ tv_ptr->full_file_small_ds_sid =
H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_file_small_ds_sid != 0),
+ VRFY((tv_ptr->full_file_small_ds_sid != 0),
"H5Screate_simple() full_file_small_ds_sid succeeded");
tv_ptr->mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_small_ds_sid != 0),
+ VRFY((tv_ptr->mem_small_ds_sid != 0),
"H5Screate_simple() mem_small_ds_sid succeeded");
tv_ptr->file_small_ds_sid_0 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_small_ds_sid_0 != 0),
+ VRFY((tv_ptr->file_small_ds_sid_0 != 0),
"H5Screate_simple() file_small_ds_sid_0 succeeded");
/* used by checker board tests only */
tv_ptr->file_small_ds_sid_1 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_small_ds_sid_1 != 0),
+ VRFY((tv_ptr->file_small_ds_sid_1 != 0),
"H5Screate_simple() file_small_ds_sid_1 succeeded");
- tv_ptr->small_ds_slice_sid =
+ tv_ptr->small_ds_slice_sid =
H5Screate_simple(tv_ptr->small_rank - 1, &(tv_ptr->dims[1]), NULL);
- VRFY((tv_ptr->small_ds_slice_sid != 0),
+ VRFY((tv_ptr->small_ds_slice_sid != 0),
"H5Screate_simple() small_ds_slice_sid succeeded");
/* Create large ds dataspaces */
- tv_ptr->full_mem_large_ds_sid =
+ tv_ptr->full_mem_large_ds_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_mem_large_ds_sid != 0),
+ VRFY((tv_ptr->full_mem_large_ds_sid != 0),
"H5Screate_simple() full_mem_large_ds_sid succeeded");
- tv_ptr->full_file_large_ds_sid =
+ tv_ptr->full_file_large_ds_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->full_file_large_ds_sid != FAIL),
+ VRFY((tv_ptr->full_file_large_ds_sid != FAIL),
"H5Screate_simple() full_file_large_ds_sid succeeded");
tv_ptr->mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_large_ds_sid != FAIL),
+ VRFY((tv_ptr->mem_large_ds_sid != FAIL),
"H5Screate_simple() mem_large_ds_sid succeeded");
tv_ptr->file_large_ds_sid_0 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_sid_0 != FAIL),
+ VRFY((tv_ptr->file_large_ds_sid_0 != FAIL),
"H5Screate_simple() file_large_ds_sid_0 succeeded");
/* used by checker board tests only */
tv_ptr->file_large_ds_sid_1 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_sid_1 != FAIL),
+ VRFY((tv_ptr->file_large_ds_sid_1 != FAIL),
"H5Screate_simple() file_large_ds_sid_1 succeeded");
- tv_ptr->mem_large_ds_process_slice_sid =
+ tv_ptr->mem_large_ds_process_slice_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL),
+ VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL),
"H5Screate_simple() mem_large_ds_process_slice_sid succeeded");
- tv_ptr->file_large_ds_process_slice_sid =
+ tv_ptr->file_large_ds_process_slice_sid =
H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL);
- VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL),
+ VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL),
"H5Screate_simple() file_large_ds_process_slice_sid succeeded");
- tv_ptr->large_ds_slice_sid =
+ tv_ptr->large_ds_slice_sid =
H5Screate_simple(tv_ptr->large_rank - 1, &(tv_ptr->dims[1]), NULL);
- VRFY((tv_ptr->large_ds_slice_sid != 0),
+ VRFY((tv_ptr->large_ds_slice_sid != 0),
"H5Screate_simple() large_ds_slice_sid succeeded");
@@ -386,18 +382,18 @@ hs_dr_pio_test__setup(const int test_num,
*/
if ( tv_ptr->chunk_edge_size > 0 ) {
- /* Under Lustre (and perhaps other parallel file systems?) we get
- * locking delays when two or more processes attempt to access the
+ /* Under Lustre (and perhaps other parallel file systems?) we get
+ * locking delays when two or more processes attempt to access the
* same file system block.
*
- * To minimize this problem, I have changed chunk_dims[0]
+ * To minimize this problem, I have changed chunk_dims[0]
* from (mpi_size + 1) to just when any sort of express test is
- * selected. Given the structure of the test, and assuming we
- * set the alignment large enough, this avoids the contention
- * issue by seeing to it that each chunk is only accessed by one
+ * selected. Given the structure of the test, and assuming we
+ * set the alignment large enough, this avoids the contention
+ * issue by seeing to it that each chunk is only accessed by one
* process.
*
- * One can argue as to whether this is a good thing to do in our
+ * One can argue as to whether this is a good thing to do in our
* tests, but for now it is necessary if we want the test to complete
* in a reasonable amount of time.
*
@@ -411,8 +407,8 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->chunk_dims[0] = 1;
}
- tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] =
- tv_ptr->chunk_dims[3] =
+ tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] =
+ tv_ptr->chunk_dims[3] =
tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size);
small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
@@ -511,7 +507,7 @@ hs_dr_pio_test__setup(const int test_num,
/* write the initial value of the small data set to file */
- ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid,
+ ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid,
tv_ptr->file_small_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded");
@@ -524,8 +520,8 @@ hs_dr_pio_test__setup(const int test_num,
VRFY((mrc==MPI_SUCCESS), "Sync after small dataset writes");
}
- /* read the small data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the small data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set and verifies it.
*/
ret = H5Dread(tv_ptr->small_dataset,
@@ -574,8 +570,8 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->count,
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded");
-
- /* In passing, setup the process slice data spaces as well */
+
+ /* In passing, setup the process slice dataspaces as well */
ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid,
H5S_SELECT_SET,
@@ -583,7 +579,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->stride,
tv_ptr->count,
tv_ptr->block);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded");
ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_process_slice_sid,
@@ -592,7 +588,7 @@ hs_dr_pio_test__setup(const int test_num,
tv_ptr->stride,
tv_ptr->count,
tv_ptr->block);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded");
if ( MAINPROCESS ) { /* add an additional slice to the selections */
@@ -618,8 +614,8 @@ hs_dr_pio_test__setup(const int test_num,
/* write the initial value of the large data set to file */
- ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type,
- tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0,
+ ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type,
+ tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0);
if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr);
VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded");
@@ -633,8 +629,8 @@ hs_dr_pio_test__setup(const int test_num,
}
- /* read the large data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the large data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set.
*/
ret = H5Dread(tv_ptr->large_dataset,
@@ -678,18 +674,14 @@ hs_dr_pio_test__setup(const int test_num,
/*-------------------------------------------------------------------------
- * Function: hs_dr_pio_test__takedown()
+ * Function: hs_dr_pio_test__takedown()
*
- * Purpose: Do takedown after tests of I/O to/from hyperslab selections
- * of different rank in the parallel case.
+ * Purpose: Do takedown after tests of I/O to/from hyperslab selections
+ * of different rank in the parallel case.
*
- * Return: void
- *
- * Programmer: JRM -- 9/18/09
- *
- * Modifications:
+ * Return: void
*
- * None.
+ * Programmer: JRM -- 9/18/09
*
*-------------------------------------------------------------------------
*/
@@ -699,11 +691,11 @@ hs_dr_pio_test__setup(const int test_num,
static void
hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG
+#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG
const char *fcnName = "hs_dr_pio_test__takedown()";
#endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */
- int mpi_rank; /* needed by the VRFY macro */
- herr_t ret; /* Generic return value */
+ int mpi_rank; /* needed by the VRFY macro */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -787,27 +779,23 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__d2m_l2s()
+ * Function: contig_hs_dr_pio_test__d2m_l2s()
*
- * Purpose: Part one of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part one of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * In this function, we test this by reading small_rank - 1
- * slices from the on disk large cube, and verifying that the
- * data read is correct. Verify that H5S_select_shape_same()
- * returns true on the memory and file selections.
+ * In this function, we test this by reading small_rank - 1
+ * slices from the on disk large cube, and verifying that the
+ * data read is correct. Verify that H5S_select_shape_same()
+ * returns true on the memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/10/11
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 9/10/11
*
*-------------------------------------------------------------------------
*/
@@ -817,24 +805,24 @@ hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__run_test()";
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
- uint32_t expected_value;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* We have already done a H5Sselect_all() on the data space
- * small_ds_slice_sid in the initialization phase, so no need to
+ /* We have already done a H5Sselect_all() on the dataspace
+ * small_ds_slice_sid in the initialization phase, so no need to
* call H5Sselect_all() again.
*/
@@ -859,16 +847,16 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the buffer we will be reading into */
HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout,
"%s reading slices from big cube on disk into small cube slice.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set. However, in the parallel version, each
+ * of the large data set. However, in the parallel version, each
* process only works with that slice of the large cube indicated
- * by its rank -- hence we set the most slowly changing index to
+ * by its rank -- hence we set the most slowly changing index to
* mpi_rank, and don't itterate over it.
*/
@@ -881,9 +869,9 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -907,7 +895,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -921,14 +909,14 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
do {
if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */
- (tv_ptr->tests_skipped)++;
+ (tv_ptr->tests_skipped)++;
} else { /* run the test */
tv_ptr->skips = 0; /* reset the skips counter */
- /* we know that small_rank - 1 >= 1 and that
- * large_rank > small_rank by the assertions at the head
+ /* we know that small_rank - 1 >= 1 and that
+ * large_rank > small_rank by the assertions at the head
* of this function. Thus no need for another inner loop.
*/
tv_ptr->start[0] = (hsize_t)i;
@@ -943,7 +931,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab(file_large_cube_sid) succeeded");
@@ -956,11 +944,11 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, (int)(tv_ptr->mpi_rank),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n",
fcnName,
@@ -981,7 +969,7 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
mis_match = FALSE;
ptr_1 = tv_ptr->small_ds_slice_buf;
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1000,10 +988,10 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
expected_value++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice read from large ds data good.");
- (tv_ptr->tests_run)++;
+ (tv_ptr->tests_run)++;
}
l++;
@@ -1028,27 +1016,23 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__d2m_s2l()
- *
- * Purpose: Part two of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
- *
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Function: contig_hs_dr_pio_test__d2m_s2l()
*
- * In this function, we test this by reading slices of the
- * on disk small data set into slices through the in memory
- * large data set, and verify that the correct data (and
- * only the correct data) is read.
+ * Purpose: Part two of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Return: void
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Programmer: JRM -- 8/10/11
+ * In this function, we test this by reading slices of the
+ * on disk small data set into slices through the in memory
+ * large data set, and verify that the correct data (and
+ * only the correct data) is read.
*
- * Modifications:
+ * Return: void
*
- * None.
+ * Programmer: JRM -- 8/10/11
*
*-------------------------------------------------------------------------
*/
@@ -1058,25 +1042,25 @@ contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__d2m_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* Read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -1102,8 +1086,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded");
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout,
"%s reading slices of on disk small data set into slices of big data set.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
@@ -1131,11 +1115,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -1149,9 +1133,9 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1175,7 +1159,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1211,7 +1195,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab(mem_large_ds_sid) succeeded");
@@ -1224,11 +1208,11 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, (int)(tv_ptr->mpi_rank),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1250,7 +1234,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
expected_value = (uint32_t)
((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1283,7 +1267,7 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice read from large ds data good.");
(tv_ptr->tests_run)++;
@@ -1311,29 +1295,25 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__m2d_l2s()
+ * Function: contig_hs_dr_pio_test__m2d_l2s()
*
- * Purpose: Part three of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part three of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Do this by writing small_rank - 1 dimensional slices from
- * the in memory large data set to the on disk small cube
- * dataset. After each write, read the slice of the small
- * dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same()
- * returns true on the memory and file selections.
+ * Do this by writing small_rank - 1 dimensional slices from
+ * the in memory large data set to the on disk small cube
+ * dataset. After each write, read the slice of the small
+ * dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same()
+ * returns true on the memory and file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/10/11
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 8/10/11
*
*-------------------------------------------------------------------------
*/
@@ -1343,19 +1323,19 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__m2d_l2s()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -1365,10 +1345,10 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* from memory to file using selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
*
- * Start by writing small_rank - 1 dimensional slices from the in memory large
- * data set to the on disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same() returns true on
+ * Start by writing small_rank - 1 dimensional slices from the in memory large
+ * data set to the on disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
@@ -1424,18 +1404,18 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size);
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout,
"%s writing slices from big ds to slices of small ds on disk.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -1449,9 +1429,9 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1476,7 +1456,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1525,7 +1505,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret >= 0),
+ VRFY((ret >= 0),
"H5Sselect_hyperslab() mem_large_ds_sid succeeded.");
@@ -1538,13 +1518,13 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed.");
- /* write the slice from the in memory large data set to the
+ /* write the slice from the in memory large data set to the
* slice of the on disk small dataset. */
-#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1576,7 +1556,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1 = tv_ptr->small_ds_buf_1;
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -1611,7 +1591,7 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small slice write from large ds data good.");
(tv_ptr->tests_run)++;
@@ -1639,31 +1619,27 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__m2d_s2l()
- *
- * Purpose: Part four of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Function: contig_hs_dr_pio_test__m2d_s2l()
*
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Purpose: Part four of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Do this by writing the contents of the process's slice of
- * the in memory small data set to slices of the on disk
- * large data set. After each write, read the process's
- * slice of the large data set back into memory, and verify
- * that it contains the expected data.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Verify that H5S_select_shape_same() returns true on the
- * memory and file selections.
+ * Do this by writing the contents of the process's slice of
+ * the in memory small data set to slices of the on disk
+ * large data set. After each write, read the process's
+ * slice of the large data set back into memory, and verify
+ * that it contains the expected data.
*
- * Return: void
+ * Verify that H5S_select_shape_same() returns true on the
+ * memory and file selections.
*
- * Programmer: JRM -- 8/10/11
+ * Return: void
*
- * Modifications:
- *
- * None
+ * Programmer: JRM -- 8/10/11
*
*-------------------------------------------------------------------------
*/
@@ -1673,32 +1649,32 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__m2d_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
- hbool_t mis_match = FALSE;
- int i, j, k, l;
- size_t n;
- int mpi_rank; /* needed by the VRFY macro */
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
+ size_t n;
+ int mpi_rank; /* needed by the VRFY macro */
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
- /* select the slice of the in memory small data set associated with
+ /* select the slice of the in memory small data set associated with
* the process's mpi rank.
*/
tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank);
@@ -1745,8 +1721,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the in memory large ds */
HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size);
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout,
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout,
"%s writing process slices of small ds to slices of large ds on disk.\n",
fcnName);
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
@@ -1760,9 +1736,9 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -1786,7 +1762,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -1802,18 +1778,18 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
(tv_ptr->tests_skipped)++;
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
tv_ptr->start[0] = (hsize_t)i;
tv_ptr->start[1] = (hsize_t)j;
tv_ptr->start[2] = (hsize_t)k;
tv_ptr->start[3] = (hsize_t)l;
tv_ptr->start[4] = 0;
- HDfprintf(stdout,
- "%s:%d: skipping test with start = %d %d %d %d %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: skipping test with start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1857,7 +1833,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->stride_ptr,
tv_ptr->count_ptr,
tv_ptr->block_ptr);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Sselect_hyperslab() target large ds slice succeeded");
@@ -1871,14 +1847,14 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed");
- /* write the small data set slice from memory to the
- * target slice of the disk data set
+ /* write the small data set slice from memory to the
+ * target slice of the disk data set
*/
-#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, (int)(tv_ptr->mpi_rank),
- (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
- (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
+ (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]),
+ (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]),
(int)(tv_ptr->start[4]));
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -1891,11 +1867,11 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_0);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dwrite of small ds slice to large ds succeeded");
- /* read this processes slice on the on disk large
+ /* read this processes slice on the on disk large
* data set into memory.
*/
@@ -1905,7 +1881,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_process_slice_sid,
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_1);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dread() of process slice of large ds succeeded");
@@ -1914,12 +1890,12 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*/
ptr_1 = tv_ptr->large_ds_buf_1;
expected_value = (uint32_t)
- ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
+ ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
- (j * tv_ptr->edge_size * tv_ptr->edge_size *
+ (j * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
@@ -1951,7 +1927,7 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((mis_match == FALSE),
+ VRFY((mis_match == FALSE),
"small ds slice write to large ds slice data good.");
(tv_ptr->tests_run)++;
@@ -1979,29 +1955,29 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test__run_test()
+ * Function: contig_hs_dr_pio_test__run_test()
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * JRM -- 9/16/10
- * Added express_test parameter. Use it to control whether
- * we set up the chunks so that no chunk is shared between
- * processes, and also whether we set an alignment when we
- * create the test file.
+ * JRM -- 9/16/10
+ * Added express_test parameter. Use it to control whether
+ * we set up the chunks so that no chunk is shared between
+ * processes, and also whether we set an alignment when we
+ * create the test file.
*
- * JRM -- 8/11/11
- * Refactored function heavily & broke it into six functions.
- * Added the skips_ptr, max_skips, total_tests_ptr,
- * tests_run_ptr, and tests_skiped_ptr parameters to support
- * skipping portions of the test according to the express
- * test value.
+ * JRM -- 8/11/11
+ * Refactored function heavily & broke it into six functions.
+ * Added the skips_ptr, max_skips, total_tests_ptr,
+ * tests_run_ptr, and tests_skiped_ptr parameters to support
+ * skipping portions of the test according to the express
+ * test value.
*
*-------------------------------------------------------------------------
*/
@@ -2023,13 +1999,13 @@ contig_hs_dr_pio_test__run_test(const int test_num,
int64_t * tests_run_ptr,
int64_t * tests_skipped_ptr)
{
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__run_test()";
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank;
- struct hs_dr_pio_test_vars_t test_vars =
+ int mpi_rank;
+ struct hs_dr_pio_test_vars_t test_vars =
{
- /* int mpi_size = */ -1,
+ /* int mpi_size = */ -1,
/* int mpi_rank = */ -1,
/* MPI_Comm mpi_comm = */ MPI_COMM_NULL,
/* MPI_Inf mpi_info = */ MPI_INFO_NULL,
@@ -2045,7 +2021,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/* uint32_t * small_ds_buf_2 = */ NULL,
/* uint32_t * small_ds_slice_buf = */ NULL,
/* uint32_t * large_ds_buf_0 = */ NULL,
- /* uint32_t * large_ds_buf_1 = */ NULL,
+ /* uint32_t * large_ds_buf_1 = */ NULL,
/* uint32_t * large_ds_buf_2 = */ NULL,
/* uint32_t * large_ds_slice_buf = */ NULL,
/* int small_ds_offset = */ -1,
@@ -2082,8 +2058,8 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/* hsize_t * stride_ptr = */ NULL,
/* hsize_t * count_ptr = */ NULL,
/* hsize_t * block_ptr = */ NULL,
- /* int skips = */ 0,
- /* int max_skips = */ 0,
+ /* int skips = */ 0,
+ /* int max_skips = */ 0,
/* int64_t total_tests = */ 0,
/* int64_t tests_run = */ 0,
/* int64_t tests_skipped = */ 0
@@ -2101,7 +2077,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
tv_ptr->skips = *skips_ptr;
tv_ptr->max_skips = max_skips;
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n",
test_num, small_rank, large_rank);
@@ -2113,12 +2089,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading small_rank - 1 dimensional slice from the on disk
- * large cube, and verifying that the data read is correct. Verify that
+ * Start by reading small_rank - 1 dimensional slice from the on disk
+ * large cube, and verifying that the data read is correct. Verify that
* H5S_select_shape_same() returns true on the memory and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_l2s.\n", test_num);
}
@@ -2126,12 +2102,12 @@ contig_hs_dr_pio_test__run_test(const int test_num,
contig_hs_dr_pio_test__d2m_l2s(tv_ptr);
- /* Second, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* Second, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_s2l.\n", test_num);
}
@@ -2144,13 +2120,13 @@ contig_hs_dr_pio_test__run_test(const int test_num,
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify that it contains
- * the expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify that it contains
+ * the expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_l2s.\n", test_num);
}
@@ -2158,25 +2134,25 @@ contig_hs_dr_pio_test__run_test(const int test_num,
contig_hs_dr_pio_test__m2d_l2s(tv_ptr);
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_s2l.\n", test_num);
}
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
contig_hs_dr_pio_test__m2d_s2l(tv_ptr);
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
- HDfprintf(stdout,
- "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout,
+ "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped),
(long long)(tv_ptr->total_tests));
}
@@ -2184,7 +2160,7 @@ contig_hs_dr_pio_test__run_test(const int test_num,
hs_dr_pio_test__takedown(tv_ptr);
-#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
+#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
HDfprintf(stdout, "test %d: Takedown complete.\n", test_num);
}
@@ -2201,58 +2177,58 @@ contig_hs_dr_pio_test__run_test(const int test_num,
/*-------------------------------------------------------------------------
- * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
+ * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel case.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * Modified function to take a sample of the run times
- * of the different tests, and skip some of them if
- * run times are too long.
+ * Modified function to take a sample of the run times
+ * of the different tests, and skip some of them if
+ * run times are too long.
*
- * We need to do this because Lustre runns very slowly
- * if two or more processes are banging on the same
- * block of memory.
- * JRM -- 9/10/10
+ * We need to do this because Lustre runns very slowly
+ * if two or more processes are banging on the same
+ * block of memory.
+ * JRM -- 9/10/10
* Break this one big test into 4 smaller tests according
* to {independent,collective}x{contigous,chunked} datasets.
- * AKC -- 2010/01/14
+ * AKC -- 2010/01/14
*
*-------------------------------------------------------------------------
*/
#define CONTIG_HS_DR_PIO_TEST__DEBUG 0
-void
+static void
contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
{
int express_test;
int local_express_test;
int mpi_rank = -1;
int mpi_size;
- int test_num = 0;
- int edge_size;
- int chunk_edge_size = 0;
- int small_rank;
- int large_rank;
- int mpi_result;
- int skips = 0;
- int max_skips = 0;
- /* The following table list the number of sub-tests skipped between
- * each test that is actually executed as a function of the express
+ int test_num = 0;
+ int edge_size;
+ int chunk_edge_size = 0;
+ int small_rank;
+ int large_rank;
+ int mpi_result;
+ int skips = 0;
+ int max_skips = 0;
+ /* The following table list the number of sub-tests skipped between
+ * each test that is actually executed as a function of the express
* test level. Note that any value in excess of 4880 will cause all
* sub tests to be skipped.
*/
int max_skips_tbl[4] = {0, 4, 64, 1024};
- hid_t dset_type = H5T_NATIVE_UINT;
- int64_t total_tests = 0;
- int64_t tests_run = 0;
+ hid_t dset_type = H5T_NATIVE_UINT;
+ int64_t total_tests = 0;
+ int64_t tests_run = 0;
int64_t tests_skipped = 0;
HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
@@ -2295,7 +2271,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- FALSE,
+ FALSE,
dset_type,
express_test,
&skips,
@@ -2316,7 +2292,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- TRUE,
+ TRUE,
dset_type,
express_test,
&skips,
@@ -2337,7 +2313,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- FALSE,
+ FALSE,
dset_type,
express_test,
&skips,
@@ -2358,7 +2334,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
chunk_edge_size,
small_rank,
large_rank,
- TRUE,
+ TRUE,
dset_type,
express_test,
&skips,
@@ -2377,7 +2353,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
} /* end of switch(sstest_type) */
#if CONTIG_HS_DR_PIO_TEST__DEBUG
if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) {
- HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n",
tests_run, tests_skipped, total_tests);
}
#endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */
@@ -2385,7 +2361,7 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
}
if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) {
- HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n",
+ HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n",
tests_skipped, total_tests);
}
@@ -2396,24 +2372,24 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
/****************************************************************
**
-** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
-** Given a data space of tgt_rank, and dimensions:
+** ckrbrd_hs_dr_pio_test__slct_ckrbrd():
+** Given a dataspace of tgt_rank, and dimensions:
**
-** (mpi_size + 1), edge_size, ... , edge_size
+** (mpi_size + 1), edge_size, ... , edge_size
**
-** edge_size, and a checker_edge_size, select a checker
-** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** edge_size, and a checker_edge_size, select a checker
+** board selection of a sel_rank (sel_rank < tgt_rank)
+** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
-** higher indicies) as indicated by the start array.
+** higher indicies) as indicated by the start array.
**
-** Note that this function, like all its relatives, is
-** hard coded to presume a maximum data space rank of 5.
-** While this maximum is declared as a constant, increasing
-** it will require extensive coding in addition to changing
+** Note that this function, like all its relatives, is
+** hard coded to presume a maximum dataspace rank of 5.
+** While this maximum is declared as a constant, increasing
+** it will require extensive coding in addition to changing
** the value of the constant.
**
-** JRM -- 10/8/09
+** JRM -- 10/8/09
**
****************************************************************/
@@ -2428,22 +2404,22 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
const int sel_rank,
hsize_t sel_start[])
{
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
- const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():";
-#endif
- hbool_t first_selection = TRUE;
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+ const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():";
+#endif
+ hbool_t first_selection = TRUE;
int i, j, k, l, m;
- int n_cube_offset;
- int sel_offset;
- const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */
+ int n_cube_offset;
+ int sel_offset;
+ const int test_max_rank = PAR_SS_DR_MAX_RANK; /* must update code if */
/* this changes */
- hsize_t base_count;
+ hsize_t base_count;
hsize_t offset_count;
- hsize_t start[PAR_SS_DR_MAX_RANK];
- hsize_t stride[PAR_SS_DR_MAX_RANK];
- hsize_t count[PAR_SS_DR_MAX_RANK];
- hsize_t block[PAR_SS_DR_MAX_RANK];
- herr_t ret; /* Generic return value */
+ hsize_t start[PAR_SS_DR_MAX_RANK];
+ hsize_t stride[PAR_SS_DR_MAX_RANK];
+ hsize_t count[PAR_SS_DR_MAX_RANK];
+ hsize_t block[PAR_SS_DR_MAX_RANK];
+ herr_t ret; /* Generic return value */
HDassert( edge_size >= 6 );
HDassert( 0 < checker_edge_size );
@@ -2460,14 +2436,14 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
HDassert( n_cube_offset >= 0 );
HDassert( n_cube_offset <= sel_offset );
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n",
fcnName, mpi_rank, edge_size, checker_edge_size);
- HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
fcnName, mpi_rank, sel_rank, sel_offset);
- HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n",
fcnName, mpi_rank, tgt_rank, n_cube_offset);
-#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* First, compute the base count (which assumes start == 0
* for the associated offset) and offset_count (which
@@ -2497,7 +2473,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
}
/* Now set up the stride and block arrays, and portions of the start
- * and count arrays that will not be altered during the selection of
+ * and count arrays that will not be altered during the selection of
* the checker board.
*/
i = 0;
@@ -2529,7 +2505,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
i++;
}
-
+
i = 0;
do {
if ( 0 >= sel_offset ) {
@@ -2548,7 +2524,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
}
j = 0;
- do {
+ do {
if ( 1 >= sel_offset ) {
if ( j == 0 ) {
@@ -2617,62 +2593,62 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
if ( ((i + j + k + l + m) % 2) == 0 ) {
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
- HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n",
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+ HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n",
fcnName, mpi_rank, (int)first_selection);
HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n",
fcnName, mpi_rank, i, j, k, l, m);
- HDfprintf(stdout,
- "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)start[0], (int)start[1],
+ HDfprintf(stdout,
+ "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)start[0], (int)start[1],
(int)start[2], (int)start[3], (int)start[4]);
- HDfprintf(stdout,
- "%s:%d: stride = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)stride[0], (int)stride[1],
+ HDfprintf(stdout,
+ "%s:%d: stride = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)stride[0], (int)stride[1],
(int)stride[2], (int)stride[3], (int)stride[4]);
- HDfprintf(stdout,
- "%s:%d: count = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)count[0], (int)count[1],
+ HDfprintf(stdout,
+ "%s:%d: count = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)count[0], (int)count[1],
(int)count[2], (int)count[3], (int)count[4]);
- HDfprintf(stdout,
- "%s:%d: block = %d %d %d %d %d.\n",
- fcnName, mpi_rank, (int)block[0], (int)block[1],
+ HDfprintf(stdout,
+ "%s:%d: block = %d %d %d %d %d.\n",
+ fcnName, mpi_rank, (int)block[0], (int)block[1],
(int)block[2], (int)block[3], (int)block[4]);
- HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n",
+ HDfprintf(stdout, "%s:%d: n-cube extent dims = %d.\n",
fcnName, mpi_rank,
H5Sget_simple_extent_ndims(tgt_sid));
- HDfprintf(stdout, "%s:%d: selection rank = %d.\n",
+ HDfprintf(stdout, "%s:%d: selection rank = %d.\n",
fcnName, mpi_rank, sel_rank);
#endif
if ( first_selection ) {
- first_selection = FALSE;
+ first_selection = FALSE;
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_SET,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded");
} else {
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_OR,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded");
}
@@ -2704,12 +2680,12 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
} while ( ( i <= 1 ) &&
( 0 >= sel_offset ) );
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */
- /* Clip the selection back to the data space proper. */
+ /* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@@ -2724,7 +2700,7 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded");
-#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
HDfprintf(stdout, "%s%d: done.\n", fcnName, mpi_rank);
@@ -2737,57 +2713,57 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank,
/****************************************************************
**
-** ckrbrd_hs_dr_pio_test__verify_data():
+** ckrbrd_hs_dr_pio_test__verify_data():
**
-** Examine the supplied buffer to see if it contains the
-** expected data. Return TRUE if it does, and FALSE
+** Examine the supplied buffer to see if it contains the
+** expected data. Return TRUE if it does, and FALSE
** otherwise.
**
-** The supplied buffer is presumed to this process's slice
-** of the target data set. Each such slice will be an
-** n-cube of rank (rank -1) and the supplied edge_size with
-** origin (mpi_rank, 0, ... , 0) in the target data set.
+** The supplied buffer is presumed to this process's slice
+** of the target data set. Each such slice will be an
+** n-cube of rank (rank -1) and the supplied edge_size with
+** origin (mpi_rank, 0, ... , 0) in the target data set.
**
-** Further, the buffer is presumed to be the result of reading
-** or writing a checker board selection of an m (1 <= m <
+** Further, the buffer is presumed to be the result of reading
+** or writing a checker board selection of an m (1 <= m <
** rank) dimensional slice through this processes slice
-** of the target data set. Also, this slice must be parallel
-** to the fastest changing indicies.
+** of the target data set. Also, this slice must be parallel
+** to the fastest changing indicies.
**
-** It is further presumed that the buffer was zeroed before
-** the read/write, and that the full target data set (i.e.
-** the buffer/data set for all processes) was initialized
-** with the natural numbers listed in order from the origin
-** along the fastest changing axis.
+** It is further presumed that the buffer was zeroed before
+** the read/write, and that the full target data set (i.e.
+** the buffer/data set for all processes) was initialized
+** with the natural numbers listed in order from the origin
+** along the fastest changing axis.
**
** Thus for a 20x10x10 dataset, the value stored in location
-** (x, y, z) (assuming that z is the fastest changing index
-** and x the slowest) is assumed to be:
+** (x, y, z) (assuming that z is the fastest changing index
+** and x the slowest) is assumed to be:
**
-** (10 * 10 * x) + (10 * y) + z
+** (10 * 10 * x) + (10 * y) + z
**
-** Further, supposing that this is process 10, this process's
-** slice of the dataset would be a 10 x 10 2-cube with origin
-** (10, 0, 0) in the data set, and would be initialize (prior
-** to the checkerboard selection) as follows:
+** Further, supposing that this is process 10, this process's
+** slice of the dataset would be a 10 x 10 2-cube with origin
+** (10, 0, 0) in the data set, and would be initialize (prior
+** to the checkerboard selection) as follows:
**
-** 1000, 1001, 1002, ... 1008, 1009
-** 1010, 1011, 1012, ... 1018, 1019
-** . . . . .
-** . . . . .
-** . . . . .
-** 1090, 1091, 1092, ... 1098, 1099
+** 1000, 1001, 1002, ... 1008, 1009
+** 1010, 1011, 1012, ... 1018, 1019
+** . . . . .
+** . . . . .
+** . . . . .
+** 1090, 1091, 1092, ... 1098, 1099
**
-** In the case of a read from the processors slice of another
-** data set of different rank, the values expected will have
-** to be adjusted accordingly. This is done via the
-** first_expected_val parameter.
+** In the case of a read from the processors slice of another
+** data set of different rank, the values expected will have
+** to be adjusted accordingly. This is done via the
+** first_expected_val parameter.
**
-** Finally, the function presumes that the first element
-** of the buffer resides either at the origin of either
-** a selected or an unselected checker. (Translation:
-** if partial checkers appear in the buffer, they will
-** intersect the edges of the n-cube oposite the origin.)
+** Finally, the function presumes that the first element
+** of the buffer resides either at the origin of either
+** a selected or an unselected checker. (Translation:
+** if partial checkers appear in the buffer, they will
+** intersect the edges of the n-cube oposite the origin.)
**
****************************************************************/
@@ -2802,7 +2778,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
hbool_t buf_starts_in_checker)
{
#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
- const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():";
+ const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():";
#endif
hbool_t good_data = TRUE;
hbool_t in_checker;
@@ -2821,9 +2797,9 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
HDassert( checker_edge_size <= edge_size );
HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK );
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
- int mpi_rank;
+ int mpi_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank);
@@ -2875,7 +2851,7 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
y = 0;
start_in_checker[3] = start_in_checker[2];
do
- {
+ {
if ( y >= checker_edge_size ) {
start_in_checker[3] = ! start_in_checker[3];
@@ -2884,13 +2860,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
m = 0;
z = 0;
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m);
#endif
in_checker = start_in_checker[3];
do
{
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, " %d", (int)(*val_ptr));
#endif
if ( z >= checker_edge_size ) {
@@ -2898,21 +2874,21 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
in_checker = ! in_checker;
z = 0;
}
-
+
if ( in_checker ) {
-
+
if ( *val_ptr != expected_value ) {
good_data = FALSE;
}
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
} else if ( *val_ptr != 0 ) {
good_data = FALSE;
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
@@ -2922,10 +2898,10 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
expected_value++;
m++;
z++;
-
+
} while ( ( rank >= (test_max_rank - 4) ) &&
( m < edge_size ) );
-#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
+#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG
HDfprintf(stdout, "\n");
#endif
l++;
@@ -2951,28 +2927,24 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__d2m_l2s()
+ * Function: ckrbrd_hs_dr_pio_test__d2m_l2s()
*
- * Purpose: Part one of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part one of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using checker
- * board selections of different rank that
+ * Verify that we can read from disk correctly using checker
+ * board selections of different rank that
* H5S_select_shape_same() views as being of the same shape.
*
- * In this function, we test this by reading small_rank - 1
- * checker board slices from the on disk large cube, and
- * verifying that the data read is correct. Verify that
- * H5S_select_shape_same() returns true on the memory and
- * file selections.
- *
- * Return: void
+ * In this function, we test this by reading small_rank - 1
+ * checker board slices from the on disk large cube, and
+ * verifying that the data read is correct. Verify that
+ * H5S_select_shape_same() returns true on the memory and
+ * file selections.
*
- * Programmer: JRM -- 9/15/11
- *
- * Modifications:
+ * Return: void
*
- * None.
+ * Programmer: JRM -- 9/15/11
*
*-------------------------------------------------------------------------
*/
@@ -2982,17 +2954,17 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr,
static void
ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_l2s()";
uint32_t * ptr_0;
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
- hbool_t data_ok = FALSE;
- int i, j, k, l;
- uint32_t expected_value;
- int mpi_rank; /* needed by VRFY */
+ hbool_t data_ok = FALSE;
+ int i, j, k, l;
+ uint32_t expected_value;
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -3002,9 +2974,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading a (small_rank - 1)-D checker board slice from this
- * processes slice of the on disk large data set, and verifying that the
- * data read is correct. Verify that H5S_select_shape_same() returns
+ * Start by reading a (small_rank - 1)-D checker board slice from this
+ * processes slice of the on disk large data set, and verifying that the
+ * data read is correct. Verify that H5S_select_shape_same() returns
* true on the memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@@ -3025,7 +2997,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* zero out the buffer we will be reading into */
HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
HDfprintf(stdout, "%s:%d: initial small_ds_slice_buf = ",
fcnName, tv_ptr->mpi_rank);
ptr_0 = tv_ptr->small_ds_slice_buf;
@@ -3034,7 +3006,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_0++;
}
HDfprintf(stdout, "\n");
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* set up start, stride, count, and block -- note that we will
* change start[] so as to read slices of the large cube.
@@ -3054,15 +3026,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout,
"%s:%d: reading slice from big ds on disk into small ds slice.\n",
fcnName, tv_ptr->mpi_rank);
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set. However, in the parallel version, each
+ * of the large data set. However, in the parallel version, each
* process only works with that slice of the large cube indicated
- * by its rank -- hence we set the most slowly changing index to
+ * by its rank -- hence we set the most slowly changing index to
* mpi_rank, and don't itterate over it.
*/
@@ -3075,9 +3047,9 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3101,7 +3073,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3121,8 +3093,8 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->skips = 0; /* reset the skips counter */
- /* we know that small_rank - 1 >= 1 and that
- * large_rank > small_rank by the assertions at the head
+ /* we know that small_rank - 1 >= 1 and that
+ * large_rank > small_rank by the assertions at the head
* of this function. Thus no need for another inner loop.
*/
tv_ptr->start[0] = (hsize_t)i;
@@ -3157,15 +3129,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName,
- tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1],
+ tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1],
tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n",
fcnName,
H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid),
H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0));
-#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
+#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
ret = H5Dread(tv_ptr->large_dataset,
H5T_NATIVE_UINT32,
@@ -3175,15 +3147,15 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_ds_slice_buf);
VRFY((ret >= 0), "H5Dread() slice from large ds succeeded.");
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: H5Dread() returns.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: H5Dread() returns.\n",
fcnName, tv_ptr->mpi_rank);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */
/* verify that expected data is retrieved */
expected_value = (uint32_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -3199,7 +3171,7 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
(hbool_t)TRUE
);
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"small slice read from large ds data good.");
(tv_ptr->tests_run)++;
@@ -3227,27 +3199,23 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__d2m_s2l()
+ * Function: ckrbrd_hs_dr_pio_test__d2m_s2l()
*
- * Purpose: Part two of a series of tests of I/O to/from hyperslab
- * selections of different rank in the parallel.
+ * Purpose: Part two of a series of tests of I/O to/from hyperslab
+ * selections of different rank in the parallel.
*
- * Verify that we can read from disk correctly using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Verify that we can read from disk correctly using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * In this function, we test this by reading checker board
- * slices of the on disk small data set into slices through
- * the in memory large data set, and verify that the correct
- * data (and only the correct data) is read.
+ * In this function, we test this by reading checker board
+ * slices of the on disk small data set into slices through
+ * the in memory large data set, and verify that the correct
+ * data (and only the correct data) is read.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/15/11
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 8/15/11
*
*-------------------------------------------------------------------------
*/
@@ -3257,27 +3225,27 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_s2l()";
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
- hbool_t data_ok = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* similarly, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* similarly, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -3292,8 +3260,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_rank - 1,
sel_start);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout,
"%s reading slices of on disk small data set into slices of big data set.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */
@@ -3303,7 +3271,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* set up start, stride, count, and block -- note that we will
* change start[] so as to read the slice of the small data set
- * into different slices of the process slice of the large data
+ * into different slices of the process slice of the large data
* set.
*/
for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) {
@@ -3322,11 +3290,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -3340,9 +3308,9 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3366,7 +3334,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3423,11 +3391,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/* Read selection from disk */
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
- tv_ptr->start[3], tv_ptr->start[4]);
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, tv_ptr->mpi_rank,
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
H5Sget_simple_extent_ndims(tv_ptr->large_ds_slice_sid),
@@ -3446,21 +3414,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
*/
data_ok = TRUE;
ptr_1 = tv_ptr->large_ds_buf_1;
- expected_value =
+ expected_value =
(uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
stop_index = start_index + tv_ptr->small_ds_slice_size - 1;
-#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG
{
int m, n;
- HDfprintf(stdout, "%s:%d: expected_value = %d.\n",
+ HDfprintf(stdout, "%s:%d: expected_value = %d.\n",
fcnName, tv_ptr->mpi_rank, expected_value);
HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n",
fcnName, tv_ptr->mpi_rank, start_index, stop_index);
@@ -3495,7 +3463,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(1).");
data_ok = ckrbrd_hs_dr_pio_test__verify_data
@@ -3508,7 +3476,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
(hbool_t)TRUE
);
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(2).");
@@ -3527,7 +3495,7 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
ptr_1++;
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"slice read from small to large ds data good(3).");
(tv_ptr->tests_run)++;
@@ -3555,31 +3523,27 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__m2d_l2s()
+ * Function: ckrbrd_hs_dr_pio_test__m2d_l2s()
*
- * Purpose: Part three of a series of tests of I/O to/from checker
- * board hyperslab selections of different rank in the
- * parallel.
+ * Purpose: Part three of a series of tests of I/O to/from checker
+ * board hyperslab selections of different rank in the
+ * parallel.
*
- * Verify that we can write from memory to file using checker
- * board selections of different rank that
- * H5S_select_shape_same() views as being of the same shape.
+ * Verify that we can write from memory to file using checker
+ * board selections of different rank that
+ * H5S_select_shape_same() views as being of the same shape.
*
- * Do this by writing small_rank - 1 dimensional checker
- * board slices from the in memory large data set to the on
- * disk small cube dataset. After each write, read the
- * slice of the small dataset back from disk, and verify
- * that it contains the expected data. Verify that
- * H5S_select_shape_same() returns true on the memory and
- * file selections.
+ * Do this by writing small_rank - 1 dimensional checker
+ * board slices from the in memory large data set to the on
+ * disk small cube dataset. After each write, read the
+ * slice of the small dataset back from disk, and verify
+ * that it contains the expected data. Verify that
+ * H5S_select_shape_same() returns true on the memory and
+ * file selections.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 8/15/11
- *
- * Modifications:
- *
- * None.
+ * Programmer: JRM -- 8/15/11
*
*-------------------------------------------------------------------------
*/
@@ -3589,21 +3553,21 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()";
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
@@ -3614,9 +3578,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small dataset. After each write, read the slice of
- * the small dataset back from disk, and verify that it contains the
- * expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small dataset. After each write, read the slice of
+ * the small dataset back from disk, and verify that it contains the
+ * expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
@@ -3684,18 +3648,18 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size);
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout,
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout,
"%s writing checker boards selections of slices from big ds to slices of small ds on disk.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
/* in serial versions of this test, we loop through all the dimensions
- * of the large data set that don't appear in the small data set.
+ * of the large data set that don't appear in the small data set.
*
- * However, in the parallel version, each process only works with that
- * slice of the large (and small) data set indicated by its rank -- hence
- * we set the most slowly changing index to mpi_rank, and don't itterate
+ * However, in the parallel version, each process only works with that
+ * slice of the large (and small) data set indicated by its rank -- hence
+ * we set the most slowly changing index to mpi_rank, and don't itterate
* over it.
*/
@@ -3709,9 +3673,9 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -3736,7 +3700,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -3760,7 +3724,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
* by the assertions at the head of this function. Thus no
* need for another inner loop.
*/
-
+
/* zero out this rank's slice of the on disk small data set */
ret = H5Dwrite(tv_ptr->small_dataset,
H5T_NATIVE_UINT32,
@@ -3769,7 +3733,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_2);
VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded.");
-
+
/* select the portion of the in memory large cube from which we
* are going to write data.
*/
@@ -3778,13 +3742,13 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->start[2] = (hsize_t)k;
tv_ptr->start[3] = (hsize_t)l;
tv_ptr->start[4] = 0;
-
+
HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1));
HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1));
-
+
ckrbrd_hs_dr_pio_test__slct_ckrbrd
(
tv_ptr->mpi_rank,
@@ -3795,26 +3759,26 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->small_rank - 1,
tv_ptr->start
);
-
-
+
+
/* verify that H5S_select_shape_same() reports the in
- * memory checkerboard selection of the slice through the
+ * memory checkerboard selection of the slice through the
* large dataset and the checkerboard selection of the process
* slice of the small data set as having the same shape.
*/
check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_1,
tv_ptr->mem_large_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed.");
-
-
- /* write the checker board selection of the slice from the in
- * memory large data set to the slice of the on disk small
- * dataset.
+
+
+ /* write the checker board selection of the slice from the in
+ * memory large data set to the slice of the on disk small
+ * dataset.
*/
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -3828,8 +3792,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded.");
-
-
+
+
/* read the on disk process slice of the small dataset into memory */
ret = H5Dread(tv_ptr->small_dataset,
H5T_NATIVE_UINT32,
@@ -3838,30 +3802,30 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_1);
VRFY((ret >= 0), "H5Dread() slice from small ds succeeded.");
-
-
+
+
/* verify that expected data is retrieved */
-
+
mis_match = FALSE;
-
+
expected_value = (uint32_t)(
- (i * tv_ptr->edge_size * tv_ptr->edge_size *
+ (i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
(l * tv_ptr->edge_size));
-
+
start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size;
stop_index = start_index + tv_ptr->small_ds_slice_size - 1;
-
+
HDassert( start_index < stop_index );
HDassert( stop_index <= tv_ptr->small_ds_size );
-
+
data_ok = TRUE;
-
+
ptr_1 = tv_ptr->small_ds_buf_1;
for ( u = 0; u < start_index; u++, ptr_1++ ) {
-
+
if ( *ptr_1 != 0 ) {
data_ok = FALSE;
@@ -3890,7 +3854,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"large slice write slice to small slice data good.");
(tv_ptr->tests_run)++;
@@ -3918,31 +3882,27 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__m2d_s2l()
- *
- * Purpose: Part four of a series of tests of I/O to/from checker
- * board hyperslab selections of different rank in the parallel.
- *
- * Verify that we can write from memory to file using
- * selections of different rank that H5S_select_shape_same()
- * views as being of the same shape.
+ * Function: ckrbrd_hs_dr_pio_test__m2d_s2l()
*
- * Do this by writing checker board selections of the contents
- * of the process's slice of the in memory small data set to
- * slices of the on disk large data set. After each write,
- * read the process's slice of the large data set back into
- * memory, and verify that it contains the expected data.
+ * Purpose: Part four of a series of tests of I/O to/from checker
+ * board hyperslab selections of different rank in the parallel.
*
- * Verify that H5S_select_shape_same() returns true on the
- * memory and file selections.
+ * Verify that we can write from memory to file using
+ * selections of different rank that H5S_select_shape_same()
+ * views as being of the same shape.
*
- * Return: void
+ * Do this by writing checker board selections of the contents
+ * of the process's slice of the in memory small data set to
+ * slices of the on disk large data set. After each write,
+ * read the process's slice of the large data set back into
+ * memory, and verify that it contains the expected data.
*
- * Programmer: JRM -- 8/15/11
+ * Verify that H5S_select_shape_same() returns true on the
+ * memory and file selections.
*
- * Modifications:
+ * Return: void
*
- * None
+ * Programmer: JRM -- 8/15/11
*
*-------------------------------------------------------------------------
*/
@@ -3952,31 +3912,31 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
static void
ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
{
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
- int i, j, k, l;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
+ int i, j, k, l;
size_t u;
size_t start_index;
size_t stop_index;
- uint32_t expected_value;
+ uint32_t expected_value;
uint32_t * ptr_1;
- int mpi_rank; /* needed by VRFY */
+ int mpi_rank; /* needed by VRFY */
hsize_t sel_start[PAR_SS_DR_MAX_RANK];
htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* initialize the local copy of mpi_rank */
mpi_rank = tv_ptr->mpi_rank;
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
@@ -4009,7 +3969,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->block);
VRFY((ret >= 0), "H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, set) suceeded");
- /* setup a checkerboard selection of the slice of the in memory small
+ /* setup a checkerboard selection of the slice of the in memory small
* data set associated with the process's mpi rank.
*/
@@ -4025,7 +3985,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
sel_start);
/* set up start, stride, count, and block -- note that we will
- * change start[] so as to write checkerboard selections of slices
+ * change start[] so as to write checkerboard selections of slices
* of the small data set to slices of the large data set.
*/
for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) {
@@ -4047,7 +4007,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size);
#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s writing process checkerboard selections of slices of small ds to process slices of large ds on disk.\n",
fcnName);
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
@@ -4061,9 +4021,9 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
i = 0;
}
- /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
+ /* since large_rank is at most PAR_SS_DR_MAX_RANK, no need to
* loop over it -- either we are setting i to mpi_rank, or
- * we are setting it to zero. It will not change during the
+ * we are setting it to zero. It will not change during the
* test.
*/
@@ -4087,7 +4047,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
do {
- /* since small rank >= 2 and large_rank > small_rank, we
+ /* since small rank >= 2 and large_rank > small_rank, we
* have large_rank >= 3. Since PAR_SS_DR_MAX_RANK == 5
* (baring major re-orgaization), this gives us:
*
@@ -4162,13 +4122,13 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
VRFY((check == TRUE), "H5S_select_shape_same_test passed");
- /* write the small data set slice from memory to the
- * target slice of the disk data set
+ /* write the small data set slice from memory to the
+ * target slice of the disk data set
*/
-#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
- HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
+#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
+ HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n",
fcnName, tv_ptr->mpi_rank,
- tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
+ tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2],
tv_ptr->start[3], tv_ptr->start[4]);
HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n",
fcnName, tv_ptr->mpi_rank,
@@ -4181,11 +4141,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_1,
tv_ptr->xfer_plist,
tv_ptr->small_ds_buf_0);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dwrite of small ds slice to large ds succeeded");
- /* read this processes slice on the on disk large
+ /* read this processes slice on the on disk large
* data set into memory.
*/
@@ -4195,18 +4155,18 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
tv_ptr->file_large_ds_sid_0,
tv_ptr->xfer_plist,
tv_ptr->large_ds_buf_1);
- VRFY((ret != FAIL),
+ VRFY((ret != FAIL),
"H5Dread() of process slice of large ds succeeded");
/* verify that the expected data and only the
* expected data was read.
*/
- expected_value =
+ expected_value =
(uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size);
start_index = (size_t)
- ((i * tv_ptr->edge_size * tv_ptr->edge_size *
+ ((i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
(k * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -4252,7 +4212,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
}
}
- VRFY((data_ok == TRUE),
+ VRFY((data_ok == TRUE),
"small ds cb slice write to large ds slice data good.");
(tv_ptr->tests_run)++;
@@ -4280,22 +4240,22 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test__run_test()
+ * Function: ckrbrd_hs_dr_pio_test__run_test()
*
- * Purpose: Test I/O to/from checkerboard selections of hyperslabs of
- * different rank in the parallel.
+ * Purpose: Test I/O to/from checkerboard selections of hyperslabs of
+ * different rank in the parallel.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 10/10/09
+ * Programmer: JRM -- 10/10/09
*
* Modifications:
*
- * JRM -- 9/16/10
- * Added the express_test parameter. Use it to control
- * whether we set an alignment, and whether we allocate
- * chunks such that no two processes will normally touch
- * the same chunk.
+ * JRM -- 9/16/10
+ * Added the express_test parameter. Use it to control
+ * whether we set an alignment, and whether we allocate
+ * chunks such that no two processes will normally touch
+ * the same chunk.
*
*-------------------------------------------------------------------------
*/
@@ -4322,10 +4282,10 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()";
#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank; /* needed by VRFY */
- struct hs_dr_pio_test_vars_t test_vars =
+ int mpi_rank; /* needed by VRFY */
+ struct hs_dr_pio_test_vars_t test_vars =
{
- /* int mpi_size = */ -1,
+ /* int mpi_size = */ -1,
/* int mpi_rank = */ -1,
/* MPI_Comm mpi_comm = */ MPI_COMM_NULL,
/* MPI_Inf mpi_info = */ MPI_INFO_NULL,
@@ -4341,7 +4301,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* uint32_t * small_ds_buf_2 = */ NULL,
/* uint32_t * small_ds_slice_buf = */ NULL,
/* uint32_t * large_ds_buf_0 = */ NULL,
- /* uint32_t * large_ds_buf_1 = */ NULL,
+ /* uint32_t * large_ds_buf_1 = */ NULL,
/* uint32_t * large_ds_buf_2 = */ NULL,
/* uint32_t * large_ds_slice_buf = */ NULL,
/* int small_ds_offset = */ -1,
@@ -4378,17 +4338,17 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/* hsize_t * stride_ptr = */ NULL,
/* hsize_t * count_ptr = */ NULL,
/* hsize_t * block_ptr = */ NULL,
- /* int skips = */ 0,
- /* int max_skips = */ 0,
+ /* int skips = */ 0,
+ /* int max_skips = */ 0,
/* int64_t total_tests = */ 0,
/* int64_t tests_run = */ 0,
/* int64_t tests_skipped = */ 0
};
struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars;
- hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size,
- chunk_edge_size, small_rank, large_rank,
- use_collective_io, dset_type, express_test,
+ hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size,
+ chunk_edge_size, small_rank, large_rank,
+ use_collective_io, dset_type, express_test,
tv_ptr);
@@ -4414,9 +4374,9 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
* of different rank that H5S_select_shape_same() views as being of the
* same shape.
*
- * Start by reading a (small_rank - 1)-D slice from this processes slice
- * of the on disk large data set, and verifying that the data read is
- * correct. Verify that H5S_select_shape_same() returns true on the
+ * Start by reading a (small_rank - 1)-D slice from this processes slice
+ * of the on disk large data set, and verifying that the data read is
+ * correct. Verify that H5S_select_shape_same() returns true on the
* memory and file selections.
*
* The first step is to set up the needed checker board selection in the
@@ -4426,8 +4386,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
ckrbrd_hs_dr_pio_test__d2m_l2s(tv_ptr);
- /* similarly, read slices of the on disk small data set into slices
- * through the in memory large data set, and verify that the correct
+ /* similarly, read slices of the on disk small data set into slices
+ * through the in memory large data set, and verify that the correct
* data (and only the correct data) is read.
*/
@@ -4439,20 +4399,20 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
* H5S_select_shape_same() views as being of the same shape.
*
* Start by writing small_rank - 1 D slices from the in memory large data
- * set to the on disk small dataset. After each write, read the slice of
- * the small dataset back from disk, and verify that it contains the
- * expected data. Verify that H5S_select_shape_same() returns true on
+ * set to the on disk small dataset. After each write, read the slice of
+ * the small dataset back from disk, and verify that it contains the
+ * expected data. Verify that H5S_select_shape_same() returns true on
* the memory and file selections.
*/
ckrbrd_hs_dr_pio_test__m2d_l2s(tv_ptr);
- /* Now write the contents of the process's slice of the in memory
- * small data set to slices of the on disk large data set. After
+ /* Now write the contents of the process's slice of the in memory
+ * small data set to slices of the on disk large data set. After
* each write, read the process's slice of the large data set back
- * into memory, and verify that it contains the expected data.
- * Verify that H5S_select_shape_same() returns true on the memory
+ * into memory, and verify that it contains the expected data.
+ * Verify that H5S_select_shape_same() returns true on the memory
* and file selections.
*/
@@ -4461,8 +4421,8 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG
if ( MAINPROCESS ) {
- HDfprintf(stdout,
- "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
+ HDfprintf(stdout,
+ "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n",
test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped),
(long long)(tv_ptr->total_tests));
}
@@ -4487,28 +4447,28 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
/*-------------------------------------------------------------------------
- * Function: ckrbrd_hs_dr_pio_test()
+ * Function: ckrbrd_hs_dr_pio_test()
*
- * Purpose: Test I/O to/from hyperslab selections of different rank in
- * the parallel case.
+ * Purpose: Test I/O to/from hyperslab selections of different rank in
+ * the parallel case.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 9/18/09
+ * Programmer: JRM -- 9/18/09
*
* Modifications:
*
- * Modified function to take a sample of the run times
- * of the different tests, and skip some of them if
- * run times are too long.
+ * Modified function to take a sample of the run times
+ * of the different tests, and skip some of them if
+ * run times are too long.
*
- * We need to do this because Lustre runns very slowly
- * if two or more processes are banging on the same
- * block of memory.
- * JRM -- 9/10/10
- * Break this one big test into 4 smaller tests according
- * to {independent,collective}x{contigous,chunked} datasets.
- * AKC -- 2010/01/17
+ * We need to do this because Lustre runns very slowly
+ * if two or more processes are banging on the same
+ * block of memory.
+ * JRM -- 9/10/10
+ * Break this one big test into 4 smaller tests according
+ * to {independent,collective}x{contigous,chunked} datasets.
+ * AKC -- 2010/01/17
*
*-------------------------------------------------------------------------
*/
@@ -4518,16 +4478,16 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
{
int express_test;
int local_express_test;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
- int test_num = 0;
- int edge_size;
+ int test_num = 0;
+ int edge_size;
int checker_edge_size = 3;
- int chunk_edge_size = 0;
- int small_rank = 3;
- int large_rank = 4;
- int mpi_result;
- hid_t dset_type = H5T_NATIVE_UINT;
+ int chunk_edge_size = 0;
+ int small_rank = 3;
+ int large_rank = 4;
+ int mpi_result;
+ hid_t dset_type = H5T_NATIVE_UINT;
int skips = 0;
int max_skips = 0;
/* The following table list the number of sub-tests skipped between
@@ -4566,13 +4526,13 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
max_skips = max_skips_tbl[local_express_test];
}
-#if 0
+#if 0
{
int DebugWait = 1;
-
+
while (DebugWait) ;
}
-#endif
+#endif
for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) {
@@ -4702,15 +4662,15 @@ int dim0;
int dim1;
int chunkdim0;
int chunkdim1;
-int nerrors = 0; /* errors count */
-int ndatasets = 300; /* number of datasets to create*/
+int nerrors = 0; /* errors count */
+int ndatasets = 300; /* number of datasets to create*/
int ngroups = 512; /* number of groups to create in root
* group. */
-int facc_type = FACC_MPIO; /*Test file access type */
+int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void *old_client_data; /* previous error handler arg.*/
+H5E_auto2_t old_func; /* previous error handler */
+void *old_client_data; /* previous error handler arg.*/
/* other option flags */
@@ -4722,10 +4682,10 @@ void *old_client_data; /* previous error handler arg.*/
#define NFILENAME 2
#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={
- "ShapeSameTest",
- NULL};
-char filenames[NFILENAME][PATH_MAX];
-hid_t fapl; /* file access property list */
+ "ShapeSameTest",
+ NULL};
+char filenames[NFILENAME][PATH_MAX];
+hid_t fapl; /* file access property list */
#ifdef USE_PAUSE
/* pause the process for a moment to allow debugger to attach if desired. */
@@ -4738,7 +4698,7 @@ void pause_proc(void)
{
int pid;
- h5_stat_t statbuf;
+ h5_stat_t statbuf;
char greenlight[] = "go";
int maxloop = 10;
int loops = 0;
@@ -4755,15 +4715,15 @@ void pause_proc(void)
MPI_Get_processor_name(mpi_name, &mpi_namelen);
if (MAINPROCESS)
- while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
- if (!loops++){
- printf("Proc %d (%*s, %d): to debug, attach %d\n",
- mpi_rank, mpi_namelen, mpi_name, pid, pid);
- }
- printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
- fflush(stdout);
- sleep(time_int);
- }
+ while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
+ if (!loops++){
+ printf("Proc %d (%*s, %d): to debug, attach %d\n",
+ mpi_rank, mpi_namelen, mpi_name, pid, pid);
+ }
+ printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
+ fflush(stdout);
+ HDsleep(time_int);
+ }
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -4775,7 +4735,7 @@ int MPI_Init(int *argc, char ***argv)
pause_proc();
return (ret_code);
}
-#endif /* USE_PAUSE */
+#endif /* USE_PAUSE */
/*
@@ -4785,15 +4745,15 @@ static void
usage(void)
{
printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
- "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
+ "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
printf("\t-m<n_datasets>"
- "\tset number of datasets for the multiple dataset test\n");
+ "\tset number of datasets for the multiple dataset test\n");
printf("\t-n<n_groups>"
"\tset number of groups for the multiple group test\n");
printf("\t-f <prefix>\tfilename prefix\n");
printf("\t-2\t\tuse Split-file together with MPIO\n");
printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
- ROW_FACTOR, COL_FACTOR);
+ ROW_FACTOR, COL_FACTOR);
printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
printf("\n");
}
@@ -4805,7 +4765,7 @@ usage(void)
static int
parse_options(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -4816,107 +4776,107 @@ parse_options(int argc, char **argv)
chunkdim1 = (dim1+9)/10;
while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'm': ndatasets = atoi((*argv+1)+1);
- if (ndatasets < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'n': ngroups = atoi((*argv+1)+1);
- if (ngroups < 0){
+ if (**(++argv) != '-'){
+ break;
+ }else{
+ switch(*(*argv+1)){
+ case 'm': ndatasets = atoi((*argv+1)+1);
+ if (ndatasets < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'n': ngroups = atoi((*argv+1)+1);
+ if (ngroups < 0){
nerrors++;
return(1);
- }
+ }
break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'i': /* Collective MPI-IO access with independent IO */
- dxfer_coll_type = DXFER_INDEPENDENT_IO;
- break;
- case '2': /* Use the split-file driver with MPIO access */
- /* Can use $HDF5_METAPREFIX to define the */
- /* meta-file-prefix. */
- facc_type = FACC_MPIO | FACC_SPLIT;
- break;
- case 'd': /* dimensizes */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- dim0 = atoi(*(++argv))*mpi_size;
- argc--;
- dim1 = atoi(*(++argv))*mpi_size;
- /* set default chunkdim sizes too */
- chunkdim0 = (dim0+9)/10;
- chunkdim1 = (dim1+9)/10;
- break;
- case 'c': /* chunk dimensions */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- chunkdim0 = atoi(*(++argv));
- argc--;
- chunkdim1 = atoi(*(++argv));
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: printf("Illegal option(%s)\n", *argv);
- nerrors++;
- return(1);
- }
- }
+ case 'f': if (--argc < 1) {
+ nerrors++;
+ return(1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return(1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'i': /* Collective MPI-IO access with independent IO */
+ dxfer_coll_type = DXFER_INDEPENDENT_IO;
+ break;
+ case '2': /* Use the split-file driver with MPIO access */
+ /* Can use $HDF5_METAPREFIX to define the */
+ /* meta-file-prefix. */
+ facc_type = FACC_MPIO | FACC_SPLIT;
+ break;
+ case 'd': /* dimensizes */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ dim0 = atoi(*(++argv))*mpi_size;
+ argc--;
+ dim1 = atoi(*(++argv))*mpi_size;
+ /* set default chunkdim sizes too */
+ chunkdim0 = (dim0+9)/10;
+ chunkdim1 = (dim1+9)/10;
+ break;
+ case 'c': /* chunk dimensions */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ chunkdim0 = atoi(*(++argv));
+ argc--;
+ chunkdim1 = atoi(*(++argv));
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return(1);
+ default: printf("Illegal option(%s)\n", *argv);
+ nerrors++;
+ return(1);
+ }
+ }
} /*while*/
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
- printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
- nerrors++;
- return(1);
+ printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
+ nerrors++;
+ return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
- printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
- nerrors++;
- return(1);
+ printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
+ nerrors++;
+ return(1);
}
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){
- if (MAINPROCESS)
- printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
- dim0, dim1, mpi_size);
- nerrors++;
- return(1);
+ if (MAINPROCESS)
+ printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
+ dim0, dim1, mpi_size);
+ nerrors++;
+ return(1);
}
/* compose the test filenames */
{
- int i, n;
-
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
+ int i, n;
+
+ n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i=0; i < n; i++)
+ if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
+ == NULL){
+ printf("h5_fixname failed\n");
+ nerrors++;
+ return(1);
+ }
+ printf("Test filenames are:\n");
+ for (i=0; i < n; i++)
+ printf(" %s\n", filenames[i]);
}
return(0);
@@ -4931,7 +4891,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
{
hid_t ret_pl = -1;
herr_t ret; /* generic return value */
- int mpi_rank; /* mpi variables */
+ int mpi_rank; /* mpi variables */
/* need the rank for error checking macros */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -4940,32 +4900,32 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
VRFY((ret_pl >= 0), "H5P_FILE_ACCESS");
if (l_facc_type == FACC_DEFAULT)
- return (ret_pl);
+ return (ret_pl);
if (l_facc_type == FACC_MPIO){
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
- return(ret_pl);
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
}
if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((mpio_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
- VRFY((ret >= 0), "");
-
- /* setup file access template */
- ret_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((ret_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
- H5Pclose(mpio_pl);
- return(ret_pl);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
}
/* unknown file access types */
@@ -5033,7 +4993,7 @@ sschecker4(void)
int main(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
#ifndef H5_HAVE_WIN32_API
/* Un-buffer the stdout and stderr */
@@ -5049,10 +5009,10 @@ int main(int argc, char **argv)
dim1 = COL_FACTOR*mpi_size;
if (MAINPROCESS){
- printf("===================================\n");
- printf("Shape Same Tests Start\n");
- printf(" express_test = %d.\n", GetTestExpress());
- printf("===================================\n");
+ printf("===================================\n");
+ printf("Shape Same Tests Start\n");
+ printf(" express_test = %d.\n", GetTestExpress());
+ printf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
@@ -5061,7 +5021,7 @@ int main(int argc, char **argv)
* calls. By then, MPI calls may not work.
*/
if (H5dont_atexit() < 0){
- printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
+ printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
};
H5open();
h5_show_hostname();
@@ -5070,26 +5030,24 @@ int main(int argc, char **argv)
TestInit(argv[0], usage, parse_options);
/* Shape Same tests using contigous hyperslab */
-#if 1
AddTest("sscontig1", sscontig1, NULL,
- "Shape Same, contigous hyperslab, ind IO, contig datasets", PARATESTFILE);
+ "Cntg hslab, ind IO, cntg dsets", PARATESTFILE);
AddTest("sscontig2", sscontig2, NULL,
- "Shape Same, contigous hyperslab, col IO, contig datasets", PARATESTFILE);
+ "Cntg hslab, col IO, cntg dsets", PARATESTFILE);
AddTest("sscontig3", sscontig3, NULL,
- "Shape Same, contigous hyperslab, ind IO, chunked datasets", PARATESTFILE);
+ "Cntg hslab, ind IO, chnk dsets", PARATESTFILE);
AddTest("sscontig4", sscontig4, NULL,
- "Shape Same, contigous hyperslab, col IO, chunked datasets", PARATESTFILE);
-#endif
+ "Cntg hslab, col IO, chnk dsets", PARATESTFILE);
/* Shape Same tests using checker board hyperslab */
AddTest("sschecker1", sschecker1, NULL,
- "Shape Same, checker hyperslab, ind IO, contig datasets", PARATESTFILE);
+ "Check hslab, ind IO, cntg dsets", PARATESTFILE);
AddTest("sschecker2", sschecker2, NULL,
- "Shape Same, checker hyperslab, col IO, contig datasets", PARATESTFILE);
+ "Check hslab, col IO, cntg dsets", PARATESTFILE);
AddTest("sschecker3", sschecker3, NULL,
- "Shape Same, checker hyperslab, ind IO, chunked datasets", PARATESTFILE);
+ "Check hslab, ind IO, chnk dsets", PARATESTFILE);
AddTest("sschecker4", sschecker4, NULL,
- "Shape Same, checker hyperslab, col IO, chunked datasets", PARATESTFILE);
+ "Check hslab, col IO, chnk dsets", PARATESTFILE);
/* Display testing information */
TestInfo(argv[0]);
@@ -5102,9 +5060,9 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
- printf("===================================\n"
- " Using Independent I/O with file set view to replace collective I/O \n"
- "===================================\n");
+ printf("===================================\n"
+ " Using Independent I/O with file set view to replace collective I/O \n"
+ "===================================\n");
}
@@ -5129,20 +5087,27 @@ int main(int argc, char **argv)
{
int temp;
MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
- nerrors=temp;
+ nerrors=temp;
}
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors)
- printf("***Shape Same tests detected %d errors***\n", nerrors);
- else
- printf("Shape Same tests finished with no errors\n");
- printf("===================================\n");
+ if (MAINPROCESS){ /* only process 0 reports */
+ printf("===================================\n");
+ if (nerrors)
+ printf("***Shape Same tests detected %d errors***\n", nerrors);
+ else
+ printf("Shape Same tests finished with no errors\n");
+ printf("===================================\n");
}
+ /* close HDF5 library */
+ H5close();
+
+ /* Release test infrastructure */
+ TestShutdown();
+
MPI_Finalize();
/* cannot just return (nerrors) because exit code is limited to 1byte */
return(nerrors!=0);
}
+
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 53ce7b1..960bedc 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -23,12 +23,12 @@
2) We will read two datasets with the same hyperslab selection settings,
1. independent read to read independent output,
independent read to read collecive output,
- Compare the result,
- If the result is the same, then collective write succeeds.
+ Compare the result,
+ If the result is the same, then collective write succeeds.
2. collective read to read independent output,
independent read to read independent output,
- Compare the result,
- If the result is the same, then collective read succeeds.
+ Compare the result,
+ If the result is the same, then collective read succeeds.
*/
@@ -42,19 +42,17 @@ static void coll_read_test(int chunk_factor);
/*-------------------------------------------------------------------------
- * Function: coll_irregular_cont_write
+ * Function: coll_irregular_cont_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
contiguous storage
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
- *
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -69,19 +67,17 @@ coll_irregular_cont_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_cont_read
+ * Function: coll_irregular_cont_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in
contiguous storage
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: Success: 0
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Failure: -1
*
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -95,19 +91,17 @@ coll_irregular_cont_read(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_simple_chunk_write
+ * Function: coll_irregular_simple_chunk_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in
chunk storage(1 chunk)
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: Success: 0
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Failure: -1
*
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -122,19 +116,17 @@ coll_irregular_simple_chunk_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_simple_chunk_read
+ * Function: coll_irregular_simple_chunk_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
storage(1 chunk)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
- *
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -147,19 +139,17 @@ coll_irregular_simple_chunk_read(void)
}
/*-------------------------------------------------------------------------
- * Function: coll_irregular_complex_chunk_write
+ * Function: coll_irregular_complex_chunk_write
*
- * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk
storage(4 chunks)
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: Success: 0
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Failure: -1
*
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -174,19 +164,17 @@ coll_irregular_complex_chunk_write(void)
/*-------------------------------------------------------------------------
- * Function: coll_irregular_complex_chunk_read
+ * Function: coll_irregular_complex_chunk_read
*
- * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
+ * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk
storage(1 chunk)
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: Success: 0
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Failure: -1
*
- * Modifications:
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -200,20 +188,18 @@ coll_irregular_complex_chunk_read(void)
/*-------------------------------------------------------------------------
- * Function: coll_write_test
+ * Function: coll_write_test
*
- * Purpose: To test the collectively irregular hyperslab write in chunk
+ * Purpose: To test the collectively irregular hyperslab write in chunk
storage
* Input: number of chunks on each dimension
if number is equal to 0, contiguous storage
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
- *
- * Modifications: Oct 18th, 2005
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
*-------------------------------------------------------------------------
*/
@@ -229,14 +215,14 @@ void coll_write_test(int chunk_factor)
#if 0
hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
- (in memory) */
+ (in memory) */
hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset
(on disk) */
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
+ dataset in memory when we
+ read selection from the
+ dataset on the disk */
#endif
hsize_t start[2]; /* Start of hyperslab */
@@ -252,12 +238,12 @@ void coll_write_test(int chunk_factor)
#if 0
int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
+ dataset */
int vector[MSPACE1_DIM];
#endif
- int *matrix_out, *matrix_out1, *vector;
+ int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL;
int mpi_size,mpi_rank;
@@ -616,12 +602,12 @@ void coll_write_test(int chunk_factor)
*/
ret = H5Dread(datasetc, H5T_NATIVE_INT, mspaceid, fspaceid,
- H5P_DEFAULT, matrix_out);
+ H5P_DEFAULT, matrix_out);
VRFY((ret >= 0),"H5D independent read succeed");
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid,
- H5P_DEFAULT, matrix_out1);
+ H5P_DEFAULT, matrix_out1);
VRFY((ret >= 0),"H5D independent read succeed");
ret = 0;
@@ -664,26 +650,30 @@ void coll_write_test(int chunk_factor)
ret = H5Fclose(file);
VRFY((ret >= 0),"");
+ if (vector)
+ HDfree(vector);
+ if (matrix_out)
+ HDfree(matrix_out);
+ if (matrix_out1)
+ HDfree(matrix_out1);
+
return ;
}
/*-------------------------------------------------------------------------
- * Function: coll_read_test
+ * Function: coll_read_test
*
- * Purpose: To test the collectively irregular hyperslab read in chunk
+ * Purpose: To test the collectively irregular hyperslab read in chunk
storage
* Input: number of chunks on each dimension
if number is equal to 0, contiguous storage
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Unknown
- * Dec 2nd, 2004
+ * Programmer: Unknown
+ * Dec 2nd, 2004
*
- * Modifications: Oct 18th, 2005
- * Note: This test must be used with the correpsonding
- coll_write_test.
*-------------------------------------------------------------------------
*/
static void
@@ -699,9 +689,9 @@ coll_read_test(int chunk_factor)
/* Dimension sizes of the dataset (on disk) */
#if 0
hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the
- dataset in memory when we
- read selection from the
- dataset on the disk */
+ dataset in memory when we
+ read selection from the
+ dataset on the disk */
#endif
hsize_t mdim[2];
@@ -718,7 +708,7 @@ coll_read_test(int chunk_factor)
#if 0
int matrix_out[MSPACE_DIM1][MSPACE_DIM2];
int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the
- dataset */
+ dataset */
#endif
int mpi_size,mpi_rank;
@@ -882,7 +872,7 @@ coll_read_test(int chunk_factor)
/* Collective read */
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1,
- dxfer_plist, matrix_out);
+ dxfer_plist, matrix_out);
VRFY((ret >= 0),"H5D collecive read succeed");
ret = H5Pclose(dxfer_plist);
@@ -890,7 +880,7 @@ coll_read_test(int chunk_factor)
/* Independent read */
ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1,
- H5P_DEFAULT, matrix_out1);
+ H5P_DEFAULT, matrix_out1);
VRFY((ret >= 0),"H5D independent read succeed");
ret = 0;
@@ -933,30 +923,30 @@ coll_read_test(int chunk_factor)
/****************************************************************
**
-** lower_dim_size_comp_test__select_checker_board():
+** lower_dim_size_comp_test__select_checker_board():
**
-** Given a data space of tgt_rank, and dimensions:
+** Given a dataspace of tgt_rank, and dimensions:
**
-** (mpi_size + 1), edge_size, ... , edge_size
+** (mpi_size + 1), edge_size, ... , edge_size
**
-** edge_size, and a checker_edge_size, select a checker
-** board selection of a sel_rank (sel_rank < tgt_rank)
-** dimensional slice through the data space parallel to the
+** edge_size, and a checker_edge_size, select a checker
+** board selection of a sel_rank (sel_rank < tgt_rank)
+** dimensional slice through the dataspace parallel to the
** sel_rank fastest changing indicies, with origin (in the
-** higher indicies) as indicated by the start array.
+** higher indicies) as indicated by the start array.
**
-** Note that this function, is hard coded to presume a
-** maximum data space rank of 5.
+** Note that this function, is hard coded to presume a
+** maximum dataspace rank of 5.
**
-** While this maximum is declared as a constant, increasing
-** it will require extensive coding in addition to changing
+** While this maximum is declared as a constant, increasing
+** it will require extensive coding in addition to changing
** the value of the constant.
**
-** JRM -- 11/11/09
+** JRM -- 11/11/09
**
****************************************************************/
-#define LDSCT_DS_RANK 5
+#define LDSCT_DS_RANK 5
#define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0
#define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0
@@ -971,32 +961,32 @@ lower_dim_size_comp_test__select_checker_board(
const int sel_rank,
hsize_t sel_start[])
{
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
- const char * fcnName =
- "lower_dim_size_comp_test__select_checker_board():";
-#endif
- hbool_t first_selection = TRUE;
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+ const char * fcnName =
+ "lower_dim_size_comp_test__select_checker_board():";
+#endif
+ hbool_t first_selection = TRUE;
int i, j, k, l, m;
- int ds_offset;
- int sel_offset;
- const int test_max_rank = LDSCT_DS_RANK; /* must update code if */
+ int ds_offset;
+ int sel_offset;
+ const int test_max_rank = LDSCT_DS_RANK; /* must update code if */
/* this changes */
- hsize_t base_count;
+ hsize_t base_count;
hsize_t offset_count;
- hsize_t start[LDSCT_DS_RANK];
- hsize_t stride[LDSCT_DS_RANK];
- hsize_t count[LDSCT_DS_RANK];
- hsize_t block[LDSCT_DS_RANK];
- herr_t ret; /* Generic return value */
+ hsize_t start[LDSCT_DS_RANK];
+ hsize_t stride[LDSCT_DS_RANK];
+ hsize_t count[LDSCT_DS_RANK];
+ hsize_t block[LDSCT_DS_RANK];
+ herr_t ret; /* Generic return value */
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: dims/checker_edge_size = %d %d %d %d %d / %d\n",
fcnName, mpi_rank, (int)dims[0], (int)dims[1], (int)dims[2],
(int)dims[3], (int)dims[4], checker_edge_size);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
HDassert( 0 < checker_edge_size );
HDassert( 0 < sel_rank );
@@ -1014,14 +1004,14 @@ lower_dim_size_comp_test__select_checker_board(
HDassert( (hsize_t)checker_edge_size <= dims[sel_offset] );
HDassert( dims[sel_offset] == 10 );
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n",
fcnName, mpi_rank, sel_rank, sel_offset);
- HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: tgt_rank/ds_offset = %d/%d.\n",
fcnName, mpi_rank, tgt_rank, ds_offset);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* First, compute the base count (which assumes start == 0
* for the associated offset) and offset_count (which
@@ -1043,25 +1033,25 @@ lower_dim_size_comp_test__select_checker_board(
base_count++;
}
- offset_count =
- (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) /
+ offset_count =
+ (hsize_t)((dims[sel_offset] - (hsize_t)checker_edge_size) /
((hsize_t)(checker_edge_size * 2)));
- if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) %
+ if ( ((dims[sel_rank] - (hsize_t)checker_edge_size) %
((hsize_t)(checker_edge_size * 2))) > 0 ) {
offset_count++;
}
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n",
+ HDfprintf(stdout, "%s:%d: base_count/offset_count = %d/%d.\n",
fcnName, mpi_rank, base_count, offset_count);
}
-#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
+#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
/* Now set up the stride and block arrays, and portions of the start
- * and count arrays that will not be altered during the selection of
+ * and count arrays that will not be altered during the selection of
* the checker board.
*/
i = 0;
@@ -1093,7 +1083,7 @@ lower_dim_size_comp_test__select_checker_board(
i++;
}
-
+
i = 0;
do {
if ( 0 >= sel_offset ) {
@@ -1112,7 +1102,7 @@ lower_dim_size_comp_test__select_checker_board(
}
j = 0;
- do {
+ do {
if ( 1 >= sel_offset ) {
if ( j == 0 ) {
@@ -1181,78 +1171,78 @@ lower_dim_size_comp_test__select_checker_board(
if ( ((i + j + k + l + m) % 2) == 0 ) {
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s%d: *** first_selection = %d ***\n",
+ HDfprintf(stdout,
+ "%s%d: *** first_selection = %d ***\n",
fcnName, mpi_rank, (int)first_selection);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n",
fcnName, mpi_rank, i, j, k, l, m);
- HDfprintf(stdout,
- "%s:%d: start = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)start[0], (int)start[1],
- (int)start[2], (int)start[3],
+ HDfprintf(stdout,
+ "%s:%d: start = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)start[0], (int)start[1],
+ (int)start[2], (int)start[3],
(int)start[4]);
- HDfprintf(stdout,
- "%s:%d: stride = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)stride[0], (int)stride[1],
- (int)stride[2], (int)stride[3],
+ HDfprintf(stdout,
+ "%s:%d: stride = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)stride[0], (int)stride[1],
+ (int)stride[2], (int)stride[3],
(int)stride[4]);
- HDfprintf(stdout,
- "%s:%d: count = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)count[0], (int)count[1],
- (int)count[2], (int)count[3],
+ HDfprintf(stdout,
+ "%s:%d: count = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)count[0], (int)count[1],
+ (int)count[2], (int)count[3],
(int)count[4]);
- HDfprintf(stdout,
- "%s:%d: block = %d %d %d %d %d.\n",
- fcnName, mpi_rank,
- (int)block[0], (int)block[1],
- (int)block[2], (int)block[3],
+ HDfprintf(stdout,
+ "%s:%d: block = %d %d %d %d %d.\n",
+ fcnName, mpi_rank,
+ (int)block[0], (int)block[1],
+ (int)block[2], (int)block[3],
(int)block[4]);
- HDfprintf(stdout,
- "%s:%d: n-cube extent dims = %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: n-cube extent dims = %d.\n",
fcnName, mpi_rank,
H5Sget_simple_extent_ndims(tgt_sid));
- HDfprintf(stdout,
- "%s:%d: selection rank = %d.\n",
+ HDfprintf(stdout,
+ "%s:%d: selection rank = %d.\n",
fcnName, mpi_rank, sel_rank);
}
#endif
if ( first_selection ) {
- first_selection = FALSE;
+ first_selection = FALSE;
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_SET,
- &(start[ds_offset]),
- &(stride[ds_offset]),
- &(count[ds_offset]),
+ &(start[ds_offset]),
+ &(stride[ds_offset]),
+ &(count[ds_offset]),
&(block[ds_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(SET) succeeded");
} else {
ret = H5Sselect_hyperslab
(
- tgt_sid,
+ tgt_sid,
H5S_SELECT_OR,
- &(start[ds_offset]),
- &(stride[ds_offset]),
- &(count[ds_offset]),
+ &(start[ds_offset]),
+ &(stride[ds_offset]),
+ &(count[ds_offset]),
&(block[ds_offset])
);
-
+
VRFY((ret != FAIL), "H5Sselect_hyperslab(OR) succeeded");
}
@@ -1284,14 +1274,14 @@ lower_dim_size_comp_test__select_checker_board(
} while ( ( i <= 1 ) &&
( 0 >= sel_offset ) );
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */
- /* Clip the selection back to the data space proper. */
+ /* Clip the selection back to the dataspace proper. */
for ( i = 0; i < test_max_rank; i++ ) {
@@ -1306,7 +1296,7 @@ lower_dim_size_comp_test__select_checker_board(
VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n",
fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid));
@@ -1321,57 +1311,57 @@ lower_dim_size_comp_test__select_checker_board(
/****************************************************************
**
-** lower_dim_size_comp_test__verify_data():
+** lower_dim_size_comp_test__verify_data():
**
-** Examine the supplied buffer to see if it contains the
-** expected data. Return TRUE if it does, and FALSE
+** Examine the supplied buffer to see if it contains the
+** expected data. Return TRUE if it does, and FALSE
** otherwise.
**
-** The supplied buffer is presumed to this process's slice
-** of the target data set. Each such slice will be an
-** n-cube of rank (rank -1) and the supplied edge_size with
-** origin (mpi_rank, 0, ... , 0) in the target data set.
+** The supplied buffer is presumed to this process's slice
+** of the target data set. Each such slice will be an
+** n-cube of rank (rank -1) and the supplied edge_size with
+** origin (mpi_rank, 0, ... , 0) in the target data set.
**
-** Further, the buffer is presumed to be the result of reading
-** or writing a checker board selection of an m (1 <= m <
+** Further, the buffer is presumed to be the result of reading
+** or writing a checker board selection of an m (1 <= m <
** rank) dimensional slice through this processes slice
-** of the target data set. Also, this slice must be parallel
-** to the fastest changing indicies.
+** of the target data set. Also, this slice must be parallel
+** to the fastest changing indicies.
**
-** It is further presumed that the buffer was zeroed before
-** the read/write, and that the full target data set (i.e.
-** the buffer/data set for all processes) was initialized
-** with the natural numbers listed in order from the origin
-** along the fastest changing axis.
+** It is further presumed that the buffer was zeroed before
+** the read/write, and that the full target data set (i.e.
+** the buffer/data set for all processes) was initialized
+** with the natural numbers listed in order from the origin
+** along the fastest changing axis.
**
** Thus for a 20x10x10 dataset, the value stored in location
-** (x, y, z) (assuming that z is the fastest changing index
-** and x the slowest) is assumed to be:
+** (x, y, z) (assuming that z is the fastest changing index
+** and x the slowest) is assumed to be:
**
-** (10 * 10 * x) + (10 * y) + z
+** (10 * 10 * x) + (10 * y) + z
**
-** Further, supposing that this is process 10, this process's
-** slice of the dataset would be a 10 x 10 2-cube with origin
-** (10, 0, 0) in the data set, and would be initialize (prior
-** to the checkerboard selection) as follows:
+** Further, supposing that this is process 10, this process's
+** slice of the dataset would be a 10 x 10 2-cube with origin
+** (10, 0, 0) in the data set, and would be initialize (prior
+** to the checkerboard selection) as follows:
**
-** 1000, 1001, 1002, ... 1008, 1009
-** 1010, 1011, 1012, ... 1018, 1019
-** . . . . .
-** . . . . .
-** . . . . .
-** 1090, 1091, 1092, ... 1098, 1099
+** 1000, 1001, 1002, ... 1008, 1009
+** 1010, 1011, 1012, ... 1018, 1019
+** . . . . .
+** . . . . .
+** . . . . .
+** 1090, 1091, 1092, ... 1098, 1099
**
-** In the case of a read from the processors slice of another
-** data set of different rank, the values expected will have
-** to be adjusted accordingly. This is done via the
-** first_expected_val parameter.
+** In the case of a read from the processors slice of another
+** data set of different rank, the values expected will have
+** to be adjusted accordingly. This is done via the
+** first_expected_val parameter.
**
-** Finally, the function presumes that the first element
-** of the buffer resides either at the origin of either
-** a selected or an unselected checker. (Translation:
-** if partial checkers appear in the buffer, they will
-** intersect the edges of the n-cube oposite the origin.)
+** Finally, the function presumes that the first element
+** of the buffer resides either at the origin of either
+** a selected or an unselected checker. (Translation:
+** if partial checkers appear in the buffer, they will
+** intersect the edges of the n-cube oposite the origin.)
**
****************************************************************/
@@ -1379,7 +1369,7 @@ lower_dim_size_comp_test__select_checker_board(
static hbool_t
lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
const int mpi_rank,
#endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */
const int rank,
@@ -1389,8 +1379,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
hbool_t buf_starts_in_checker)
{
#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- const char * fcnName =
- "lower_dim_size_comp_test__verify_data():";
+ const char * fcnName =
+ "lower_dim_size_comp_test__verify_data():";
#endif
hbool_t good_data = TRUE;
hbool_t in_checker;
@@ -1409,16 +1399,16 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
HDassert( checker_edge_size <= edge_size );
HDassert( test_max_rank <= LDSCT_DS_RANK );
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s mpi_rank = %d.\n", fcnName, mpi_rank);
HDfprintf(stdout, "%s rank = %d.\n", fcnName, rank);
HDfprintf(stdout, "%s edge_size = %d.\n", fcnName, edge_size);
- HDfprintf(stdout, "%s checker_edge_size = %d.\n",
+ HDfprintf(stdout, "%s checker_edge_size = %d.\n",
fcnName, checker_edge_size);
- HDfprintf(stdout, "%s first_expected_val = %d.\n",
+ HDfprintf(stdout, "%s first_expected_val = %d.\n",
fcnName, (int)first_expected_val);
- HDfprintf(stdout, "%s starts_in_checker = %d.\n",
+ HDfprintf(stdout, "%s starts_in_checker = %d.\n",
fcnName, (int)buf_starts_in_checker);
}
#endif
@@ -1463,7 +1453,7 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
y = 0;
start_in_checker[3] = start_in_checker[2];
do
- {
+ {
if ( y >= checker_edge_size ) {
start_in_checker[3] = ! start_in_checker[3];
@@ -1472,8 +1462,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
m = 0;
z = 0;
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m);
}
@@ -1481,8 +1471,8 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
in_checker = start_in_checker[3];
do
{
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, " %d", (int)(*val_ptr));
}
@@ -1492,21 +1482,21 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
in_checker = ! in_checker;
z = 0;
}
-
+
if ( in_checker ) {
-
+
if ( *val_ptr != expected_value ) {
good_data = FALSE;
}
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
} else if ( *val_ptr != 0 ) {
good_data = FALSE;
-
+
/* zero out buffer for re-use */
*val_ptr = 0;
@@ -1516,11 +1506,11 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
expected_value++;
m++;
z++;
-
+
} while ( ( rank >= (test_max_rank - 4) ) &&
( m < edge_size ) );
-#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
- if ( mpi_rank ==
+#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
+ if ( mpi_rank ==
LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "\n");
}
@@ -1548,22 +1538,20 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr,
/*-------------------------------------------------------------------------
- * Function: lower_dim_size_comp_test__run_test()
+ * Function: lower_dim_size_comp_test__run_test()
*
- * Purpose: Verify that a bug in the computation of the size of the
- * lower dimensions of a data space in H5S_obtain_datatype()
- * has been corrected.
+ * Purpose: Verify that a bug in the computation of the size of the
+ * lower dimensions of a dataspace in H5S_obtain_datatype()
+ * has been corrected.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 11/11/09
- *
- * Modifications:
+ * Programmer: JRM -- 11/11/09
*
*-------------------------------------------------------------------------
*/
-#define LDSCT_DS_RANK 5
+#define LDSCT_DS_RANK 5
#define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0
static void
@@ -1571,21 +1559,21 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
const hbool_t use_collective_io,
const hid_t dset_type)
{
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
const char *fcnName = "lower_dim_size_comp_test__run_test()";
- int rank;
- hsize_t dims[32];
- hsize_t max_dims[32];
+ int rank;
+ hsize_t dims[32];
+ hsize_t max_dims[32];
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
const char *filename;
- hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
+ hbool_t data_ok = FALSE;
+ hbool_t mis_match = FALSE;
int i;
int start_index;
int stop_index;
- int mrc;
- int mpi_rank;
- int mpi_size;
+ int mrc;
+ int mpi_rank;
+ int mpi_size;
MPI_Comm mpi_comm = MPI_COMM_NULL;
MPI_Info mpi_info = MPI_INFO_NULL;
hid_t fid; /* HDF5 file ID */
@@ -1635,7 +1623,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
mpi_comm = MPI_COMM_WORLD;
mpi_info = MPI_INFO_NULL;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: chunk_edge_size = %d.\n",
fcnName, mpi_rank, (int)chunk_edge_size);
@@ -1650,13 +1638,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10);
large_ds_slice_size = (size_t) (10 * 10 * 10 * 10);
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)small_ds_size, (int)small_ds_slice_size);
HDfprintf(stdout, "%s:%d: large ds size / slice size = %d / %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)large_ds_size, (int)large_ds_slice_size);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -1739,7 +1727,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_dims[3] = 10;
large_dims[4] = 10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small_dims[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)small_dims[0], (int)small_dims[1],
@@ -1748,41 +1736,41 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
fcnName, mpi_rank, (int)large_dims[0], (int)large_dims[1],
(int)large_dims[2], (int)large_dims[3], (int)large_dims[4]);
}
-#endif
+#endif
- /* create data spaces */
+ /* create dataspaces */
full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((full_mem_small_ds_sid != 0),
+ VRFY((full_mem_small_ds_sid != 0),
"H5Screate_simple() full_mem_small_ds_sid succeeded");
full_file_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((full_file_small_ds_sid != 0),
+ VRFY((full_file_small_ds_sid != 0),
"H5Screate_simple() full_file_small_ds_sid succeeded");
mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((mem_small_ds_sid != 0),
+ VRFY((mem_small_ds_sid != 0),
"H5Screate_simple() mem_small_ds_sid succeeded");
file_small_ds_sid = H5Screate_simple(5, small_dims, NULL);
- VRFY((file_small_ds_sid != 0),
+ VRFY((file_small_ds_sid != 0),
"H5Screate_simple() file_small_ds_sid succeeded");
full_mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((full_mem_large_ds_sid != 0),
+ VRFY((full_mem_large_ds_sid != 0),
"H5Screate_simple() full_mem_large_ds_sid succeeded");
full_file_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((full_file_large_ds_sid != 0),
+ VRFY((full_file_large_ds_sid != 0),
"H5Screate_simple() full_file_large_ds_sid succeeded");
mem_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((mem_large_ds_sid != 0),
+ VRFY((mem_large_ds_sid != 0),
"H5Screate_simple() mem_large_ds_sid succeeded");
file_large_ds_sid = H5Screate_simple(5, large_dims, NULL);
- VRFY((file_large_ds_sid != 0),
+ VRFY((file_large_ds_sid != 0),
"H5Screate_simple() file_large_ds_sid succeeded");
@@ -1812,14 +1800,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
small_chunk_dims[1] = small_chunk_dims[2] = (hsize_t)1;
small_chunk_dims[3] = small_chunk_dims[4] = (hsize_t)chunk_edge_size;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small chunk dims[] = %d %d %d %d %d\n",
- fcnName, mpi_rank, (int)small_chunk_dims[0],
- (int)small_chunk_dims[1], (int)small_chunk_dims[2],
+ fcnName, mpi_rank, (int)small_chunk_dims[0],
+ (int)small_chunk_dims[1], (int)small_chunk_dims[2],
(int)small_chunk_dims[3], (int)small_chunk_dims[4]);
}
-#endif
+#endif
small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded");
@@ -1831,18 +1819,18 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded");
large_chunk_dims[0] = (hsize_t)(1);
- large_chunk_dims[1] = large_chunk_dims[2] =
- large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size;
+ large_chunk_dims[1] = large_chunk_dims[2] =
+ large_chunk_dims[3] = large_chunk_dims[4] = (hsize_t)chunk_edge_size;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: large chunk dims[] = %d %d %d %d %d\n",
- fcnName, mpi_rank, (int)large_chunk_dims[0],
- (int)large_chunk_dims[1], (int)large_chunk_dims[2],
+ fcnName, mpi_rank, (int)large_chunk_dims[0],
+ (int)large_chunk_dims[1], (int)large_chunk_dims[2],
(int)large_chunk_dims[3], (int)large_chunk_dims[4]);
}
-#endif
+#endif
large_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((ret != FAIL), "H5Pcreate() large_ds_dcpl_id succeeded");
@@ -1868,11 +1856,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
large_ds_dcpl_id, H5P_DEFAULT);
VRFY((ret >= 0), "H5Dcreate2() large_dataset succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: small/large ds id = %d / %d.\n",
- fcnName, mpi_rank, (int)small_dataset,
+ HDfprintf(stdout,
+ "%s:%d: small/large ds id = %d / %d.\n",
+ fcnName, mpi_rank, (int)small_dataset,
(int)large_dataset);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -1906,10 +1894,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block[0] = block[1] = block[2] = 1;
block[3] = block[4] = 10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: settings for small data set initialization.\n",
+ HDfprintf(stdout,
+ "%s:%d: settings for small data set initialization.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -1947,10 +1935,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start[0] = 0;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: added settings for main process.\n",
+ HDfprintf(stdout,
+ "%s:%d: added settings for main process.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -1992,23 +1980,23 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* write the initial value of the small data set to file */
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: writing init value of small ds to file.\n",
fcnName, mpi_rank);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
- ret = H5Dwrite(small_dataset,
- dset_type,
- mem_small_ds_sid,
+ ret = H5Dwrite(small_dataset,
+ dset_type,
+ mem_small_ds_sid,
file_small_ds_sid,
- xfer_plist,
+ xfer_plist,
small_ds_buf_0);
VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded");
- /* read the small data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the small data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set and verifies it.
*/
ret = H5Dread(small_dataset,
@@ -2061,10 +2049,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block[0] = (hsize_t)1;
block[1] = block[2] = block[3] = block[4] = (hsize_t)10;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: settings for large data set initialization.\n",
+ HDfprintf(stdout,
+ "%s:%d: settings for large data set initialization.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -2097,15 +2085,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block);
VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid, set) suceeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(mem_large_ds_sid));
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(file_large_ds_sid));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -2114,10 +2102,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start[0] = (hsize_t)0;
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
- "%s:%d: added settings for main process.\n",
+ HDfprintf(stdout,
+ "%s:%d: added settings for main process.\n",
fcnName, mpi_rank);
HDfprintf(stdout, "%s:%d: start[] = %d %d %d %d %d\n",
fcnName, mpi_rank, (int)start[0], (int)start[1],
@@ -2150,21 +2138,21 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
block);
VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid, or) suceeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(mem_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(mem_large_ds_sid));
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s%d: H5Sget_select_npoints(file_large_ds_sid) = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)H5Sget_select_npoints(file_large_ds_sid));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
}
- /* try clipping the selection back to the large data space proper */
+ /* try clipping the selection back to the large dataspace proper */
start[0] = start[1] = start[2] = start[3] = start[4] = (hsize_t)0;
stride[0] = (hsize_t)(2 * (mpi_size + 1));
@@ -2183,19 +2171,19 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
start, stride, count, block);
VRFY((ret != FAIL),"H5Sselect_hyperslab(file_large_ds_sid, and) succeeded");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
- if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+ if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
rank = H5Sget_simple_extent_dims(mem_large_ds_sid, dims, max_dims);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: mem_large_ds_sid dims[%d] = %d %d %d %d %d\n",
- fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
+ fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
(int)dims[2], (int)dims[3], (int)dims[4]);
rank = H5Sget_simple_extent_dims(file_large_ds_sid, dims, max_dims);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: file_large_ds_sid dims[%d] = %d %d %d %d %d\n",
- fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
+ fcnName, mpi_rank, rank, (int)dims[0], (int)dims[1],
(int)dims[2], (int)dims[3], (int)dims[4]);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
@@ -2208,26 +2196,26 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* write the initial value of the large data set to file */
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
- if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+ if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: writing init value of large ds to file.\n",
fcnName, mpi_rank);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: large_dataset = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)large_dataset);
- HDfprintf(stdout,
+ HDfprintf(stdout,
"%s:%d: mem_large_ds_sid = %d, file_large_ds_sid = %d.\n",
- fcnName, mpi_rank,
+ fcnName, mpi_rank,
(int)mem_large_ds_sid, (int)file_large_ds_sid);
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */
- ret = H5Dwrite(large_dataset,
- dset_type,
- mem_large_ds_sid,
+ ret = H5Dwrite(large_dataset,
+ dset_type,
+ mem_large_ds_sid,
file_large_ds_sid,
- xfer_plist,
+ xfer_plist,
large_ds_buf_0);
if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr);
@@ -2238,8 +2226,8 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
mrc = MPI_Barrier(MPI_COMM_WORLD);
VRFY((mrc==MPI_SUCCESS), "Sync after large dataset writes");
- /* read the large data set back to verify that it contains the
- * expected data. Note that each process reads in the entire
+ /* read the large data set back to verify that it contains the
+ * expected data. Note that each process reads in the entire
* data set.
*/
ret = H5Dread(large_dataset,
@@ -2278,13 +2266,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/***********************************/
- /* read a checkerboard selection of the process slice of the
- * small on disk data set into the process slice of the large
+ /* read a checkerboard selection of the process slice of the
+ * small on disk data set into the process slice of the large
* in memory data set, and verify the data read.
*/
small_sel_start[0] = (hsize_t)(mpi_rank + 1);
- small_sel_start[1] = small_sel_start[2] =
+ small_sel_start[1] = small_sel_start[2] =
small_sel_start[3] = small_sel_start[4] = 0;
lower_dim_size_comp_test__select_checker_board(mpi_rank,
@@ -2296,9 +2284,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
small_sel_start);
expected_value = (uint32_t)
- ((small_sel_start[0] * small_dims[1] * small_dims[2] *
+ ((small_sel_start[0] * small_dims[1] * small_dims[2] *
small_dims[3] * small_dims[4]) +
- (small_sel_start[1] * small_dims[2] * small_dims[3] *
+ (small_sel_start[1] * small_dims[2] * small_dims[3] *
small_dims[4]) +
(small_sel_start[2] * small_dims[3] * small_dims[4]) +
(small_sel_start[3] * small_dims[4]) +
@@ -2321,8 +2309,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* verify that H5S_select_shape_same() reports the two
* selections as having the same shape.
*/
- check = H5S_select_shape_same_test(mem_large_ds_sid,
- file_small_ds_sid);
+ check = H5S_select_shape_same_test(mem_large_ds_sid, file_small_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed (1)");
@@ -2335,7 +2322,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret >= 0), "H5Sread() slice from small ds succeeded.");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank);
}
@@ -2345,9 +2332,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
data_ok = TRUE;
- start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] *
+ start_index = (int)((large_sel_start[0] * large_dims[1] * large_dims[2] *
large_dims[3] * large_dims[4]) +
- (large_sel_start[1] * large_dims[2] * large_dims[3] *
+ (large_sel_start[1] * large_dims[2] * large_dims[3] *
large_dims[4]) +
(large_sel_start[2] * large_dims[3] * large_dims[4]) +
(large_sel_start[3] * large_dims[4]) +
@@ -2409,13 +2396,13 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
- /* read a checkerboard selection of a slice of the process slice of
- * the large on disk data set into the process slice of the small
+ /* read a checkerboard selection of a slice of the process slice of
+ * the large on disk data set into the process slice of the small
* in memory data set, and verify the data read.
*/
small_sel_start[0] = (hsize_t)(mpi_rank + 1);
- small_sel_start[1] = small_sel_start[2] =
+ small_sel_start[1] = small_sel_start[2] =
small_sel_start[3] = small_sel_start[4] = 0;
lower_dim_size_comp_test__select_checker_board(mpi_rank,
@@ -2442,8 +2429,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/* verify that H5S_select_shape_same() reports the two
* selections as having the same shape.
*/
- check = H5S_select_shape_same_test(mem_small_ds_sid,
- file_large_ds_sid);
+ check = H5S_select_shape_same_test(mem_small_ds_sid, file_large_ds_sid);
VRFY((check == TRUE), "H5S_select_shape_same_test passed (2)");
@@ -2456,7 +2442,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
VRFY((ret >= 0), "H5Sread() slice from large ds succeeded.");
-#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", fcnName, mpi_rank);
}
@@ -2467,9 +2453,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
data_ok = TRUE;
expected_value = (uint32_t)
- ((large_sel_start[0] * large_dims[1] * large_dims[2] *
+ ((large_sel_start[0] * large_dims[1] * large_dims[2] *
large_dims[3] * large_dims[4]) +
- (large_sel_start[1] * large_dims[2] * large_dims[3] *
+ (large_sel_start[1] * large_dims[2] * large_dims[3] *
large_dims[4]) +
(large_sel_start[2] * large_dims[3] * large_dims[4]) +
(large_sel_start[3] * large_dims[4]) +
@@ -2522,7 +2508,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
#if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
- HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n",
+ HDfprintf(stdout, "%s:%d: unexpected value at index %d: %d.\n",
fcnName, mpi_rank, (int)i, (int)(*ptr_1));
}
#endif /* LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG */
@@ -2590,17 +2576,15 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
/*-------------------------------------------------------------------------
- * Function: lower_dim_size_comp_test()
+ * Function: lower_dim_size_comp_test()
*
- * Purpose: Test to see if an error in the computation of the size
- * of the lower dimensions in H5S_obtain_datatype() has
- * been corrected.
+ * Purpose: Test to see if an error in the computation of the size
+ * of the lower dimensions in H5S_obtain_datatype() has
+ * been corrected.
*
- * Return: void
+ * Return: void
*
- * Programmer: JRM -- 11/11/09
- *
- * Modifications:
+ * Programmer: JRM -- 11/11/09
*
*-------------------------------------------------------------------------
*/
@@ -2609,66 +2593,60 @@ void
lower_dim_size_comp_test(void)
{
/* const char *fcnName = "lower_dim_size_comp_test()"; */
- int chunk_edge_size = 0;
- int use_collective_io = 1;
- hid_t dset_type = H5T_NATIVE_UINT;
+ int chunk_edge_size = 0;
+ int use_collective_io;
+
#if 0
- sleep(60);
+ HDsleep(60);
#endif
- HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
- for ( use_collective_io = (hbool_t)0;
- (int)use_collective_io <= 1;
- (hbool_t)(use_collective_io++) ) {
+ HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned));
+ for(use_collective_io = 0; use_collective_io <= 1; use_collective_io++) {
chunk_edge_size = 0;
lower_dim_size_comp_test__run_test(chunk_edge_size,
(hbool_t)use_collective_io,
- dset_type);
-
+ H5T_NATIVE_UINT);
chunk_edge_size = 5;
lower_dim_size_comp_test__run_test(chunk_edge_size,
(hbool_t)use_collective_io,
- dset_type);
- }
+ H5T_NATIVE_UINT);
+ } /* end for */
return;
-
} /* lower_dim_size_comp_test() */
/*-------------------------------------------------------------------------
- * Function: link_chunk_collective_io_test()
- *
- * Purpose: Test to verify that an error in MPI type management in
- * H5D_link_chunk_collective_io() has been corrected.
- * In this bug, we used to free MPI types regardless of
- * whether they were basic or derived.
+ * Function: link_chunk_collective_io_test()
*
- * This test is based on a bug report kindly provided by
- * Rob Latham of the MPICH team and ANL.
+ * Purpose: Test to verify that an error in MPI type management in
+ * H5D_link_chunk_collective_io() has been corrected.
+ * In this bug, we used to free MPI types regardless of
+ * whether they were basic or derived.
*
- * The basic thrust of the test is to cause a process
- * to participate in a collective I/O in which it:
+ * This test is based on a bug report kindly provided by
+ * Rob Latham of the MPICH team and ANL.
*
- * 1) Reads or writes exactly one chunk,
+ * The basic thrust of the test is to cause a process
+ * to participate in a collective I/O in which it:
*
- * 2) Has no in memory buffer for any other chunk.
+ * 1) Reads or writes exactly one chunk,
*
- * The test differers from Rob Latham's bug report in
- * that is runs with an arbitrary number of proceeses,
- * and uses a 1 dimensional dataset.
+ * 2) Has no in memory buffer for any other chunk.
*
- * Return: void
+ * The test differers from Rob Latham's bug report in
+ * that is runs with an arbitrary number of proceeses,
+ * and uses a 1 dimensional dataset.
*
- * Programmer: JRM -- 12/16/09
+ * Return: void
*
- * Modifications:
+ * Programmer: JRM -- 12/16/09
*
*-------------------------------------------------------------------------
*/
-#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16
+#define LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE 16
void
link_chunk_collective_io_test(void)
@@ -2676,8 +2654,8 @@ link_chunk_collective_io_test(void)
/* const char *fcnName = "link_chunk_collective_io_test()"; */
const char *filename;
hbool_t mis_match = FALSE;
- int i;
- int mrc;
+ int i;
+ int mrc;
int mpi_rank;
int mpi_size;
MPI_Comm mpi_comm = MPI_COMM_WORLD;
@@ -2728,7 +2706,7 @@ link_chunk_collective_io_test(void)
/* setup dims */
dims[0] = ((hsize_t)mpi_size) * ((hsize_t)(LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE));
- /* setup mem and file data spaces */
+ /* setup mem and file dataspaces */
write_mem_ds_sid = H5Screate_simple(1, chunk_dims, NULL);
VRFY((write_mem_ds_sid != 0),
"H5Screate_simple() write_mem_ds_sid succeeded");
@@ -2767,8 +2745,8 @@ link_chunk_collective_io_test(void)
for ( i = 0; i < LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE; i++ ) {
local_data_written[i] = expected_value;
- local_data_read[i] = 0.0;
- expected_value += 1.0;
+ local_data_read[i] = 0.0;
+ expected_value += 1.0;
}
/* select the file and mem spaces */
@@ -2794,15 +2772,15 @@ link_chunk_collective_io_test(void)
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
/* write the data set */
- ret = H5Dwrite(dset_id,
- H5T_NATIVE_DOUBLE,
- write_mem_ds_sid,
+ ret = H5Dwrite(dset_id,
+ H5T_NATIVE_DOUBLE,
+ write_mem_ds_sid,
file_ds_sid,
- xfer_plist,
+ xfer_plist,
local_data_written);
VRFY((ret >= 0), "H5Dwrite() dataset initial write succeeded");
-
+
/* sync with the other processes before checking data */
mrc = MPI_Barrier(MPI_COMM_WORLD);
VRFY((mrc==MPI_SUCCESS), "Sync after dataset write");
@@ -2830,7 +2808,7 @@ link_chunk_collective_io_test(void)
if ( diff >= 0.001 ) {
mis_match = TRUE;
- }
+ }
}
VRFY( (mis_match == FALSE), "dataset data good.");
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index ce0c69b..b89c790 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -26,15 +26,15 @@ int dim0;
int dim1;
int chunkdim0;
int chunkdim1;
-int nerrors = 0; /* errors count */
-int ndatasets = 300; /* number of datasets to create*/
+int nerrors = 0; /* errors count */
+int ndatasets = 300; /* number of datasets to create*/
int ngroups = 512; /* number of groups to create in root
- * group. */
-int facc_type = FACC_MPIO; /*Test file access type */
+ * group. */
+int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void *old_client_data; /* previous error handler arg.*/
+H5E_auto2_t old_func; /* previous error handler */
+void *old_client_data; /* previous error handler arg.*/
/* other option flags */
@@ -46,10 +46,10 @@ void *old_client_data; /* previous error handler arg.*/
#define NFILENAME 2
#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={
- "ParaTest",
- NULL};
-char filenames[NFILENAME][PATH_MAX];
-hid_t fapl; /* file access property list */
+ "ParaTest",
+ NULL};
+char filenames[NFILENAME][PATH_MAX];
+hid_t fapl; /* file access property list */
#ifdef USE_PAUSE
/* pause the process for a moment to allow debugger to attach if desired. */
@@ -62,7 +62,7 @@ void pause_proc(void)
{
int pid;
- h5_stat_t statbuf;
+ h5_stat_t statbuf;
char greenlight[] = "go";
int maxloop = 10;
int loops = 0;
@@ -79,15 +79,15 @@ void pause_proc(void)
MPI_Get_processor_name(mpi_name, &mpi_namelen);
if (MAINPROCESS)
- while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
- if (!loops++){
- printf("Proc %d (%*s, %d): to debug, attach %d\n",
- mpi_rank, mpi_namelen, mpi_name, pid, pid);
- }
- printf("waiting(%ds) for file %s ...\n", time_int, greenlight);
- fflush(stdout);
- sleep(time_int);
- }
+ while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
+ if (!loops++){
+ HDprintf("Proc %d (%*s, %d): to debug, attach %d\n",
+ mpi_rank, mpi_namelen, mpi_name, pid, pid);
+ }
+ HDprintf("waiting(%ds) for file %s ...\n", time_int, greenlight);
+ HDfflush(stdout);
+ HDsleep(time_int);
+ }
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -99,7 +99,7 @@ int MPI_Init(int *argc, char ***argv)
pause_proc();
return (ret_code);
}
-#endif /* USE_PAUSE */
+#endif /* USE_PAUSE */
/*
@@ -108,18 +108,18 @@ int MPI_Init(int *argc, char ***argv)
static void
usage(void)
{
- printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
- "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
- printf("\t-m<n_datasets>"
- "\tset number of datasets for the multiple dataset test\n");
- printf("\t-n<n_groups>"
- "\tset number of groups for the multiple group test\n");
- printf("\t-f <prefix>\tfilename prefix\n");
- printf("\t-2\t\tuse Split-file together with MPIO\n");
- printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
- ROW_FACTOR, COL_FACTOR);
- printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
- printf("\n");
+ HDprintf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
+ "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
+ HDprintf("\t-m<n_datasets>"
+ "\tset number of datasets for the multiple dataset test\n");
+ HDprintf("\t-n<n_groups>"
+ "\tset number of groups for the multiple group test\n");
+ HDprintf("\t-f <prefix>\tfilename prefix\n");
+ HDprintf("\t-2\t\tuse Split-file together with MPIO\n");
+ HDprintf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n",
+ ROW_FACTOR, COL_FACTOR);
+ HDprintf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
+ HDprintf("\n");
}
@@ -129,7 +129,7 @@ usage(void)
static int
parse_options(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -140,107 +140,107 @@ parse_options(int argc, char **argv)
chunkdim1 = (dim1+9)/10;
while (--argc){
- if (**(++argv) != '-'){
- break;
- }else{
- switch(*(*argv+1)){
- case 'm': ndatasets = atoi((*argv+1)+1);
- if (ndatasets < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'n': ngroups = atoi((*argv+1)+1);
- if (ngroups < 0){
- nerrors++;
- return(1);
- }
- break;
- case 'f': if (--argc < 1) {
- nerrors++;
- return(1);
- }
- if (**(++argv) == '-') {
- nerrors++;
- return(1);
- }
- paraprefix = *argv;
- break;
- case 'i': /* Collective MPI-IO access with independent IO */
- dxfer_coll_type = DXFER_INDEPENDENT_IO;
- break;
- case '2': /* Use the split-file driver with MPIO access */
- /* Can use $HDF5_METAPREFIX to define the */
- /* meta-file-prefix. */
- facc_type = FACC_MPIO | FACC_SPLIT;
- break;
- case 'd': /* dimensizes */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- dim0 = atoi(*(++argv))*mpi_size;
- argc--;
- dim1 = atoi(*(++argv))*mpi_size;
- /* set default chunkdim sizes too */
- chunkdim0 = (dim0+9)/10;
- chunkdim1 = (dim1+9)/10;
- break;
- case 'c': /* chunk dimensions */
- if (--argc < 2){
- nerrors++;
- return(1);
- }
- chunkdim0 = atoi(*(++argv));
- argc--;
- chunkdim1 = atoi(*(++argv));
- break;
- case 'h': /* print help message--return with nerrors set */
- return(1);
- default: printf("Illegal option(%s)\n", *argv);
- nerrors++;
- return(1);
- }
- }
+ if (**(++argv) != '-'){
+ break;
+ }else{
+ switch(*(*argv+1)){
+ case 'm': ndatasets = atoi((*argv+1)+1);
+ if (ndatasets < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'n': ngroups = atoi((*argv+1)+1);
+ if (ngroups < 0){
+ nerrors++;
+ return(1);
+ }
+ break;
+ case 'f': if (--argc < 1) {
+ nerrors++;
+ return(1);
+ }
+ if (**(++argv) == '-') {
+ nerrors++;
+ return(1);
+ }
+ paraprefix = *argv;
+ break;
+ case 'i': /* Collective MPI-IO access with independent IO */
+ dxfer_coll_type = DXFER_INDEPENDENT_IO;
+ break;
+ case '2': /* Use the split-file driver with MPIO access */
+ /* Can use $HDF5_METAPREFIX to define the */
+ /* meta-file-prefix. */
+ facc_type = FACC_MPIO | FACC_SPLIT;
+ break;
+ case 'd': /* dimensizes */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ dim0 = atoi(*(++argv))*mpi_size;
+ argc--;
+ dim1 = atoi(*(++argv))*mpi_size;
+ /* set default chunkdim sizes too */
+ chunkdim0 = (dim0+9)/10;
+ chunkdim1 = (dim1+9)/10;
+ break;
+ case 'c': /* chunk dimensions */
+ if (--argc < 2){
+ nerrors++;
+ return(1);
+ }
+ chunkdim0 = atoi(*(++argv));
+ argc--;
+ chunkdim1 = atoi(*(++argv));
+ break;
+ case 'h': /* print help message--return with nerrors set */
+ return(1);
+ default: HDprintf("Illegal option(%s)\n", *argv);
+ nerrors++;
+ return(1);
+ }
+ }
} /*while*/
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
- printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
- nerrors++;
- return(1);
+ HDprintf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
+ nerrors++;
+ return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
- printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
- nerrors++;
- return(1);
+ HDprintf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
+ nerrors++;
+ return(1);
}
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){
- if (MAINPROCESS)
- printf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
- dim0, dim1, mpi_size);
- nerrors++;
- return(1);
+ if (MAINPROCESS)
+ HDprintf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
+ dim0, dim1, mpi_size);
+ nerrors++;
+ return(1);
}
/* compose the test filenames */
{
- int i, n;
-
- n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
-
- for (i=0; i < n; i++)
- if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
- == NULL){
- printf("h5_fixname failed\n");
- nerrors++;
- return(1);
- }
- printf("Test filenames are:\n");
- for (i=0; i < n; i++)
- printf(" %s\n", filenames[i]);
+ int i, n;
+
+ n = sizeof(FILENAME)/sizeof(FILENAME[0]) - 1; /* exclude the NULL */
+
+ for (i=0; i < n; i++)
+ if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
+ == NULL){
+ HDprintf("h5_fixname failed\n");
+ nerrors++;
+ return(1);
+ }
+ HDprintf("Test filenames are:\n");
+ for (i=0; i < n; i++)
+ HDprintf(" %s\n", filenames[i]);
}
return(0);
@@ -255,7 +255,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
{
hid_t ret_pl = -1;
herr_t ret; /* generic return value */
- int mpi_rank; /* mpi variables */
+ int mpi_rank; /* mpi variables */
/* need the rank for error checking macros */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -264,32 +264,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
VRFY((ret_pl >= 0), "H5P_FILE_ACCESS");
if (l_facc_type == FACC_DEFAULT)
- return (ret_pl);
+ return (ret_pl);
if (l_facc_type == FACC_MPIO){
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(ret_pl, comm, info);
- VRFY((ret >= 0), "");
- return(ret_pl);
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(ret_pl, comm, info);
+ VRFY((ret >= 0), "");
+ ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE);
+ VRFY((ret >= 0), "");
+ ret = H5Pset_coll_metadata_write(ret_pl, TRUE);
+ VRFY((ret >= 0), "");
+ return(ret_pl);
}
if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((mpio_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
- VRFY((ret >= 0), "");
-
- /* setup file access template */
- ret_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((ret_pl >= 0), "");
- /* set Parallel access with communicator */
- ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
- H5Pclose(mpio_pl);
- return(ret_pl);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((mpio_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_mpio(mpio_pl, comm, info);
+ VRFY((ret >= 0), "");
+
+ /* setup file access template */
+ ret_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((ret_pl >= 0), "");
+ /* set Parallel access with communicator */
+ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded");
+ H5Pclose(mpio_pl);
+ return(ret_pl);
}
/* unknown file access types */
@@ -299,7 +303,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
int main(int argc, char **argv)
{
- int mpi_size, mpi_rank; /* mpi variables */
+ int mpi_size, mpi_rank; /* mpi variables */
H5Ptest_param_t ndsets_params, ngroups_params;
H5Ptest_param_t collngroups_params;
H5Ptest_param_t io_mode_confusion_params;
@@ -319,18 +323,18 @@ int main(int argc, char **argv)
dim1 = COL_FACTOR*mpi_size;
if (MAINPROCESS){
- printf("===================================\n");
- printf("PHDF5 TESTS START\n");
- printf("===================================\n");
+ HDprintf("===================================\n");
+ HDprintf("PHDF5 TESTS START\n");
+ HDprintf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
- * happen during the test and the process is aborted, it will not get
- * hang in the atexit post processing in which it may try to make MPI
- * calls. By then, MPI calls may not work.
- */
+ * happen during the test and the process is aborted, it will not get
+ * hang in the atexit post processing in which it may try to make MPI
+ * calls. By then, MPI calls may not work.
+ */
if (H5dont_atexit() < 0){
- printf("Failed to turn off atexit processing. Continue.\n");
+ HDprintf("Failed to turn off atexit processing. Continue.\n");
};
H5open();
h5_show_hostname();
@@ -340,144 +344,152 @@ int main(int argc, char **argv)
/* Tests are generally arranged from least to most complexity... */
AddTest("mpiodup", test_fapl_mpio_dup, NULL,
- "fapl_mpio duplicate", NULL);
+ "fapl_mpio duplicate", NULL);
AddTest("split", test_split_comm_access, NULL,
- "dataset using split communicators", PARATESTFILE);
+ "dataset using split communicators", PARATESTFILE);
+
+#ifdef PB_OUT /* temporary: disable page buffering when parallel */
+ AddTest("page_buffer", test_page_buffer_access, NULL,
+ "page buffer usage in parallel", PARATESTFILE);
+#endif
+
+ AddTest("props", test_file_properties, NULL,
+ "Coll Metadata file property settings", PARATESTFILE);
AddTest("idsetw", dataset_writeInd, NULL,
- "dataset independent write", PARATESTFILE);
+ "dataset independent write", PARATESTFILE);
AddTest("idsetr", dataset_readInd, NULL,
- "dataset independent read", PARATESTFILE);
+ "dataset independent read", PARATESTFILE);
AddTest("cdsetw", dataset_writeAll, NULL,
- "dataset collective write", PARATESTFILE);
+ "dataset collective write", PARATESTFILE);
AddTest("cdsetr", dataset_readAll, NULL,
- "dataset collective read", PARATESTFILE);
+ "dataset collective read", PARATESTFILE);
AddTest("eidsetw", extend_writeInd, NULL,
- "extendible dataset independent write", PARATESTFILE);
+ "extendible dataset independent write", PARATESTFILE);
AddTest("eidsetr", extend_readInd, NULL,
- "extendible dataset independent read", PARATESTFILE);
+ "extendible dataset independent read", PARATESTFILE);
AddTest("ecdsetw", extend_writeAll, NULL,
- "extendible dataset collective write", PARATESTFILE);
+ "extendible dataset collective write", PARATESTFILE);
AddTest("ecdsetr", extend_readAll, NULL,
- "extendible dataset collective read", PARATESTFILE);
+ "extendible dataset collective read", PARATESTFILE);
AddTest("eidsetw2", extend_writeInd2, NULL,
- "extendible dataset independent write #2", PARATESTFILE);
+ "extendible dataset independent write #2", PARATESTFILE);
AddTest("selnone", none_selection_chunk, NULL,
"chunked dataset with none-selection", PARATESTFILE);
AddTest("calloc", test_chunk_alloc, NULL,
- "parallel extend Chunked allocation on serial file", PARATESTFILE);
+ "parallel extend Chunked allocation on serial file", PARATESTFILE);
AddTest("fltread", test_filter_read, NULL,
- "parallel read of dataset written serially with filters", PARATESTFILE);
+ "parallel read of dataset written serially with filters", PARATESTFILE);
#ifdef H5_HAVE_FILTER_DEFLATE
AddTest("cmpdsetr", compress_readAll, NULL,
- "compressed dataset collective read", PARATESTFILE);
+ "compressed dataset collective read", PARATESTFILE);
#endif /* H5_HAVE_FILTER_DEFLATE */
AddTest("zerodsetr", zero_dim_dset, NULL,
- "zero dim dset", PARATESTFILE);
+ "zero dim dset", PARATESTFILE);
ndsets_params.name = PARATESTFILE;
ndsets_params.count = ndatasets;
AddTest("ndsetw", multiple_dset_write, NULL,
- "multiple datasets write", &ndsets_params);
+ "multiple datasets write", &ndsets_params);
ngroups_params.name = PARATESTFILE;
ngroups_params.count = ngroups;
AddTest("ngrpw", multiple_group_write, NULL,
- "multiple groups write", &ngroups_params);
+ "multiple groups write", &ngroups_params);
AddTest("ngrpr", multiple_group_read, NULL,
- "multiple groups read", &ngroups_params);
+ "multiple groups read", &ngroups_params);
AddTest("compact", compact_dataset, NULL,
- "compact dataset test", PARATESTFILE);
+ "compact dataset test", PARATESTFILE);
collngroups_params.name = PARATESTFILE;
collngroups_params.count = ngroups;
- AddTest("cngrpw", collective_group_write, NULL,
- "collective group and dataset write", &collngroups_params);
- AddTest("ingrpr", independent_group_read, NULL,
- "independent group and dataset read", &collngroups_params);
+ /* combined cngrpw and ingrpr tests because ingrpr reads file created by cngrpw. */
+ AddTest("cngrpw-ingrpr", collective_group_write_independent_group_read, NULL,
+ "collective grp/dset write - independent grp/dset read",
+ &collngroups_params);
#ifndef H5_HAVE_WIN32_API
AddTest("bigdset", big_dataset, NULL,
"big dataset test", PARATESTFILE);
#else
- printf("big dataset test will be skipped on Windows (JIRA HDDFV-8064)\n");
+ HDprintf("big dataset test will be skipped on Windows (JIRA HDDFV-8064)\n");
#endif
AddTest("fill", dataset_fillvalue, NULL,
- "dataset fill value", PARATESTFILE);
+ "dataset fill value", PARATESTFILE);
AddTest("cchunk1",
- coll_chunk1,NULL, "simple collective chunk io",PARATESTFILE);
+ coll_chunk1,NULL, "simple collective chunk io",PARATESTFILE);
AddTest("cchunk2",
- coll_chunk2,NULL, "noncontiguous collective chunk io",PARATESTFILE);
+ coll_chunk2,NULL, "noncontiguous collective chunk io",PARATESTFILE);
AddTest("cchunk3",
- coll_chunk3,NULL, "multi-chunk collective chunk io",PARATESTFILE);
+ coll_chunk3,NULL, "multi-chunk collective chunk io",PARATESTFILE);
AddTest("cchunk4",
- coll_chunk4,NULL, "collective chunk io with partial non-selection ",PARATESTFILE);
+ coll_chunk4,NULL, "collective chunk io with partial non-selection ",PARATESTFILE);
if((mpi_size < 3)&& MAINPROCESS ) {
- printf("Collective chunk IO optimization APIs ");
- printf("needs at least 3 processes to participate\n");
- printf("Collective chunk IO API tests will be skipped \n");
+ HDprintf("Collective chunk IO optimization APIs ");
+ HDprintf("needs at least 3 processes to participate\n");
+ HDprintf("Collective chunk IO API tests will be skipped \n");
}
AddTest((mpi_size <3)? "-cchunk5":"cchunk5" ,
- coll_chunk5,NULL,
- "linked chunk collective IO without optimization",PARATESTFILE);
+ coll_chunk5,NULL,
+ "linked chunk collective IO without optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk6" : "cchunk6",
- coll_chunk6,NULL,
- "multi-chunk collective IO with direct request",PARATESTFILE);
+ coll_chunk6,NULL,
+ "multi-chunk collective IO with direct request",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk7" : "cchunk7",
- coll_chunk7,NULL,
- "linked chunk collective IO with optimization",PARATESTFILE);
+ coll_chunk7,NULL,
+ "linked chunk collective IO with optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk8" : "cchunk8",
- coll_chunk8,NULL,
- "linked chunk collective IO transferring to multi-chunk",PARATESTFILE);
+ coll_chunk8,NULL,
+ "linked chunk collective IO transferring to multi-chunk",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk9" : "cchunk9",
- coll_chunk9,NULL,
- "multiple chunk collective IO with optimization",PARATESTFILE);
+ coll_chunk9,NULL,
+ "multiple chunk collective IO with optimization",PARATESTFILE);
AddTest((mpi_size < 3)? "-cchunk10" : "cchunk10",
- coll_chunk10,NULL,
- "multiple chunk collective IO transferring to independent IO",PARATESTFILE);
+ coll_chunk10,NULL,
+ "multiple chunk collective IO transferring to independent IO",PARATESTFILE);
-/* irregular collective IO tests*/
+ /* irregular collective IO tests*/
AddTest("ccontw",
- coll_irregular_cont_write,NULL,
- "collective irregular contiguous write",PARATESTFILE);
+ coll_irregular_cont_write,NULL,
+ "collective irregular contiguous write",PARATESTFILE);
AddTest("ccontr",
- coll_irregular_cont_read,NULL,
- "collective irregular contiguous read",PARATESTFILE);
+ coll_irregular_cont_read,NULL,
+ "collective irregular contiguous read",PARATESTFILE);
AddTest("cschunkw",
- coll_irregular_simple_chunk_write,NULL,
- "collective irregular simple chunk write",PARATESTFILE);
+ coll_irregular_simple_chunk_write,NULL,
+ "collective irregular simple chunk write",PARATESTFILE);
AddTest("cschunkr",
- coll_irregular_simple_chunk_read,NULL,
- "collective irregular simple chunk read",PARATESTFILE);
+ coll_irregular_simple_chunk_read,NULL,
+ "collective irregular simple chunk read",PARATESTFILE);
AddTest("ccchunkw",
- coll_irregular_complex_chunk_write,NULL,
- "collective irregular complex chunk write",PARATESTFILE);
+ coll_irregular_complex_chunk_write,NULL,
+ "collective irregular complex chunk write",PARATESTFILE);
AddTest("ccchunkr",
- coll_irregular_complex_chunk_read,NULL,
- "collective irregular complex chunk read",PARATESTFILE);
+ coll_irregular_complex_chunk_read,NULL,
+ "collective irregular complex chunk read",PARATESTFILE);
AddTest("null", null_dataset, NULL,
- "null dataset test", PARATESTFILE);
+ "null dataset test", PARATESTFILE);
io_mode_confusion_params.name = PARATESTFILE;
io_mode_confusion_params.count = 0; /* value not used */
AddTest("I/Omodeconf", io_mode_confusion, NULL,
- "I/O mode confusion test -- hangs quickly on failure",
+ "I/O mode confusion test -- hangs quickly on failure",
&io_mode_confusion_params);
if((mpi_size < 3) && MAINPROCESS) {
- printf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n");
- printf("rr_obj_hdr_flush_confusion test will be skipped \n");
+ HDprintf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n");
+ HDprintf("rr_obj_hdr_flush_confusion test will be skipped \n");
}
if(mpi_size > 2) {
rr_obj_flush_confusion_params.name = PARATESTFILE;
@@ -494,12 +506,12 @@ int main(int argc, char **argv)
AddTest("tldsc",
lower_dim_size_comp_test, NULL,
- "test lower dim size comp in span tree to mpi derived type",
+ "test lower dim size comp in span tree to mpi derived type",
PARATESTFILE);
AddTest("lccio",
link_chunk_collective_io_test, NULL,
- "test mpi derived type management",
+ "test mpi derived type management",
PARATESTFILE);
AddTest("actualio", actual_io_mode_tests, NULL,
@@ -510,19 +522,22 @@ int main(int argc, char **argv)
"test cause for broken collective io",
PARATESTFILE);
+ AddTest("edpl", test_plist_ed, NULL,
+ "encode/decode Property Lists", NULL);
+
if((mpi_size < 2) && MAINPROCESS) {
- printf("File Image Ops daisy chain test needs at least 2 processes.\n");
- printf("File Image Ops daisy chain test will be skipped \n");
+ HDprintf("File Image Ops daisy chain test needs at least 2 processes.\n");
+ HDprintf("File Image Ops daisy chain test will be skipped \n");
}
AddTest((mpi_size < 2)? "-fiodc" : "fiodc", file_image_daisy_chain_test, NULL,
"file image ops daisy chain", NULL);
if((mpi_size < 2)&& MAINPROCESS ) {
- printf("Atomicity tests need at least 2 processes to participate\n");
- printf("8 is more recommended.. Atomicity tests will be skipped \n");
+ HDprintf("Atomicity tests need at least 2 processes to participate\n");
+ HDprintf("8 is more recommended.. Atomicity tests will be skipped \n");
}
else if (facc_type != FACC_MPIO && MAINPROCESS) {
- printf("Atomicity tests will not work with a non MPIO VFD\n");
+ HDprintf("Atomicity tests will not work with a non MPIO VFD\n");
}
else if(mpi_size >= 2 && facc_type == FACC_MPIO){
AddTest("atomicity", dataset_atomicity, NULL,
@@ -530,8 +545,14 @@ int main(int argc, char **argv)
}
AddTest("denseattr", test_dense_attr, NULL,
- "Store Dense Attributes", PARATESTFILE);
+ "Store Dense Attributes", PARATESTFILE);
+ AddTest("noselcollmdread", test_partial_no_selection_coll_md_read, NULL,
+ "Collective Metadata read with some ranks having no selection", PARATESTFILE);
+ AddTest("MC_coll_MD_read", test_multi_chunk_io_addrmap_issue, NULL,
+ "Collective MD read with multi chunk I/O (H5D__chunk_addrmap)", PARATESTFILE);
+ AddTest("LC_coll_MD_read", test_link_chunk_io_sort_chunk_issue, NULL,
+ "Collective MD read with link chunk I/O (H5D__sort_chunk)", PARATESTFILE);
/* Display testing information */
TestInfo(argv[0]);
@@ -544,9 +565,9 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
- printf("===================================\n"
- " Using Independent I/O with file set view to replace collective I/O \n"
- "===================================\n");
+ HDprintf("===================================\n"
+ " Using Independent I/O with file set view to replace collective I/O \n"
+ "===================================\n");
}
@@ -554,8 +575,8 @@ int main(int argc, char **argv)
PerformTests();
/* make sure all processes are finished before final report, cleanup
- * and exit.
- */
+ * and exit.
+ */
MPI_Barrier(MPI_COMM_WORLD);
/* Display test summary, if requested */
@@ -571,20 +592,24 @@ int main(int argc, char **argv)
{
int temp;
MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
- nerrors=temp;
+ nerrors=temp;
}
- if (MAINPROCESS){ /* only process 0 reports */
- printf("===================================\n");
- if (nerrors)
- printf("***PHDF5 tests detected %d errors***\n", nerrors);
- else
- printf("PHDF5 tests finished with no errors\n");
- printf("===================================\n");
+ if (MAINPROCESS){ /* only process 0 reports */
+ HDprintf("===================================\n");
+ if (nerrors)
+ HDprintf("***PHDF5 tests detected %d errors***\n", nerrors);
+ else
+ HDprintf("PHDF5 tests finished with no errors\n");
+ HDprintf("===================================\n");
}
+
/* close HDF5 library */
H5close();
+ /* Release test infrastructure */
+ TestShutdown();
+
/* MPI_Finalize must be called AFTER H5close which may use MPI calls */
MPI_Finalize();
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 0b10249..c028c4e 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -119,7 +119,7 @@ print_incoming_data(void)
HDmemset(data, 0, PRINT_DATA_MAX_SIZE+1);
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status);
- printf("%s", data);
+ HDprintf("%s", data);
}
} while(incomingMessage);
}
@@ -274,12 +274,15 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
int cmp;
trav_table_t *table = NULL;
size_t idx;
+ int ret_value = 0;
h5difftrace("build_match_list start\n");
/* init */
trav_table_init(&table);
- if (table == NULL)
- H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create tarverse table");
+ if (table == NULL) {
+ H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create traverse table");
+ HGOTO_DONE(-1);
+ }
/*
* This is necessary for the case that given objects are group and
* have different names (ex: obj1 is /grp1 and obj2 is /grp5).
@@ -367,6 +370,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
free_exclude_path_list (opts);
+done:
*table_out = table;
h5difftrace("build_match_list finish\n");
}
@@ -1115,7 +1119,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
/*Set up args to pass to worker task. */
if(HDstrlen(obj1_fullpath) > 255 ||
HDstrlen(obj2_fullpath) > 255) {
- printf("The parallel diff only supports object names up to 255 characters\n");
+ HDprintf("The parallel diff only supports object names up to 255 characters\n");
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end if */
@@ -1243,7 +1247,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD);
} /* end else-if */
else {
- printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
+ HDprintf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
MPI_Finalize();
} /* end else */
@@ -1320,10 +1324,10 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status);
- printf("%s", data);
+ HDprintf("%s", data);
} /* end else-if */
else {
- printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
+ HDprintf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG);
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end else */
} /* end while */
@@ -1340,7 +1344,6 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
}
#endif /* H5_HAVE_PARALLEL */
-out:
opts->err_stat = opts->err_stat | ret_value;
/* free table */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 955819e..cbfabad 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -515,14 +515,14 @@ static hsize_t diff_datum(
if (H5Tis_variable_str(m_type)) {
h5difftrace("diff_datum H5T_STRING variable\n");
/* Get pointer to first string */
- s1 = *(char**) mem1;
+ s1 = *(char **)((void *)mem1);
if (s1)
size1 = HDstrlen(s1);
else
size1 = 0;
/* Get pointer to second string */
- s2 = *(char**) mem2;
+ s2 = *(char **)((void *)mem2);
if (s2)
size2 = HDstrlen(s2);
else
@@ -828,10 +828,10 @@ static hsize_t diff_datum(
size = H5Tget_size(memb_type);
/* get the number of sequence elements */
- nelmts = ((hvl_t *) mem1)->len;
+ nelmts = ((hvl_t *)((void *)mem1))->len;
for (j = 0; j < nelmts; j++)
- nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index,
+ nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, index, /* Extra (void *) cast to quiet "cast to create alignment" warning - 2019/07/05, QAK */
rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members);
H5Tclose(memb_type);
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 8ceaecc..32fb865 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1283,7 +1283,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
mem = ((unsigned char*)_mem) + block_index * size;
if (H5Tis_variable_str(tid)) {
- s = *(char**) mem;
+ s = *(char **)((void *)mem);
if (s != NULL)
size = HDstrlen(s);
else
@@ -1375,10 +1375,10 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char*)_mem) + block_index * size;
/* Get the number of sequence elements */
- nelmts = ((hvl_t *) mem)->len;
+ nelmts = ((hvl_t *)((void *)mem))->len;
/* dump the array element */
- if (render_bin_output(stream, container, memb, ((char *) (((hvl_t *) mem)->p)), nelmts) < 0) {
+ if (render_bin_output(stream, container, memb, ((char *) (((hvl_t *)((void *)mem))->p)), nelmts) < 0) {
H5Tclose(memb);
H5E_THROW(FAIL, H5E_tools_min_id_g, "render_bin_output failed");
}
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index e24d654..59cc42f 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -324,6 +324,7 @@ typedef struct h5tool_format_t {
const char *cmpd_suf;
const char *cmpd_end;
+
/*
* Fields associated with vlen data types.
*
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index 457d1af..87ac166 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -20,7 +20,7 @@
*/
static void print_filter_warning(const char *dname, const char *fname)
{
- fprintf(stderr,
+ HDfprintf(stderr,
"Warning: dataset <%s> cannot be read, %s filter is not available\n",
dname, fname);
}
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index fdd88ed..794a3d3 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -709,7 +709,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
if(H5Tis_variable_str(type)) {
/* cp_vp is the pointer into the struct where a `char*' is stored. So we have
* to dereference the pointer to get the `char*' to pass to HDstrlen(). */
- s = *(char**) cp_vp;
+ s = *(char **)((void *)cp_vp);
if(s != NULL) size = HDstrlen(s);
}
else {
@@ -1106,7 +1106,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
h5tools_str_append(str, "%s", OPT(info->vlen_pre, "("));
/* Get the number of sequence elements */
- nelmts = ((hvl_t *) cp_vp)->len;
+ nelmts = ((hvl_t *)((void *)cp_vp))->len;
for(i = 0; i < nelmts; i++) {
if(i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK));
@@ -1130,7 +1130,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
ctx->indent_level++;
/* Dump the array element */
- h5tools_str_sprint(str, info, container, memb, ((char *) (((hvl_t *) cp_vp)->p)) + i * size, ctx);
+ h5tools_str_sprint(str, info, container, memb, ((char *) (((hvl_t *)((void *)cp_vp))->p)) + i * size, ctx);
ctx->indent_level--;
} /* end for */
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 3f66ef6..37d137c 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -97,7 +97,7 @@ parallel_print(const char* format, ...)
HDva_end(ap);
}
-
+
/*-------------------------------------------------------------------------
* Function: error_msg
*
@@ -122,7 +122,7 @@ error_msg(const char *fmt, ...)
HDva_end(ap);
}
-
+
/*-------------------------------------------------------------------------
* Function: warn_msg
*
@@ -161,7 +161,7 @@ help_ref_msg(FILE *output)
HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n",h5tools_getprogname());
}
-
+
/*-------------------------------------------------------------------------
* Function: get_option
*
@@ -344,7 +344,7 @@ indentation(unsigned x)
}
}
-
+
/*-------------------------------------------------------------------------
* Function: print_version
*
@@ -362,7 +362,7 @@ print_version(const char *progname)
((const char *)H5_VERS_SUBRELEASE)[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
+
/*-------------------------------------------------------------------------
* Function: init_table
*
@@ -384,7 +384,7 @@ init_table(table_t **tbl)
*tbl = table;
}
-
+
/*-------------------------------------------------------------------------
* Function: free_table
*
@@ -408,7 +408,7 @@ free_table(table_t *table)
}
#ifdef H5DUMP_DEBUG
-
+
/*-------------------------------------------------------------------------
* Function: dump_table
*
@@ -429,7 +429,7 @@ dump_table(char* tablename, table_t *table)
table->objs[u].displayed, table->objs[u].recorded);
}
-
+
/*-------------------------------------------------------------------------
* Function: dump_tables
*
@@ -447,7 +447,7 @@ dump_tables(find_objs_t *info)
}
#endif /* H5DUMP_DEBUG */
-
+
/*-------------------------------------------------------------------------
* Function: search_obj
*
@@ -470,7 +470,7 @@ search_obj(table_t *table, haddr_t objno)
return NULL;
}
-
+
/*-------------------------------------------------------------------------
* Function: find_objs_cb
*
@@ -482,8 +482,7 @@ search_obj(table_t *table, haddr_t objno)
*-------------------------------------------------------------------------
*/
static herr_t
-find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen,
- void *op_data)
+find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen, void *op_data)
{
find_objs_t *info = (find_objs_t*)op_data;
herr_t ret_value = 0;
@@ -547,7 +546,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: init_objs
*
@@ -562,6 +561,8 @@ herr_t
init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
table_t **dset_table, table_t **type_table)
{
+ herr_t ret_value = SUCCEED;
+
/* Initialize the tables */
init_table(group_table);
init_table(dset_table);
@@ -574,10 +575,23 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
info->dset_table = *dset_table;
/* Find all shared objects */
- return(h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info));
+ if((ret_value = h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "finding shared objects failed")
+
+done:
+ /* Release resources */
+ if(ret_value < 0) {
+ free_table(*group_table);
+ info->group_table = NULL;
+ free_table(*type_table);
+ info->type_table = NULL;
+ free_table(*dset_table);
+ info->dset_table = NULL;
+ }
+ return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: add_obj
*
@@ -608,7 +622,7 @@ add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record)
table->objs[u].displayed = 0;
}
-
+
#ifndef H5_HAVE_TMPFILE
/*-------------------------------------------------------------------------
* Function: tmpfile
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index a31ba3a..4c2bf1e 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -157,7 +157,7 @@ typedef struct {
/* obtain link info from H5tools_get_symlink_info() */
typedef struct {
H5O_type_t trg_type; /* OUT: target type */
- char *trg_path; /* OUT: target obj path. This must be freed
+ char *trg_path; /* OUT: target obj path. This must be freed
* when used with H5tools_get_symlink_info() */
haddr_t objno; /* OUT: target object address */
unsigned long fileno; /* OUT: File number that target object is located in */
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index ce47f4f..2d07c15 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -821,14 +821,14 @@ trav_attr(hid_t
const char *buf = op_data->path;
if((strlen(buf)==1) && (*buf=='/'))
- printf(" %-10s %s%s", "attribute", buf, attr_name);
+ HDprintf(" %-10s %s%s", "attribute", buf, attr_name);
else
- printf(" %-10s %s/%s", "attribute", buf, attr_name);
+ HDprintf(" %-10s %s/%s", "attribute", buf, attr_name);
#ifdef H5TRAV_PRINT_SPACE
if(trav_verbosity < 2) {
#endif
- printf("\n");
+ HDprintf("\n");
#ifdef H5TRAV_PRINT_SPACE
}
else {
@@ -848,26 +848,26 @@ trav_attr(hid_t
switch(space_type) {
case H5S_SCALAR:
/* scalar dataspace */
- printf(" scalar\n");
+ HDprintf(" scalar\n");
break;
case H5S_SIMPLE:
/* simple dataspace */
- printf(" {");
+ HDprintf(" {");
for (i = 0; i < ndims; i++) {
- printf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
+ HDprintf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
}
- printf("}\n");
+ HDprintf("}\n");
break;
case H5S_NULL:
/* null dataspace */
- printf(" null\n");
+ HDprintf(" null\n");
break;
default:
/* Unknown dataspace type */
- printf(" unknown\n");
+ HDprintf(" unknown\n");
break;
} /* end switch */
@@ -901,21 +901,21 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
*/
switch(oinfo->type) {
case H5O_TYPE_GROUP:
- printf(" %-10s %s", "group", path);
+ HDprintf(" %-10s %s", "group", path);
break;
case H5O_TYPE_DATASET:
- printf(" %-10s %s", "dataset", path);
+ HDprintf(" %-10s %s", "dataset", path);
break;
case H5O_TYPE_NAMED_DATATYPE:
- printf(" %-10s %s", "datatype", path);
+ HDprintf(" %-10s %s", "datatype", path);
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
default:
- printf(" %-10s %s", "unknown object type", path);
+ HDprintf(" %-10s %s", "unknown object type", path);
break;
} /* end switch */
@@ -925,14 +925,14 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
op_data.path = path;
/* Finish printing line about object */
- printf("\n");
+ HDprintf("\n");
if(trav_verbosity > 0)
H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order,
NULL, trav_attr, &op_data, H5P_DEFAULT);
}
else
/* Print the link's original name */
- printf(" -> %s\n", already_visited);
+ HDprintf(" -> %s\n", already_visited);
return(0);
} /* end trav_print_visit_obj() */
@@ -960,12 +960,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
if(targbuf) {
if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0)
targbuf[0] = 0;
- printf(" %-10s %s -> %s\n", "link", path, targbuf);
+ HDprintf(" %-10s %s -> %s\n", "link", path, targbuf);
HDfree(targbuf);
}
} /* end if */
else
- printf(" %-10s %s ->\n", "link", path);
+ HDprintf(" %-10s %s ->\n", "link", path);
break;
case H5L_TYPE_EXTERNAL:
@@ -979,12 +979,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0)
targbuf[0] = 0;
if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0)
- printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname);
+ HDprintf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname);
HDfree(targbuf);
}
} /* end if */
else
- printf(" %-10s %s ->\n", "ext link", path);
+ HDprintf(" %-10s %s ->\n", "ext link", path);
break;
case H5L_TYPE_HARD:
@@ -994,7 +994,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
case H5L_TYPE_ERROR:
case H5L_TYPE_MAX:
default:
- printf(" %-10s %s -> ???\n", "unknown type of UD link", path);
+ HDprintf(" %-10s %s -> ???\n", "unknown type of UD link", path);
break;
} /* end switch() */
diff --git a/tools/perform/pio_standalone.c b/tools/perform/pio_standalone.c
index 0df3541..022e390 100644
--- a/tools/perform/pio_standalone.c
+++ b/tools/perform/pio_standalone.c
@@ -166,110 +166,4 @@ print_version(const char *progname)
MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
#endif
-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<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c
index 550ca4a..38d95b4 100644
--- a/tools/perform/sio_engine.c
+++ b/tools/perform/sio_engine.c
@@ -54,6 +54,12 @@
} while(0)
/* POSIX I/O macros */
+#ifdef H5_HAVE_WIN32_API
+/* Can't link against the library, so this test will use the older, non-Unicode
+ * _open() call on Windows.
+ */
+#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#endif /* H5_HAVE_WIN32_API */
#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)
@@ -941,8 +947,9 @@ done:
* Modifications:
*/
-static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms,
- void *buffer, const char *buffer2)
+static herr_t
+dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer,
+ const char *buffer2)
{
int cur_dim = order[local_dim]-1;
hsize_t i;
@@ -1248,7 +1255,15 @@ done:
* Programmer: Albert Cheng 2001/12/12
* Modifications: Support for file drivers. Christian Chilan, April, 2008
*/
- static void
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'temp' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+static void
do_cleanupfile(iotype iot, char *filename)
{
char temp[2048];
@@ -1261,12 +1276,12 @@ do_cleanupfile(iotype iot, char *filename)
if (clean_file_g){
switch (iot) {
- case POSIXIO:
- HDremove(filename);
- break;
+ case POSIXIO:
+ HDremove(filename);
+ break;
- case HDF5:
- driver = H5Pget_driver(fapl);
+ case HDF5:
+ driver = H5Pget_driver(fapl);
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
@@ -1299,14 +1314,15 @@ do_cleanupfile(iotype iot, char *filename)
HDremove(filename);
}
H5Pclose(fapl);
- break;
-
- default:
- /* unknown request */
- HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
- HDassert(0 && "Unknown IO type");
- break;
- }
+ break;
+
+ default:
+ /* unknown request */
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
+ HDassert(0 && "Unknown IO type");
+ break;
+ }
}
}
+#pragma GCC diagnostic pop
diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c
index 8fa2c6f..2e6510f 100644
--- a/tools/perform/sio_perf.c
+++ b/tools/perform/sio_perf.c
@@ -280,11 +280,11 @@ struct options {
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[MAX_DIMS]; /* Dimension access order */
+ int dset_rank; /* Rank */
+ int buf_rank; /* Rank */
int order_rank; /* Rank */
- int chk_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 */
@@ -495,6 +495,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/* 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 */
diff --git a/tools/perform/sio_perf.h b/tools/perform/sio_perf.h
index 119d009..1588ae3 100644
--- a/tools/perform/sio_perf.h
+++ b/tools/perform/sio_perf.h
@@ -50,21 +50,21 @@ typedef enum 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 */
- int verify; /* Verify data correctness */
+ 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 */
+ int verify; /* Verify data correctness */
} parameters;
typedef struct results_ {
diff --git a/tools/perform/sio_standalone.c b/tools/perform/sio_standalone.c
index dfdbc55..ac191e5 100644
--- a/tools/perform/sio_standalone.c
+++ b/tools/perform/sio_standalone.c
@@ -162,122 +162,3 @@ print_version(const char *progname)
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<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
-
-#endif
-