OESS-29 Update HD prefix mostly

This commit is contained in:
Allen Byrne 2019-08-24 14:07:19 -05:00
parent 884ad149e2
commit ba974c031d
36 changed files with 1728 additions and 1734 deletions

View File

@ -125,12 +125,31 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
if (TEST_FIND_RESULT GREATER 0)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
# remove special error output
if (NOT TEST_ERRREF)
# the error stack has been appended to the output file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
else ()
# the error stack remains in the .err file
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif ()
string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
# write back the changes to the original files
if (NOT TEST_ERRREF)
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
else ()
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
endif ()
endif ()
# if the output file needs Storage text removed
if (TEST_MASK)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)

View File

@ -79,12 +79,12 @@ int main(int argc , char **argv)
if (argc < 2) {
printf("Usage: gen_test [le | be]\n");
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
if ( argv[1] && (strcmp("le",argv[1])!=0) && (strcmp("be",argv[1])!=0) ) {
printf("Usage: gen_test [le | be]\n");
HDprintf("Usage: gen_test [le | be]\n");
return 1;
}
@ -103,11 +103,11 @@ int main(int argc , char **argv)
nerrors += test_long_scalenames(filename) < 0 ? 1 : 0;
if(nerrors) goto error;
printf("Dimension scales file generation passed.\n");
HDprintf("Dimension scales file generation passed.\n");
return 0;
error:
printf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
HDprintf("***** %d DIMENSION SCALES FILE GENERATION FAILED! *****\n",nerrors);
return 1;
}
@ -188,11 +188,11 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
if(H5DSis_attached(did, dsid, idx) == 0) {
if(H5DSattach_scale(did, dsid, idx) >= 0) {
if(H5DSis_attached(did, dsid, idx) > 0) {
/* printf(" scale attached "); */
/* HDprintf(" scale attached "); */
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
printf(" scale not attached ");
HDprintf(" scale not attached ");
}
}
}

View File

@ -1049,7 +1049,7 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id
ret_value = SUCCEED;
}
else if(H5DSis_attached(did, dsid, idx) == 0) {
printf(" scale not attached ");
HDprintf(" scale not attached ");
}
}
}
@ -1153,14 +1153,14 @@ static int test_detachscales(void)
/* make datasets; they are three dimensional*/
for (i=0; i < 2; i++) {
sprintf(dname,"D%d", i);
HDsprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
}
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
sprintf(dname, "DS%d", i);
HDsprintf(dname, "DS%d", i);
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
@ -2255,7 +2255,7 @@ static int test_simple(void)
char snames[3];
int i, j;
printf("Testing API functions\n");
HDprintf("Testing API functions\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -2919,7 +2919,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
sprintf(sname, "ds_%d", j);
HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, DIM0) < 0)
@ -2942,7 +2942,7 @@ static int test_simple(void)
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
sprintf(sname,"ds_%d",j);
HDsprintf(sname,"ds_%d",j);
if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,DIM0) < 0)
@ -3740,7 +3740,7 @@ static int test_errors(void)
hid_t sidds = -1; /* space ID */
hsize_t pal_dims[] = {9,3};
printf("Testing error conditions\n");
HDprintf("Testing error conditions\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@ -4119,7 +4119,7 @@ static int test_iterators(void)
char dname[30]; /* dataset name */
int i;
printf("Testing iterators\n");
HDprintf("Testing iterators\n");
/*-------------------------------------------------------------------------
* create a file, spaces, dataset and group ids
@ -4198,7 +4198,7 @@ static int test_iterators(void)
for(i=0; i<100; i++) {
/* make a DS */
sprintf(dname,"ds_%d",i);
HDsprintf(dname,"ds_%d",i);
if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
goto out;
/* open */
@ -4311,7 +4311,7 @@ static int test_rank(void)
float buff[1]={1};
int i;
printf("Testing ranks\n");
HDprintf("Testing ranks\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales
@ -4349,7 +4349,7 @@ static int test_rank(void)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
@ -4377,7 +4377,7 @@ static int test_rank(void)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
@ -4403,7 +4403,7 @@ static int test_rank(void)
goto out;
for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
HDsprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,name) < 0)
@ -4517,7 +4517,7 @@ static int test_types(void)
const char *s1_str = "ABC";
const char *s2_str = "ABCD";
printf("Testing scales with several datatypes\n");
HDprintf("Testing scales with several datatypes\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -4694,7 +4694,7 @@ static int test_data(void)
float fill=-99; /* fill value */
printf("Testing reading ASCII data and generate HDF5 data with scales\n");
HDprintf("Testing reading ASCII data and generate HDF5 data with scales\n");
/*-------------------------------------------------------------------------
* create a file for the test
@ -4870,7 +4870,7 @@ static int read_data( const char* fname,
/* read first data file */
f = HDfopen(data_file, "r");
if( f == NULL ) {
printf( "Could not open file %s\n", data_file );
HDprintf( "Could not open file %s\n", data_file );
return -1;
}
@ -4892,7 +4892,7 @@ static int read_data( const char* fname,
*buf = (float*) HDmalloc (nelms * sizeof( float ));
if ( *buf == NULL ) {
printf( "memory allocation failed\n" );
HDprintf( "memory allocation failed\n" );
HDfclose(f);
return -1;
}
@ -4930,7 +4930,7 @@ static int test_errors2(void)
int nscales; /* number of scales in DIM */
int count; /* visitor data */
printf("Testing parameter errors\n");
HDprintf("Testing parameter errors\n");
/*-------------------------------------------------------------------------
* create a file, a dataset, scales

View File

@ -112,7 +112,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags)
filename[i] = (char *)HDmalloc(sizeof(char) * 32);
/* create file name */
sprintf(filename[i], "image_file%d.h5", (int)i);
HDsprintf(filename[i], "image_file%d.h5", (int)i);
/* create file */
if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@ -536,11 +536,11 @@ int main( void )
nerrors += test_file_image(open_images, nflags, flags) < 0? 1 : 0;
if (nerrors) goto error;
printf("File image tests passed.\n");
HDprintf("File image tests passed.\n");
return 0;
error:
printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}

View File

@ -75,11 +75,11 @@ int main(void)
nerrors += test_generate()<0 ?1:0;
if (nerrors) goto error;
printf("All image tests passed.\n");
HDprintf("All image tests passed.\n");
return 0;
error:
printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
HDprintf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@ -344,7 +344,7 @@ static int test_data(void)
if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
printf("Testing read ascii image data and generate images\n");
HDprintf("Testing read ascii image data and generate images\n");
/*-------------------------------------------------------------------------
* read 8bit image data
@ -551,7 +551,7 @@ static int test_generate(void)
if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
printf("Testing read and process data and make indexed images\n");
HDprintf("Testing read and process data and make indexed images\n");
/*-------------------------------------------------------------------------
* read data; the file data format is described below
@ -561,7 +561,7 @@ static int test_generate(void)
f = HDfopen( data_file, "r" ) ;
if ( f == NULL )
{
printf( "Could not find file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not find file %s. Try set $srcdir \n", data_file );
goto out;
}
@ -602,11 +602,11 @@ static int test_generate(void)
if(fscanf( f, "%d %d %d", &imax, &jmax, &kmax ) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "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 );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@ -638,7 +638,7 @@ static int test_generate(void)
for ( i = 0; i < n_elements; i++ )
{
if(fscanf( f, "%f ", &value ) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
data[i] = value;
@ -797,37 +797,37 @@ static int read_data(const char* fname, /*IN*/
*/
if(NULL == (f = HDfopen(data_file, "r"))) {
printf( "Could not open file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
goto out;
}
if(fscanf(f, "%s", str) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "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 );
HDprintf( "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 );
HDprintf( "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 );
HDprintf( "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 );
HDprintf( "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 );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
@ -861,7 +861,7 @@ static int read_data(const char* fname, /*IN*/
/* Read data elements */
for(i = 0; i < n_elements; i++) {
if(fscanf(f, "%d", &n) < 0 && HDferror(f)) {
printf( "fscanf error in file %s.\n", data_file );
HDprintf( "fscanf error in file %s.\n", data_file );
goto out;
} /* end if */
image_data[i] = (unsigned char)n;
@ -917,7 +917,7 @@ static int read_palette(const char* fname,
/* open the input file */
if (!(file = HDfopen(data_file, "r")))
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
HDprintf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}

View File

@ -69,7 +69,7 @@ static int test_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@ -108,7 +108,7 @@ static int test_VLof_atomic(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -120,8 +120,8 @@ static int test_VLof_atomic(void)
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]);
HDprintf("Packet %u's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
HDprintf("Packet %u's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@ -186,7 +186,7 @@ static int test_VLof_comptype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@ -242,7 +242,7 @@ static int test_VLof_comptype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -253,13 +253,13 @@ static int test_VLof_comptype(void)
/* 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);
HDfprintf(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 */
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]);
HDfprintf(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 */
}
@ -334,7 +334,7 @@ static int test_compound_VL_VLtype(void)
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
@ -342,7 +342,7 @@ static int test_compound_VL_VLtype(void)
{
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);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@ -407,7 +407,7 @@ static int test_compound_VL_VLtype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -418,27 +418,27 @@ static int test_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f,readBuf[uu].f)) {
fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
fprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%d].v.len=%zu, readBuf[%d].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@ -505,7 +505,7 @@ static int test_VLof_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
@ -513,7 +513,7 @@ static int test_VLof_VLtype(void)
{
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv * 1;
@ -559,7 +559,7 @@ static int test_VLof_VLtype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -628,7 +628,7 @@ static int verify_ptlengthtype(hid_t fid, const char *table_name, herr_t expecte
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);
HDfprintf(stderr, "\nPacket table '%s' should be %s but is not\n", table_name, lenthtype);
ret = FAIL;
}
@ -1062,7 +1062,7 @@ static int testfl_VLof_atomic(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(unsigned int));
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@ -1101,7 +1101,7 @@ static int testfl_VLof_atomic(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -1113,8 +1113,8 @@ static int testfl_VLof_atomic(void)
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]);
HDprintf("Packet %d's value should be %d\n", uu, ((unsigned int *)writeBuf[uu].p)[vv]);
HDprintf("Packet %d's value in readBuf is %d\n", uu, ((unsigned int *)readBuf[uu].p)[vv]);
}
}
@ -1179,7 +1179,7 @@ static int testfl_VLof_comptype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(VLcomp_t));
if(writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].len = uu + 1;
@ -1235,7 +1235,7 @@ static int testfl_VLof_comptype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -1246,13 +1246,13 @@ static int testfl_VLof_comptype(void)
/* 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);
HDfprintf(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 */
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]);
HDfprintf(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 */
}
@ -1327,7 +1327,7 @@ static int testfl_compound_VL_VLtype(void)
writeBuf[uu].f = (float)(uu * 20) / 3.0F;
writeBuf[uu].v.p = HDmalloc((uu + L1_INCM) * sizeof(hvl_t));
if (writeBuf[uu].v.p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
writeBuf[uu].v.len = uu + L1_INCM;
@ -1335,7 +1335,7 @@ static int testfl_compound_VL_VLtype(void)
{
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);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + L2_INCM;
@ -1400,7 +1400,7 @@ static int testfl_compound_VL_VLtype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */
@ -1411,27 +1411,27 @@ static int testfl_compound_VL_VLtype(void)
/* Compare data read in */
for (uu = 0; uu < NRECORDS; uu++) {
if (writeBuf[uu].u != readBuf[uu].u) {
fprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
HDfprintf(stderr, "Integer components don't match!, writeBuf[%u].u=%u, readBuf[%u].u=%u\n", uu, writeBuf[uu].u, uu, readBuf[uu].u);
continue;
} /* end if */
if (!H5_FLT_ABS_EQUAL(writeBuf[uu].f, readBuf[uu].f)) {
fprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
HDfprintf(stderr, "Float components don't match!, writeBuf[%u].f=%f, readBuf[%u].f=%f\n", uu, (double)writeBuf[uu].f, uu, (double)readBuf[uu].f);
continue;
} /* end if */
if (writeBuf[uu].v.len != readBuf[uu].v.len) {
fprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
HDfprintf(stderr, "%d: VL data length don't match!, writeBuf[%u].v.len=%zu, readBuf[%u].v.len=%zu\n", __LINE__, uu, writeBuf[uu].v.len, uu, readBuf[uu].v.len);
continue;
} /* end if */
for (t1 = (hvl_t *)(writeBuf[uu].v.p), t2 = (hvl_t *)(readBuf[uu].v.p), vv = 0; (size_t)vv < readBuf[uu].v.len; vv++, t1++, t2++) {
if (t1->len != t2->len) {
fprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
HDfprintf(stderr, "%d: VL data length don't match!, uu=%u, vv=%u, t1->len=%zu, t2->len=%zu\n", __LINE__, uu, vv, t1->len, t2->len);
continue;
} /* end if */
for (ww = 0; (size_t)ww < t2->len; ww++) {
if (((unsigned int *)t1->p)[ww] != ((unsigned int *)t2->p)[ww] ) {
fprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
HDfprintf(stderr, "VL data values don't match!, t1->p[%u]=%u, t2->p[%u]=%u\n", ww, ((unsigned int *)t1->p)[ww], ww, ((unsigned int *)t2->p)[ww]);
continue;
} /* end if */
} /* end for */
@ -1498,7 +1498,7 @@ static int testfl_VLof_VLtype(void)
for (uu = 0; uu < NRECORDS; uu++) {
writeBuf[uu].p = HDmalloc((uu + 1) * sizeof(hvl_t));
if (writeBuf[uu].p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
} /* end if */
writeBuf[uu].len = uu + 1;
@ -1506,7 +1506,7 @@ static int testfl_VLof_VLtype(void)
{
t1->p = HDmalloc((vv + 1) * sizeof(unsigned int));
if (t1->p == NULL) {
fprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
HDfprintf(stderr, "Cannot allocate memory for VL data! uu=%u\n", uu);
goto error;
}
t1->len = vv + 1;
@ -1552,7 +1552,7 @@ static int testfl_VLof_VLtype(void)
if (ret < 0)
goto error;
sprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
HDsprintf(msg, "The number of packets in the packet table must be %u\n", NRECORDS);
VERIFY(count == NRECORDS, msg);
/* Read all five packets back */

View File

@ -55,7 +55,7 @@ int verify(int fd, unsigned int k);
void print_info(int *info, unsigned int lastr, unsigned iteration);
/*-------------------------------------------------------------------------
* Function: usage
*
@ -63,7 +63,7 @@ void print_info(int *info, unsigned int lastr, unsigned iteration);
*
* Parameters: None
*
* Return: void
* Return: void
*
*-------------------------------------------------------------------------
*/
@ -78,13 +78,13 @@ usage(void)
printf("\n");
} /* usage() */
/*-------------------------------------------------------------------------
* Function: verify
*
* Purpose: To verify that the data read is the pattern expected.
* Each integer read should be the same as the index.
* When a difference is encountered, the remaining integers
* When a difference is encountered, the remaining integers
* read should be the same as the previous index.
* For example, the pattern expected should be either:
* a) 01234567....n-1
@ -93,11 +93,11 @@ usage(void)
* the remaining integers should be all "3"s as:
* 012333333333333
*
* Parameters:
* Parameters:
* fd -- the file descriptor
* k -- the number of integers to read
*
* Return:
* Return:
* positive on success
* negative on failure
*
@ -106,9 +106,9 @@ usage(void)
int
verify(int fd, unsigned int k)
{
unsigned int i; /* local index variable */
ssize_t bytes_read; /* the number of bytes read */
unsigned int *buf = NULL; /* buffer to hold data read */
unsigned int i; /* local index variable */
ssize_t bytes_read; /* the number of bytes read */
unsigned int *buf = NULL; /* buffer to hold data read */
/* Allocate buffer for data read */
if((buf = (unsigned int *)malloc(k * sizeof(unsigned int))) == NULL) {
@ -165,13 +165,13 @@ error:
} /* end verify() */
/*-------------------------------------------------------------------------
* Function: print_info
*
* Purpose: To print the statistics gathered for re-reads
*
* Parameters:
* Parameters:
* info -- the array storing the statistics for re-reads
* lastr -- the last read completed
* iteration -- the current iteration
@ -183,7 +183,7 @@ error:
void
print_info(int *info, unsigned int lastr, unsigned iteration)
{
unsigned j; /* local index variable */
unsigned j; /* local index variable */
printf("--------statistics for %u reads (iteration %u)--------\n", lastr, iteration);
@ -193,13 +193,13 @@ print_info(int *info, unsigned int lastr, unsigned iteration)
printf("--------end statistics for %u reads (iteration %u)--------\n", lastr, iteration);
} /* print_info() */
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To verify that the data read is the pattern expected.
* (1) Make sure the file opens successfully and the # of bytes read is as expected
* (2) Iterate the reader with i iterations
* (1) Make sure the file opens successfully and the # of bytes read is as expected
* (2) Iterate the reader with i iterations
* (3) Read and verify n integers for each iteration
* (4) On verification error, re-read the data at most READ_TRIES
* times to see if correct data can be obtained

View File

@ -14,7 +14,7 @@
*
* Created: atomic_writer.c
*
* Purpose: This is the "writer" part of the standalone test to check
* Purpose: This is the "writer" part of the standalone test to check
* atomic read-write operation on a system.
* a) atomic_writer.c--the writer (this file)
* b) atomic_reader.c--the reader
@ -53,7 +53,7 @@
static void usage(void);
/*-------------------------------------------------------------------------
* Function: usage
*
@ -77,12 +77,12 @@ usage(void)
} /* usage() */
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: To write a series of integers to a file for the reader to verify the data.
* A write is atomic if the whole amount written in one operation is not interleaved
* A write is atomic if the whole amount written in one operation is not interleaved
* with data from any other process.
* (1) Iterate with i iterations
* (2) Write a series of integers (0 to n-1) to the file with this pattern:
@ -196,7 +196,7 @@ main(int argc, char *argv[])
printf("WRITER: error from lseek\n");
goto error;
} /* end if */
/* Write the data */
if((bytes_wrote = write(fd, buf, ((num-n) * sizeof(unsigned int)))) < 0) {
printf("WRITER: error from write\n");

View File

@ -2217,7 +2217,7 @@ main (int argc, char *argv[])
if (argc>1) {
if (argc>2 || strcmp("--noopt", argv[1])) {
HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]);
exit(EXIT_FAILURE);
HDexit(EXIT_FAILURE);
}
H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, (H5T_conv_t)((void (*) (void))H5T__conv_struct_opt));
}

