diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
commit | d9e5ca72f39934531b534524d07cf784c3d0e613 (patch) | |
tree | 1913b13a317132523091035f1175b2291c8b9db7 /testpar | |
parent | 053807fa81579e6bd9ac6a701ddcaac39e4d0b87 (diff) | |
download | hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.zip hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.gz hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.bz2 |
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_chunk_alloc.c | 44 | ||||
-rw-r--r-- | testpar/t_coll_chunk.c | 18 | ||||
-rw-r--r-- | testpar/t_dset.c | 480 | ||||
-rw-r--r-- | testpar/t_filter_read.c | 32 | ||||
-rw-r--r-- | testpar/t_mdset.c | 464 | ||||
-rw-r--r-- | testpar/t_pflush1.c | 34 | ||||
-rw-r--r-- | testpar/t_span_tree.c | 10 |
7 files changed, 517 insertions, 565 deletions
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index e496a58..5d02822 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -126,46 +126,34 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte VRFY((file_id >= 0), "H5Fcreate"); /* Modify dataset creation properties, i.e. enable chunking */ - cparms = H5Pcreate (H5P_DATASET_CREATE); + cparms = H5Pcreate(H5P_DATASET_CREATE); VRFY((cparms >= 0), ""); hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY); VRFY((hrc >= 0), ""); - hrc = H5Pset_chunk ( cparms, 1, chunk_dims); + hrc = H5Pset_chunk(cparms, 1, chunk_dims); VRFY((hrc >= 0), ""); /* Create a new dataset within the file using cparms creation properties. */ - dataset = H5Dcreate (file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, cparms); + dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); VRFY((dataset >= 0), ""); - switch (write_pattern) { - - /* writes only the second to last chunk */ - case sec_last: - - memset(buffer, 100, CHUNKSIZE); - - count[0] = 1; - stride[0] = 1; - block[0] = chunk_dims[0]; - offset[0] = (nchunks-2)*chunk_dims[0]; - - hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); - VRFY((hrc >= 0), ""); + if(write_pattern == sec_last) { + HDmemset(buffer, 100, CHUNKSIZE); - /* Write sec_last chunk */ - hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); - VRFY((hrc >= 0), "H5Dwrite"); + count[0] = 1; + stride[0] = 1; + block[0] = chunk_dims[0]; + offset[0] = (nchunks-2)*chunk_dims[0]; - break; - - - /* doesn't write anything */ - case none: + hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); + VRFY((hrc >= 0), ""); - break; - } + /* Write sec_last chunk */ + hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); + VRFY((hrc >= 0), "H5Dwrite"); + } /* end if */ /* Close resources */ hrc = H5Dclose (dataset); @@ -187,7 +175,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char); + est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); } diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 46dfff1..7886066 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -598,14 +598,14 @@ coll_chunktest(const char* filename, /* allocate memory for data buffer */ - data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); file_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((file_dataspace >= 0),"file dataspace created succeeded"); + VRFY((file_dataspace >= 0), "file dataspace created succeeded"); crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); @@ -619,29 +619,29 @@ coll_chunktest(const char* filename, status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); - dataset = H5Dcreate(file,DSET_COLLECTIVE_CHUNK_NAME,H5T_NATIVE_INT, - file_dataspace,crp_plist); + dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); VRFY((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); - VRFY((status >= 0),""); + VRFY((status >= 0), ""); /*put some trivial data in the data array */ - ccdataset_fill(start, stride,count,block, data_array1); + ccdataset_fill(start, stride, count,block, data_array1); MESG("data_array initialized"); - status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((status >= 0),"hyperslab selection succeeded"); /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY((xfer_plist >= 0), ""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO); VRFY((status>= 0),"set independent IO collectively succeeded"); } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 2d02cdb..c8dd00e 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -58,7 +58,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], count[1] = 1; start[0] = mpi_rank*block[0]; start[1] = 0; -if (VERBOSE_MED) printf("slab_set BYROW\n"); +if(VERBOSE_MED) printf("slab_set BYROW\n"); break; case BYCOL: /* Each process takes a block of columns. */ @@ -70,7 +70,7 @@ if (VERBOSE_MED) printf("slab_set BYROW\n"); count[1] = 1; start[0] = 0; start[1] = mpi_rank*block[1]; -if (VERBOSE_MED) printf("slab_set BYCOL\n"); +if(VERBOSE_MED) printf("slab_set BYCOL\n"); break; case ZROW: /* Similar to BYROW except process 0 gets 0 row */ @@ -82,7 +82,7 @@ if (VERBOSE_MED) printf("slab_set BYCOL\n"); count[1] = 1; start[0] = (mpi_rank? mpi_rank*block[0] : 0); start[1] = 0; -if (VERBOSE_MED) printf("slab_set ZROW\n"); +if(VERBOSE_MED) printf("slab_set ZROW\n"); break; case ZCOL: /* Similar to BYCOL except process 0 gets 0 column */ @@ -94,7 +94,7 @@ if (VERBOSE_MED) printf("slab_set ZROW\n"); count[1] = 1; start[0] = 0; start[1] = (mpi_rank? mpi_rank*block[1] : 0); -if (VERBOSE_MED) printf("slab_set ZCOL\n"); +if(VERBOSE_MED) printf("slab_set ZCOL\n"); break; default: /* Unknown mode. Set it to cover the whole dataset. */ @@ -107,10 +107,10 @@ if (VERBOSE_MED) printf("slab_set ZCOL\n"); count[1] = 1; start[0] = 0; start[1] = 0; -if (VERBOSE_MED) printf("slab_set wholeset\n"); +if(VERBOSE_MED) printf("slab_set wholeset\n"); break; } -if (VERBOSE_MED){ +if(VERBOSE_MED){ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n", (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], @@ -176,7 +176,7 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] int vrfyerrs; /* print it if VERBOSE_MED */ - if (VERBOSE_MED) { + if(VERBOSE_MED) { printf("dataset_vrfy dumping:::\n"); printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], @@ -190,8 +190,8 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] vrfyerrs = 0; for (i=0; i < block[0]; i++){ for (j=0; j < block[1]; j++){ - if (*dataset != *original){ - if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + if(*dataset != *original){ + if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), @@ -202,9 +202,9 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] } } } - if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) + if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); - if (vrfyerrs) + if(vrfyerrs) printf("%d errors found in dataset_vrfy\n", vrfyerrs); return(vrfyerrs); } @@ -247,7 +247,7 @@ dataset_writeInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -266,11 +266,11 @@ dataset_writeInd(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -286,14 +286,14 @@ dataset_writeInd(void) /* create a dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, - H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, - H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* @@ -312,7 +312,7 @@ dataset_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -329,18 +329,18 @@ dataset_writeInd(void) VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); /* setup dimensions again to write with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeInd by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeInd by some with zero row"); -if ((mpi_rank/2)*2 != mpi_rank){ +if((mpi_rank/2)*2 != mpi_rank){ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1); VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded"); @@ -353,9 +353,9 @@ MPI_Barrier(MPI_COMM_WORLD); H5Sclose(file_dataspace); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* release all IDs created */ @@ -365,7 +365,7 @@ MPI_Barrier(MPI_COMM_WORLD); H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -393,7 +393,7 @@ dataset_readInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -415,7 +415,7 @@ dataset_readInd(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -433,7 +433,7 @@ dataset_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -450,7 +450,7 @@ dataset_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* read data independently */ ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -459,12 +459,12 @@ dataset_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); /* release all IDs created */ @@ -474,8 +474,8 @@ dataset_readInd(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); } @@ -519,7 +519,7 @@ dataset_writeAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective write test on file %s\n", filename); /* set up MPI parameters */ @@ -538,11 +538,11 @@ dataset_writeAll(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -558,20 +558,20 @@ dataset_writeAll(void) /* create a dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another dataset collectively */ datatype = H5Tcopy(H5T_NATIVE_INT); ret = H5Tset_order(datatype, H5T_ORDER_LE); VRFY((ret >= 0), "H5Tset_order succeeded"); - dataset2 = H5Dcreate(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dcreate 2 succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 2 succeeded"); /* create a third dataset collectively */ - dataset3 = H5Dcreate(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset3 >= 0), "H5Dcreate succeeded"); + dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset3 >= 0), "H5Dcreate2 succeeded"); /* release 2-D space ID created */ H5Sclose(sid); @@ -581,8 +581,8 @@ dataset_writeAll(void) VRFY((sid >= 0), "H5Screate succeeded"); /* create a fourth dataset collectively */ - dataset4 = H5Dcreate(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT); - VRFY((dataset4 >= 0), "H5Dcreate succeeded"); + dataset4 = H5Dcreate2(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset4 >= 0), "H5Dcreate2 succeeded"); /* release scalar space ID created */ H5Sclose(sid); @@ -597,7 +597,7 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -607,7 +607,7 @@ dataset_writeAll(void) /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -615,7 +615,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -630,14 +630,14 @@ dataset_writeAll(void) VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); /* setup dimensions again to writeAll with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeAll by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeAll by some with zero row"); @@ -658,7 +658,7 @@ dataset_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -666,7 +666,7 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -676,7 +676,7 @@ dataset_writeAll(void) /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -684,7 +684,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -698,14 +698,14 @@ dataset_writeAll(void) VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); /* setup dimensions again to writeAll with zero columns for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("writeAll by some with zero col\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("writeAll by some with zero col"); @@ -727,27 +727,27 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset3); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if (MAINPROCESS) { - ret=H5Sselect_none(file_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded"); } /* end else */ /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); VRFY((mem_dataspace >= 0), ""); - if (MAINPROCESS) { - ret=H5Sselect_none(mem_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded"); } /* end if */ /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } /* end if */ @@ -755,7 +755,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -788,31 +788,31 @@ dataset_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset4); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if (MAINPROCESS) { - ret=H5Sselect_none(file_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_all(file_dataspace); + ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } /* end else */ /* create a memory dataspace independently */ mem_dataspace = H5Screate(H5S_SCALAR); VRFY((mem_dataspace >= 0), ""); - if (MAINPROCESS) { - ret=H5Sselect_none(mem_dataspace); + if(MAINPROCESS) { + ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded"); } /* end if */ else { - ret=H5Sselect_all(mem_dataspace); + ret = H5Sselect_all(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } /* end else */ /* fill the local slab with some trivial data */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } /* end if */ @@ -820,7 +820,7 @@ dataset_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -849,20 +849,20 @@ dataset_writeAll(void) /* * All writes completed. Close datasets collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); - ret=H5Dclose(dataset3); + ret = H5Dclose(dataset3); VRFY((ret >= 0), "H5Dclose3 succeeded"); - ret=H5Dclose(dataset4); + ret = H5Dclose(dataset4); VRFY((ret >= 0), "H5Dclose3 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* @@ -899,7 +899,7 @@ dataset_readAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective read test on file %s\n", filename); /* set up MPI parameters */ @@ -924,7 +924,7 @@ dataset_readAll(void) VRFY((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -949,7 +949,7 @@ dataset_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -959,7 +959,7 @@ dataset_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_origin1); } @@ -967,7 +967,7 @@ dataset_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -982,17 +982,17 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* setup dimensions again to readAll with zero columns for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("readAll by some with zero col\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("readAll by some with zero col"); @@ -1002,7 +1002,7 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* release all temporary handles. */ /* Could have used them for dataset2 but it is cleaner */ @@ -1017,7 +1017,7 @@ dataset_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ @@ -1027,7 +1027,7 @@ dataset_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_origin1); } @@ -1035,7 +1035,7 @@ dataset_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), ""); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1050,17 +1050,17 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* setup dimensions again to readAll with zero rows for process 0 */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("readAll by some with zero row\n"); slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* need to make mem_dataspace to match for process 0 */ - if (MAINPROCESS){ - ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + if(MAINPROCESS){ + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); } MESG("readAll by some with zero row"); @@ -1070,7 +1070,7 @@ dataset_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); - if (ret) nerrors++; + if(ret) nerrors++; /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -1081,17 +1081,17 @@ dataset_readAll(void) /* * All reads completed. Close datasets collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); } @@ -1137,7 +1137,7 @@ extend_writeInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -1169,19 +1169,19 @@ extend_writeInd(void) size_t rdcc_nbytes; double rdcc_w0; - ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); + ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); VRFY((ret >= 0), "H5Pget_cache succeeded"); mdc_nelmts=4; - ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); + ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); VRFY((ret >= 0), "H5Pset_cache succeeded"); } /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -1190,7 +1190,7 @@ extend_writeInd(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -1204,12 +1204,12 @@ extend_writeInd(void) VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -1226,7 +1226,7 @@ extend_writeInd(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1244,7 +1244,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1266,7 +1266,7 @@ extend_writeInd(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1283,7 +1283,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently. Should fail. */ @@ -1304,7 +1304,7 @@ extend_writeInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1313,23 +1313,23 @@ extend_writeInd(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* @@ -1361,7 +1361,7 @@ extend_writeInd2(void) herr_t ret; /* Generic return value */ filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test #2 on file %s\n", filename); /* set up MPI parameters */ @@ -1376,11 +1376,11 @@ extend_writeInd2(void) VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -1399,11 +1399,11 @@ extend_writeInd2(void) VRFY((fs >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, fs, dcpl); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, fs, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreat2e succeeded"); /* release resource */ - ret=H5Pclose(dcpl); + ret = H5Pclose(dcpl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -1415,12 +1415,12 @@ extend_writeInd2(void) VRFY((ms >= 0), "H5Screate_simple succeeded"); /* put some trivial data in the data_array */ - for (i=0; i<(int)orig_size; i++) + for(i = 0; i < (int)orig_size; i++) written[i] = i; MESG("data array initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("writing at offset zero: "); - for (i=0; i<(int)orig_size; i++) + for(i = 0; i < (int)orig_size; i++) printf("%s%d", i?", ":"", written[i]); printf("\n"); } @@ -1438,7 +1438,7 @@ extend_writeInd2(void) i,written[i], i,retrieved[i]); nerrors++; } - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("read at offset zero: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", retrieved[i]); @@ -1461,7 +1461,7 @@ extend_writeInd2(void) for (i=0; i<(int)orig_size; i++) written[i] = orig_size + i; MESG("data array re-initialized"); - if (VERBOSE_MED) { + if(VERBOSE_MED) { MESG("writing at offset 10: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", written[i]); @@ -1483,7 +1483,7 @@ extend_writeInd2(void) i,written[i], i,retrieved[i]); nerrors++; } - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("read at offset 10: "); for (i=0; i<(int)orig_size; i++) printf("%s%d", i?", ":"", retrieved[i]); @@ -1492,7 +1492,7 @@ extend_writeInd2(void) /* Close dataset collectively */ - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); /* Close the file collectively */ @@ -1527,7 +1527,7 @@ extend_readInd(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -1554,7 +1554,7 @@ extend_readInd(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -1590,7 +1590,7 @@ extend_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -1599,7 +1599,7 @@ extend_readInd(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1612,7 +1612,7 @@ extend_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset1 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); @@ -1625,7 +1625,7 @@ extend_readInd(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -1634,7 +1634,7 @@ extend_readInd(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1647,15 +1647,15 @@ extend_readInd(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset2 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); @@ -1663,9 +1663,9 @@ extend_readInd(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_array2) free(data_array2); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_array2) free(data_array2); + if(data_origin1) free(data_origin1); } /* @@ -1711,7 +1711,7 @@ extend_writeAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -1743,19 +1743,19 @@ extend_writeAll(void) size_t rdcc_nbytes; double rdcc_w0; - ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); + ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); VRFY((ret >= 0), "H5Pget_cache succeeded"); mdc_nelmts=4; - ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); + ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); VRFY((ret >= 0), "H5Pset_cache succeeded"); } /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); @@ -1764,7 +1764,7 @@ extend_writeAll(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -1778,12 +1778,12 @@ extend_writeAll(void) VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -1800,7 +1800,7 @@ extend_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED) { MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1818,13 +1818,13 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1852,7 +1852,7 @@ extend_writeAll(void) /* put some trivial data in the data_array */ dataset_fill(start, block, data_array1); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -1864,7 +1864,7 @@ extend_writeAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -1880,7 +1880,7 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently. Should fail. */ @@ -1901,7 +1901,7 @@ extend_writeAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* write data independently */ @@ -1910,25 +1910,25 @@ extend_writeAll(void) VRFY((ret >= 0), "H5Dwrite succeeded"); /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); + if(data_array1) free(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -1959,7 +1959,7 @@ extend_readAll(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent read test on file %s\n", filename); /* set up MPI parameters */ @@ -1986,7 +1986,7 @@ extend_readAll(void) VRFY((fid >= 0), ""); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* open the dataset1 collectively */ @@ -2022,7 +2022,7 @@ extend_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -2031,7 +2031,7 @@ extend_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -2039,7 +2039,7 @@ extend_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2055,7 +2055,7 @@ extend_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset1 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); @@ -2069,7 +2069,7 @@ extend_readAll(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset2); VRFY((file_dataspace >= 0), ""); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), ""); /* create a memory dataspace independently */ @@ -2078,7 +2078,7 @@ extend_readAll(void) /* fill dataset with test data */ dataset_fill(start, block, data_origin1); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(start, block, data_array1); } @@ -2086,7 +2086,7 @@ extend_readAll(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2102,16 +2102,16 @@ extend_readAll(void) /* verify the read data with original expected data */ ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); VRFY((ret == 0), "dataset2 read verified correct"); - if (ret) nerrors++; + if(ret) nerrors++; H5Sclose(mem_dataspace); H5Sclose(file_dataspace); H5Pclose(xfer_plist); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), ""); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), ""); @@ -2119,9 +2119,9 @@ extend_readAll(void) H5Fclose(fid); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_array2) free(data_array2); - if (data_origin1) free(data_origin1); + if(data_array1) free(data_array1); + if(data_array2) free(data_array2); + if(data_origin1) free(data_origin1); } /* @@ -2152,7 +2152,7 @@ compress_readAll(void) herr_t ret; /* Generic return value */ filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Collective chunked dataset read test on file %s\n", filename); /* Retrieve MPI parameters */ @@ -2181,15 +2181,15 @@ compress_readAll(void) dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl > 0), "H5Pcreate succeeded"); - ret=H5Pset_layout(dcpl, H5D_CHUNKED); + ret = H5Pset_layout(dcpl, H5D_CHUNKED); VRFY((ret >= 0), "H5Pset_layout succeeded"); /* Use eight chunks */ - chunk_dim=dim/8; - ret=H5Pset_chunk(dcpl, rank, &chunk_dim); + chunk_dim = dim / 8; + ret = H5Pset_chunk(dcpl, rank, &chunk_dim); VRFY((ret >= 0), "H5Pset_chunk succeeded"); - ret=H5Pset_deflate(dcpl, 9); + ret = H5Pset_deflate(dcpl, 9); VRFY((ret >= 0), "H5Pset_deflate succeeded"); /* Create dataspace */ @@ -2197,21 +2197,21 @@ compress_readAll(void) VRFY((dataspace > 0), "H5Screate_simple succeeded"); /* Create dataset */ - dataset = H5Dcreate(fid, "compressed_data", H5T_NATIVE_INT, dataspace, dcpl); - VRFY((dataset > 0), "H5Screate_simple succeeded"); + dataset = H5Dcreate2(fid, "compressed_data", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset > 0), "H5Dcreate2 succeeded"); /* Write compressed data */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Close objects */ - ret=H5Pclose(dcpl); + re = =H5Pclose(dcpl); VRFY((ret >= 0), "H5Pclose succeeded"); - ret=H5Sclose(dataspace); + ret = H5Sclose(dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Fclose(fid); + ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); } @@ -2231,7 +2231,7 @@ compress_readAll(void) VRFY((fid > 0), "H5Fopen succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -2245,7 +2245,7 @@ compress_readAll(void) xfer_plist = H5Pcreate(H5P_DATASET_XFER); VRFY((xfer_plist > 0), "H5Pcreate succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); @@ -2254,7 +2254,7 @@ compress_readAll(void) /* Try reading the data */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* Verify data read */ @@ -2267,22 +2267,22 @@ compress_readAll(void) /* Writing to the compressed, chunked dataset in parallel should fail */ H5E_BEGIN_TRY { - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read); } H5E_END_TRY; VRFY((ret < 0), "H5Dwrite failed"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); - ret=H5Dclose(dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); } /* end if */ - ret=H5Fclose(fid); + ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); /* release data buffers */ - if (data_read) HDfree(data_read); - if (data_orig) HDfree(data_orig); + if(data_read) HDfree(data_read); + if(data_orig) HDfree(data_orig); } #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -2329,7 +2329,7 @@ none_selection_chunk(void) MPI_Info info = MPI_INFO_NULL; filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Extend independent write test on file %s\n", filename); /* set up MPI parameters */ @@ -2348,11 +2348,11 @@ none_selection_chunk(void) VRFY((acc_tpl >= 0), ""); /* create the file collectively */ - fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret=H5Pclose(acc_tpl); + ret = H5Pclose(acc_tpl); VRFY((ret >= 0), ""); /* -------------------------------------------------------------- @@ -2360,7 +2360,7 @@ none_selection_chunk(void) * ------------------------------------------------------------- */ /* set up dataset storage chunk sizes and creation property list */ - if (VERBOSE_MED) + if(VERBOSE_MED) printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]); dataset_pl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dataset_pl >= 0), "H5Pcreate succeeded"); @@ -2370,16 +2370,16 @@ none_selection_chunk(void) /* setup dimensionality object */ dims[0] = dim0; dims[1] = dim1; - sid = H5Screate_simple (RANK, dims, NULL); + sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); /* create an extendible dataset collectively */ - dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset1 >= 0), "H5Dcreate succeeded"); + dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); /* create another extendible dataset collectively */ - dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl); - VRFY((dataset2 >= 0), "H5Dcreate succeeded"); + dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT); + VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); /* release resource */ H5Sclose(sid); @@ -2393,7 +2393,7 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ - if (mpi_rank) { + if(mpi_rank) { data_origin = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE)); VRFY((data_origin != NULL), "data_origin malloc succeeded"); @@ -2404,7 +2404,7 @@ none_selection_chunk(void) mstart[0] = mstart[1] = 0; dataset_fill(mstart, block, data_origin); MESG("data_array initialized"); - if (VERBOSE_MED){ + if(VERBOSE_MED){ MESG("data_array created"); dataset_print(mstart, block, data_origin); } @@ -2415,7 +2415,7 @@ none_selection_chunk(void) VRFY((mem_dataspace >= 0), ""); /* Process 0 has no selection */ - if (!mpi_rank) { + if(!mpi_rank) { ret = H5Sselect_none(mem_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } @@ -2423,11 +2423,11 @@ none_selection_chunk(void) /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset1); VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); /* Process 0 has no selection */ - if (!mpi_rank) { + if(!mpi_rank) { ret = H5Sselect_none(file_dataspace); VRFY((ret >= 0), "H5Sselect_none succeeded"); } @@ -2435,7 +2435,7 @@ none_selection_chunk(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write data collectively */ @@ -2449,15 +2449,15 @@ none_selection_chunk(void) VRFY((ret >= 0), ""); /* verify the read data with original expected data */ - if (mpi_rank) { + if(mpi_rank) { ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin); - if (ret) nerrors++; + if(ret) nerrors++; } /* ------------------------- * Test independent writing to dataset2 * -------------------------*/ - ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); /* write data collectively */ @@ -2471,30 +2471,30 @@ none_selection_chunk(void) VRFY((ret >= 0), ""); /* verify the read data with original expected data */ - if (mpi_rank) { + if(mpi_rank) { ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin); - if (ret) nerrors++; + if(ret) nerrors++; } /* release resource */ - ret=H5Sclose(file_dataspace); + ret = H5Sclose(file_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Sclose(mem_dataspace); + ret = H5Sclose(mem_dataspace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Pclose(xfer_plist); + ret = H5Pclose(xfer_plist); VRFY((ret >= 0), "H5Pclose succeeded"); /* close dataset collectively */ - ret=H5Dclose(dataset1); + ret = H5Dclose(dataset1); VRFY((ret >= 0), "H5Dclose1 succeeded"); - ret=H5Dclose(dataset2); + ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ - if (data_origin) free(data_origin); - if (data_array) free(data_array); + if(data_origin) free(data_origin); + if(data_array) free(data_array); } diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index e255c73..e2d39c3 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -86,35 +86,33 @@ filter_read_internal(const char *filename, hid_t dcpl, VRFY(sid>=0, "H5Screate_simple"); /* Create buffers */ - points = (int *)HDmalloc(size[0]*size[1]*sizeof(int)); + points = (int *)HDmalloc(size[0] * size[1] * sizeof(int)); VRFY(points!=NULL, "HDmalloc"); - check = (int *)HDmalloc(hs_size[0]*hs_size[1]*sizeof(int)); + check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int)); VRFY(check!=NULL, "HDmalloc"); /* Initialize writing buffer with random data */ - for (i=0; i<size[0]; i++) { - for (j=0; j<size[1]; j++) { - points[i*size[1]+j] = (int)(i+j+7); - } - } + for(i = 0; i < size[0]; i++) + for(j = 0; j < size[1]; j++) + points[i * size[1]+j] = (int)(i+j+7); VRFY(H5Pall_filters_avail(dcpl), "Incorrect filter availability"); /* Serial write phase */ - if (MAINPROCESS){ + if(MAINPROCESS) { file = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VRFY(file>=0, "H5Fcreate"); /* Create the dataset */ - dataset = H5Dcreate(file, name, H5T_NATIVE_INT, sid, dcpl); - VRFY(dataset>=0, "H5Dcreate"); + dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY(dataset>=0, "H5Dcreate2"); hrc = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points); VRFY(hrc>=0, "H5Dwrite"); - *dset_size=H5Dget_storage_size(dataset); + *dset_size = H5Dget_storage_size(dataset); VRFY(*dset_size>0, "H5Dget_storage_size"); hrc = H5Dclose (dataset); @@ -153,7 +151,7 @@ filter_read_internal(const char *filename, hid_t dcpl, /* Check that the values read are the same as the values written */ for (i=0; i<hs_size[0]; i++) { for (j=0; j<hs_size[1]; j++) { - if (points[i*size[1]+(size_t)hs_offset[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", @@ -235,13 +233,13 @@ test_filter_read(void) hsize_t shuffle_size; /* Size of dataset with shuffle filter */ #endif /* H5_HAVE_FILTER_SHUFFLE */ -#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */ #endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ filename = GetTestParameters(); - if (VERBOSE_MED) + if(VERBOSE_MED) printf("Parallel reading of dataset written with filters %s\n", filename); /*---------------------------------------------------------- @@ -312,7 +310,7 @@ test_filter_read(void) *---------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP - if ( h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0, "H5Pcreate"); @@ -424,7 +422,7 @@ test_filter_read(void) VRFY(hrc>=0, "H5Pset_shuffle"); /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block); VRFY(hrc>=0, "H5Pset_szip"); @@ -437,7 +435,7 @@ test_filter_read(void) /* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */ /* Make sure encoding is enabled */ - if ( h5_szip_can_encode() == 1) { + if(h5_szip_can_encode() == 1) { dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0, "H5Pcreate"); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 2fb2aef..b2ae824 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -50,12 +50,12 @@ int get_size(void) int mpi_size; int size = SIZE; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */ - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - if ( mpi_size > size ) { + if(mpi_size > size ) { - if ( (mpi_size % 2) == 0 ) { + if((mpi_size % 2) == 0 ) { size = mpi_size; @@ -105,59 +105,59 @@ void multiple_dset_write(void) size = get_size(); - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); VRFY((plist>=0), "create_faccess_plist succeeded"); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); VRFY((iof>=0), "H5Fcreate succeeded"); - ret = H5Pclose (plist); + ret = H5Pclose(plist); VRFY((ret>=0), "H5Pclose succeeded"); /* decide the hyperslab according to process number. */ get_slab(chunk_origin, chunk_dims, count, file_dims, size); - memspace = H5Screate_simple (DIM, chunk_dims, NULL); - filespace = H5Screate_simple (DIM, file_dims, NULL); - ret = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); + memspace = H5Screate_simple(DIM, chunk_dims, NULL); + filespace = H5Screate_simple(DIM, file_dims, NULL); + ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); VRFY((ret>=0), "mdata hyperslab selection"); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl>=0), "dataset creation property list succeeded"); - ret=H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill); VRFY((ret>=0), "set fill-value succeeded"); - for (n = 0; n < ndatasets; n++) { - sprintf (dname, "dataset %d", n); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); + for(n = 0; n < ndatasets; n++) { + sprintf(dname, "dataset %d", n); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); VRFY((dataset > 0), dname); /* calculate data to write */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) outme [(i * size) + j] = n*1000 + mpi_rank; - H5Dwrite (dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme); + H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme); - H5Dclose (dataset); + H5Dclose(dataset); #ifdef BARRIER_CHECKS - if (! ((n+1) % 10)) { + if(!((n+1) % 10)) { printf("created %d datasets\n", n+1); MPI_Barrier(MPI_COMM_WORLD); } #endif /* BARRIER_CHECKS */ } - H5Sclose (filespace); - H5Sclose (memspace); - H5Pclose (dcpl); - H5Fclose (iof); + H5Sclose(filespace); + H5Sclose(memspace); + H5Pclose(dcpl); + H5Fclose(iof); HDfree(outme); } @@ -185,13 +185,11 @@ void compact_dataset(void) size = get_size(); - for ( i = 0; i < DIM; i++ ) - { + for(i = 0; i < DIM; i++ ) file_dims[i] = size; - } - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); @@ -203,46 +201,46 @@ void compact_dataset(void) VRFY((mpi_size <= size), "mpi_size <= size"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ - filespace = H5Screate_simple (DIM, file_dims, NULL); + filespace = H5Screate_simple(DIM, file_dims, NULL); /* Create a compact dataset */ dcpl = H5Pcreate(H5P_DATASET_CREATE); VRFY((dcpl>=0), "dataset creation property list succeeded"); - ret=H5Pset_layout(dcpl, H5D_COMPACT); + ret = H5Pset_layout(dcpl, H5D_COMPACT); VRFY((dcpl >= 0), "set property list for compact dataset"); - ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); VRFY((ret >= 0), "set space allocation time for compact dataset"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); + ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO); VRFY((ret>= 0),"set independent IO collectively succeeded"); } /* Recalculate data to write. Each process writes the same data. */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) - outme[(i * size) + j] = (i+j)*1000; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] =(i + j) * 1000; - ret=H5Dwrite (dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme); + ret = H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme); VRFY((ret >= 0), "H5Dwrite succeeded"); - H5Pclose (dcpl); - H5Pclose (plist); - H5Dclose (dataset); - H5Sclose (filespace); - H5Fclose (iof); + H5Pclose(dcpl); + H5Pclose(plist); + H5Dclose(dataset); + H5Sclose(filespace); + H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); @@ -250,9 +248,9 @@ void compact_dataset(void) VRFY((iof >= 0), "H5Fopen succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -267,9 +265,9 @@ void compact_dataset(void) VRFY((ret >= 0), "H5Dread succeeded"); /* Verify data value */ - for (i = 0; i < size; i++) - for (j = 0; j < size; j++) - if ( inme[(i * size) + j] != outme[(i * size) + j]) + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + if(inme[(i * size) + j] != outme[(i * size) + j]) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]); @@ -306,54 +304,54 @@ void null_dataset(void) herr_t ret; const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); filename = GetTestParameters(); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* Define data space */ sid = H5Screate(H5S_NULL); /* Check that the null dataspace actually has 0 elements */ nelem = H5Sget_simple_extent_npoints(sid); - VRFY((nelem== 0), "H5Sget_simple_extent_npoints"); + VRFY((nelem == 0), "H5Sget_simple_extent_npoints"); /* Create a compact dataset */ - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); + ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO); VRFY((ret>= 0),"set independent IO collectively succeeded"); } - /* Write "nothing" to the dataset (with type conversion) */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval); + /* Write "nothing" to the dataset(with type conversion) */ + ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Create an attribute for the group */ attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((attr >= 0), "H5Acreate2"); - /* Write "nothing" to the attribute (with type conversion) */ + /* Write "nothing" to the attribute(with type conversion) */ ret = H5Awrite(attr, H5T_NATIVE_INT, &val); VRFY((ret >= 0), "H5Awrite"); - H5Aclose (attr); - H5Dclose (dataset); - H5Pclose (plist); - H5Sclose (sid); - H5Fclose (iof); + H5Aclose(attr); + H5Dclose(dataset); + H5Pclose(plist); + H5Sclose(sid); + H5Fclose(iof); /* Open the file and dataset, read and compare the data. */ plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); @@ -361,9 +359,9 @@ void null_dataset(void) VRFY((iof >= 0), "H5Fopen succeeded"); /* set up the collective transfer properties list */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -374,7 +372,7 @@ void null_dataset(void) dataset = H5Dopen2(iof, dname, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); - /* Try reading from the dataset (make certain our buffer is unmodified) */ + /* Try reading from the dataset(make certain our buffer is unmodified) */ ret = H5Dread(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, dxpl, &uval); VRFY((ret>=0), "H5Dread"); VRFY((uval==2), "H5Dread"); @@ -383,20 +381,20 @@ void null_dataset(void) attr = H5Aopen(dataset, ".", attr_name, H5P_DEFAULT, H5P_DEFAULT); VRFY((attr >= 0), "H5Aopen"); - /* Try reading from the attribute (make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val); + /* Try reading from the attribute(make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val); VRFY((ret>=0), "H5Aread"); VRFY((val==1), "H5Aread"); H5Pclose(plist); H5Pclose(dxpl); - H5Aclose (attr); + H5Aclose(attr); H5Dclose(dataset); H5Fclose(iof); } -/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB) +/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB) * Actual data is _not_ written to these datasets. Dataspaces are exact - * sizes (2GB, 4GB, etc.), but the metadata for the file pushes the file over + * sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over * the boundary of interest. * * Changes: Removed the assert that mpi_size <= the SIZE #define. @@ -421,11 +419,11 @@ void big_dataset(void) herr_t ret; /* Generic return value */ const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); /* Verify MPI_Offset can handle larger than 2GB sizes */ - VRFY((sizeof(MPI_Offset)>4), "sizeof(MPI_Offset)>4"); + VRFY((sizeof(MPI_Offset) > 4), "sizeof(MPI_Offset)>4"); filename = GetTestParameters(); @@ -435,7 +433,7 @@ void big_dataset(void) /* * Create >2GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 2GB dataspace */ @@ -443,30 +441,30 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 2147485696ULL), "File is correct size (~2GB)"); + VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)"); #endif /* * Create >4GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 4GB dataspace */ @@ -474,30 +472,30 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 4294969344ULL), "File is correct size (~4GB)"); + VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)"); #endif /* * Create >8GB HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 8GB dataspace */ @@ -505,28 +503,28 @@ void big_dataset(void) file_dims[1]= 1024; file_dims[2]= 1024; file_dims[3]= 1024; - filespace = H5Screate_simple (4, file_dims, NULL); + filespace = H5Screate_simple(4, file_dims, NULL); VRFY((filespace >= 0), "H5Screate_simple succeeded"); - dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_get_file_size(filename); #ifndef _WIN32 - VRFY((file_size == 8589936640ULL), "File is correct size (~8GB)"); + VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)"); #endif /* Close fapl */ - ret=H5Pclose (fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); } @@ -566,8 +564,8 @@ void dataset_fillvalue(void) herr_t ret; /* Generic return value */ const char *filename; - MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); - MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); filename = GetTestParameters(); @@ -588,14 +586,14 @@ void dataset_fillvalue(void) /* * Create HDF5 file */ - iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); VRFY((iof >= 0), "H5Fcreate succeeded"); filespace = H5Screate_simple(4, dset_dims, NULL); VRFY((filespace >= 0), "File H5Screate_simple succeeded"); - dataset = H5Dcreate(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + dataset = H5Dcreate2(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2 succeeded"); memspace = H5Screate_simple(4, dset_dims, NULL); VRFY((memspace >= 0), "Memory H5Screate_simple succeeded"); @@ -606,19 +604,19 @@ void dataset_fillvalue(void) /* set entire read buffer with the constant 2 */ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int))); /* Independently read the entire dataset back */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); VRFY((ret >= 0), "H5Dread succeeded"); /* Verify all data read are the fill value 0 */ - trdata=rdata; - err_num=0; - for (i=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) - if( *trdata != 0) + trdata = rdata; + err_num = 0; + for(i = 0; i < (int)dset_dims[0]; i++) + for(j = 0; j < (int)dset_dims[1]; j++) + for(k = 0; k < (int)dset_dims[2]; k++) + for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++) + if(*trdata != 0) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata); + printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata); if(err_num > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); if(err_num){ @@ -634,16 +632,16 @@ void dataset_fillvalue(void) */ /* Create hyperslabs in memory and file dataspaces */ req_start[0]=mpi_rank; - ret=H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); + ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); - ret=H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); + ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); /* Create DXPL for collective I/O */ - dxpl = H5Pcreate (H5P_DATASET_XFER); + dxpl = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl >= 0), "H5Pcreate succeeded"); - ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO); @@ -653,14 +651,14 @@ void dataset_fillvalue(void) /* Fill write buffer with some values */ twdata=wdata; - for (i=0, acc=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++) + for(i=0, acc=0; i<(int)dset_dims[0]; i++) + for(j=0; j<(int)dset_dims[1]; j++) + for(k=0; k<(int)dset_dims[2]; k++) + for(l=0; l<(int)dset_dims[3]; l++) *twdata++ = acc++; /* Collectively write a hyperslab of data to the dataset */ - ret=H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata); VRFY((ret >= 0), "H5Dwrite succeeded"); /* Barrier here, to allow MPI-posix I/O to sync */ @@ -672,24 +670,24 @@ void dataset_fillvalue(void) /* set entire read buffer with the constant 2 */ HDmemset(rdata,2,(size_t)(dset_size*sizeof(int))); /* Independently read the entire dataset back */ - ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); + ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata); VRFY((ret >= 0), "H5Dread succeeded"); /* Verify correct data read */ twdata=wdata; trdata=rdata; err_num=0; - for (i=0; i<(int)dset_dims[0]; i++) - for (j=0; j<(int)dset_dims[1]; j++) - for (k=0; k<(int)dset_dims[2]; k++) - for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) + for(i=0; i<(int)dset_dims[0]; i++) + for(j=0; j<(int)dset_dims[1]; j++) + for(k=0; k<(int)dset_dims[2]; k++) + for(l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++) if(i<mpi_size) { - if( *twdata != *trdata ) + if(*twdata != *trdata ) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) printf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata); } /* end if */ else { - if( *trdata != 0) + if(*trdata != 0) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata); } /* end else */ @@ -701,23 +699,23 @@ void dataset_fillvalue(void) } /* Close all file objects */ - ret=H5Dclose (dataset); + ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded"); - ret=H5Sclose (filespace); + ret = H5Sclose(filespace); VRFY((ret >= 0), "H5Sclose succeeded"); - ret=H5Fclose (iof); + ret = H5Fclose(iof); VRFY((ret >= 0), "H5Fclose succeeded"); /* Close memory dataspace */ - ret=H5Sclose (memspace); + ret = H5Sclose(memspace); VRFY((ret >= 0), "H5Sclose succeeded"); /* Close dxpl */ - ret=H5Pclose (dxpl); + ret = H5Pclose(dxpl); VRFY((ret >= 0), "H5Pclose succeeded"); /* Close fapl */ - ret=H5Pclose (fapl); + ret = H5Pclose(fapl); VRFY((ret >= 0), "H5Pclose succeeded"); /* free the buffers */ @@ -759,8 +757,8 @@ void collective_group_write(void) size = get_size(); - chunk_size[0] = (hsize_t)(size / 2); - chunk_size[1] = (hsize_t)(size / 2); + chunk_size[0] =(hsize_t)(size / 2); + chunk_size[1] =(hsize_t)(size / 2); outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); @@ -786,7 +784,7 @@ void collective_group_write(void) VRFY((ret2>=0), "mgroup filespace selection"); dcpl = H5Pcreate(H5P_DATASET_CREATE); - ret1 = H5Pset_chunk (dcpl, 2, chunk_size); + ret1 = H5Pset_chunk(dcpl, 2, chunk_size); VRFY((dcpl>=0), "dataset creation property"); VRFY((ret1>=0), "set chunk for dataset creation property"); @@ -798,12 +796,12 @@ void collective_group_write(void) VRFY((gid > 0), gname); sprintf(dname, "dataset%d", m); - did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, dcpl); + did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT); VRFY((did > 0), dname); - for(i=0; i < size; i++) - for(j=0; j < size; j++) - outme[(i * size) + j] = (i+j)*1000 + mpi_rank; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] =(i + j) * 1000 + mpi_rank; H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); @@ -812,7 +810,7 @@ void collective_group_write(void) H5Gclose(gid); #ifdef BARRIER_CHECKS - if(! ((m+1) % 10)) { + if(!((m+1) % 10)) { printf("created %d groups\n", m+1); MPI_Barrier(MPI_COMM_WORLD); } @@ -885,10 +883,10 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); /* open every group under root group. */ @@ -906,7 +904,7 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m) /* this is the original value */ for(i=0; i<size; i++) for(j=0; j<size; j++) { - outdata[(i * size) + j] = (i+j)*1000 + mpi_rank; + outdata[(i * size) + j] =(i+j)*1000 + mpi_rank; } /* compare the original value(outdata) to the value in file(indata).*/ @@ -1012,7 +1010,7 @@ void multiple_group_write(void) H5Gclose(gid); #ifdef BARRIER_CHECKS - if(! ((m+1) % 10)) { + if(!((m+1) % 10)) { printf("created %d groups\n", m+1); MPI_Barrier(MPI_COMM_WORLD); } @@ -1059,18 +1057,16 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) outme = HDmalloc((size_t)(size * size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); - for(n=0; n < NDATASET; n++) { + for(n = 0; n < NDATASET; n++) { sprintf(dname, "dataset%d", n); - did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, - H5P_DEFAULT); + did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((did > 0), dname); - for(i=0; i < size; i++) - for(j=0; j < size; j++) - outme[(i * size) + j] = n*1000 + mpi_rank; + for(i = 0; i < size; i++) + for(j = 0; j < size; j++) + outme[(i * size) + j] = n * 1000 + mpi_rank; - H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, - outme); + H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); /* create attribute for these datasets.*/ write_attribute(did, is_dset, n); @@ -1094,7 +1090,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #ifdef BARRIER_CHECKS - if(! ((counter+1) % 10)) { + if(!((counter+1) % 10)) { printf("created %dth child groups\n", counter+1); MPI_Barrier(MPI_COMM_WORLD); } @@ -1107,7 +1103,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, /* write datasets in parallel. */ write_dataset(memspace, filespace, gid); - if( counter < GROUP_DEPTH ) + if(counter < GROUP_DEPTH ) create_group_recursive(memspace, filespace, child_gid, counter+1); H5Gclose(child_gid); @@ -1168,12 +1164,12 @@ void multiple_group_read(void) /* check the data. */ if(m != 0) - if( (error_num = read_dataset(memspace, filespace, gid))>0) + if((error_num = read_dataset(memspace, filespace, gid))>0) nerrors += error_num; /* check attribute.*/ error_num = 0; - if( (error_num = read_attribute(gid, is_group, m))>0 ) + if((error_num = read_attribute(gid, is_group, m))>0 ) nerrors += error_num; H5Gclose(gid); @@ -1218,10 +1214,10 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); for(n=0; n<NDATASET; n++) { @@ -1244,7 +1240,7 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) vrfy_errors = check_value(indata, outdata, size); /* check attribute.*/ - if( (attr_errors = read_attribute(did, is_dset, n))>0 ) + if((attr_errors = read_attribute(did, is_dset, n))>0 ) vrfy_errors += attr_errors; H5Dclose(did); @@ -1273,10 +1269,10 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, MPI_Barrier(MPI_COMM_WORLD); #endif /* BARRIER_CHECKS */ - if( (err_num = read_dataset(memspace, filespace, gid)) ) + if((err_num = read_dataset(memspace, filespace, gid)) ) nerrors += err_num; - if( counter < GROUP_DEPTH ) { + if(counter < GROUP_DEPTH ) { sprintf(gname, "%dth_child_group", counter+1); child_gid = H5Gopen2(gid, gname, H5P_DEFAULT); VRFY((child_gid>0), gname); @@ -1377,9 +1373,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size) outdata += chunk_origin[0]*size; for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++) for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) { - if( *indata != *outdata ) + if(*indata != *outdata ) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata); + printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n",(unsigned long)i,(unsigned long)j,(unsigned long)i,(unsigned long)j, *outdata, *indata); } if(err_num > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); @@ -1409,7 +1405,7 @@ void get_slab(hsize_t chunk_origin[], MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); if(chunk_origin != NULL) { - chunk_origin[0] = mpi_rank * (size/mpi_size); + chunk_origin[0] = mpi_rank *(size/mpi_size); chunk_origin[1] = 0; } if(chunk_dims != NULL) { @@ -1424,7 +1420,7 @@ void get_slab(hsize_t chunk_origin[], /* * This function is based on bug demonstration code provided by Thomas - * Guignon (thomas.guignon@ifp.fr), and is intended to verify the + * Guignon(thomas.guignon@ifp.fr), and is intended to verify the * correctness of my fix for that bug. * * In essence, the bug appeared when at least one process attempted to @@ -1495,115 +1491,98 @@ void io_mode_confusion(void) * Set up file access property list with parallel I/O access */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Setting up property list.\n", mpi_rank, fcn_name); plist_id = H5Pcreate(H5P_FILE_ACCESS); - VRFY((plist_id != -1), "H5Pcreate() failed"); status = H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, MPI_INFO_NULL); - - VRFY(( status >= 0 ), "H5Pset_fapl_mpio() failed"); + VRFY((status >= 0 ), "H5Pset_fapl_mpio() failed"); /* * Create a new file collectively and release property list identifier. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating new file.\n", mpi_rank, fcn_name); file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); - - VRFY(( file_id >= 0 ), "H5Fcreate() failed"); + VRFY((file_id >= 0 ), "H5Fcreate() failed"); status = H5Pclose(plist_id); - - VRFY(( status >= 0 ), "H5Pclose() failed"); + VRFY((status >= 0 ), "H5Pclose() failed"); /* * Create the dataspace for the dataset. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating the dataspace for the dataset.\n", mpi_rank, fcn_name); dimsf[0] = N; - filespace = H5Screate_simple(rank, dimsf, NULL); - - VRFY(( filespace >= 0 ), "H5Screate_simple() failed."); + VRFY((filespace >= 0 ), "H5Screate_simple() failed."); /* * Create the dataset with default properties and close filespace. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Creating the dataset, and closing filespace.\n", mpi_rank, fcn_name); - dset_id = H5Dcreate(file_id, dataset_name, H5T_NATIVE_INT, filespace, - H5P_DEFAULT); - - VRFY(( dset_id >= 0 ), "H5Dcreate() failed"); + dset_id = H5Dcreate2(file_id, dataset_name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dset_id >= 0 ), "H5Dcreate2() failed"); status = H5Sclose(filespace); - - VRFY(( status >= 0 ), "H5Sclose() failed"); + VRFY((status >= 0 ), "H5Sclose() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Screate_simple().\n", - mpi_rank, fcn_name); + mpi_rank, fcn_name); memspace = H5Screate_simple(rank, dimsf, NULL); - - VRFY(( memspace >= 0 ), "H5Screate_simple() failed."); + VRFY((memspace >= 0 ), "H5Screate_simple() failed."); - if( mpi_rank == 0 ) { - - if ( verbose ) + if(mpi_rank == 0 ) { + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_all(memspace).\n", mpi_rank, fcn_name); status = H5Sselect_all(memspace); - - VRFY(( status >= 0 ), "H5Sselect_all() failed"); - + VRFY((status >= 0 ), "H5Sselect_all() failed"); } else { - - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none(memspace).\n", mpi_rank, fcn_name); status = H5Sselect_none(memspace); - - VRFY(( status >= 0 ), "H5Sselect_none() failed"); - + VRFY((status >= 0 ), "H5Sselect_none() failed"); } - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Dget_space().\n", mpi_rank, fcn_name); filespace = H5Dget_space(dset_id); - - VRFY(( filespace >= 0 ), "H5Dget_space() failed"); + VRFY((filespace >= 0 ), "H5Dget_space() failed"); start[0] = 0L; @@ -1611,102 +1590,90 @@ void io_mode_confusion(void) count[0] = 1; block[0] = N; - if ( mpi_rank == 0 ) { - - /* select all */ - - if ( verbose ) + /* select all */ + if(mpi_rank == 0 ) { + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_elements() -- set up hang?\n", mpi_rank, fcn_name); status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, - (const hsize_t **)&coord); - - VRFY(( status >= 0 ), "H5Sselect_elements() failed"); - - } else { - - /* select nothing */ - - if ( verbose ) + (const hsize_t **)&coord); + VRFY((status >= 0 ), "H5Sselect_elements() failed"); + } else { /* select nothing */ + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none().\n", mpi_rank, fcn_name); status = H5Sselect_none(filespace); - - VRFY(( status >= 0 ), "H5Sselect_none() failed"); - + VRFY((status >= 0 ), "H5Sselect_none() failed"); } - - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Pcreate().\n", mpi_rank, fcn_name); plist_id = H5Pcreate(H5P_DATASET_XFER); - - VRFY(( plist_id != -1 ), "H5Pcreate() failed"); + VRFY((plist_id != -1 ), "H5Pcreate() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Pset_dxpl_mpio().\n", mpi_rank, fcn_name); status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); - VRFY(( status >= 0 ), "H5Pset_dxpl_mpio() failed"); + VRFY((status >= 0 ), "H5Pset_dxpl_mpio() failed"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { - status = H5Pset_dxpl_mpio_collective_opt(plist_id,H5FD_MPIO_INDIVIDUAL_IO); + status = H5Pset_dxpl_mpio_collective_opt(plist_id, H5FD_MPIO_INDIVIDUAL_IO); VRFY((status>= 0),"set independent IO collectively succeeded"); } - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Dwrite() -- hang here?.\n", mpi_rank, fcn_name); status = H5Dwrite(dset_id, H5T_NATIVE_INT, memspace, filespace, plist_id, data); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Returned from H5Dwrite(), status=%d.\n", mpi_rank, fcn_name, status); - - VRFY(( status >= 0 ), "H5Dwrite() failed"); + VRFY((status >= 0 ), "H5Dwrite() failed"); /* * Close/release resources. */ - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Cleaning up from test.\n", mpi_rank, fcn_name); status = H5Dclose(dset_id); - VRFY(( status >= 0 ), "H5Dclose() failed"); + VRFY((status >= 0 ), "H5Dclose() failed"); status = H5Sclose(filespace); - VRFY(( status >= 0 ), "H5Dclose() failed"); + VRFY((status >= 0 ), "H5Dclose() failed"); status = H5Sclose(memspace); - VRFY(( status >= 0 ), "H5Sclose() failed"); + VRFY((status >= 0 ), "H5Sclose() failed"); status = H5Pclose(plist_id); - VRFY(( status >= 0 ), "H5Pclose() failed"); + VRFY((status >= 0 ), "H5Pclose() failed"); status = H5Fclose(file_id); - VRFY(( status >= 0 ), "H5Fclose() failed"); + VRFY((status >= 0 ), "H5Fclose() failed"); - if ( verbose ) + if(verbose ) HDfprintf(stdout, "%0d:%s: Done.\n", mpi_rank, fcn_name); return; @@ -1718,3 +1685,4 @@ void io_mode_confusion(void) /*============================================================================= * End of t_mdset.c *===========================================================================*/ + diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index e35ac2c..8734bfb 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -59,13 +59,13 @@ hid_t create_file(char* name, hid_t fapl) - if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; + if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Create a chunked dataset */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error; - if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error; - if ((dset=H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; + if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error; + if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; plist = H5Pcreate(H5P_DATASET_XFER); @@ -73,15 +73,14 @@ hid_t create_file(char* name, hid_t fapl) /* Write some data */ - for (i=0; i<ds_size[0]; i++) { + for(i = 0; i < ds_size[0]; i++) { /* * The extra cast in the following statement is a bug workaround * for the Win32 version 5.0 compiler. * 1998-11-06 ptl */ - for (j=0; j<ds_size[1]; j++) { + for(j = 0; j < ds_size[1]; j++) the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); - } } if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error; @@ -93,12 +92,10 @@ hid_t create_file(char* name, hid_t fapl) if(H5Gclose(grp) < 0) goto error; } - return file; error: - HD_exit(1); - + HD_exit(1); } /*------------------------------------------------------------------------- @@ -142,14 +139,14 @@ main(int argc, char* argv[]) if(mpi_rank == 0) TESTING("H5Fflush (part1)"); envval = HDgetenv("HDF5_DRIVER"); - if (envval == NULL) + if(envval == NULL) envval = "nomatch"; - if (HDstrcmp(envval, "split")) { + if(HDstrcmp(envval, "split")) { /* Create the file */ h5_fixname(FILENAME[0], fapl, name, sizeof name); file1 = create_file(name, fapl); /* Flush and exit without closing the library */ - if (H5Fflush(file1, H5F_SCOPE_GLOBAL)<0) goto error; + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; /* Create the other file which will not be flushed */ h5_fixname(FILENAME[1], fapl, name, sizeof name); @@ -179,20 +176,20 @@ main(int argc, char* argv[]) */ /* close file1 */ - if (H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p)<0){ + if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0){ printf("H5Fget_vfd_handle for file1 failed\n"); goto error; } - if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ printf("MPI_File_close for file1 failed\n"); goto error; } /* close file2 */ - if (H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p)<0){ + if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0){ printf("H5Fget_vfd_handle for file2 failed\n"); goto error; } - if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ printf("MPI_File_close for file2 failed\n"); goto error; } @@ -208,3 +205,4 @@ error: MPI_Finalize(); HD_exit(1); } + diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 3a5bc2e..71d526b 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -312,8 +312,8 @@ void coll_write_test(int chunk_factor) VRFY((ret >= 0),"Fill value creation property list succeeded"); if(chunk_factor != 0) { - chunk_dims[0] = fsdim[0]/chunk_factor; - chunk_dims[1] = fsdim[1]/chunk_factor; + chunk_dims[0] = fsdim[0] / chunk_factor; + chunk_dims[1] = fsdim[1] / chunk_factor; ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); } @@ -333,10 +333,10 @@ void coll_write_test(int chunk_factor) * Create dataset in the file. Notice that creation * property list dcrt_plist is used. */ - datasetc = H5Dcreate(file, "collect_write", H5T_NATIVE_INT, fspaceid, dcrt_plist); + datasetc = H5Dcreate2(file, "collect_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT); VRFY((datasetc >= 0),"dataset created succeeded"); - dataseti = H5Dcreate(file, "independ_write", H5T_NATIVE_INT, fspaceid, dcrt_plist); + dataseti = H5Dcreate2(file, "independ_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT); VRFY((dataseti >= 0),"dataset created succeeded"); /* The First selection for FILE @@ -349,7 +349,7 @@ void coll_write_test(int chunk_factor) */ start[0] = FHSTART0; - start[1] = FHSTART1+mpi_rank*FHSTRIDE1*FHCOUNT1; + start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1; stride[0] = FHSTRIDE0; stride[1] = FHSTRIDE1; count[0] = FHCOUNT0; |