summaryrefslogtreecommitdiffstats
path: root/testpar/t_2Gio.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 22:48:12 (GMT)
committerGitHub <noreply@github.com>2023-06-28 22:48:12 (GMT)
commitaebac33a1f290fa5065bce96bb0512317a34c283 (patch)
treecdbae6dbd65a2eb4e6f786921ee907cec92c92d3 /testpar/t_2Gio.c
parent605cea4af60cfcbe03a54f697de392eec75e5a85 (diff)
downloadhdf5-aebac33a1f290fa5065bce96bb0512317a34c283.zip
hdf5-aebac33a1f290fa5065bce96bb0512317a34c283.tar.gz
hdf5-aebac33a1f290fa5065bce96bb0512317a34c283.tar.bz2
Remove HD from memory allocate/free calls (#3195)
* HDcalloc * HDfree * HDmalloc * HDrealloc
Diffstat (limited to 'testpar/t_2Gio.c')
-rw-r--r--testpar/t_2Gio.c170
1 files changed, 85 insertions, 85 deletions
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index d3422e0..c9faa09 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -641,8 +641,8 @@ MpioTest2G(MPI_Comm comm)
hsize_t);
data_size = slice_per_process * shape[1] * shape[2];
data_size_bytes = sizeof(int) * data_size;
- data = HDmalloc(data_size_bytes);
- VRFY((data != NULL), "data HDmalloc succeeded");
+ data = malloc(data_size_bytes);
+ VRFY((data != NULL), "data malloc succeeded");
for (size_t i = 0; i < data_size; i++) {
data[i] = mpi_rank;
@@ -738,8 +738,8 @@ dataset_writeInd(void)
/* allocate memory for data buffer */
data_size = sizeof(DATATYPE);
data_size *= (hsize_t)dim0 * (hsize_t)dim1;
- data_array1 = (DATATYPE *)HDmalloc(data_size);
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc(data_size);
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* ----------------------------------------
* CREATE AN HDF5 FILE WITH PARALLEL ACCESS
@@ -841,7 +841,7 @@ dataset_writeInd(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
}
/* Example of using the parallel HDF5 library to read a dataset */
@@ -876,10 +876,10 @@ dataset_readInd(void)
MPI_Comm_rank(test_comm, &mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type);
@@ -949,9 +949,9 @@ dataset_readInd(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
if (data_origin1)
- HDfree(data_origin1);
+ free(data_origin1);
}
/*
@@ -1010,12 +1010,12 @@ dataset_writeAll(void)
/* set up the coords array selection */
num_points = (size_t)dim1;
- coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)MAX_RANK * sizeof(hsize_t));
+ coords = (hsize_t *)malloc((size_t)dim1 * (size_t)MAX_RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -1326,7 +1326,7 @@ dataset_writeAll(void)
if (data_array1)
free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
@@ -1475,9 +1475,9 @@ dataset_writeAll(void)
/* release data buffers */
if (coords)
- HDfree(coords);
+ free(coords);
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
}
/*
@@ -1526,14 +1526,14 @@ dataset_readAll(void)
/* set up the coords array selection */
num_points = (size_t)dim1;
- coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * MAX_RANK * sizeof(hsize_t));
+ coords = (hsize_t *)malloc((size_t)dim0 * (size_t)dim1 * MAX_RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -1709,9 +1709,9 @@ dataset_readAll(void)
free(data_array1);
if (data_origin1)
free(data_origin1);
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
@@ -1770,7 +1770,7 @@ dataset_readAll(void)
if (data_array1)
free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
@@ -1816,7 +1816,7 @@ dataset_readAll(void)
if (data_array1)
free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1884,11 +1884,11 @@ dataset_readAll(void)
/* release data buffers */
if (coords)
- HDfree(coords);
+ free(coords);
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
if (data_origin1)
- HDfree(data_origin1);
+ free(data_origin1);
}
/*
@@ -1943,8 +1943,8 @@ extend_writeInd(void)
chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -2116,7 +2116,7 @@ extend_writeInd(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
}
/*
@@ -2317,12 +2317,12 @@ extend_readInd(void)
MPI_Comm_rank(test_comm, &mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array2 != NULL), "data_array2 malloc succeeded");
+ data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -2443,11 +2443,11 @@ extend_readInd(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
if (data_array2)
- HDfree(data_array2);
+ free(data_array2);
if (data_origin1)
- HDfree(data_origin1);
+ free(data_origin1);
}
/*
@@ -2503,8 +2503,8 @@ extend_writeAll(void)
chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* -------------------
* START AN HDF5 FILE
@@ -2699,7 +2699,7 @@ extend_writeAll(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
}
/* Example of using the parallel HDF5 library to read an extendible dataset */
@@ -2737,12 +2737,12 @@ extend_readAll(void)
MPI_Comm_rank(test_comm, &mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
- VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
+ data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
+ data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_array2 != NULL), "data_array2 malloc succeeded");
+ data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE));
+ VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
/* -------------------
* OPEN AN HDF5 FILE
@@ -2885,11 +2885,11 @@ extend_readAll(void)
/* release data buffers */
if (data_array1)
- HDfree(data_array1);
+ free(data_array1);
if (data_array2)
- HDfree(data_array2);
+ free(data_array2);
if (data_origin1)
- HDfree(data_origin1);
+ free(data_origin1);
}
/*
@@ -2928,10 +2928,10 @@ compress_readAll(void)
MPI_Comm_rank(comm, &mpi_rank);
/* Allocate data buffer */
- data_orig = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE));
- VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded");
- data_read = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE));
- VRFY((data_read != NULL), "data_array1 HDmalloc succeeded");
+ data_orig = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE));
+ VRFY((data_orig != NULL), "data_origin1 malloc succeeded");
+ data_read = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE));
+ VRFY((data_read != NULL), "data_array1 malloc succeeded");
/* Initialize data buffers */
for (u = 0; u < dim; u++)
@@ -3064,9 +3064,9 @@ compress_readAll(void)
/* release data buffers */
if (data_read)
- HDfree(data_read);
+ free(data_read);
if (data_orig)
- HDfree(data_orig);
+ free(data_orig);
}
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -3177,11 +3177,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 *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE));
- VRFY((data_origin != NULL), "data_origin HDmalloc succeeded");
+ data_origin = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE));
+ VRFY((data_origin != NULL), "data_origin malloc succeeded");
- data_array = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE));
- VRFY((data_array != NULL), "data_array HDmalloc succeeded");
+ data_array = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE));
+ VRFY((data_array != NULL), "data_array malloc succeeded");
/* put some trivial data in the data_array */
mstart[0] = mstart[1] = 0;
@@ -3276,9 +3276,9 @@ none_selection_chunk(void)
/* release data buffers */
if (data_origin)
- HDfree(data_origin);
+ free(data_origin);
if (data_array)
- HDfree(data_array);
+ free(data_array);
}
/* Function: test_actual_io_mode
@@ -3625,8 +3625,8 @@ test_actual_io_mode(int selection_mode)
length = dim0 * dim1;
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ buffer = (int *)malloc(sizeof(int) * (size_t)length);
+ VRFY((buffer != NULL), "malloc of buffer succeeded");
for (i = 0; i < length; i++)
buffer[i] = i;
@@ -3767,7 +3767,7 @@ test_actual_io_mode(int selection_mode)
ret = H5Sclose(mem_space);
ret = H5Sclose(file_space);
ret = H5Fclose(fid);
- HDfree(buffer);
+ free(buffer);
return;
}
@@ -4063,8 +4063,8 @@ test_no_collective_cause_mode(int selection_mode)
H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], hsize_t);
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ buffer = (int *)malloc(sizeof(int) * (size_t)length);
+ VRFY((buffer != NULL), "malloc of buffer succeeded");
for (i = 0; i < length; i++)
buffer[i] = i;
@@ -4178,7 +4178,7 @@ test_no_collective_cause_mode(int selection_mode)
H5Sclose(file_space);
if (fid)
H5Fclose(fid);
- HDfree(buffer);
+ free(buffer);
/* clean up external file */
if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL)
@@ -4272,11 +4272,11 @@ dataset_atomicity(void)
buf_size = dim0 * dim1;
/* allocate memory for data buffer */
- write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
- VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
+ write_buf = (int *)calloc((size_t)buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf calloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
- VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
+ read_buf = (int *)calloc((size_t)buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf calloc succeeded");
/* setup file access template */
acc_tpl = create_faccess_plist(comm, info, facc_type);
@@ -4422,20 +4422,20 @@ dataset_atomicity(void)
/* release data buffers */
if (write_buf)
- HDfree(write_buf);
+ free(write_buf);
if (read_buf)
- HDfree(read_buf);
+ free(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 *)HDcalloc((size_t)buf_size, sizeof(int));
- VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
+ write_buf = (int *)calloc((size_t)buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf calloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
- VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
+ read_buf = (int *)calloc((size_t)buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf calloc succeeded");
for (i = 0; i < buf_size; i++) {
write_buf[i] = 5;
@@ -4549,9 +4549,9 @@ dataset_atomicity(void)
/* release data buffers */
if (write_buf)
- HDfree(write_buf);
+ free(write_buf);
if (read_buf)
- HDfree(read_buf);
+ free(read_buf);
ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
@@ -4659,7 +4659,7 @@ main(int argc, char **argv)
HDmemset(filenames, 0, sizeof(filenames));
for (int i = 0; i < NFILENAME; i++) {
- if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) {
+ if (NULL == (filenames[i] = malloc(PATH_MAX))) {
printf("couldn't allocate filename array\n");
MPI_Abort(MPI_COMM_WORLD, -1);
}
@@ -4730,7 +4730,7 @@ main(int argc, char **argv)
HDremove(FILENAME[0]);
for (int i = 0; i < NFILENAME; i++) {
- HDfree(filenames[i]);
+ free(filenames[i]);
filenames[i] = NULL;
}