summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2006-10-06 00:27:05 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2006-10-06 00:27:05 (GMT)
commitad80fe7ea97649a831087b52f1a81546000f7c7d (patch)
tree250b4bb0b07c443481fc2af68418a7d0c35320b8 /testpar
parent831be1cdff55df0e00163d0069171bbdde2b1d25 (diff)
downloadhdf5-ad80fe7ea97649a831087b52f1a81546000f7c7d.zip
hdf5-ad80fe7ea97649a831087b52f1a81546000f7c7d.tar.gz
hdf5-ad80fe7ea97649a831087b52f1a81546000f7c7d.tar.bz2
[svn-r12725] Purpose:
Bug Fix (Bug 544) Description: SGI Altix's MPI_File_get_size overflowed at 2GB and more. Put in a temporary patch to use stat() instead to make Cobalt passing on this test (bigdset). A better fix (like detect if MPI_File_get_size does not work before using this is preferred.) Tested: Cobalt and Heping.
Diffstat (limited to 'testpar')
-rw-r--r--testpar/testphdf5.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index 4b0d5b3..e35bfed 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -310,10 +310,15 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type,
/*
* Check the size of a file using MPI routines
+ * Temporary hack: SGI Altix MPI_File_get_size() does not work correctly
+ * for size >= 2GB. Use stat for now.
+ * If stat() does not work for other systems, need to make it conditional
+ * compile for Altix only.
*/
MPI_Offset
h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info)
{
+#if 0
MPI_File fh; /* MPI file handle */
MPI_Offset size=0; /* File size to return */
@@ -325,6 +330,23 @@ h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info)
if (MPI_SUCCESS != MPI_File_close(&fh))
size=0;
+#else
+ MPI_Offset size=0; /* File size to return */
+#ifdef H5_HAVE_STAT64
+ /* use stat64 if available */
+ struct stat64 mystat;
+#else
+ struct stat mystat;
+#endif
+
+#ifdef H5_HAVE_STAT64
+ stat(filename, &mystat);
+#else
+ stat(filename, &mystat);
+#endif
+
+ size = mystat.st_size;
+#endif
done:
return(size);