2005-08-30 12:35:17 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2005-08-30 12:35:17 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2005-08-30 12:35:17 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
/*
|
2005-08-30 12:35:17 +08:00
|
|
|
* This verifies if the storage space allocation methods are compatible between
|
|
|
|
* serial and parallel modes.
|
|
|
|
*
|
|
|
|
* Created by: Christian Chilan and Albert Cheng
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
* Date: 2006/05/25
|
2005-08-30 12:35:17 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "testphdf5.h"
|
2005-09-02 22:44:40 +08:00
|
|
|
static int mpi_size, mpi_rank;
|
2005-08-30 12:35:17 +08:00
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
#define DATASETNAME "ExtendibleArray"
|
2005-09-02 22:44:40 +08:00
|
|
|
#define CHUNKSIZE 1000 /* #elements per chunk */
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
#define DSETCHUNKS 20000
|
|
|
|
#define CLOSE 1
|
|
|
|
#define NO_CLOSE 0
|
2005-09-02 22:44:40 +08:00
|
|
|
|
|
|
|
static MPI_Offset
|
|
|
|
get_filesize(const char *filename)
|
|
|
|
{
|
|
|
|
int mpierr;
|
|
|
|
MPI_File fd;
|
|
|
|
MPI_Offset filesize;
|
2007-06-03 02:19:36 +08:00
|
|
|
#ifndef H5_HAVE_MPI_GET_SIZE
|
|
|
|
struct stat stat_buf;
|
|
|
|
#endif
|
2005-09-02 22:44:40 +08:00
|
|
|
|
2007-06-03 02:19:36 +08:00
|
|
|
#ifdef H5_HAVE_MPI_GET_SIZE
|
2005-09-02 22:44:40 +08:00
|
|
|
mpierr = MPI_File_open(MPI_COMM_SELF, (char*)filename, MPI_MODE_RDONLY,
|
|
|
|
MPI_INFO_NULL, &fd);
|
|
|
|
VRFY((mpierr == MPI_SUCCESS), "");
|
|
|
|
|
|
|
|
mpierr = MPI_File_get_size(fd, &filesize);
|
|
|
|
VRFY((mpierr == MPI_SUCCESS), "");
|
|
|
|
|
|
|
|
mpierr = MPI_File_close(&fd);
|
|
|
|
VRFY((mpierr == MPI_SUCCESS), "");
|
2007-06-03 02:19:36 +08:00
|
|
|
#else
|
|
|
|
/* Some systems (only SGI Altix Propack 4 so far) doesn't return correct
|
|
|
|
* file size for MPI_File_get_size. Use stat instead.
|
|
|
|
*/
|
|
|
|
if((mpierr=stat(filename, &stat_buf))<0)
|
|
|
|
VRFY((mpierr == MPI_SUCCESS), "");
|
|
|
|
|
|
|
|
/* Hopefully this casting is safe */
|
|
|
|
filesize = (MPI_Offset)(stat_buf.st_size);
|
|
|
|
#endif
|
2005-09-02 22:44:40 +08:00
|
|
|
|
|
|
|
return(filesize);
|
|
|
|
}
|
2005-08-30 12:35:17 +08:00
|
|
|
|
2006-06-06 23:24:38 +08:00
|
|
|
typedef enum write_pattern {
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
none,
|
|
|
|
sec_last,
|
|
|
|
all
|
|
|
|
} write_type;
|
|
|
|
|
|
|
|
typedef enum access_ {
|
|
|
|
write_all,
|
|
|
|
open_only,
|
|
|
|
extend_only
|
|
|
|
} access_type;
|
|
|
|
|
|
|
|
|
2005-08-30 12:35:17 +08:00
|
|
|
/*
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
* This creates a dataset serially with 'nchunks' chunks, each of CHUNKSIZE
|
|
|
|
* elements. The allocation time is set to H5D_ALLOC_TIME_EARLY. Another
|
|
|
|
* routine will open this in parallel for extension test.
|
2005-08-30 12:35:17 +08:00
|
|
|
*/
|
|
|
|
void
|
2006-06-06 23:24:38 +08:00
|
|
|
create_chunked_dataset(const char *filename, int nchunks, write_type write_pattern)
|
2005-08-30 12:35:17 +08:00
|
|
|
{
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hid_t file_id, dataset; /* handles */
|
2006-06-27 22:45:06 +08:00
|
|
|
hid_t dataspace,memspace;
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hid_t cparms;
|
|
|
|
hsize_t dims[1];
|
2005-08-30 12:35:17 +08:00
|
|
|
hsize_t maxdims[1] = {H5S_UNLIMITED};
|
2006-06-27 22:45:06 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hsize_t chunk_dims[1] ={CHUNKSIZE};
|
|
|
|
hsize_t count[1];
|
|
|
|
hsize_t stride[1];
|
|
|
|
hsize_t block[1];
|
|
|
|
hsize_t offset[1]; /* Selection offset within dataspace */
|
|
|
|
/* Variables used in reading data back */
|
|
|
|
char buffer[CHUNKSIZE];
|
|
|
|
int i;
|
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
herr_t hrc;
|
2005-08-30 12:35:17 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
MPI_Offset filesize, /* actual file size */
|
|
|
|
est_filesize; /* estimated file size */
|
2005-08-30 12:35:17 +08:00
|
|
|
|
|
|
|
/* set up MPI parameters */
|
|
|
|
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
|
|
|
|
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
|
|
|
|
|
2005-09-06 04:23:02 +08:00
|
|
|
/* Only MAINPROCESS should create the file. Others just wait. */
|
|
|
|
if (MAINPROCESS){
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
dims[0]=nchunks*CHUNKSIZE;
|
2005-09-06 04:23:02 +08:00
|
|
|
/* Create the data space with unlimited dimensions. */
|
2006-06-27 22:45:06 +08:00
|
|
|
dataspace = H5Screate_simple (1, dims, maxdims);
|
2005-09-06 04:23:02 +08:00
|
|
|
VRFY((dataspace >= 0), "");
|
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
memspace = H5Screate_simple(1, chunk_dims, NULL);
|
|
|
|
VRFY((memspace >= 0), "");
|
2006-06-27 22:45:06 +08:00
|
|
|
|
2005-09-06 04:23:02 +08:00
|
|
|
/* Create a new file. If file exists its contents will be overwritten. */
|
2006-06-02 06:57:29 +08:00
|
|
|
file_id = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT,
|
|
|
|
H5P_DEFAULT);
|
|
|
|
VRFY((file_id >= 0), "H5Fcreate");
|
2005-09-06 04:23:02 +08:00
|
|
|
|
|
|
|
/* Modify dataset creation properties, i.e. enable chunking */
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
cparms = H5Pcreate(H5P_DATASET_CREATE);
|
2005-09-06 04:23:02 +08:00
|
|
|
VRFY((cparms >= 0), "");
|
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
hrc = H5Pset_chunk(cparms, 1, chunk_dims);
|
2005-09-06 04:23:02 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Create a new dataset within the file using cparms creation properties. */
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
|
2005-09-06 04:23:02 +08:00
|
|
|
VRFY((dataset >= 0), "");
|
|
|
|
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
if(write_pattern == sec_last) {
|
|
|
|
HDmemset(buffer, 100, CHUNKSIZE);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
count[0] = 1;
|
|
|
|
stride[0] = 1;
|
|
|
|
block[0] = chunk_dims[0];
|
|
|
|
offset[0] = (nchunks-2)*chunk_dims[0];
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
|
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
/* Write sec_last chunk */
|
|
|
|
hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
|
|
|
|
VRFY((hrc >= 0), "H5Dwrite");
|
|
|
|
} /* end if */
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2005-09-06 04:23:02 +08:00
|
|
|
/* Close resources */
|
|
|
|
hrc = H5Dclose (dataset);
|
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
dataset = -1;
|
|
|
|
|
|
|
|
hrc = H5Sclose (dataspace);
|
|
|
|
VRFY((hrc >= 0), "");
|
2005-09-06 04:23:02 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hrc = H5Sclose (memspace);
|
2005-09-06 04:23:02 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
hrc = H5Pclose (cparms);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
hrc = H5Fclose (file_id);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
file_id = -1;
|
|
|
|
|
|
|
|
/* verify file size */
|
|
|
|
filesize = get_filesize(filename);
|
[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
2007-10-12 00:24:11 +08:00
|
|
|
est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((filesize >= est_filesize), "file size check");
|
|
|
|
|
2005-09-06 04:23:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure all processes are done before exiting this routine. Otherwise,
|
|
|
|
* other tests may start and change the test data file before some processes
|
|
|
|
* of this test are still accessing the file.
|
|
|
|
*/
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2005-09-06 04:23:02 +08:00
|
|
|
MPI_Barrier(MPI_COMM_WORLD);
|
2006-06-27 22:45:06 +08:00
|
|
|
}
|
2005-08-30 12:35:17 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2005-08-30 12:35:17 +08:00
|
|
|
/*
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
* This program performs three different types of parallel access. It writes on
|
|
|
|
* the entire dataset, it extends the dataset to nchunks*CHUNKSIZE, and it only
|
|
|
|
* opens the dataset. At the end, it verifies the size of the dataset to be
|
|
|
|
* consistent with argument 'nchunks'.
|
2005-08-30 12:35:17 +08:00
|
|
|
*/
|
|
|
|
void
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
parallel_access_dataset(const char *filename, int nchunks, access_type action, hid_t *file_id, hid_t *dataset)
|
2005-08-30 12:35:17 +08:00
|
|
|
{
|
|
|
|
/* HDF5 gubbins */
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hid_t memspace, dataspace; /* HDF5 file identifier */
|
2005-09-02 22:44:40 +08:00
|
|
|
hid_t access_plist; /* HDF5 ID for file access property list */
|
|
|
|
herr_t hrc; /* HDF5 return code */
|
2005-08-30 12:35:17 +08:00
|
|
|
hsize_t size[1];
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hsize_t dim_size;
|
|
|
|
|
|
|
|
hsize_t chunk_dims[1] ={CHUNKSIZE};
|
|
|
|
hsize_t count[1];
|
|
|
|
hsize_t stride[1];
|
|
|
|
hsize_t block[1];
|
|
|
|
hsize_t offset[1]; /* Selection offset within dataspace */
|
|
|
|
/* Variables used in reading data back */
|
|
|
|
char buffer[CHUNKSIZE];
|
|
|
|
int i;
|
2005-08-30 12:35:17 +08:00
|
|
|
|
|
|
|
/* MPI Gubbins */
|
2005-09-02 22:44:40 +08:00
|
|
|
MPI_Offset filesize, /* actual file size */
|
|
|
|
est_filesize; /* estimated file size */
|
|
|
|
int mpierr;
|
2005-08-30 12:35:17 +08:00
|
|
|
|
|
|
|
/* Initialize MPI */
|
|
|
|
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
|
|
|
|
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
|
|
|
|
|
2005-09-02 22:44:40 +08:00
|
|
|
/* Set up MPIO file access property lists */
|
2005-08-30 12:35:17 +08:00
|
|
|
access_plist = H5Pcreate(H5P_FILE_ACCESS);
|
|
|
|
VRFY((access_plist >= 0), "");
|
|
|
|
|
2005-09-02 22:44:40 +08:00
|
|
|
hrc = H5Pset_fapl_mpio(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL);
|
2005-08-30 12:35:17 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Open the file */
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
if (*file_id<0){
|
|
|
|
*file_id = H5Fopen(filename, H5F_ACC_RDWR, access_plist);
|
|
|
|
VRFY((*file_id >= 0), "");
|
|
|
|
}
|
2005-08-30 12:35:17 +08:00
|
|
|
|
|
|
|
/* Open dataset*/
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
if (*dataset<0){
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
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
2007-10-09 03:59:36 +08:00
|
|
|
*dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((*dataset >= 0), "");
|
|
|
|
}
|
2005-08-30 12:35:17 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
memspace = H5Screate_simple(1, chunk_dims, NULL);
|
|
|
|
VRFY((memspace >= 0), "");
|
2005-08-30 12:35:17 +08:00
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
dataspace = H5Dget_space(*dataset);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((dataspace >= 0), "");
|
|
|
|
|
|
|
|
size[0] = nchunks*CHUNKSIZE;
|
|
|
|
|
|
|
|
switch (action) {
|
|
|
|
|
|
|
|
/* all chunks are written by all the processes in an interleaved way*/
|
|
|
|
case write_all:
|
|
|
|
|
2006-06-06 14:55:26 +08:00
|
|
|
memset(buffer, mpi_rank+1, CHUNKSIZE);
|
|
|
|
count[0] = 1;
|
|
|
|
stride[0] = 1;
|
|
|
|
block[0] = chunk_dims[0];
|
2006-06-27 22:45:06 +08:00
|
|
|
for (i=0; i<(nchunks+mpi_size-1)/mpi_size; i++){
|
2006-06-06 14:55:26 +08:00
|
|
|
if (i*mpi_size+mpi_rank < nchunks){
|
|
|
|
offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
|
|
|
|
|
|
|
|
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
|
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2006-06-06 14:55:26 +08:00
|
|
|
/* Write the buffer out */
|
|
|
|
hrc = H5Dwrite(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
|
|
|
|
VRFY((hrc >= 0), "H5Dwrite");
|
|
|
|
}
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* only extends the dataset */
|
|
|
|
case extend_only:
|
|
|
|
/* Extend dataset*/
|
[svn-r14192] Description:
Deprecate H5Dextend in favor of H5Dset_extent (without using API
versioning, due to changed behavior) and switch internal usage to H5Dset_extent
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
2007-10-08 23:26:02 +08:00
|
|
|
hrc = H5Dset_extent(*dataset, size);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* only opens the dataset */
|
|
|
|
case open_only:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2005-08-30 12:35:17 +08:00
|
|
|
|
|
|
|
/* Close up */
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hrc = H5Dclose(*dataset);
|
2005-08-30 12:35:17 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
*dataset = -1;
|
|
|
|
|
|
|
|
hrc = H5Sclose (dataspace);
|
|
|
|
VRFY((hrc >= 0), "");
|
2005-08-30 12:35:17 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hrc = H5Sclose (memspace);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
hrc = H5Fclose(*file_id);
|
2005-08-30 12:35:17 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
*file_id = -1;
|
2005-08-30 12:35:17 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
/* verify file size */
|
2005-09-02 22:44:40 +08:00
|
|
|
filesize = get_filesize(filename);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char);
|
|
|
|
VRFY((filesize >= est_filesize), "file size check");
|
2005-08-30 12:35:17 +08:00
|
|
|
|
2005-09-02 22:44:40 +08:00
|
|
|
/* Can close some plists */
|
|
|
|
hrc = H5Pclose(access_plist);
|
2005-08-30 12:35:17 +08:00
|
|
|
VRFY((hrc >= 0), "");
|
2005-09-06 04:23:02 +08:00
|
|
|
|
|
|
|
/* Make sure all processes are done before exiting this routine. Otherwise,
|
|
|
|
* other tests may start and change the test data file before some processes
|
|
|
|
* of this test are still accessing the file.
|
|
|
|
*/
|
|
|
|
MPI_Barrier(MPI_COMM_WORLD);
|
2005-08-30 12:35:17 +08:00
|
|
|
}
|
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
/*
|
|
|
|
* This routine verifies the data written in the dataset. It does one of the
|
2006-06-06 14:55:26 +08:00
|
|
|
* three cases according to the value of parameter `write_pattern'.
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
* 1. it returns correct fill values though the dataset has not been written;
|
|
|
|
* 2. it still returns correct fill values though only a small part is written;
|
|
|
|
* 3. it returns correct values when the whole dataset has been written in an
|
|
|
|
* interleaved pattern.
|
|
|
|
*/
|
2006-06-06 14:55:26 +08:00
|
|
|
void verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
{
|
|
|
|
/* HDF5 gubbins */
|
|
|
|
hid_t dataspace, memspace; /* HDF5 file identifier */
|
|
|
|
hid_t access_plist; /* HDF5 ID for file access property list */
|
|
|
|
herr_t hrc; /* HDF5 return code */
|
|
|
|
|
|
|
|
hsize_t chunk_dims[1] ={CHUNKSIZE};
|
|
|
|
hsize_t count[1];
|
|
|
|
hsize_t stride[1];
|
|
|
|
hsize_t block[1];
|
|
|
|
hsize_t offset[1]; /* Selection offset within dataspace */
|
|
|
|
/* Variables used in reading data back */
|
|
|
|
char buffer[CHUNKSIZE];
|
|
|
|
int value, i;
|
|
|
|
int index, current;
|
|
|
|
|
|
|
|
/* MPI Gubbins */
|
|
|
|
MPI_Offset filesize, /* actual file size */
|
|
|
|
est_filesize; /* estimated file size */
|
|
|
|
int mpierr;
|
|
|
|
|
|
|
|
/* Initialize MPI */
|
|
|
|
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
|
|
|
|
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
|
|
|
|
|
|
|
|
/* Set up MPIO file access property lists */
|
|
|
|
access_plist = H5Pcreate(H5P_FILE_ACCESS);
|
|
|
|
VRFY((access_plist >= 0), "");
|
|
|
|
|
|
|
|
hrc = H5Pset_fapl_mpio(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Open the file */
|
|
|
|
if (*file_id<0){
|
|
|
|
*file_id = H5Fopen(filename, H5F_ACC_RDWR, access_plist);
|
|
|
|
VRFY((*file_id >= 0), "");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Open dataset*/
|
|
|
|
if (*dataset<0){
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
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
2007-10-09 03:59:36 +08:00
|
|
|
*dataset = H5Dopen2(*file_id, DATASETNAME, H5P_DEFAULT);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((*dataset >= 0), "");
|
|
|
|
}
|
|
|
|
|
|
|
|
memspace = H5Screate_simple(1, chunk_dims, NULL);
|
|
|
|
VRFY((memspace >= 0), "");
|
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
dataspace = H5Dget_space(*dataset);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
VRFY((dataspace >= 0), "");
|
|
|
|
|
2006-06-06 14:55:26 +08:00
|
|
|
/* all processes check all chunks. */
|
|
|
|
count[0] = 1;
|
|
|
|
stride[0] = 1;
|
|
|
|
block[0] = chunk_dims[0];
|
2006-06-27 22:45:06 +08:00
|
|
|
for (i=0; i<nchunks; i++){
|
2006-06-06 14:55:26 +08:00
|
|
|
/* reset buffer values */
|
|
|
|
memset(buffer, -1, CHUNKSIZE);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2006-06-06 14:55:26 +08:00
|
|
|
offset[0] = i*chunk_dims[0];
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Read the chunk */
|
|
|
|
hrc = H5Dread(*dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
|
|
|
|
VRFY((hrc >= 0), "H5Dread");
|
|
|
|
|
2006-06-06 14:55:26 +08:00
|
|
|
/* set expected value according the write pattern */
|
|
|
|
switch (write_pattern) {
|
|
|
|
case all:
|
|
|
|
value = i%mpi_size + 1;
|
|
|
|
break;
|
|
|
|
case none:
|
|
|
|
value = 0;
|
|
|
|
break;
|
|
|
|
case sec_last:
|
|
|
|
if (i==(nchunks-2))
|
|
|
|
value = 100;
|
|
|
|
else
|
|
|
|
value = 0;
|
|
|
|
}
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
/* verify content of the chunk */
|
|
|
|
for (index = 0; index < CHUNKSIZE; index++)
|
|
|
|
VRFY((buffer[index] == value), "data verification");
|
2006-06-27 22:45:06 +08:00
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
hrc = H5Sclose (dataspace);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
hrc = H5Sclose (memspace);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Can close some plists */
|
|
|
|
hrc = H5Pclose(access_plist);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
|
|
|
|
/* Close up */
|
|
|
|
if (close){
|
|
|
|
hrc = H5Dclose(*dataset);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
*dataset = -1;
|
|
|
|
|
|
|
|
hrc = H5Fclose(*file_id);
|
|
|
|
VRFY((hrc >= 0), "");
|
|
|
|
*file_id = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure all processes are done before exiting this routine. Otherwise,
|
|
|
|
* other tests may start and change the test data file before some processes
|
|
|
|
* of this test are still accessing the file.
|
|
|
|
*/
|
|
|
|
MPI_Barrier(MPI_COMM_WORLD);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Test following possible scenarios,
|
|
|
|
* Case 1:
|
|
|
|
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
|
|
|
|
* size, no write, close, reopen in parallel, read to verify all return
|
|
|
|
* the fill value.
|
|
|
|
* Case 2:
|
|
|
|
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
|
|
|
|
* size, no write, close, reopen in parallel, extend to large size, then close,
|
|
|
|
* then reopen in parallel and read to verify all return the fill value.
|
|
|
|
* Case 3:
|
|
|
|
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
|
|
|
|
* size, write just a small part of the dataset (second to the last), close,
|
|
|
|
* then reopen in parallel, read to verify all return the fill value except
|
|
|
|
* those small portion that has been written. Without closing it, writes
|
|
|
|
* all parts of the dataset in a interleave pattern, close it, and reopen
|
|
|
|
* it, read to verify all data are as written.
|
|
|
|
*/
|
2005-08-30 12:35:17 +08:00
|
|
|
void
|
|
|
|
test_chunk_alloc(void)
|
|
|
|
{
|
|
|
|
const char *filename;
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
hid_t file_id, dataset;
|
|
|
|
|
|
|
|
file_id = dataset = -1;
|
2006-06-27 22:45:06 +08:00
|
|
|
|
2005-08-30 12:35:17 +08:00
|
|
|
filename = GetTestParameters();
|
|
|
|
if (VERBOSE_MED)
|
|
|
|
printf("Extend Chunked allocation test on file %s\n", filename);
|
|
|
|
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
/* Case 1 */
|
|
|
|
/* Create chunked dataset without writing anything.*/
|
|
|
|
create_chunked_dataset(filename, DSETCHUNKS, none);
|
|
|
|
/* reopen dataset in parallel and check for file size */
|
|
|
|
parallel_access_dataset(filename, DSETCHUNKS, open_only, &file_id, &dataset);
|
|
|
|
/* reopen dataset in parallel, read and verify the data */
|
2006-06-27 22:45:06 +08:00
|
|
|
verify_data(filename, DSETCHUNKS, none, CLOSE, &file_id, &dataset);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
|
|
|
/* Case 2 */
|
|
|
|
/* Create chunked dataset without writing anything */
|
|
|
|
create_chunked_dataset(filename, 20, none);
|
|
|
|
/* reopen dataset in parallel and only extend it */
|
|
|
|
parallel_access_dataset(filename, DSETCHUNKS, extend_only, &file_id, &dataset);
|
|
|
|
/* reopen dataset in parallel, read and verify the data */
|
|
|
|
verify_data(filename, DSETCHUNKS, none, CLOSE, &file_id, &dataset);
|
|
|
|
|
|
|
|
/* Case 3 */
|
|
|
|
/* Create chunked dataset and write in the second to last chunk */
|
|
|
|
create_chunked_dataset(filename, DSETCHUNKS, sec_last);
|
|
|
|
/* Reopen dataset in parallel, read and verify the data. The file and dataset are not closed*/
|
2006-06-27 22:45:06 +08:00
|
|
|
verify_data(filename, DSETCHUNKS, sec_last, NO_CLOSE, &file_id, &dataset);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
/* All processes write in all the chunks in a interleaved way */
|
|
|
|
parallel_access_dataset(filename, DSETCHUNKS, write_all, &file_id, &dataset);
|
|
|
|
/* reopen dataset in parallel, read and verify the data */
|
2006-06-27 22:45:06 +08:00
|
|
|
verify_data(filename, DSETCHUNKS, all, CLOSE, &file_id, &dataset);
|
[svn-r12380] Purpose:
Feature
(Code and tests are done by Christian. I just committed the code.)
Description:
Rewrote the purpose of this test. Now it tests these three cases,
/*
* Test following possible scenarios,
* Case 1:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, no write, close, reopen in parallel, read to verify all return
* the fill value.
* Case 2:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY but small
* size, no write, close, reopen in parallel, extend to large size, then close,
* then reopen in parallel and read to verify all return the fill value.
* Case 3:
* Sequential create a file and dataset with H5D_ALLOC_TIME_EARLY and large
* size, write just a small part of the dataset (second to the last), close,
* then reopen in parallel, read to verify all return the fill value except
* those small portion that has been written. Without closing it, writes
* all parts of the dataset in a interleave pattern, close it, and reopen
* it, read to verify all data are as written.
*/
Platforms tested:
Tested in copper, tg-ncsa and heping, all in parallel mode.
2006-05-27 06:11:00 +08:00
|
|
|
|
2005-08-30 12:35:17 +08:00
|
|
|
}
|