summaryrefslogtreecommitdiffstats
path: root/testpar/testphdf5.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-09-16 17:33:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-09-16 17:33:00 (GMT)
commitd7bde16f45fac765f45172d88a1a9cd44a1f95fa (patch)
treebe73c954ea0220b752cfbb49597e35954aa47cd9 /testpar/testphdf5.c
parentbf1c2f0e8bf9788c2e47a1b1ac963cc321afab0e (diff)
downloadhdf5-d7bde16f45fac765f45172d88a1a9cd44a1f95fa.zip
hdf5-d7bde16f45fac765f45172d88a1a9cd44a1f95fa.tar.gz
hdf5-d7bde16f45fac765f45172d88a1a9cd44a1f95fa.tar.bz2
[svn-r7480] Purpose:
Bug fix Description: The MPI_File_set_size() routine on ASCI Red is not able to extend files so that they are larger than 2GB. Solution: Add an extra macro which controls whether MPI_File_set_size() can handle >2GB offsets or if our "older" way of reading a byte, then writing a byte at the appropriate offset should be used. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'testpar/testphdf5.c')
-rw-r--r--testpar/testphdf5.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 6a4a0b2..ff44424 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -44,9 +44,10 @@ int doread=1; /* read test */
int dowrite=1; /* write test */
int docompact=1; /* compact dataset test */
int doindependent=1; /* independent test */
+unsigned dobig=1; /* "big" dataset tests */
/* FILENAME and filenames must have the same number of names */
-const char *FILENAME[8]={
+const char *FILENAME[9]={
"ParaEg1",
"ParaEg2",
"ParaEg3",
@@ -54,8 +55,9 @@ const char *FILENAME[8]={
"ParaMgroup",
"ParaCompact",
"ParaIndividual",
+ "ParaBig",
NULL};
-char filenames[8][PATH_MAX];
+char filenames[9][PATH_MAX];
hid_t fapl; /* file access property list */
#ifdef USE_PAUSE
@@ -177,6 +179,8 @@ parse_options(int argc, char **argv)
break;
case 'i': doindependent = 0;
break;
+ case 'b': dobig = 0;
+ break;
case 'v': verbose = 1;
break;
case 'f': if (--argc < 1) {
@@ -326,6 +330,27 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type,
return (ret_pl);
}
+/*
+ * Check the size of a file using MPI routines
+ */
+MPI_Offset
+h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info)
+{
+ MPI_File fh; /* MPI file handle */
+ MPI_Offset size=0; /* File size to return */
+
+ if (MPI_SUCCESS != MPI_File_open(comm, (char*)filename, MPI_MODE_RDONLY, info, &fh))
+ goto done;
+
+ if (MPI_SUCCESS != (MPI_File_get_size(fh, &size)))
+ goto done;
+
+ if (MPI_SUCCESS != MPI_File_close(&fh))
+ size=0;
+
+done:
+ return(size);
+}
int main(int argc, char **argv)
{
@@ -445,7 +470,15 @@ int main(int argc, char **argv)
MPI_BANNER("Independent test skipped");
}
- if (!(dowrite || doread || ndatasets || ngroups || docompact)){
+ if (dobig && sizeof(MPI_Offset)>4){
+ MPI_BANNER("big dataset test...");
+ big_dataset(filenames[7]);
+ }
+ else {
+ MPI_BANNER("big dataset test skipped");
+ }
+
+ if (!(dowrite || doread || ndatasets || ngroups || docompact || doindependent || dobig)){
usage();
nerrors++;
}