View File

@ -338,7 +338,7 @@ test_extend(hid_t f, const char *prefix,
HDfprintf(stderr,",%lu", (unsigned long)size[1]);
if (ndims > 2)
HDfprintf(stderr,",%lu", (unsigned long)size[2]);
HD fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
if (0 == nelmts)
HDfprintf(stderr," *SKIPPED*");
HDfprintf(stderr,"\n");

View File

@ -11163,17 +11163,18 @@ test_attr(void)
{
hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */
hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */
hid_t dcpl = -1;
unsigned new_format; /* Whether to use the new format or not */
unsigned use_shared; /* Whether to use shared attributes or not */
unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */
herr_t ret; /* Generic return value */
hid_t dcpl = -1; /* Dataset creation property list */
unsigned new_format; /* Whether to use the new format or not */
unsigned use_shared; /* Whether to use shared attributes or not */
unsigned minimize_dset_oh; /* Whether to use minimized dataset object headers */
herr_t ret; /* Generic return value */
MESSAGE(5, ("Testing Attributes\n"));
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
/* fapl2 uses "latest version of the format" for creating objects in the file */
fapl2 = H5Pcopy(fapl);
CHECK(fapl2, FAIL, "H5Pcopy");
ret = H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
@ -11207,6 +11208,7 @@ test_attr(void)
for(new_format = FALSE; new_format <= TRUE; new_format++) {
hid_t my_fapl;
/* Set the FAPL for the type of format */
if(new_format) {
MESSAGE(7, ("testing with new file format\n"));
my_fapl = fapl2;
@ -11262,8 +11264,7 @@ test_attr(void)
test_attr_rename_invalid_name(my_fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */
test_attr_get_name_invalid_buf(my_fcpl, my_fapl); /* Test passing NULL buffer to H5Aget_name(_by_idx) */
/* New attribute API routine tests
*/
/* New attribute API routine tests */
test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */
test_attr_delete_by_idx(new_format, my_fcpl, my_fapl); /* Test deleting attribute by index */
test_attr_iterate2(new_format, my_fcpl, my_fapl); /* Test iterating over attributes by index */
@ -11271,8 +11272,7 @@ test_attr(void)
test_attr_open_by_name(new_format, my_fcpl, my_fapl); /* Test opening attributes by name */
test_attr_create_by_name(new_format, my_fcpl, my_fapl); /* Test creating attributes by name */
/* Tests that address specific bugs
*/
/* Tests that address specific bugs */
test_attr_bug1(my_fcpl, my_fapl); /* Test odd allocation operations */
test_attr_bug2(my_fcpl, my_fapl); /* Test many deleted attributes */
test_attr_bug3(my_fcpl, my_fapl); /* Test "self referential" attributes */
@ -11285,8 +11285,7 @@ test_attr(void)
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
/* tests specific to the "new format"
*/
/* tests specific to the "new format" */
if (new_format == TRUE) {
/* General attribute tests */
test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */
@ -11297,8 +11296,7 @@ test_attr(void)
test_attr_dense_limits(my_fcpl, my_fapl); /* Test dense attribute storage limits */
test_attr_dense_dup_ids(my_fcpl, my_fapl); /* Test duplicated IDs for dense attribute storage */
/* Attribute creation order tests
*/
/* Attribute creation order tests */
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
test_attr_corder_create_compact(my_fcpl, my_fapl); /* Test compact attribute storage on an object w/attribute creation order info */
test_attr_corder_create_dense(my_fcpl, my_fapl);/* Test dense attribute storage on an object w/attribute creation order info */
@ -11306,8 +11304,7 @@ test_attr(void)
test_attr_corder_transition(my_fcpl, my_fapl); /* Test attribute storage transitions on an object w/attribute creation order info */
test_attr_corder_delete(my_fcpl, my_fapl); /* Test deleting object using dense storage w/attribute creation order info */
/* More complex tests with exclusively both "new format" and "shared" attributes
*/
/* More complex tests with exclusively both "new format" and "shared" attributes */
if(use_shared == TRUE) {
test_attr_shared_write(my_fcpl, my_fapl); /* Test writing to shared attributes in compact & dense storage */
test_attr_shared_rename(my_fcpl, my_fapl); /* Test renaming shared attributes in compact & dense storage */
@ -11365,6 +11362,6 @@ test_attr(void)
void
cleanup_attr(void)
{
remove(FILENAME);
HDremove(FILENAME);
}

View File

@ -42,10 +42,10 @@ typedef struct TestStruct {
* Variables used by testing framework.
*/
static int enable_error_stack = 0; /* enable error stack; disable=0 enable=1 */
static int num_errs = 0; /* Total number of errors during testing */
static int num_errs = 0; /* Total number of errors during testing */
int TestVerbosity = VERBO_DEF; /* Default Verbosity is Low */
static int Summary = 0; /* Show test summary. Default is no. */
static int CleanUp = 1; /* Do cleanup or not. Default is yes. */
static int Summary = 0; /* Show test summary. Default is no. */
static int CleanUp = 1; /* Do cleanup or not. Default is yes. */
static int TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */
static TestStruct *Test = NULL; /* Array of tests */
static unsigned TestAlloc = 0; /* Size of the Test array */
@ -74,14 +74,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
{
/* Sanity checking */
if (HDstrlen(TheDescr) >= MAXTESTDESC) {
HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n",
TheDescr, MAXTESTDESC);
exit(EXIT_FAILURE);
HDprintf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", TheDescr, MAXTESTDESC);
HDexit(EXIT_FAILURE);
} /* end if */
if (HDstrlen(TheName) >= MAXTESTNAME) {
HDprintf("Test name too long, increase MAXTESTNAME(%d).\n",
MAXTESTNAME);
exit(EXIT_FAILURE);
HDprintf("Test name too long, increase MAXTESTNAME(%d).\n", MAXTESTNAME);
HDexit(EXIT_FAILURE);
} /* end if */
/* Check for increasing the Test array size */
@ -167,7 +165,7 @@ void TestUsage(void)
unsigned i;
print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n",
TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
print_func(" [-[e]x[clude] name]+ \n");
print_func(" [-o[nly] name]+ \n");
print_func(" [-b[egin] name] \n");
@ -228,78 +226,80 @@ void TestParseCmdLine(int argc, char *argv[])
int ret_code;
while (argv++, --argc > 0){
if ((HDstrcmp(*argv, "-verbose") == 0) ||
(HDstrcmp(*argv, "-v") == 0)) {
if (argc > 0){
--argc; ++argv;
ParseTestVerbosity(*argv);
}else{
TestUsage();
exit(EXIT_FAILURE);
if ((HDstrcmp(*argv, "-verbose") == 0) || (HDstrcmp(*argv, "-v") == 0)) {
if (argc > 0){
--argc; ++argv;
ParseTestVerbosity(*argv);
}
else{
TestUsage();
HDexit(EXIT_FAILURE);
}
}
}
else if (((HDstrcmp(*argv, "-exclude") == 0) ||
(HDstrcmp(*argv, "-x") == 0))) {
if (argc > 0){
--argc; ++argv;
SetTest(*argv, SKIPTEST);
}else{
TestUsage();
exit(EXIT_FAILURE);
else if (((HDstrcmp(*argv, "-exclude") == 0) ||
(HDstrcmp(*argv, "-x") == 0))) {
if (argc > 0){
--argc; ++argv;
SetTest(*argv, SKIPTEST);
}
else{
TestUsage();
HDexit(EXIT_FAILURE);
}
}
}
else if (((HDstrcmp(*argv, "-begin") == 0) ||
(HDstrcmp(*argv, "-b") == 0))) {
if (argc > 0){
--argc; ++argv;
SetTest(*argv, BEGINTEST);
}else{
TestUsage();
exit(EXIT_FAILURE);
else if (((HDstrcmp(*argv, "-begin") == 0) ||
(HDstrcmp(*argv, "-b") == 0))) {
if (argc > 0){
--argc; ++argv;
SetTest(*argv, BEGINTEST);
}
else{
TestUsage();
HDexit(EXIT_FAILURE);
}
}
}
else if (((HDstrcmp(*argv, "-only") == 0) ||
(HDstrcmp(*argv, "-o") == 0))) {
if(argc > 0) {
unsigned Loop;
else if (((HDstrcmp(*argv, "-only") == 0) ||
(HDstrcmp(*argv, "-o") == 0))) {
if(argc > 0) {
unsigned Loop;
--argc; ++argv;
--argc; ++argv;
/* Skip all tests, then activate only one. */
/* Skip all tests, then activate only one. */
if(!skipped_all) {
for(Loop = 0; Loop < Index; Loop++)
Test[Loop].SkipFlag = 1;
skipped_all = TRUE;
} /* end if */
SetTest(*argv, ONLYTEST);
} /* end if */
else {
TestUsage();
exit(EXIT_FAILURE);
SetTest(*argv, ONLYTEST);
}
else{
TestUsage();
HDexit(EXIT_FAILURE);
}
}
else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
Summary = 1;
else if (HDstrcmp(*argv, "-enable-error-stack") == 0)
enable_error_stack = 1;
else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
TestUsage();
HDexit(EXIT_SUCCESS);
}
else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
SetTestNoCleanup();
else {
/* non-standard option. Break out. */
break;
}
}
else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
Summary = 1;
else if (HDstrcmp(*argv, "-enable-error-stack") == 0)
enable_error_stack = 1;
else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
TestUsage();
exit(EXIT_SUCCESS);
}
else if ((HDstrcmp(*argv, "-cleanoff") == 0) || (HDstrcmp(*argv, "-c") == 0))
SetTestNoCleanup();
else {
/* non-standard option. Break out. */
break;
}
}
/* Call extra parsing function if provided. */
if (NULL != TestPrivateParser){
ret_code=TestPrivateParser(argc+1, argv-1);
if (ret_code != 0)
exit(EXIT_FAILURE);
ret_code=TestPrivateParser(argc+1, argv-1);
if (ret_code != 0)
HDexit(EXIT_FAILURE);
}
}
@ -318,10 +318,10 @@ void PerformTests(void)
MESSAGE(2, ("Testing -- %s (%s) \n", Test[Loop].Description, Test[Loop].Name));
MESSAGE(5, ("===============================================\n"));
Test[Loop].NumErrors = num_errs;
Test_parameters = Test[Loop].Parameters;
ALARM_ON;
Test_parameters = Test[Loop].Parameters;
ALARM_ON;
Test[Loop].Call();
ALARM_OFF;
ALARM_OFF;
Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors;
MESSAGE(5, ("===============================================\n"));
MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors));
@ -440,18 +440,18 @@ int GetTestExpress(void)
/* set it here for now. Should be done in something like h5test_init(). */
if(TestExpress==-1)
{
env_val = getenv("HDF5TestExpress");
env_val = getenv("HDF5TestExpress");
if(env_val == NULL)
SetTestExpress(1);
else if(strcmp(env_val, "0") == 0)
SetTestExpress(0);
else if(strcmp(env_val, "1") == 0)
SetTestExpress(1);
else if(strcmp(env_val, "2") == 0)
SetTestExpress(2);
else
SetTestExpress(3);
if(env_val == NULL)
SetTestExpress(1);
else if(strcmp(env_val, "0") == 0)
SetTestExpress(0);
else if(strcmp(env_val, "1") == 0)
SetTestExpress(1);
else if(strcmp(env_val, "2") == 0)
SetTestExpress(2);
else
SetTestExpress(3);
}
return(TestExpress);
@ -508,13 +508,13 @@ int SetTestNoCleanup(void)
void ParseTestVerbosity(char *argv)
{
if (*argv == 'l')
SetTestVerbosity(VERBO_LO);
SetTestVerbosity(VERBO_LO);
else if (*argv == 'm')
SetTestVerbosity(VERBO_MED);
SetTestVerbosity(VERBO_MED);
else if (*argv == 'h')
SetTestVerbosity(VERBO_HI);
SetTestVerbosity(VERBO_HI);
else
SetTestVerbosity(atoi(argv));
SetTestVerbosity(atoi(argv));
}
@ -582,29 +582,29 @@ void SetTest(const char *testname, int action)
switch (action){
case SKIPTEST:
for (Loop = 0; Loop < Index; Loop++)
if (HDstrcmp(testname, Test[Loop].Name) == 0){
Test[Loop].SkipFlag = 1;
break;
}
if (HDstrcmp(testname, Test[Loop].Name) == 0){
Test[Loop].SkipFlag = 1;
break;
}
break;
case BEGINTEST:
for (Loop = 0; Loop < Index; Loop++) {
if (HDstrcmp(testname, Test[Loop].Name) != 0)
Test[Loop].SkipFlag = 1;
else{
/* Found it. Set it to run. Done. */
Test[Loop].SkipFlag = 0;
break;
}
if (HDstrcmp(testname, Test[Loop].Name) != 0)
Test[Loop].SkipFlag = 1;
else{
/* Found it. Set it to run. Done. */
Test[Loop].SkipFlag = 0;
break;
}
}
break;
case ONLYTEST:
for (Loop = 0; Loop < Index; Loop++) {
if (HDstrcmp(testname, Test[Loop].Name) == 0) {
/* Found it. Set it to run. Break to skip the rest. */
Test[Loop].SkipFlag = 0;
break;
}
if (HDstrcmp(testname, Test[Loop].Name) == 0) {
/* Found it. Set it to run. Break to skip the rest. */
Test[Loop].SkipFlag = 0;
break;
}
}
break;
default:

View File

@ -177,53 +177,53 @@ extern "C" {
#endif
/* Prototypes for the test routines */
void test_metadata(void);
void test_checksum(void);
void test_tst(void);
void test_heap(void);
void test_refstr(void);
void test_file(void);
void test_h5o(void);
void test_h5t(void);
void test_h5s(void);
void test_coords(void);
void test_h5d(void);
void test_attr(void);
void test_select(void);
void test_time(void);
void test_reference(void);
void test_vltypes(void);
void test_vlstrings(void);
void test_iterate(void);
void test_array(void);
void test_genprop(void);
void test_configure(void);
void test_misc(void);
void test_ids(void);
void test_skiplist(void);
void test_sohm(void);
void test_unicode(void);
void test_metadata(void);
void test_checksum(void);
void test_tst(void);
void test_heap(void);
void test_refstr(void);
void test_file(void);
void test_h5o(void);
void test_h5t(void);
void test_h5s(void);
void test_coords(void);
void test_h5d(void);
void test_attr(void);
void test_select(void);
void test_time(void);
void test_reference(void);
void test_vltypes(void);
void test_vlstrings(void);
void test_iterate(void);
void test_array(void);
void test_genprop(void);
void test_configure(void);
void test_misc(void);
void test_ids(void);
void test_skiplist(void);
void test_sohm(void);
void test_unicode(void);
/* Prototypes for the cleanup routines */
void cleanup_metadata(void);
void cleanup_checksum(void);
void cleanup_file(void);
void cleanup_h5o(void);
void cleanup_h5s(void);
void cleanup_coords(void);
void cleanup_attr(void);
void cleanup_select(void);
void cleanup_time(void);
void cleanup_reference(void);
void cleanup_vltypes(void);
void cleanup_vlstrings(void);
void cleanup_iterate(void);
void cleanup_array(void);
void cleanup_genprop(void);
void cleanup_configure(void);
void cleanup_sohm(void);
void cleanup_misc(void);
void cleanup_unicode(void);
void cleanup_metadata(void);
void cleanup_checksum(void);
void cleanup_file(void);
void cleanup_h5o(void);
void cleanup_h5s(void);
void cleanup_coords(void);
void cleanup_attr(void);
void cleanup_select(void);
void cleanup_time(void);
void cleanup_reference(void);
void cleanup_vltypes(void);
void cleanup_vlstrings(void);
void cleanup_iterate(void);
void cleanup_array(void);
void cleanup_genprop(void);
void cleanup_configure(void);
void cleanup_sohm(void);
void cleanup_misc(void);
void cleanup_unicode(void);
#ifdef __cplusplus
}

View File

@ -23,34 +23,34 @@
*/
#include "hdf5.h"
#include "h5test.h"
#define FILEN "testmeta.h5"
#define FILEN "testmeta.h5"
#define CHUNK_SIZE 512
#define CHUNK_SIZE 512
#define NDATAARRAYS 3
/*#define NPOINTS 2048*/
#define NPOINTS 20
#define NEXTARRAYS 10
#define NDATAOBJECTS 100000
#define NDATAARRAYS 3
/*#define NPOINTS 2048*/
#define NPOINTS 20
#define NEXTARRAYS 10
#define NDATAOBJECTS 100000
int main(void)
{
hid_t file_id, prop_id, memspace_id, type_id;
hid_t group_id;
hid_t dataset_id, dataspace_id;
herr_t status;
hsize_t dims[1];
hsize_t maxdims[1];
float data[NPOINTS];
float floatval;
unsigned numdataobj = 0;
unsigned i, j;
char name[80];
hsize_t start[1] = {0};
hsize_t stride[1] = {1};
hsize_t count[1] = {1};
hid_t file_id, prop_id, memspace_id, type_id;
hid_t group_id;
hid_t dataset_id, dataspace_id;
herr_t status;
hsize_t dims[1];
hsize_t maxdims[1];
float data[NPOINTS];
float floatval;
unsigned numdataobj = 0;
unsigned i, j;
char name[80];
hsize_t start[1] = {0};
hsize_t stride[1] = {1};
hsize_t count[1] = {1};
/* Create a file */
file_id = H5Fcreate(FILEN, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -64,8 +64,7 @@ int main(void)
H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write value to NumDataObj dataset */
status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL,
H5S_ALL, H5P_DEFAULT, &numdataobj);
status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj);
/* Close the identifiers */
status = H5Dclose(dataset_id);
@ -78,16 +77,14 @@ int main(void)
status = H5Pset_chunk(prop_id, 1, dims);
/* Create dataspace */
dims[0]=1;
maxdims[0]=H5S_UNLIMITED;
dims[0] = 1;
maxdims[0] = H5S_UNLIMITED;
dataspace_id = H5Screate_simple(1, dims, maxdims);
for(i=0; i<NEXTARRAYS; i++)
{
for(i = 0; i < NEXTARRAYS; i++) {
/* Create dataset */
sprintf(name, "/ExtArray%06d", i);
dataset_id = H5Dcreate2(file_id, name,
H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
/* Close the identifier */
status = H5Dclose(dataset_id);
@ -101,47 +98,43 @@ int main(void)
group_id = H5Gcreate2(file_id, "/DataArray", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group_id);
for(j=0; j<NDATAOBJECTS; j++)
{
for(j = 0; j < NDATAOBJECTS; j++) {
/* Removed print statement as it would lock system resources on Windows */
/*
* printf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS);
* HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS);
* fflush(stdout);
*/
floatval = (float)j;
/* Create group to hold data arrays for this object */
sprintf(name, "/DataArray/%06d", j);
HDsprintf(name, "/DataArray/%06d", j);
group_id = H5Gcreate2(file_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(group_id < 0) {
fprintf(stderr, "Failed to create DataArray group.\n");
HDfprintf(stderr, "Failed to create DataArray group.\n");
status = H5Fclose(file_id);
return -1;
}
/* Loop over data arrays */
for(i=0; i<NDATAARRAYS; i++)
{
for(i = 0; i < NDATAARRAYS; i++) {
/* Create dataspace */
dims[0]=NPOINTS;
maxdims[0]=NPOINTS;
dataspace_id = H5Screate_simple(1 ,dims, maxdims);
/* Create dataset */
sprintf(name, "DataArray%06d", i);
dataset_id = H5Dcreate2(group_id, name,
H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
HDsprintf(name, "DataArray%06d", i);
dataset_id = H5Dcreate2(group_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dataset_id < 0) {
fprintf(stderr, "Failed to create DataArray dataset.\n");
HDfprintf(stderr, "Failed to create DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
/* Write the data array data */
status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL,
H5S_ALL, H5P_DEFAULT, data);
status = H5Dwrite(dataset_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if(status < 0) {
fprintf(stderr, "Failed to write DataArray dataset.\n");
HDfprintf(stderr, "Failed to write DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@ -154,17 +147,16 @@ int main(void)
/* Open NumDataObj dataset */
dataset_id = H5Dopen2(file_id, "/NumDataObj", H5P_DEFAULT);
if(dataset_id < 0) {
fprintf(stderr, "Failed to open NumDataObj dataset.\n");
HDfprintf(stderr, "Failed to open NumDataObj dataset.\n");
status = H5Fclose(file_id);
return -1;
}
/* Write value to NumDataObj dataset */
numdataobj = j + 1;
status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL,
H5S_ALL, H5P_DEFAULT, &numdataobj);
status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj);
if(status < 0) {
fprintf(stderr, "Failed to write NumDataObj dataset.\n");
HDfprintf(stderr, "Failed to write NumDataObj dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@ -176,10 +168,10 @@ int main(void)
/* Extend attribute arrays */
for(i = 0; i < NEXTARRAYS; i++) {
/* Open extendable dataset */
sprintf(name, "/ExtArray%06d", i);
HDsprintf(name, "/ExtArray%06d", i);
dataset_id = H5Dopen2(file_id, name, H5P_DEFAULT);
if(dataset_id < 0) {
fprintf(stderr, "Failed to open ExtArray dataset.\n");
HDfprintf(stderr, "Failed to open ExtArray dataset.\n");
status = H5Fclose(file_id);
return -1;
} /* end if */
@ -188,7 +180,7 @@ int main(void)
dims[0] = (hsize_t)j + 1;
status = H5Dset_extent(dataset_id, dims);
if(status < 0) {
fprintf(stderr, "Failed to extend DataArray dataset.\n");
HDfprintf(stderr, "Failed to extend DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
} /* end if */
@ -200,16 +192,12 @@ int main(void)
type_id = H5Dget_type(dataset_id);
start[0] = 0;
status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET,
start, stride, count, NULL);
status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, start, stride, count, NULL);
start[0] = (hssize_t)j;
status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET,
start, stride, count, NULL);
status = H5Dwrite(dataset_id, type_id, memspace_id,
dataspace_id, H5P_DEFAULT, &floatval);
if(status < 0)
{
fprintf(stderr, "Failed to write DataArray dataset.\n");
status = H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, stride, count, NULL);
status = H5Dwrite(dataset_id, type_id, memspace_id, dataspace_id, H5P_DEFAULT, &floatval);
if(status < 0) {
HDfprintf(stderr, "Failed to write DataArray dataset.\n");
status = H5Fclose(file_id);
return -1;
}
@ -226,7 +214,7 @@ int main(void)
/* Close the file */
status = H5Fclose(file_id);
printf("\n");
HDprintf("\n");
return 0;
}

View File

@ -966,7 +966,7 @@ test_file_close(void)
****************************************************************/
static void
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
hid_t *ret_gid2, hid_t *ret_gid3)
hid_t *ret_gid2, hid_t *ret_gid3)
{
ssize_t oid_count;
herr_t ret;
@ -1120,8 +1120,7 @@ test_get_obj_ids(void)
/* Call the public function H5F_get_obj_ids to use H5F__get_objects. User reported having problem here.
* that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in
* (oid_list_size).
*/
* (oid_list_size) */
ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list);
CHECK(ret_count, FAIL, "H5Fget_obj_ids");
VERIFY(ret_count, oid_list_size, "H5Fget_obj_count");

View File

@ -1184,24 +1184,24 @@ test_h5s_zero_dim(void)
static void
test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
{
hid_t sid1, sid2, sid3; /* Dataspace ID */
hid_t decoded_sid1, decoded_sid2, decoded_sid3;
int rank; /* Logical rank of dataspace */
hid_t fapl = -1; /* File access property list ID */
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
size_t sbuf_size=0, null_size=0, scalar_size=0;
unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL;
hsize_t tdims[4]; /* Dimension array to test with */
hssize_t n; /* Number of dataspace elements */
hsize_t start[] = {0, 0, 0};
hsize_t stride[] = {2, 5, 3};
hsize_t count[] = {2, 2, 2};
hsize_t block[] = {1, 3, 1};
H5S_sel_type sel_type;
H5S_class_t space_type;
hssize_t nblocks;
hid_t ret_id; /* Generic hid_t return value */
herr_t ret; /* Generic return value */
hid_t sid1, sid2, sid3; /* Dataspace ID */
hid_t decoded_sid1, decoded_sid2, decoded_sid3;
int rank; /* Logical rank of dataspace */
hid_t fapl = -1; /* File access property list ID */
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
size_t sbuf_size=0, null_size=0, scalar_size=0;
unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL;
hsize_t tdims[4]; /* Dimension array to test with */
hssize_t n; /* Number of dataspace elements */
hsize_t start[] = {0, 0, 0};
hsize_t stride[] = {2, 5, 3};
hsize_t count[] = {2, 2, 2};
hsize_t block[] = {1, 3, 1};
H5S_sel_type sel_type;
H5S_class_t space_type;
hssize_t nblocks;
hid_t ret_id; /* Generic hid_t return value */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n"));

View File

@ -21,7 +21,7 @@
#include "testhdf5.h"
#define FILE1 "trefer1.h5"
#define FILE1 "trefer1.h5"
#define FILE2 "trefer2.h5"
#define FILE3 "trefer3.h5"
@ -941,7 +941,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
uint8_t *tu8; /* Temporary pointer to uint8 data */
H5O_type_t obj_type; /* Object type */
int i; /* counting variables */
herr_t ret; /* Generic return value */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));

View File

@ -3730,8 +3730,7 @@ test_sohm_external_dtype(void)
ret = H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
CHECK_I(ret, "H5Tinsert");
/* Set up dataset in first file
*/
/* Set up dataset in first file */
file1 = H5Fcreate(FILENAME_SRC, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK_I(file1, "H5Fcreate");
@ -3767,8 +3766,7 @@ test_sohm_external_dtype(void)
ret = H5Dclose(dataset1);
CHECK_I(ret, "H5Dclose");
/* Create dataset in second file using datatype from dataset in the first file
*/
/* Create dataset in second file using datatype from dataset in the first file */
file2 = H5Fcreate(FILENAME_DST, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK_I(file2, "H5Fcreate");
@ -3797,8 +3795,7 @@ test_sohm_external_dtype(void)
ret = H5Fclose(file1);
CHECK_I(ret, "H5Fclose");
/* Verify that datatype details are still accessible by second file
*/
/* Verify that datatype details are still accessible by second file */
dataset2 = H5Dopen2(file2, "dataset_2", H5P_DEFAULT);
CHECK_I(dataset2, "H5Dopen2");
@ -3808,8 +3805,7 @@ test_sohm_external_dtype(void)
dtype_class = H5Tget_class(dset2_tid);
VERIFY(dtype_class, H5T_COMPOUND, "H5Tget_class");
/* Cleanup
*/
/* Cleanup */
ret = H5Tclose(dset2_tid);
CHECK_I(ret, "H5Tclose");
ret = H5Dclose(dataset2);

File diff suppressed because it is too large Load Diff

View File

@ -622,7 +622,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: MPI_Comm_group() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@ -641,7 +641,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: MPI_Group_excl() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@ -658,7 +658,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: MPI_Comm_create() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@ -672,7 +672,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: file_mpi_comm == MPI_COMM_NULL.\n",
world_mpi_rank, FUNC);
}
@ -686,7 +686,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: file_mpi_comm != MPI_COMM_NULL.\n",
world_mpi_rank, FUNC);
}
@ -704,7 +704,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: MPI_Comm_size() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@ -720,7 +720,7 @@ set_up_file_communicator(void)
nerrors++;
success = FALSE;
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"%d:%s: MPI_Comm_rank() failed with error %d.\n",
world_mpi_rank, FUNC, mpi_result);
}
@ -7457,7 +7457,7 @@ 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",
HDprintf("%d:Failed to turn off atexit processing. Continue.\n",
mpi_rank);
};
H5open();
@ -7476,24 +7476,24 @@ main(int argc, char **argv)
}
#ifdef H5_HAVE_MPE
if ( MAINPROCESS ) { printf(" Tests compiled for MPE.\n"); }
if ( MAINPROCESS ) { HDprintf(" 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");
HDprintf("===================================\n");
HDprintf("Parallel metadata cache tests\n");
HDprintf(" mpi_size = %d\n", mpi_size);
HDprintf(" express_test = %d\n", express_test);
HDprintf("===================================\n");
}
if ( mpi_size < 3 ) {
if ( MAINPROCESS ) {
printf(" Need at least 3 processes. Exiting.\n");
HDprintf(" Need at least 3 processes. Exiting.\n");
}
goto finish;
}
@ -7639,15 +7639,15 @@ finish:
*/
MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS){ /* only process 0 reports */
printf("===================================\n");
HDprintf("===================================\n");
if (failures){
printf("***metadata cache tests detected %d failures***\n",
HDprintf("***metadata cache tests detected %d failures***\n",
failures);
}
else{
printf("metadata cache tests finished with no failures\n");
HDprintf("metadata cache tests finished with no failures\n");
}
printf("===================================\n");
HDprintf("===================================\n");
}
takedown_derived_types();

View File

@ -519,7 +519,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
/* create the dataset */
if ( pass ) {
sprintf(dset_name, "/dset%03d", i);
HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
dataspace_id, H5P_DEFAULT,
properties, H5P_DEFAULT);
@ -713,7 +713,7 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset)
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
}
@ -830,7 +830,7 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset)
while ( ( pass ) && ( i <= max_dset ) )
{
sprintf(dset_name, "/dset%03d", i);
HDsprintf(dset_name, "/dset%03d", i);
if ( H5Ldelete(file_id, dset_name, H5P_DEFAULT) < 0) {
@ -1187,7 +1187,7 @@ open_hdf5_file(const hbool_t create_file,
} else {
file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@ -1446,7 +1446,7 @@ par_create_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
verbose = (verbose && (mpi_rank == 0));
sprintf(dset_name, "/dset%03d", dset_num);
HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@ -1750,7 +1750,7 @@ par_create_dataset(int dset_num,
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, dset_num);
}
@ -1848,7 +1848,7 @@ par_delete_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
sprintf(dset_name, "/dset%03d", dset_num);
HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@ -1932,8 +1932,8 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
int child_status;
pid_t child_pid;
sprintf(file_name_idx_str, "%d", file_name_idx);
sprintf(mpi_size_str, "%d", mpi_size);
HDsprintf(file_name_idx_str, "%d", file_name_idx);
HDsprintf(mpi_size_str, "%d", mpi_size);
child_pid = fork();
@ -1954,7 +1954,7 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size )
HDfprintf(stdout,
"execl() of ici process failed. errno = %d(%s)\n",
errno, strerror(errno));
exit(1);
HDexit(1);
}
} else if ( child_pid != -1 ) {
@ -2056,7 +2056,7 @@ par_verify_dataset(int dset_num,
show_progress = (show_progress && (mpi_rank == 0));
verbose = (verbose && (mpi_rank == 0));
sprintf(dset_name, "/dset%03d", dset_num);
HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@ -2233,7 +2233,7 @@ par_verify_dataset(int dset_num,
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, dset_num);
}
@ -2448,7 +2448,7 @@ serial_verify_dataset(int dset_num,
hid_t dset_id = -1;
hid_t filespace_id = -1;
sprintf(dset_name, "/dset%03d", dset_num);
HDsprintf(dset_name, "/dset%03d", dset_num);
if ( show_progress ) {
HDfprintf(stdout, "%s: dset name = \"%s\".\n", fcn_name, dset_name);
@ -2603,7 +2603,7 @@ serial_verify_dataset(int dset_num,
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
j, k, dset_num);
}
@ -2801,7 +2801,7 @@ usage(void)
int i = 0;
while(s[i] != NULL) {
fprintf(stdout, "%s", s[i]);
HDfprintf(stdout, "%s", s[i]);
i++;
}
@ -2876,7 +2876,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
/* open the dataset */
if ( pass ) {
sprintf(dset_name, "/dset%03d", i);
HDsprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@ -3016,7 +3016,7 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset)
if ( verbose ) {
fprintf(stdout,
HDfprintf(stdout,
"Chunk (%0d, %0d) in /dset%03d is invalid.\n",
i, j, m);
}
@ -4137,31 +4137,31 @@ main(int argc, char **argv)
if ( pass ) {
printf("done.\n");
HDprintf("done.\n");
HDfflush(stdout);
} else {
printf("failed.\n");
exit(1);
HDprintf("failed.\n");
HDexit(1);
}
i++;
}
HDfprintf(stdout, "Test file construction complete.\n");
exit(0);
HDexit(0);
} else if ( ici ) {
if ( serial_insert_cache_image(file_idx, mpi_size) ) {
exit(0);
HD exit(0);
} else {
HDfprintf(stderr, "\n\nCache image insertion failed.\n");
HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg);
exit(1);
HDexit(1);
}
}
@ -4178,24 +4178,24 @@ 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",
HDprintf("%d:Failed to turn off atexit processing. Continue.\n",
mpi_rank);
};
H5open();
if ( mpi_rank == 0 ) {
printf("===================================\n");
printf("Parallel metadata cache image tests\n");
printf(" mpi_size = %d\n", mpi_size);
printf("===================================\n");
HDprintf("===================================\n");
HDprintf("Parallel metadata cache image tests\n");
HDprintf(" mpi_size = %d\n", mpi_size);
HDprintf("===================================\n");
}
if ( mpi_size < 2 ) {
if ( mpi_rank == 0 ) {
printf(" Need at least 2 processes. Exiting.\n");
HDprintf(" Need at least 2 processes. Exiting.\n");
}
goto finish;
}
@ -4220,7 +4220,7 @@ main(int argc, char **argv)
HDfprintf(stdout,
"execl() of setup process failed. errno = %d(%s)\n",
errno, strerror(errno));
exit(1);
HDexit(1);
}
} else if ( child_pid != -1 ) {
@ -4271,16 +4271,16 @@ finish:
MPI_Barrier(MPI_COMM_WORLD);
if ( mpi_rank == 0 ) { /* only process 0 reports */
sleep(10);
printf("===================================\n");
HDsleep(10);
HDprintf("===================================\n");
if ( nerrs > 0 ) {
printf("***metadata cache image tests detected %d failures***\n",
HDprintf("***metadata cache image tests detected %d failures***\n",
nerrs);
}
else {
printf("metadata cache image tests finished with no failures\n");
HDprintf("metadata cache image tests finished with no failures\n");
}
printf("===================================\n");
HDprintf("===================================\n");
}
/* takedown_derived_types(); */

View File

@ -1134,7 +1134,7 @@ ccslab_set(int mpi_rank,
break;
}
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]));
@ -1197,20 +1197,20 @@ ccdataset_print(hsize_t start[],
hsize_t i, j;
/* print the column heading */
printf("Print only the first block of the dataset\n");
printf("%-8s", "Cols:");
HDprintf("Print only the first block of the dataset\n");
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]));
HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
printf("%03d ", *dataptr++);
HDprintf("%03d ", *dataptr++);
}
printf("\n");
HDprintf("\n");
}
}
@ -1233,13 +1233,13 @@ ccdataset_vrfy(hsize_t start[],
/* 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",
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]);
printf("original values:\n");
HDprintf("original values:\n");
ccdataset_print(start, block, original);
printf("compared values:\n");
HDprintf("compared values:\n");
ccdataset_print(start, block, dataset);
}
@ -1262,7 +1262,7 @@ ccdataset_vrfy(hsize_t start[],
}
if (*dataptr != *oriptr){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
HDprintf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
*(oriptr), *(dataptr));
}
@ -1272,8 +1272,8 @@ ccdataset_vrfy(hsize_t start[],
}
}
if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
HDprintf("[more errors ...]\n");
if (vrfyerrs)
printf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
HDprintf("%d errors found in ccdataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}

View File

@ -24,14 +24,14 @@
/*
* This file needs to access private information from the H5F package.
*/
#define H5AC_FRIEND /*suppress error about including H5ACpkg */
#define H5AC_FRIEND /*suppress error about including H5ACpkg */
#include "H5ACpkg.h"
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#define H5C_FRIEND /*suppress error about including H5Cpkg */
#include "H5Cpkg.h"
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
#define H5MF_FRIEND /*suppress error about including H5MFpkg */
#define H5MF_FRIEND /*suppress error about including H5MFpkg */
#include "H5MFpkg.h"
#define NUM_DSETS 5
@ -39,7 +39,7 @@
int mpi_size, mpi_rank;
static int create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_strategy);
static int open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
static int open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
hsize_t page_size, size_t page_buffer_size);
/*
@ -60,15 +60,15 @@ test_split_comm_access(void)
MPI_Info info = MPI_INFO_NULL;
int is_old, mrc;
int newrank, newprocs;
hid_t fid; /* file IDs */
hid_t acc_tpl; /* File access properties */
herr_t ret; /* generic return value */
hid_t fid; /* file IDs */
hid_t acc_tpl; /* File access properties */
herr_t ret; /* generic return value */
const char *filename;
filename = (const char *)GetTestParameters();
if (VERBOSE_MED)
printf("Split Communicator access test on file %s\n",
filename);
HDprintf("Split Communicator access test on file %s\n",
filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@ -80,35 +80,35 @@ test_split_comm_access(void)
MPI_Comm_rank(comm,&newrank);
if (is_old){
/* odd-rank processes */
mrc = MPI_Barrier(comm);
VRFY((mrc==MPI_SUCCESS), "");
/* odd-rank processes */
mrc = MPI_Barrier(comm);
VRFY((mrc==MPI_SUCCESS), "");
}else{
/* even-rank processes */
int sub_mpi_rank; /* rank in the sub-comm */
MPI_Comm_rank(comm,&sub_mpi_rank);
/* even-rank processes */
int sub_mpi_rank; /* rank in the sub-comm */
MPI_Comm_rank(comm,&sub_mpi_rank);
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type);
VRFY((acc_tpl >= 0), "");
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type);
VRFY((acc_tpl >= 0), "");
/* create the file collectively */
fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* create the file collectively */
fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
ret=H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* Release file-access template */
ret=H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* close the file */
ret=H5Fclose(fid);
VRFY((ret >= 0), "");
/* close the file */
ret=H5Fclose(fid);
VRFY((ret >= 0), "");
/* delete the test file */
if (sub_mpi_rank == 0){
mrc = MPI_File_delete((char *)filename, info);
/*VRFY((mrc==MPI_SUCCESS), ""); */
}
/* delete the test file */
if (sub_mpi_rank == 0){
mrc = MPI_File_delete((char *)filename, info);
/*VRFY((mrc==MPI_SUCCESS), ""); */
}
}
mrc = MPI_Comm_free(&comm);
VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free succeeded");
@ -126,7 +126,7 @@ test_page_buffer_access(void)
haddr_t raw_addr, meta_addr;
int *data;
H5F_t *f = NULL;
herr_t ret; /* generic return value */
herr_t ret; /* generic return value */
const char *filename;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@ -136,7 +136,7 @@ test_page_buffer_access(void)
filename = (const char *)GetTestParameters();
if (VERBOSE_MED)
printf("Page Buffer Usage in Parallel %s\n", filename);
HDprintf("Page Buffer Usage in Parallel %s\n", filename);
fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
VRFY((fapl >= 0), "create_faccess_plist succeeded");
@ -178,7 +178,6 @@ test_page_buffer_access(void)
/* intialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
if(MAINPROCESS) {
hid_t fapl_self;
@ -400,7 +399,7 @@ test_page_buffer_access(void)
ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
for (i=0; i < 50; i++)
VRFY((data[i] == -1), "Read different values than written");
/* close the file */
@ -504,28 +503,28 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
VRFY((mem_dataspace >= 0), "");
for(k=0 ; k<NUM_DSETS; k++) {
sprintf(dset_name, "D1dset%d", k);
HDsprintf(dset_name, "D1dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
sprintf(dset_name, "D2dset%d", k);
HDsprintf(dset_name, "D2dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
sprintf(dset_name, "D3dset%d", k);
HDsprintf(dset_name, "D3dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
ret = H5Dclose(dset_id);
VRFY((ret == 0), "");
sprintf(dset_name, "dset%d", k);
HDsprintf(dset_name, "dset%d", k);
dset_id = H5Dcreate2(grp_id, dset_name, H5T_NATIVE_INT, sid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
@ -549,13 +548,13 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
for (i=0; i < num_elements; i++)
VRFY((data_array[i] == mpi_rank+1), "Dataset Verify failed");
sprintf(dset_name, "D1dset%d", k);
HDsprintf(dset_name, "D1dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
sprintf(dset_name, "D2dset%d", k);
HDsprintf(dset_name, "D2dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
sprintf(dset_name, "D3dset%d", k);
HDsprintf(dset_name, "D3dset%d", k);
ret = H5Ldelete(grp_id, dset_name, H5P_DEFAULT);
VRFY((ret == 0), "");
}
@ -657,7 +656,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
VRFY((mem_dataspace >= 0), "");
for(k=0 ; k<NUM_DSETS; k++) {
sprintf(dset_name, "dset%d", k);
HDsprintf(dset_name, "dset%d", k);
dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT);
VRFY((dset_id >= 0), "");
@ -741,7 +740,7 @@ void
test_file_properties(void)
{
hid_t fid; /* HDF5 file ID */
hid_t fapl_id; /* File access plist */
hid_t fapl_id; /* File access plist */
hbool_t is_coll;
const char *filename;
MPI_Comm comm = MPI_COMM_WORLD;

View File

@ -37,9 +37,9 @@ static int mpi_size, mpi_rank;
#define HS_DIM1 200
#define HS_DIM2 100
/*-------------------------------------------------------------------------
* Function: filter_read_internal
* Function: filter_read_internal
*
* Purpose: Tests parallel reading of a 2D dataset written serially using
* filters. During the parallel reading phase, the dataset is
@ -54,13 +54,13 @@ static void
filter_read_internal(const char *filename, hid_t dcpl,
hsize_t *dset_size)
{
hid_t file, dataset; /* HDF5 IDs */
hid_t access_plist; /* Access property list ID */
hid_t sid, memspace; /* Dataspace IDs */
hsize_t size[2]; /* Dataspace dimensions */
hsize_t hs_offset[2]; /* Hyperslab offset */
hsize_t hs_size[2]; /* Hyperslab size */
size_t i, j; /* Local index variables */
hid_t file, dataset; /* HDF5 IDs */
hid_t access_plist; /* Access property list ID */
hid_t sid, memspace; /* Dataspace IDs */
hsize_t size[2]; /* Dataspace dimensions */
hsize_t hs_offset[2]; /* Hyperslab offset */
hsize_t hs_size[2]; /* Hyperslab size */
size_t i, j; /* Local index variables */
char name[32] = "dataset";
herr_t hrc; /* Error status */
int *points = NULL; /* Writing buffer for entire dataset */
@ -151,17 +151,17 @@ filter_read_internal(const char *filename, hid_t dcpl,
for (j=0; j<hs_size[1]; j++) {
if(points[i*size[1]+(size_t)hs_offset[1]+j] !=
check[i*hs_size[1]+j]) {
fprintf(stderr," Read different values than written.\n");
fprintf(stderr," At index %lu,%lu\n",
(unsigned long)(i),
(unsigned long)(hs_offset[1]+j));
fprintf(stderr," At original: %d\n",
(int)points[i*size[1]+(size_t)hs_offset[1]+j]);
fprintf(stderr," At returned: %d\n",
(int)check[i*hs_size[1]+j]);
HDfprintf(stderr," Read different values than written.\n");
HDfprintf(stderr," At index %lu,%lu\n",
(unsigned long)(i),
(unsigned long)(hs_offset[1]+j));
HDfprintf(stderr," At original: %d\n",
(int)points[i*size[1]+(size_t)hs_offset[1]+j]);
HDfprintf(stderr," At returned: %d\n",
(int)check[i*hs_size[1]+j]);
VRFY(FALSE, "");
}
}
}
}
}
/* Get the storage size of the dataset */
@ -194,10 +194,10 @@ filter_read_internal(const char *filename, hid_t dcpl,
/*-------------------------------------------------------------------------
* Function: test_filter_read
*
* Purpose: Tests parallel reading of datasets written serially using
* Purpose: Tests parallel reading of datasets written serially using
* several (combinations of) filters.
*
* Programmer: Christian Chilan
* Programmer: Christian Chilan
* Tuesday, May 15, 2007
*
* Modifications:
@ -208,7 +208,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
void
test_filter_read(void)
{
hid_t dc; /* HDF5 IDs */
hid_t dc; /* HDF5 IDs */
const hsize_t chunk_size[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */
hsize_t null_size; /* Size of dataset without filters */
unsigned chunk_opts; /* Chunk options */
@ -236,7 +236,7 @@ test_filter_read(void)
filename = GetTestParameters();
if(VERBOSE_MED)
printf("Parallel reading of dataset written with filters %s\n", filename);
HDprintf("Parallel reading of dataset written with filters %s\n", filename);
/*----------------------------------------------------------
* STEP 0: Test without filters.
@ -448,10 +448,10 @@ test_filter_read(void)
/* Make sure encoding is enabled */
if(h5_szip_can_encode() == 1) {
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
VRFY(hrc>=0, "H5Pset_szip");
filter_read_internal(filename,dc,&combo_size);
filter_read_internal(filename,dc,&combo_size);
}
/* Clean up objects used for this test */
@ -461,25 +461,25 @@ test_filter_read(void)
/* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
/* Make sure encoding is enabled */
if(h5_szip_can_encode() == 1) {
dc = H5Pcreate(H5P_DATASET_CREATE);
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
hrc = H5Pset_chunk (dc, 2, chunk_size);
hrc = H5Pset_chunk (dc, 2, chunk_size);
VRFY(hrc>=0, "H5Pset_chunk");
hrc = H5Pset_shuffle (dc);
hrc = H5Pset_shuffle (dc);
VRFY(hrc>=0, "H5Pset_shuffle");
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
VRFY(hrc>=0, "H5Pset_szip");
hrc = H5Pset_fletcher32 (dc);
hrc = H5Pset_fletcher32 (dc);
VRFY(hrc>=0, "H5Pset_fletcher32");
filter_read_internal(filename,dc,&combo_size);
filter_read_internal(filename,dc,&combo_size);
/* Clean up objects used for this test */
hrc = H5Pclose (dc);
/* Clean up objects used for this test */
hrc = H5Pclose (dc);
VRFY(hrc>=0, "H5Pclose");
}

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ static int test_mpio_overlap_writes(char *filename) {
MPI_Status mpi_stat;
if (VERBOSE_MED)
printf("MPIO independent overlapping writes test on file %s\n",
HDprintf("MPIO independent overlapping writes test on file %s\n",
filename);
nerrs = 0;
@ -64,8 +64,8 @@ static int test_mpio_overlap_writes(char *filename) {
/* 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");
HDprintf("Need at least 2 processes to run MPIO test.\n");
HDprintf(" -SKIP- \n");
return 0;
}
@ -138,13 +138,13 @@ static int test_mpio_overlap_writes(char *filename) {
expected = (unsigned char) (mpi_off + i);
if ((expected != buf[i])
&& (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
printf(
HDprintf(
"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);
HDprintf("proc %d: [more errors ...]\n", mpi_rank);
nerrs += vrfyerrs;
}
@ -204,7 +204,7 @@ static int test_mpio_gb_file(char *filename) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
if (VERBOSE_MED)
printf("MPI_Offset range test\n");
HDprintf("MPI_Offset range test\n");
/* figure out the signness and sizeof MPI_Offset */
mpi_off = 0;
@ -216,10 +216,10 @@ static int test_mpio_gb_file(char *filename) {
* sizes.
*/
if (MAINPROCESS) { /* only process 0 needs to check it*/
printf("MPI_Offset is %s %d bytes integeral type\n",
HDprintf("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 "
HDprintf("Skipped 2GB range test "
"because MPI_Offset cannot support it\n");
} else {
/* verify correctness of assigning 2GB sizes */
@ -241,7 +241,7 @@ static int test_mpio_gb_file(char *filename) {
}
if (sizeof_mpi_offset <= 4) {
printf("Skipped 4GB range test "
HDprintf("Skipped 4GB range test "
"because MPI_Offset cannot support it\n");
} else {
/* verify correctness of assigning 4GB sizes */
@ -267,10 +267,10 @@ static int test_mpio_gb_file(char *filename) {
* Verify if we can write to a file of multiple GB sizes.
*/
if (VERBOSE_MED)
printf("MPIO GB file test %s\n", filename);
HDprintf("MPIO GB file test %s\n", filename);
if (sizeof_mpi_offset <= 4) {
printf("Skipped GB file range test "
HDprintf("Skipped GB file range test "
"because MPI_Offset cannot support it\n");
} else {
buf = (char *) HDmalloc(MB);
@ -286,7 +286,7 @@ static int test_mpio_gb_file(char *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);
HDprintf("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
@ -328,9 +328,9 @@ static int test_mpio_gb_file(char *filename) {
*/
/* 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);
HDprintf("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",
HDprintf("proc %d: Skip read test due to previous write errors\n",
mpi_rank);
goto finish;
}
@ -356,14 +356,14 @@ static int test_mpio_gb_file(char *filename) {
for (j = 0; j < MB; j++) {
if ((*(buf + j) != expected)
&& (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED)) {
printf(
HDprintf(
"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);
HDprintf("proc %d: [more errors ...]\n", mpi_rank);
nerrs += vrfyerrs;
}
@ -380,7 +380,7 @@ static int test_mpio_gb_file(char *filename) {
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);
HDprintf("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);
@ -428,7 +428,7 @@ static int test_mpio_gb_file(char *filename) {
*/
#define DIMSIZE 32 /* Dimension size. */
#define PRINTID printf("Proc %d: ", mpi_rank)
#define PRINTID HDprintf("Proc %d: ", mpi_rank)
#define USENONE 0
#define USEATOM 1 /* request atomic I/O */
#define USEFSYNC 2 /* request file_sync */
@ -452,24 +452,24 @@ static int test_mpio_1wMr(char *filename, int special_request) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
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(" (Filename can be specified via program argument)\n");
HDprintf("Testing one process writes, all processes read.\n");
HDprintf("Using %d processes accessing file %s\n", mpi_size, filename);
HDprintf(" (Filename can be specified via program argument)\n");
}
/* show the hostname so that we can tell where the processes are running */
if (VERBOSE_DEF) {
#ifdef H5_HAVE_GETHOSTNAME
if(HDgethostname(hostname, sizeof(hostname)) < 0) {
printf("gethostname failed\n");
HDprintf("gethostname failed\n");
hostname[0] = '\0';
}
#else
printf("gethostname unavailable\n");
HDprintf("gethostname unavailable\n");
hostname[0] = '\0';
#endif
PRINTID;
printf("hostname=%s\n", hostname);
HDprintf("hostname=%s\n", hostname);
}
/* Delete any old file in order to start anew. */
@ -483,7 +483,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
!= MPI_SUCCESS) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
PRINTID;
printf("MPI_File_open failed (%s)\n", mpi_err_str);
HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
return 1;
}
@ -495,29 +495,29 @@ static int test_mpio_1wMr(char *filename, int special_request) {
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);
HDprintf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
}
if (VERBOSE_HI)
printf("Initial atomicity = %d\n", atomicity);
HDprintf("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);
HDprintf("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);
HDprintf("MPI_File_get_atomicity failed (%s)\n", mpi_err_str);
}
if (VERBOSE_HI)
printf("After set_atomicity atomicity = %d\n", atomicity);
HDprintf("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");
HDprintf("between MPI_Barrier and MPI_File_write_at\n");
}
/* ==================================================
@ -533,13 +533,13 @@ static int test_mpio_1wMr(char *filename, int special_request) {
if (mpi_rank == irank) {
if (VERBOSE_HI) {
PRINTID;
printf("wrote %d bytes at %ld\n", DIMSIZE, (long) mpi_off);
HDprintf("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",
HDprintf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
(long) mpi_off, DIMSIZE, mpi_err_str);
return 1;
};
@ -550,7 +550,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
MPI_Bcast(&mpi_err, 1, MPI_INT, irank, MPI_COMM_WORLD);
if (VERBOSE_HI) {
PRINTID;
printf("MPI_Bcast: mpi_err = %d\n", mpi_err);
HDprintf("MPI_Bcast: mpi_err = %d\n", mpi_err);
}
if (special_request & USEFSYNC) {
@ -559,19 +559,19 @@ static int test_mpio_1wMr(char *filename, int special_request) {
* should not need this.
* ==================================================*/
if (VERBOSE_HI)
printf("Apply MPI_File_sync\n");
HDprintf("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);
HDprintf("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);
HDprintf("MPI_File_sync failed (%s)\n", mpi_err_str);
}
}
@ -580,7 +580,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
MPI_Barrier(MPI_COMM_WORLD);
if (VERBOSE_HI) {
PRINTID;
printf("after MPI_Barrier\n");
HDprintf("after MPI_Barrier\n");
}
/* ==================================================
@ -592,7 +592,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
&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",
HDprintf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
(long) mpi_off, DIMSIZE, mpi_err_str);
return 1;
};
@ -600,7 +600,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
expect_val = irank * DIMSIZE + i;
if (readdata[i] != expect_val) {
PRINTID;
printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
HDprintf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
readdata[i], expect_val);
nerrs++;
}
@ -610,7 +610,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
if (VERBOSE_HI) {
PRINTID;
printf("%d data errors detected\n", nerrs);
HDprintf("%d data errors detected\n", nerrs);
}
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
@ -664,7 +664,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
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
If this bug has been fixed in the previous not-working package, this test will issue a HDprintf 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
@ -703,7 +703,7 @@ static int test_mpio_derived_dtype(char *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);
HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
return 1;
}
@ -717,13 +717,13 @@ static int test_mpio_derived_dtype(char *filename) {
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);
HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
}
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);
HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
}
@ -733,13 +733,13 @@ static int test_mpio_derived_dtype(char *filename) {
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);
HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
}
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);
HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
}
@ -754,52 +754,52 @@ static int test_mpio_derived_dtype(char *filename) {
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);
HDprintf("MPI_Type_create_struct failed (%s)\n", mpi_err_str);
return 1;
}
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);
HDprintf("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);
HDprintf("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) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_File_write failed (%s)\n", mpi_err_str);
HDprintf("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);
HDprintf("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);
HDprintf("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) {
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
printf("MPI_File_set_view failed (%s)\n", mpi_err_str);
HDprintf("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);
HDprintf("MPI_File_read failed (%s)\n", mpi_err_str);
return 1;
}
@ -807,9 +807,9 @@ static int test_mpio_derived_dtype(char *filename) {
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");
HDprintf("complicated derived datatype is NOT working at this platform\n");
HDprintf("go back to hdf5/config and find the corresponding\n");
HDprintf("configure-specific file and change ?????\n");
}
*/
retcode = -1;
@ -817,16 +817,16 @@ static int test_mpio_derived_dtype(char *filename) {
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);
HDprintf("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(
HDprintf(
"Complicated derived datatype is NOT working at this platform\n");
printf(" Please report to help@hdfgroup.org about this problem.\n");
HDprintf(" Please report to help@hdfgroup.org about this problem.\n");
}
retcode = 1;
}
@ -851,7 +851,7 @@ static int test_mpio_derived_dtype(char *filename) {
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
If this bug has been fixed in the previous not-working package, this test will issue a HDprintf 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
@ -898,26 +898,26 @@ static int test_mpio_special_collective(char *filename) {
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);
HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
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);
HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
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);
HDprintf("MPI_Type_contiguous failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
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);
HDprintf("MPI_Type_commit failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
} /* end if */
@ -931,7 +931,7 @@ static int test_mpio_special_collective(char *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);
HDprintf("MPI_File_open failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
@ -943,7 +943,7 @@ static int test_mpio_special_collective(char *filename) {
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);
HDprintf("MPI_File_set_view failed (%s)\n", mpi_err_str);
return 1;
} /* end if */
@ -951,7 +951,7 @@ static int test_mpio_special_collective(char *filename) {
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",
HDprintf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
(long) mpi_off, bufcount, mpi_err_str);
return 1;
} /* end if */
@ -959,7 +959,7 @@ static int test_mpio_special_collective(char *filename) {
/* Close the file */
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. \n");
HDprintf("MPI_File_close failed. \n");
return 1;
} /* end if */
@ -967,8 +967,8 @@ static int test_mpio_special_collective(char *filename) {
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
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");
HDprintf("special collective IO is NOT working at this platform\n");
HDprintf(" Please report to help@hdfgroup.org about this problem.\n");
} /* end if */
retcode = 1;
} /* end if */
@ -1024,15 +1024,15 @@ static int parse_options(int argc, char **argv) {
for (i = 0; i < n; i++)
if (h5_fixname(FILENAME[i], plist, filenames[i],
sizeof(filenames[i])) == NULL) {
printf("h5_fixname failed\n");
HDprintf("h5_fixname failed\n");
nerrors++;
return (1);
}
H5Pclose(plist);
if (VERBOSE_MED) {
printf("Test filenames are:\n");
HDprintf("Test filenames are:\n");
for (i = 0; i < n; i++)
printf(" %s\n", filenames[i]);
HDprintf(" %s\n", filenames[i]);
}
}
@ -1043,10 +1043,10 @@ static int parse_options(int argc, char **argv) {
* Show command usage
*/
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");
printf("\n");
HDprintf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
HDprintf("\t-v<verbosity>\tset verbose level (0-9,l,m,h)\n");
HDprintf("\t-f <prefix>\tfilename prefix\n");
HDprintf("\n");
}
/*
@ -1072,7 +1072,7 @@ int 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");
HDprintf("Failed to turn off atexit processing. Continue.\n");
};
H5open();
if (parse_options(argc, argv) != 0) {
@ -1082,9 +1082,9 @@ int main(int argc, char **argv) {
}
if (MAINPROCESS) {
printf("===================================\n");
printf("MPI functionality tests\n");
printf("===================================\n");
HDprintf("===================================\n");
HDprintf("MPI functionality tests\n");
HDprintf("===================================\n");
}
if (VERBOSE_MED)
@ -1103,7 +1103,7 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
@ -1114,7 +1114,7 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
@ -1122,7 +1122,7 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
}
@ -1135,12 +1135,12 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
#else
if (mpi_rank==0)
printf(" will be skipped on Windows (JIRA HDDFV-8064)\n");
HDprintf(" will be skipped on Windows (JIRA HDDFV-8064)\n");
#endif
/*=======================================
@ -1150,7 +1150,7 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
@ -1161,7 +1161,7 @@ int main(int argc, char **argv) {
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);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
@ -1171,7 +1171,7 @@ int main(int argc, char **argv) {
if (mpi_size < 4) {
MPI_BANNER("MPIO special collective io test SKIPPED.");
if (mpi_rank == 0)
printf("This test needs at least four processes to run.\n");
HDprintf("This test needs at least four processes to run.\n");
ret_code = 0;
goto sc_finish;
} /* end if */
@ -1181,7 +1181,7 @@ int main(int argc, char **argv) {
sc_finish: ret_code = errors_sum(ret_code);
if (mpi_rank == 0 && ret_code > 0) {
printf("***FAILED with %d total errors\n", ret_code);
HDprintf("***FAILED with %d total errors\n", ret_code);
nerrors += ret_code;
}
@ -1191,14 +1191,14 @@ int main(int argc, char **argv) {
*/
MPI_Barrier(MPI_COMM_WORLD);
if (MAINPROCESS) { /* only process 0 reports */
printf("===================================\n");
HDprintf("===================================\n");
if (nerrors) {
printf("***MPI tests detected %d errors***\n", nerrors);
HDprintf("***MPI tests detected %d errors***\n", nerrors);
}
else {
printf("MPI tests finished with no errors\n");
HDprintf("MPI tests finished with no errors\n");
}
printf("===================================\n");
HDprintf("===================================\n");
}
/* turn off alarm */

View File

@ -50,13 +50,13 @@ test_fapl_mpio_dup(void)
int nkeys, nkeys_tmp;
if (VERBOSE_MED)
printf("Verify fapl_mpio duplicates communicator and INFO objects\n");
HDprintf("Verify fapl_mpio duplicates communicator and INFO objects\n");
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
if (VERBOSE_MED)
printf("rank/size of MPI_COMM_WORLD are %d/%d\n", mpi_rank, mpi_size);
HDprintf("rank/size of MPI_COMM_WORLD are %d/%d\n", mpi_rank, mpi_size);
/* Create a new communicator that has the same processes as MPI_COMM_WORLD.
* Use MPI_Comm_split because it is simplier than MPI_Comm_create
@ -66,7 +66,7 @@ test_fapl_mpio_dup(void)
MPI_Comm_size(comm,&mpi_size_old);
MPI_Comm_rank(comm,&mpi_rank_old);
if (VERBOSE_MED)
printf("rank/size of comm are %d/%d\n", mpi_rank_old, mpi_size_old);
HDprintf("rank/size of comm are %d/%d\n", mpi_rank_old, mpi_size_old);
/* create a new INFO object with some trivial information. */
mrc = MPI_Info_create(&info);
@ -103,7 +103,7 @@ test_fapl_mpio_dup(void)
MPI_Comm_size(comm_tmp,&mpi_size_tmp);
MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
if (VERBOSE_MED)
printf("After H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
HDprintf("After H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
mpi_rank_tmp, mpi_size_tmp);
VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size");
VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank");
@ -151,7 +151,7 @@ test_fapl_mpio_dup(void)
MPI_Comm_size(comm_tmp,&mpi_size_tmp);
MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
if (VERBOSE_MED)
printf("After second H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
HDprintf("After second H5Pget_fapl_mpio: rank/size of comm are %d/%d\n",
mpi_rank_tmp, mpi_size_tmp);
VRFY((mpi_size_tmp==mpi_size), "MPI_Comm_size");
VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank");
@ -171,7 +171,7 @@ test_fapl_mpio_dup(void)
MPI_Comm_size(comm_tmp,&mpi_size_tmp);
MPI_Comm_rank(comm_tmp,&mpi_rank_tmp);
if (VERBOSE_MED)
printf("After Property list closed: rank/size of comm are %d/%d\n",
HDprintf("After Property list closed: rank/size of comm are %d/%d\n",
mpi_rank_tmp, mpi_size_tmp);
if (MPI_INFO_NULL != info_tmp){
mrc=MPI_Info_get_nkeys(info_tmp, &nkeys_tmp);

View File

@ -107,7 +107,7 @@ main (int argc, char **argv)
for (i=0; i < block[0]; i++){
for (j=0; j < block[1]; j++){
if(*dataptr != mpi_rank+1) {
printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
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]),
mpi_rank+1, *(dataptr));

View File

@ -141,7 +141,7 @@ test_plist_ed(void)
herr_t ret; /* Generic return value */
if(VERBOSE_MED)
printf("Encode/Decode DCPLs\n");
HDprintf("Encode/Decode DCPLs\n");
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);

View File

@ -4656,10 +4656,10 @@ void pause_proc(void)
if (MAINPROCESS)
while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){
if (!loops++){
printf("Proc %d (%*s, %d): to debug, attach %d\n",
HDprintf("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);
HDprintf("waiting(%ds) for file %s ...\n", time_int, greenlight);
fflush(stdout);
HDsleep(time_int);
}
@ -4683,18 +4683,18 @@ int MPI_Init(int *argc, char ***argv)
static void
usage(void)
{
printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
HDprintf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] "
"[-o] [-f <prefix>] [-d <dim0> <dim1>]\n");
printf("\t-m<n_datasets>"
HDprintf("\t-m<n_datasets>"
"\tset number of datasets for the multiple dataset test\n");
printf("\t-n<n_groups>"
HDprintf("\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",
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);
printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
printf("\n");
HDprintf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n");
HDprintf("\n");
}
@ -4772,7 +4772,7 @@ parse_options(int argc, char **argv)
break;
case 'h': /* print help message--return with nerrors set */
return(1);
default: printf("Illegal option(%s)\n", *argv);
default: HDprintf("Illegal option(%s)\n", *argv);
nerrors++;
return(1);
}
@ -4781,12 +4781,12 @@ parse_options(int argc, char **argv)
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
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);
HDprintf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
nerrors++;
return(1);
}
@ -4794,7 +4794,7 @@ parse_options(int argc, char **argv)
/* 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",
HDprintf("dim0(%d) and dim1(%d) must be multiples of processes(%d)\n",
dim0, dim1, mpi_size);
nerrors++;
return(1);
@ -4809,13 +4809,13 @@ parse_options(int argc, char **argv)
for (i=0; i < n; i++)
if (h5_fixname(FILENAME[i],fapl,filenames[i],sizeof(filenames[i]))
== NULL){
printf("h5_fixname failed\n");
HDprintf("h5_fixname failed\n");
nerrors++;
return(1);
}
printf("Test filenames are:\n");
HDprintf("Test filenames are:\n");
for (i=0; i < n; i++)
printf(" %s\n", filenames[i]);
HDprintf(" %s\n", filenames[i]);
}
return(0);
@ -4952,10 +4952,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");
HDprintf("===================================\n");
HDprintf("Shape Same Tests Start\n");
HDprintf(" express_test = %d.\n", GetTestExpress());
HDprintf("===================================\n");
}
/* Attempt to turn off atexit post processing so that in case errors
@ -4964,7 +4964,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);
HDprintf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank);
};
H5open();
h5_show_hostname();
@ -5003,7 +5003,7 @@ int main(int argc, char **argv)
TestParseCmdLine(argc, argv);
if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS){
printf("===================================\n"
HDprintf("===================================\n"
" Using Independent I/O with file set view to replace collective I/O \n"
"===================================\n");
}
@ -5034,12 +5034,12 @@ int main(int argc, char **argv)
}
if (MAINPROCESS){ /* only process 0 reports */
printf("===================================\n");
HDprintf("===================================\n");
if (nerrors)
printf("***Shape Same tests detected %d errors***\n", nerrors);
HDprintf("***Shape Same tests detected %d errors***\n", nerrors);
else
printf("Shape Same tests finished with no errors\n");
printf("===================================\n");
HDprintf("Shape Same tests finished with no errors\n");
HDprintf("===================================\n");
}
/* close HDF5 library */

View File

@ -32,7 +32,7 @@
*/
#define MESG(mesg) \
if (VERBOSE_MED && *mesg != '\0') \
printf("%s\n", mesg)
HDprintf("%s\n", mesg)
/*
* VRFY: Verify if the condition val is true.
@ -48,14 +48,14 @@
if (val) { \
MESG(mesg); \
} else { \
printf("Proc %d: ", mpi_rank); \
printf("*** Parallel ERROR ***\n"); \
printf(" VRFY (%s) failed at line %4d in %s\n", \
HDprintf("Proc %d: ", mpi_rank); \
HDprintf("*** Parallel ERROR ***\n"); \
HDprintf(" VRFY (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
++nerrors; \
fflush(stdout); \
if (!VERBOSE_MED) { \
printf("aborting MPI processes\n"); \
HDprintf("aborting MPI processes\n"); \
MPI_Abort(MPI_COMM_WORLD, 1); \
} \
} \
@ -70,9 +70,9 @@
if (val) { \
MESG(mesg); \
} else { \
printf("Proc %d: ", mpi_rank); \
printf("*** PHDF5 REMARK (not an error) ***\n"); \
printf(" Condition (%s) failed at line %4d in %s\n", \
HDprintf("Proc %d: ", mpi_rank); \
HDprintf("*** PHDF5 REMARK (not an error) ***\n"); \
HDprintf(" Condition (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
fflush(stdout); \
} \
@ -80,10 +80,10 @@
#define MPI_BANNER(mesg) do { \
if (VERBOSE_MED || MAINPROCESS){ \
printf("--------------------------------\n"); \
printf("Proc %d: ", mpi_rank); \
printf("*** %s\n", mesg); \
printf("--------------------------------\n"); \
HDprintf("--------------------------------\n"); \
HDprintf("Proc %d: ", mpi_rank); \
HDprintf("*** %s\n", mesg); \
HDprintf("--------------------------------\n"); \
} \
} while(0)

View File

@ -19,7 +19,7 @@
#include "testpar.h"
enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
API_MULTI_HARD,API_LINK_TRUE,API_LINK_FALSE,
API_MULTI_HARD,API_LINK_TRUE,API_LINK_FALSE,
API_MULTI_COLL,API_MULTI_IND};
#ifndef FALSE
@ -32,20 +32,20 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* Constants definitions */
#define DIM0 600 /* Default dataset sizes. */
#define DIM1 1200 /* Values are from a monitor pixel sizes */
#define ROW_FACTOR 8 /* Nominal row factor for dataset size */
#define COL_FACTOR 16 /* Nominal column factor for dataset size */
#define RANK 2
#define DATASETNAME1 "Data1"
#define DATASETNAME2 "Data2"
#define DATASETNAME3 "Data3"
#define DATASETNAME4 "Data4"
#define DATASETNAME5 "Data5"
#define DATASETNAME6 "Data6"
#define DATASETNAME7 "Data7"
#define DATASETNAME8 "Data8"
#define DATASETNAME9 "Data9"
#define DIM0 600 /* Default dataset sizes. */
#define DIM1 1200 /* Values are from a monitor pixel sizes */
#define ROW_FACTOR 8 /* Nominal row factor for dataset size */
#define COL_FACTOR 16 /* Nominal column factor for dataset size */
#define RANK 2
#define DATASETNAME1 "Data1"
#define DATASETNAME2 "Data2"
#define DATASETNAME3 "Data3"
#define DATASETNAME4 "Data4"
#define DATASETNAME5 "Data5"
#define DATASETNAME6 "Data6"
#define DATASETNAME7 "Data7"
#define DATASETNAME8 "Data8"
#define DATASETNAME9 "Data9"
/* point selection order */
#define IN_ORDER 1
@ -179,14 +179,14 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* Definitions of the selection mode for the no_collective_cause_tests function. */
#define TEST_COLLECTIVE 0x001
#define TEST_SET_INDEPENDENT 0x002
#define TEST_SET_INDEPENDENT 0x002
#define TEST_DATATYPE_CONVERSION 0x004
#define TEST_DATA_TRANSFORMS 0x008
#define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x010
#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x020
#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x040
#define TEST_FILTERS 0x080
/* TEST_FILTERS will take place of this after supporting mpio + filter for
/* TEST_FILTERS will take place of this after supporting mpio + filter for
* H5Dcreate and H5Dwrite */
#define TEST_FILTERS_READ 0x100
@ -209,8 +209,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
/* type definitions */
typedef struct H5Ptest_param_t /* holds extra test parameters */
{
char *name;
int count;
char *name;
int count;
} H5Ptest_param_t;
/* Dataset data type. Int's can be easily octo dumped. */
@ -218,19 +218,19 @@ typedef int DATATYPE;
/* Shape Same Tests Definitions */
typedef enum {
IND_CONTIG, /* Independent IO on contigous datasets */
COL_CONTIG, /* Collective IO on contigous datasets */
IND_CHUNKED, /* Independent IO on chunked datasets */
COL_CHUNKED /* Collective IO on chunked datasets */
IND_CONTIG, /* Independent IO on contigous datasets */
COL_CONTIG, /* Collective IO on contigous datasets */
IND_CHUNKED, /* Independent IO on chunked datasets */
COL_CHUNKED /* Collective IO on chunked datasets */
} ShapeSameTestMethods;
/* Shared global variables */
extern int dim0, dim1; /*Dataset dimensions */
extern int chunkdim0, chunkdim1; /*Chunk dimensions */
extern int nerrors; /*errors count */
extern H5E_auto2_t old_func; /* previous error handler */
extern void *old_client_data; /*previous error handler arg.*/
extern int facc_type; /*Test file access type */
extern int dim0, dim1; /*Dataset dimensions */
extern int chunkdim0, chunkdim1; /*Chunk dimensions */
extern int nerrors; /*errors count */
extern H5E_auto2_t old_func; /* previous error handler */
extern void *old_client_data; /*previous error handler arg.*/
extern int facc_type; /*Test file access type */
extern int dxfer_coll_type;
/* Test program prototypes */

View File

@ -3753,7 +3753,7 @@ void setDefaultValues(struct Input *in, int count)
in->path.count = 1;
HDstrcpy(temp, "dataset");
sprintf(num, "%d", count);
HDsprintf(num, "%d", count);
HDstrcat(temp, num);
HDstrcpy(in->path.group[0], temp);

View File

@ -4120,7 +4120,7 @@ int write_dset_in(hid_t loc_id,
dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
HDprintf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
goto out;
}

View File

@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
This test generates attributes, groups, and datasets of many types. It
creates a large number of attributes, groups, and datasets by specifying
This test generates attributes, groups, and datasets of many types. It
creates a large number of attributes, groups, and datasets by specifying
-a, -g, -d options respectively. Using "-h" option to see details.
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
@ -31,7 +31,7 @@
#define MAXVLEN 10
#define FIXED_LEN 8
typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
typedef struct {
int i;
@ -43,24 +43,24 @@ typedef struct {
float f_array[FIXED_LEN];
hvl_t i_vlen;
char *s_vlen;
} test_comp_t;
} test_comp_t;
typedef struct {
int zipcode;
char *city;
} zipcode_t;
} zipcode_t;
int add_attrs(hid_t oid, int idx);
int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ;
herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
int compressed, int latest);
herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
int compressed, int latest);
int main (int argc, char *argv[])
{
char fname[32];
int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
memset(fname, 0, 32);
for (i=1; i<argc; i++) {
@ -83,92 +83,92 @@ int main (int argc, char *argv[])
else if (strcmp(argv[i], "-l")==0)
l = 1;
else if (strcmp(argv[i], "-z")==0)
z = 1;
z = 1;
else if (strcmp(argv[i], "-h")==0) {
printf("\nOPTONS:\n");
printf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
printf("\t-l:\tuse latest format (default: no).\n");
printf("\t-z:\tuse gzip compression (default: no).\n");
printf("\t-h:\tthis help information.\n");
printf("Example:\n");
printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
HDprintf("\nOPTONS:\n");
HDprintf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
HDprintf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
HDprintf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
HDprintf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
HDprintf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
HDprintf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
HDprintf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
HDprintf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
HDprintf("\t-l:\tuse latest format (default: no).\n");
HDprintf("\t-z:\tuse gzip compression (default: no).\n");
HDprintf("\t-h:\tthis help information.\n");
HDprintf("Example:\n");
HDprintf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
exit(0);
}
}
if (strlen(fname)<=0)
sprintf(fname, FNAME);
create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
(hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
if (strlen(fname)<=0)
HDsprintf(fname, FNAME);
create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
(hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
return 0;
}
/*****************************************************************************
This function generates attributes, groups, and datasets of many types.
This function generates attributes, groups, and datasets of many types.
Parameters:
fname: file_name.
ngrps: number of top level groups.
ndsets: number of datasets.
attrs: number of attributes.
nrow: number of rows in a dataset.
chunk: chunk size (single number).
vlen: max vlen size.
comp: use latest format.
latest: use gzip comnpression.
fname: file_name.
ngrps: number of top level groups.
ndsets: number of datasets.
attrs: number of attributes.
nrow: number of rows in a dataset.
chunk: chunk size (single number).
vlen: max vlen size.
comp: use latest format.
latest: use gzip comnpression.
Return: Non-negative on success/Negative on failure
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
****************************************************************************/
herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
int compressed, int latest)
herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
int compressed, int latest)
{
int i, j, k;
hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32];
hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
dim1[1]={2};
hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
dim1[1]={2};
char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"};
test_comp_t *buf_comp=NULL, *buf_comp_large=NULL;
int *buf_int=NULL;
float (*buf_float_a)[FIXED_LEN]=NULL;
double **buf_double2d=NULL;
hvl_t *buf_vlen_i=NULL;
char (*buf_str)[FIXED_LEN];
char **buf_vlen_s=NULL;
hobj_ref_t buf_ref[2];
hdset_reg_ref_t buf_reg_ref[2];
char (*buf_str)[FIXED_LEN];
char **buf_vlen_s=NULL;
hobj_ref_t buf_ref[2];
hdset_reg_ref_t buf_reg_ref[2];
size_t offset, len;
herr_t status;
char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
"enum", "fixed float array", "vlen int array", "vlen strings"};
hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
"enum", "fixed float array", "vlen int array", "vlen strings"};
hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s};
hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
if (nrows < NROWS) nrows = NROWS;
hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
if (nrows < NROWS) nrows = NROWS;
if (ngrps<NGROUPS) ngrps=NGROUPS;
if (ndsets<NDSETS) ndsets=NDSETS;
if (nattrs<NATTRS) nattrs=NATTRS;
if (dim0<DIM0) dim0=DIM0;
if (ndsets<NDSETS) ndsets=NDSETS;
if (nattrs<NATTRS) nattrs=NATTRS;
if (dim0<DIM0) dim0=DIM0;
if (chunk>dim0) chunk=dim0/4;
if (chunk<1) chunk = 1;
if (vlen<1) vlen = MAXVLEN;
if (vlen<1) vlen = MAXVLEN;
/* create fixed string datatype */
/* create fixed string datatype */
types[4] = tid_str = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_str, FIXED_LEN);
@ -181,15 +181,15 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
/* create float array datatype */
types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array);
/* create variable length integer datatypes */
types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT);
/* create variable length string datatype */
types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_vlen_s, H5T_VARIABLE);
/* create compound datatypes */
/* create compound datatypes */
cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t));
offset = 0;
for (i=0; i<NTYPES-2; i++) {
@ -197,31 +197,31 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
offset += H5Tget_size(types[i]);
}
H5Tinsert(cmp_tid, names[7], offset, types[7]);
offset += sizeof (hvl_t);
H5Tinsert(cmp_tid, names[8], offset, types[8]);
H5Tinsert(cmp_tid, names[7], offset, types[7]);
offset += sizeof (hvl_t);
H5Tinsert(cmp_tid, names[8], offset, types[8]);
/* create dataspace */
/* create dataspace */
sid_1d = H5Screate_simple (1, dims, NULL);
sid_2d = H5Screate_simple (2, dims2d, NULL);
sid_2 = H5Screate_simple (1, dim1, NULL);
sid_large = H5Screate_simple (1, &nrows, NULL);
sid_null = H5Screate (H5S_NULL);
sid_scalar = H5Screate (H5S_SCALAR);
/* create fid access property */
fapl = H5Pcreate (H5P_FILE_ACCESS);
sid_large = H5Screate_simple (1, &nrows, NULL);
sid_null = H5Screate (H5S_NULL);
sid_scalar = H5Screate (H5S_SCALAR);
/* create fid access property */
fapl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
/* create dataset creation property */
/* create dataset creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
/* set dataset chunk */
/* set dataset chunk */
if (chunk>0) {
H5Pset_chunk (dcpl, 1, &chunk);
}
/* set dataset compression */
/* set dataset compression */
if (compressed) {
if (chunk<=0) {
chunk = dim0/10+1;;
@ -229,54 +229,54 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
H5Pset_shuffle (dcpl);
H5Pset_deflate (dcpl, 6);
}
}
/* allocate buffers */
/* allocate buffers */
buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t));
buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t));
buf_int = (int *)calloc(dim0, sizeof(int));
buf_float_a = malloc(dim0*sizeof(*buf_float_a));
buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
buf_vlen_s = (char **)calloc(dim0, sizeof(char *));
buf_str = malloc(dim0*sizeof (*buf_str));
buf_str = malloc(dim0*sizeof (*buf_str));
/* allocate array of doulbe pointers */
buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
/* allocate a contigous chunk of memory for the data */
buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
/* assign memory city to pointer array */
for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
/* allocate array of doulbe pointers */
buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
/* allocate a contigous chunk of memory for the data */
buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
/* assign memory city to pointer array */
for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
/* fill buffer values */
len = 1;
/* fill buffer values */
len = 1;
for (i=0; i<dims[0]; i++) {
buf_comp[i].i = buf_int[i] = i-2147483648;
buf_comp[i].l = 0xffffffffffffffff-i;
buf_comp[i].f = 1.0/(i+1.0);
buf_comp[i].d = 987654321.0*i+1.0/(i+1.0);
buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1));
for (j=0; j<FIXED_LEN; j++) {
buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
buf_str[i][j] = 'a' + (i%26);
}
buf_str[i][FIXED_LEN-1] = 0;
for (j=0; j<FIXED_LEN; j++) {
buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
buf_str[i][j] = 'a' + (i%26);
}
buf_str[i][FIXED_LEN-1] = 0;
strcpy(buf_comp[i].s, buf_str[i]);
len = (1-cos(i/8.0))/2*vlen+1;
if (!i) len = vlen;
buf_vlen_i[i].len = len;
buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
buf_comp[i].i_vlen = buf_vlen_i[i];
buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
for (j=0; j<len-1; j++)
buf_vlen_s[i][j] = j%26+'A';
buf_comp[i].s_vlen = buf_vlen_s[i];
for (j=0; j<dims2d[1]; j++)
buf_double2d[i][j] = i+j/10000.0;
len = (1-cos(i/8.0))/2*vlen+1;
if (!i) len = vlen;
buf_vlen_i[i].len = len;
buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
buf_comp[i].i_vlen = buf_vlen_i[i];
buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
for (j=0; j<len-1; j++)
buf_vlen_s[i][j] = j%26+'A';
buf_comp[i].s_vlen = buf_vlen_s[i];
for (j=0; j<dims2d[1]; j++)
buf_double2d[i][j] = i+j/10000.0;
}
for (i=0; i<nrows; i++) {
@ -289,147 +289,147 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
buf_comp_large[i].f_array[j] = i*100+j;
buf_comp_large[i].s[j] = 'a' + (i%26);
}
len = i%vlen+1;
len = i%vlen+1;
buf_comp_large[i].i_vlen.len = len;
buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int));
for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j;
buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char));
for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A';
}
/* create file */
/* create file */
if (latest)
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
else
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
add_attrs(fid, 0);
add_attrs(fid, 0);
sprintf(name, "a cmp ds of %d rows", nrows);
did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
add_attrs(did, 0);
H5Dclose(did);
HDsprintf(name, "a cmp ds of %d rows", nrows);
did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
add_attrs(did, 0);
H5Dclose(did);
// /* add attributes*/
// /* add attributes*/
gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (nattrs<1) nattrs = 1;
i=0;
while (i<nattrs) i += add_attrs(gid1, i);
H5Gclose(gid1);
/* add many sub groups to a group*/
if (nattrs<1) nattrs = 1;
i=0;
while (i<nattrs) i += add_attrs(gid1, i);
H5Gclose(gid1);
/* add many sub groups to a group*/
gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
add_attrs(gid1, 0);
add_attrs(gid1, 0);
for (i=0; i<ngrps; i++) {
/* create sub groups */
sprintf(name, "g%02d", i);
/* create sub groups */
HDsprintf(name, "g%02d", i);
gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (i<10) add_attrs(gid2, 0);
H5Gclose(gid2);
}
H5Gclose(gid1);
if (i<10) add_attrs(gid2, 0);
H5Gclose(gid2);
}
H5Gclose(gid1);
/* add many datasets to a group */
gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
add_attrs(gid1, 0);
/* add many datasets to a group */
gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
add_attrs(gid1, 0);
for (j=0; j<ndsets; j+=12) {
/* 1 add a null dataset */
sprintf(name, "%05d null dataset", j);
/* 1 add a null dataset */
HDsprintf(name, "%05d null dataset", j);
did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (!j) add_attrs(did, j);
H5Dclose(did);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 2 add scalar int point */
sprintf(name, "%05d scalar int point", j);
/* 2 add scalar int point */
HDsprintf(name, "%05d scalar int point", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 3 scalar vlen string */
sprintf(name, "%05d scalar vlen string", j);
H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 3 scalar vlen string */
HDsprintf(name, "%05d scalar vlen string", j);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 4 add fixed-length float array */
sprintf(name, "%05d fixed-length float array", j);
did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 5 add fixed-length strings */
sprintf(name, "%05d fixed-length strings", j);
did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 6 add compound data */
sprintf(name, "%05d compund data", j);
did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
if (!j) add_attrs(did, j);
H5Dclose(did);
H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 7 add 2D double */
sprintf(name, "%05d 2D double", j);
strcpy (tmp_name1, name);
did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 8 add 1D int array */
sprintf(name, "%05d 1D int array", j);
/* 4 add fixed-length float array */
HDsprintf(name, "%05d fixed-length float array", j);
did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 5 add fixed-length strings */
HDsprintf(name, "%05d fixed-length strings", j);
did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 6 add compound data */
HDsprintf(name, "%05d compund data", j);
did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 7 add 2D double */
HDsprintf(name, "%05d 2D double", j);
strcpy (tmp_name1, name);
did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 8 add 1D int array */
HDsprintf(name, "%05d 1D int array", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 9 add vlen int array */
sprintf(name, "%05d vlen int array", j);
strcpy (tmp_name2, name);
H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 9 add vlen int array */
HDsprintf(name, "%05d vlen int array", j);
strcpy (tmp_name2, name);
did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
if (!j) add_attrs(did, j);
H5Dclose(did);
H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 10 add vlen strings */
sprintf(name, "%05d vlen strings", j);
strcpy (tmp_name3, name);
/* 10 add vlen strings */
HDsprintf(name, "%05d vlen strings", j);
strcpy (tmp_name3, name);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 11 add object refs */
H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
sprintf(name, "%05d obj refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
if (!j) add_attrs(did, j);
H5Dclose(did);
H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 12 add region refs */
H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
H5Sselect_none(sid_2d);
count = dims[0]/2+1;
H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
H5Sselect_none(sid_1d);
sprintf(name, "%05d region refs", j);
/* 11 add object refs */
H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
HDsprintf(name, "%05d obj refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
if (!j) add_attrs(did, j);
H5Dclose(did);
/* 12 add region refs */
H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
H5Sselect_none(sid_2d);
count = dims[0]/2+1;
H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
H5Sselect_none(sid_1d);
HDsprintf(name, "%05d region refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
if (!j) add_attrs(did, j);
H5Dclose(did);
}
H5Gclose(gid1);
H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
if (!j) add_attrs(did, j);
H5Dclose(did);
}
H5Gclose(gid1);
H5Tclose (tid_array_f);
H5Tclose (tid_vlen_i);
H5Tclose (tid_vlen_s);
@ -447,22 +447,22 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
H5Fclose (fid);
for (i=0; i<dims[0]; i++) {
if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
if (buf_vlen_s[i]) free(buf_vlen_s[i]);
}
if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
if (buf_vlen_s[i]) free(buf_vlen_s[i]);
}
for (i=0; i<nrows; i++) {
if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
}
if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
}
free (buf_comp);
free (buf_comp_large);
free (buf_int);
free (buf_float_a);
free (buf_double2d[0]);
free (buf_double2d);
free (buf_str);
free (buf_str);
free(buf_vlen_i);
free(buf_vlen_s);
@ -470,34 +470,34 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
/* add a single attribute */
int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
{
hid_t aid;
aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
if (aid <0)
return 0;
H5Awrite(aid, tid, buf);
if (aid <0)
return 0;
H5Awrite(aid, tid, buf);
H5Aclose(aid);
return 1;
return 1;
}
/*
/*
adds different types of attributes to an object.
returns the number of attributes added to the objects.
returns the number of attributes added to the objects.
*/
int add_attrs(hid_t oid, int idx)
int add_attrs(hid_t oid, int idx)
{
char name[32];
int i0, i1, i2, j, nattrs=0;
hid_t aid, tid, tid1, sid;
hid_t aid, tid, tid1, sid;
hvl_t i_vlen[4];
hobj_ref_t ref;
zipcode_t cmp_data[4];
hobj_ref_t ref;
zipcode_t cmp_data[4];
unsigned int i = 0xffffffff;
long long l = -2147483647;
float f = 123456789.987654321;
@ -505,22 +505,22 @@ int add_attrs(hid_t oid, int idx)
char *s[7] = {"Parting", "is such", "sweeter", "sorrow."};
float f_array[4] = {1.0, 2.22, 3.333, 4.444};
char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."};
hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
int int3d[4][3][5];
size_t offset = 0;
for (i0=0; i0<4; i0++) {
i_vlen[i0].len = (i0+1);
i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
for (j=0; j<i_vlen[i0].len; j++)
((int *)i_vlen[i0].p)[j] = i0*100+j;
for (i1=0; i1<3; i1++) {
for (i2=0; i2<5; i2++)
int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
}
hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
int int3d[4][3][5];
size_t offset = 0;
for (i0=0; i0<4; i0++) {
i_vlen[i0].len = (i0+1);
i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
for (j=0; j<i_vlen[i0].len; j++)
((int *)i_vlen[i0].p)[j] = i0*100+j;
for (i1=0; i1<3; i1++) {
for (i2=0; i2<5; i2++)
int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
}
}
cmp_data[0].zipcode = 01001;
cmp_data[0].zipcode = 01001;
cmp_data[0].city = "Agawam, Massachusetts";
cmp_data[1].zipcode = 99950;
cmp_data[1].city = "Ketchikan, Alaska";
@ -528,82 +528,82 @@ int add_attrs(hid_t oid, int idx)
cmp_data[2].city = "Holtsville, New York";
cmp_data[3].zipcode = 61820;
cmp_data[3].city = "Champaign, Illinois";
/* 1 scalar point */
sid = H5Screate (H5S_SCALAR);
sprintf(name, "%05d scalar int", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
sprintf(name, "%05d scalar ulong", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
sprintf(name, "%05d scalar str", idx);
tid = H5Tcopy (H5T_C_S1);
/* 1 scalar point */
sid = H5Screate (H5S_SCALAR);
HDsprintf(name, "%05d scalar int", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
HDsprintf(name, "%05d scalar ulong", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
HDsprintf(name, "%05d scalar str", idx);
tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, H5T_VARIABLE);
nattrs += add_attr(oid, name, tid, sid, &s[2]);
H5Tclose(tid);
H5Sclose(sid);
nattrs += add_attr(oid, name, tid, sid, &s[2]);
H5Tclose(tid);
H5Sclose(sid);
/* 4 single point */
sid = H5Screate_simple (1, dims1, NULL);
/* 4 single point */
sid = H5Screate_simple (1, dims1, NULL);
H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1);
sprintf(name, "%05d single float", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
sprintf(name, "%05d single double", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
sprintf(name, "%05d single obj_ref", idx);
nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
H5Sclose(sid);
/* 7 fixed length 1D array */
sid = H5Screate_simple (1, dims1, NULL);
tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
sprintf(name, "%05d array float", idx);
HDsprintf(name, "%05d single float", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
HDsprintf(name, "%05d single double", idx);
nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
HDsprintf(name, "%05d single obj_ref", idx);
nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
H5Sclose(sid);
/* 7 fixed length 1D array */
sid = H5Screate_simple (1, dims1, NULL);
tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
HDsprintf(name, "%05d array float", idx);
nattrs += add_attr(oid, name, tid, sid, &f_array[0]);
H5Tclose(tid);
tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, strlen(s[0])+1);
tid1 = H5Tarray_create (tid, 1, dims2);
sprintf(name, "%05d array str", idx);
nattrs += add_attr(oid, name, tid1, sid, s);
H5Tclose(tid1);
H5Tclose(tid);
H5Sclose(sid);
H5Tclose(tid);
tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, strlen(s[0])+1);
tid1 = H5Tarray_create (tid, 1, dims2);
HDsprintf(name, "%05d array str", idx);
nattrs += add_attr(oid, name, tid1, sid, s);
H5Tclose(tid1);
H5Tclose(tid);
H5Sclose(sid);
/* 9 fixed length 2D int arrays */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
sprintf(name, "%05d array int 2D", idx);
/* 9 fixed length 2D int arrays */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
HDsprintf(name, "%05d array int 2D", idx);
nattrs += add_attr(oid, name, tid, sid, int3d[0][0]);
H5Tclose(tid);
H5Sclose(sid);
/* 10 variable length arrays */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, H5T_VARIABLE);
sprintf(name, "%05d vlen strings", idx);
nattrs += add_attr(oid, name, tid, sid, s_vlen);
H5Tclose(tid);
tid = H5Tvlen_create (H5T_NATIVE_INT);;
sprintf(name, "%05d vlen int array", idx);
nattrs += add_attr(oid, name, tid, sid, i_vlen);
H5Tclose(tid);
H5Sclose(sid);
H5Tclose(tid);
H5Sclose(sid);
/* 12 compound data */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
tid1 = H5Tcopy (H5T_C_S1);
H5Tset_size (tid1, H5T_VARIABLE);
/* 10 variable length arrays */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, H5T_VARIABLE);
HDsprintf(name, "%05d vlen strings", idx);
nattrs += add_attr(oid, name, tid, sid, s_vlen);
H5Tclose(tid);
tid = H5Tvlen_create (H5T_NATIVE_INT);;
HDsprintf(name, "%05d vlen int array", idx);
nattrs += add_attr(oid, name, tid, sid, i_vlen);
H5Tclose(tid);
H5Sclose(sid);
/* 12 compound data */
sid = H5Screate_simple (1, dims2, NULL);
tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
tid1 = H5Tcopy (H5T_C_S1);
H5Tset_size (tid1, H5T_VARIABLE);
H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT);
H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *);
sprintf(name, "%05d compound data", idx);
HDsprintf(name, "%05d compound data", idx);
nattrs += add_attr(oid, name, tid, sid, cmp_data);
H5Tclose(tid1);
H5Tclose(tid);
H5Sclose(sid);
H5Tclose(tid1);
H5Tclose(tid);
H5Sclose(sid);
for (i0=0; i0<4; i0++)
free(i_vlen[i0].p);
return nattrs;
for (i0=0; i0<4; i0++)
free(i_vlen[i0].p);
return nattrs;
}

View File

@ -53,12 +53,12 @@ int main(void)
HDprintf("%-70s", "Testing alignment in compound datatypes");
HDstrcpy(string5, "Hi!");
strcpy(string5, "Hi!");
HDunlink(fname);
fil = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fil < 0) {
HDputs("*FAILED*");
puts("*FAILED*");
return 1;
}
@ -123,8 +123,8 @@ int main(void)
data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
HDperror("malloc() failed");
HDabort();
perror("malloc() failed");
abort();
}
set = H5Dopen2(fil, setname, H5P_DEFAULT);
@ -136,7 +136,7 @@ int main(void)
out:
if(error < 0) {
result = 1;
HDputs("*FAILED - HDF5 library error*");
puts("*FAILED - HDF5 library error*");
} else if(!(H5_FLT_ABS_EQUAL(fok[0], fptr[0]))
|| !(H5_FLT_ABS_EQUAL(fok[1], fptr[1]))
|| !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2]))
@ -183,9 +183,9 @@ out:
(double)fok[1], (double)fptr[1],
(double)fnok[0], (double)fptr[2],
(double)fnok[1], (double)fptr[3]);
HDputs("*FAILED - compound type alignmnent problem*");
puts("*FAILED - compound type alignmnent problem*");
} else {
HDputs(" PASSED");
puts(" PASSED");
}
if(data)
@ -200,7 +200,7 @@ out:
H5Pclose(plist);
H5Fclose(fil);
HDunlink(fname);
HDfflush(stdout);
fflush(stdout);
return result;
}