summaryrefslogtreecommitdiffstats
path: root/testpar/t_coll_chunk.c
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2006-03-23 02:50:09 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2006-03-23 02:50:09 (GMT)
commit15f0a2e95c3c6ea72fe88fe8c9bc45cab7eb3212 (patch)
treea446225b73fbc0992ac80f496073a81910160045 /testpar/t_coll_chunk.c
parent36dda5514c3e077d34b526dfa059f93e978764c5 (diff)
downloadhdf5-15f0a2e95c3c6ea72fe88fe8c9bc45cab7eb3212.zip
hdf5-15f0a2e95c3c6ea72fe88fe8c9bc45cab7eb3212.tar.gz
hdf5-15f0a2e95c3c6ea72fe88fe8c9bc45cab7eb3212.tar.bz2
[svn-r12142] Purpose:
change the array size of collective chunking features of parallel tests. Description: Previously array size for collective optimization tests including cchunk1, cchunk2, cchunk3, cchunk4, ccontw, ccontr, cschunkw, cschunkr, ccchunkw, ccchunkr are fixed, They are only valid for some good number of processors(1,2,3,4,6,8,12,16,24,32,48 etc). Recently there are more requests for parallel tests to be valid on some odd number of processes such as 5,7,11,13 etc. Solution: I change the array size to be dynamic rather than static. Now the fastest change array size is a function of mpi_size. dim2 = constant *mpi_size. After some tunings, theoretically the above tests should be valid for any number of processors. However, other parallel tests still need to be tuned. To verify the correctness of these tests, using mpirun -np 5 ./testphdf5 -b cchunk1 at heping. Platforms tested: h5committest(shanti is refused to be connected) at heping, 5 and 7 processes are used to verify the correctness. Misc. update:
Diffstat (limited to 'testpar/t_coll_chunk.c')
-rw-r--r--testpar/t_coll_chunk.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index fbc3505..1591764 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -54,15 +54,15 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact
* Descriptions for the selection: One big singluar selection inside one chunk
* Two dimensions,
*
- * dim1 = SPACE_DIM1(5760)
+ * dim1 = SPACE_DIM1(5760)*mpi_size
* dim2 = SPACE_DIM2(3)
* chunk_dim1 = dim1
* chunk_dim2 = dim2
* block = 1 for all dimensions
* stride = 1 for all dimensions
- * count0 = SPACE_DIM1/mpi_size(5760/mpi_size)
+ * count0 = SPACE_DIM1(5760)
* count1 = SPACE_DIM2(3)
- * start0 = mpi_rank*SPACE_DIM1/mpi_size
+ * start0 = mpi_rank*SPACE_DIM1
* start1 = 0
* ------------------------------------------------------------------------
*/
@@ -101,15 +101,15 @@ coll_chunk1(void)
* Descriptions for the selection: many disjoint selections inside one chunk
* Two dimensions,
*
- * dim1 = SPACE_DIM1(5760)
+ * dim1 = SPACE_DIM1*mpi_size(5760)
* dim2 = SPACE_DIM2(3)
* chunk_dim1 = dim1
* chunk_dim2 = dim2
* block = 1 for all dimensions
* stride = 3 for all dimensions
- * count0 = SPACE_DIM1/mpi_size/stride0(5760/mpi_size/3)
+ * count0 = SPACE_DIM1/stride0(5760/3)
* count1 = SPACE_DIM2/stride(3/3 = 1)
- * start0 = mpi_rank*SPACE_DIM1/mpi_size
+ * start0 = mpi_rank*SPACE_DIM1
* start1 = 0
*
* ------------------------------------------------------------------------
@@ -148,15 +148,15 @@ coll_chunk2(void)
* Descriptions for the selection: one singular selection accross many chunks
* Two dimensions, Num of chunks = 2* mpi_size
*
- * dim1 = SPACE_DIM1(5760)
+ * dim1 = SPACE_DIM1*mpi_size
* dim2 = SPACE_DIM2(3)
- * chunk_dim1 = dim1/mpi_size
+ * chunk_dim1 = SPACE_DIM1
* chunk_dim2 = dim2/2
* block = 1 for all dimensions
* stride = 1 for all dimensions
- * count0 = SPACE_DIM1/mpi_size(5760/mpi_size)
+ * count0 = SPACE_DIM1
* count1 = SPACE_DIM2(3)
- * start0 = mpi_rank*SPACE_DIM1/mpi_size
+ * start0 = mpi_rank*SPACE_DIM1
* start1 = 0
*
* ------------------------------------------------------------------------
@@ -199,15 +199,15 @@ coll_chunk3(void)
* Descriptions for the selection: one singular selection accross many chunks
* Two dimensions, Num of chunks = 2* mpi_size
*
- * dim1 = SPACE_DIM1(5760)
- * dim2 = SPACE_DIM2(3)
- * chunk_dim1 = dim1/mpi_size
- * chunk_dim2 = dim2/2
+ * dim1 = SPACE_DIM1*mpi_size
+ * dim2 = SPACE_DIM2
+ * chunk_dim1 = dim1
+ * chunk_dim2 = dim2
* block = 1 for all dimensions
* stride = 1 for all dimensions
- * count0 = SPACE_DIM1/mpi_size(5760/mpi_size)
+ * count0 = SPACE_DIM1
* count1 = SPACE_DIM2(3)
- * start0 = mpi_rank*SPACE_DIM1/mpi_size
+ * start0 = mpi_rank*SPACE_DIM1
* start1 = 0
*
* ------------------------------------------------------------------------
@@ -221,7 +221,6 @@ coll_chunk4(void)
int mpi_size;
MPI_Comm comm = MPI_COMM_WORLD;
- MPI_Comm_size(comm,&mpi_size);
filename = GetTestParameters();
coll_chunktest(filename,1,BYROW_SELECTNONE);
@@ -288,12 +287,12 @@ coll_chunktest(const char* filename,
VRFY((status >= 0),"");
/* setup dimensionality object */
- dims[0] = SPACE_DIM1;
+ dims[0] = SPACE_DIM1*mpi_size;
dims[1] = SPACE_DIM2;
/* allocate memory for data buffer */
- data_array1 = (int *)malloc(SPACE_DIM1*SPACE_DIM2*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 */
@@ -306,7 +305,7 @@ coll_chunktest(const char* filename,
VRFY((crp_plist >= 0),"");
/* Set up chunk information. */
- chunk_dims[0] = SPACE_DIM1/chunk_factor;
+ chunk_dims[0] = dims[0]/chunk_factor;
/* to decrease the testing time, maintain bigger chunk size */
@@ -359,11 +358,11 @@ coll_chunktest(const char* filename,
/* Use collective read to verify the correctness of collective write. */
/* allocate memory for data buffer */
- data_array1 = (int *)malloc(SPACE_DIM1*SPACE_DIM2*sizeof(int));
+ data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* allocate memory for data buffer */
- data_origin1 = (int *)malloc(SPACE_DIM1*SPACE_DIM2*sizeof(int));
+ data_origin1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs);
@@ -443,7 +442,7 @@ ccslab_set(int mpi_rank,
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
- count[0] = SPACE_DIM1/mpi_size;
+ count[0] = SPACE_DIM1;
count[1] = SPACE_DIM2;
start[0] = mpi_rank*count[0];
start[1] = 0;
@@ -456,9 +455,9 @@ ccslab_set(int mpi_rank,
block[1] = 1;
stride[0] = 3;
stride[1] = 3;
- count[0] = (SPACE_DIM1/mpi_size)/(stride[0]*block[0]);
+ count[0] = SPACE_DIM1/(stride[0]*block[0]);
count[1] = (SPACE_DIM2)/(stride[1]*block[1]);
- start[0] = SPACE_DIM1/mpi_size*mpi_rank;
+ start[0] = SPACE_DIM1*mpi_rank;
start[1] = 0;
break;
@@ -470,7 +469,7 @@ ccslab_set(int mpi_rank,
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
- count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:SPACE_DIM1/mpi_size);
+ count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:SPACE_DIM1);
count[1] = SPACE_DIM2;
start[0] = mpi_rank*count[0];
start[1] = 0;
@@ -479,7 +478,7 @@ ccslab_set(int mpi_rank,
default:
/* Unknown mode. Set it to cover the whole dataset. */
- block[0] = SPACE_DIM1;
+ block[0] = SPACE_DIM1*mpi_size;
block[1] = SPACE_DIM2;
stride[0] = block[0];
stride[1] = block[1];