diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2013-10-31 07:44:00 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2013-10-31 07:44:00 (GMT) |
commit | 0aa06db0a4e5d01b752fecf9e33d4db302ee3abc (patch) | |
tree | 5bd2d0032760de036383fa28004a89972265e52d /testpar | |
parent | 89f2019ecf51f46a99a1d08149d633655c1e7dec (diff) | |
download | hdf5-0aa06db0a4e5d01b752fecf9e33d4db302ee3abc.zip hdf5-0aa06db0a4e5d01b752fecf9e33d4db302ee3abc.tar.gz hdf5-0aa06db0a4e5d01b752fecf9e33d4db302ee3abc.tar.bz2 |
[svn-r24380] The parallel test code now uses HDfree, HDmalloc, and HDcalloc
exclusively.
Part of the preparation for a fix for HDFFV-8551.
Tested on:
32-bit LE linux (jam) w/ parallel and Fortran.
There are no behavior changes, so testing was minimal.
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_coll_chunk.c | 10 | ||||
-rw-r--r-- | testpar/t_dset.c | 130 | ||||
-rw-r--r-- | testpar/t_filter_read.c | 4 | ||||
-rw-r--r-- | testpar/t_mpi.c | 2 | ||||
-rw-r--r-- | testpar/t_posix_compliant.c | 32 |
5 files changed, 89 insertions, 89 deletions
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 73e7f09..5dac36f 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -553,7 +553,7 @@ coll_chunktest(const char* filename, /* allocate memory for data buffer */ - data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -748,11 +748,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(dims[0]*dims[1]*sizeof(int)); + data_array1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)malloc(dims[0]*dims[1]*sizeof(int)); + data_origin1 = (int *)HDmalloc(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); @@ -813,8 +813,8 @@ coll_chunktest(const char* filename, H5Fclose(file); /* release data buffers */ - if (data_array1) free(data_array1); - if (data_origin1) free(data_origin1); + if (data_array1) HDfree(data_array1); + if (data_origin1) HDfree(data_origin1); } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 743de3a..34ccab7 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -255,8 +255,8 @@ dataset_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -365,7 +365,7 @@ MPI_Barrier(MPI_COMM_WORLD); H5Fclose(fid); /* release data buffers */ - if(data_array1) free(data_array1); + if(data_array1) HDfree(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -401,10 +401,10 @@ dataset_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); @@ -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) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); } @@ -527,8 +527,8 @@ dataset_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -862,7 +862,7 @@ dataset_writeAll(void) H5Fclose(fid); /* release data buffers */ - if(data_array1) free(data_array1); + if(data_array1) HDfree(data_array1); } /* @@ -907,10 +907,10 @@ dataset_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -1090,8 +1090,8 @@ dataset_readAll(void) H5Fclose(fid); /* release data buffers */ - if(data_array1) free(data_array1); - if(data_origin1) free(data_origin1); + if(data_array1) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); } @@ -1149,8 +1149,8 @@ extend_writeInd(void) chunk_dims[1] = chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -1329,7 +1329,7 @@ extend_writeInd(void) H5Fclose(fid); /* release data buffers */ - if(data_array1) free(data_array1); + if(data_array1) HDfree(data_array1); } /* @@ -1535,12 +1535,12 @@ extend_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_array2 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); - data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); + data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -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) HDfree(data_array1); + if(data_array2) HDfree(data_array2); + if(data_origin1) HDfree(data_origin1); } /* @@ -1723,8 +1723,8 @@ extend_writeAll(void) chunk_dims[1] = chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -1928,7 +1928,7 @@ extend_writeAll(void) H5Fclose(fid); /* release data buffers */ - if(data_array1) free(data_array1); + if(data_array1) HDfree(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -1967,12 +1967,12 @@ extend_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_array2 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); - data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); + data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -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) HDfree(data_array1); + if(data_array2) HDfree(data_array2); + if(data_origin1) HDfree(data_origin1); } /* @@ -2161,9 +2161,9 @@ compress_readAll(void) /* Allocate data buffer */ data_orig = (DATATYPE *)HDmalloc((size_t)dim*sizeof(DATATYPE)); - VRFY((data_orig != NULL), "data_origin1 malloc succeeded"); + VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded"); data_read = (DATATYPE *)HDmalloc((size_t)dim*sizeof(DATATYPE)); - VRFY((data_read != NULL), "data_array1 malloc succeeded"); + VRFY((data_read != NULL), "data_array1 HDmalloc succeeded"); /* Initialize data buffers */ for(u=0; u<dim;u++) @@ -2394,11 +2394,11 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ if(mpi_rank) { - data_origin = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE)); - VRFY((data_origin != NULL), "data_origin malloc succeeded"); + data_origin = (DATATYPE *)HDmalloc(block[0]*block[1]*sizeof(DATATYPE)); + VRFY((data_origin != NULL), "data_origin HDmalloc succeeded"); - data_array = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array malloc succeeded"); + data_array = (DATATYPE *)HDmalloc(block[0]*block[1]*sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array HDmalloc succeeded"); /* put some trivial data in the data_array */ mstart[0] = mstart[1] = 0; @@ -2495,8 +2495,8 @@ none_selection_chunk(void) H5Fclose(fid); /* release data buffers */ - if(data_origin) free(data_origin); - if(data_array) free(data_array); + if(data_origin) HDfree(data_origin); + if(data_array) HDfree(data_array); } @@ -2849,7 +2849,7 @@ test_actual_io_mode(int selection_mode) { /* Allocate and initialize the buffer */ buffer = (int *)HDmalloc(sizeof(int) * length); - VRFY((buffer != NULL), "malloc of buffer succeeded"); + VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3323,7 +3323,7 @@ test_no_collective_cause_mode(int selection_mode) /* Allocate and initialize the buffer */ buffer = (int *)HDmalloc(sizeof(int) * length); - VRFY((buffer != NULL), "malloc of buffer succeeded"); + VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3571,7 +3571,7 @@ test_no_collective_cause_mode_filter(int selection_mode) /* Allocate and initialize the buffer */ buffer = (int *)HDmalloc(sizeof(int) * length); - VRFY((buffer != NULL), "malloc of buffer succeeded"); + VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3763,11 +3763,11 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)calloc(buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf malloc succeeded"); + write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)calloc(buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf malloc succeeded"); + read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); @@ -3909,19 +3909,19 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5D close succeeded"); /* release data buffers */ - if(write_buf) free(write_buf); - if(read_buf) free(read_buf); + if(write_buf) HDfree(write_buf); + if(read_buf) HDfree(read_buf); /* open dataset2 (non-contiguous case) */ dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)calloc(buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf malloc succeeded"); + write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)calloc(buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf malloc succeeded"); + read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); for (i=0 ; i<buf_size ; i++) { write_buf[i] = 5; @@ -4031,8 +4031,8 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5Sclose succeeded"); /* release data buffers */ - if(write_buf) free(write_buf); - if(read_buf) free(read_buf); + if(write_buf) HDfree(write_buf); + if(read_buf) HDfree(read_buf); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index f38b30e..7e782ce 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -186,8 +186,8 @@ filter_read_internal(const char *filename, hid_t dcpl, hrc = H5Fclose (file); VRFY(hrc>=0, "H5Fclose"); - free(points); - free(check); + HDfree(points); + HDfree(check); MPI_Barrier(MPI_COMM_WORLD); } diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index fa9cf9d..a74aa22 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -282,7 +282,7 @@ test_mpio_gb_file(char *filename) printf("Skipped GB file range test " "because MPI_Offset cannot support it\n"); }else{ - buf = malloc(MB); + buf = HDmalloc(MB); VRFY((buf!=NULL), "malloc succeed"); /* open a new file. Remove it first in case it exists. */ diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c index 1bc0053..207f07e 100644 --- a/testpar/t_posix_compliant.c +++ b/testpar/t_posix_compliant.c @@ -105,8 +105,8 @@ static int allwrite_allread_blocks(int numprocs, int rank, int write_size) int amode, i; MPI_Offset offset = rank*write_size*sizeof(int); MPI_Status Status; - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); for(i=0; i<write_size; i++) writebuf[i] = i; @@ -143,8 +143,8 @@ static int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size) int ret; int i; int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); FILE* file = NULL; for(i=0; i<write_size; i++) @@ -216,8 +216,8 @@ static int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size) int ret; int i; int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); FILE* file = NULL; for(i=0; i<write_size; i++) @@ -295,8 +295,8 @@ static int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_s int ret; int i, fill, index; int offset = rank*write_size*sizeof(int); - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); FILE* file = NULL; if(rank==0) @@ -389,8 +389,8 @@ static int allwrite_allread_interlaced(int numprocs, int rank, int write_size) int amode, i, counter = 0; MPI_Datatype filetype; MPI_Status Status; - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*) malloc(numprocs*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*) HDmalloc(numprocs*sizeof(int)); int offset=0; for(i=0; i<write_size; i++) @@ -488,8 +488,8 @@ static int allwrite_allread_overlap(int numprocs, int rank, int write_size) int amode, i, counter = 0; MPI_Datatype filetype; MPI_Status Status; - int* writebuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */ - int* readbuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int)); + int* writebuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */ + int* readbuf = (int*) HDmalloc(write_size*(numprocs-1)*sizeof(int)); if(numprocs < 2) { @@ -581,8 +581,8 @@ static int onewrite_allread_blocks(int numprocs, int rank, int write_size) int mpio_result; int amode, i; MPI_Status Status; - int* writebuf = (int*)malloc(write_size*sizeof(int)); - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*)HDmalloc(write_size*sizeof(int)); + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); for(i=0; i<write_size; i++) writebuf[i] = i; @@ -632,8 +632,8 @@ static int onewrite_allread_interlaced(int numprocs, int rank, int write_size) int amode, i; MPI_Datatype filetype; MPI_Status Status; - int* writebuf = (int*) malloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */ - int* readbuf = (int*)malloc (write_size*sizeof(int)); + int* writebuf = (int*) HDmalloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */ + int* readbuf = (int*)HDmalloc (write_size*sizeof(int)); amode = MPI_MODE_CREATE | MPI_MODE_RDWR; |