summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-02-19 17:59:46 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-02-19 17:59:46 (GMT)
commit117381d3258fb9e897d07e507247b09d670185be (patch)
tree282cadd631b1334b8d0b301e95d3f982e75272c9
parent941509ab25e444f4e66f0f9d7e355e1ecef9b245 (diff)
downloadhdf5-117381d3258fb9e897d07e507247b09d670185be.zip
hdf5-117381d3258fb9e897d07e507247b09d670185be.tar.gz
hdf5-117381d3258fb9e897d07e507247b09d670185be.tar.bz2
[svn-r6421]
Purpose: test program modification Description: put part of code into an internal function. Nothing serious. Platforms tested: eirene
-rw-r--r--testpar/t_mdset.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index e3ef984..548a055 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -40,18 +40,13 @@ void multiple_dset_write(char *filename, int ndatasets)
VRFY((mpi_size <= SIZE), "mpi_size <= SIZE");
- chunk_origin [0] = mpi_rank * (SIZE / mpi_size);
- chunk_origin [1] = 0;
- chunk_dims [0] = SIZE / mpi_size;
- chunk_dims [1] = SIZE;
-
- for (i = 0; i < DIM; i++)
- file_dims [i] = SIZE;
-
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
H5Pclose (plist);
+ /* decide the hyperslab according to process number. */
+ get_slab(chunk_origin, chunk_dims, count, file_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);
@@ -110,17 +105,12 @@ void compact_dataset(char *filename)
VRFY((mpi_size <= SIZE), "mpi_size <= SIZE");
- chunk_origin [0] = mpi_rank * (SIZE / mpi_size);
- chunk_origin [1] = 0;
- chunk_dims [0] = SIZE / mpi_size;
- chunk_dims [1] = SIZE;
-
- for (i = 0; i < DIM; i++)
- file_dims [i] = SIZE;
-
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ /* decide the hyperslab according to process number. */
+ get_slab(chunk_origin, chunk_dims, count, file_dims);
+
/* Define data space */
memspace = H5Screate_simple (DIM, chunk_dims, NULL);
filespace = H5Screate_simple (DIM, file_dims, NULL);