summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpiposix.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2013-01-08 01:19:17 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2013-01-08 01:19:17 (GMT)
commit724a0a93b4c6d00a47431d4c33fbedc4e402c2c4 (patch)
tree2a5e8962d028f9c3269bde09652da38110a99fa5 /src/H5FDmpiposix.c
parent38517de982be2c3abc2abc53e5096f5ef57c5ab5 (diff)
downloadhdf5-724a0a93b4c6d00a47431d4c33fbedc4e402c2c4.zip
hdf5-724a0a93b4c6d00a47431d4c33fbedc4e402c2c4.tar.gz
hdf5-724a0a93b4c6d00a47431d4c33fbedc4e402c2c4.tar.bz2
[svn-r23142] Purpose:
Merged 23111 from the trunk. (Core VFD and Mac OS X I/O changes) Tested on: 64-bit Windows 7, Visual Studio 2010, CMake 64-bit Mac OS X Snow Leopard (Fred), Fortran, C++ 64-bit BE Linux (Ostrich), Fortran, C++ 32-bit LE LInux (jam), Fortran, C++ (also parallel w/ Fortran)
Diffstat (limited to 'src/H5FDmpiposix.c')
-rw-r--r--src/H5FDmpiposix.c62
1 files changed, 22 insertions, 40 deletions
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 9cf8b45..725913c 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -71,21 +71,6 @@
*/
static hid_t H5FD_MPIPOSIX_g = 0;
-/* Since Windows doesn't follow the rest of the world when it comes
- * to POSIX I/O types, some typedefs and constants are needed to avoid
- * making the code messy with #ifdefs.
- */
-#ifdef H5_HAVE_WIN32_API
-typedef unsigned int h5_mpiposix_io_t;
-typedef int h5_mpiposix_io_ret_t;
-static int H5_MPIPOSIX_MAX_IO_BYTES_g = INT_MAX;
-#else
-/* Unix, everyone else */
-typedef size_t h5_mpiposix_io_t;
-typedef ssize_t h5_mpiposix_io_ret_t;
-static size_t H5_MPIPOSIX_MAX_IO_BYTES_g = SSIZET_MAX;
-#endif /* H5_HAVE_WIN32_API */
-
/*
* The description of a file belonging to this driver.
* The EOF value is only used just after the file is opened in order for the
@@ -236,19 +221,16 @@ static const H5FD_class_mpi_t H5FD_mpiposix_g = {
};
-/*--------------------------------------------------------------------------
-NAME
- H5FD_mpiposix_init_interface -- Initialize interface-specific information
-USAGE
- herr_t H5FD_mpiposix_init_interface()
-
-RETURNS
- Non-negative on success/Negative on failure
-DESCRIPTION
- Initializes any interface-specific data or routines. (Just calls
- H5FD_mpiposix_init currently).
-
---------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------
+ * Function: H5FD_mpiposix_init_interface
+ *
+ * Purpose: Initializes any interface-specific data or routines.
+ *
+ * Return: Success: The driver ID for the mpiposix driver.
+ * Failure: Negative.
+ *
+ *-------------------------------------------------------------------------
+ */
static herr_t
H5FD_mpiposix_init_interface(void)
{
@@ -1079,16 +1061,16 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id,
*/
while(size > 0) {
- h5_mpiposix_io_t bytes_in = 0; /* # of bytes to read */
- h5_mpiposix_io_ret_t bytes_read = -1; /* # of bytes actually read */
+ h5_posix_io_t bytes_in = 0; /* # of bytes to read */
+ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
/* Trying to read more bytes than the return type can handle is
* undefined behavior in POSIX.
*/
- if(size > H5_MPIPOSIX_MAX_IO_BYTES_g)
- bytes_in = H5_MPIPOSIX_MAX_IO_BYTES_g;
+ if(size > H5_POSIX_MAX_IO_BYTES)
+ bytes_in = H5_POSIX_MAX_IO_BYTES;
else
- bytes_in = (h5_mpiposix_io_t)size;
+ bytes_in = (h5_posix_io_t)size;
do {
bytes_read = HDread(file->fd, buf, bytes_in);
@@ -1099,7 +1081,7 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id,
time_t mytime = HDtime(NULL);
HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset);
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)myoffset);
} /* end if */
if(0 == bytes_read) {
@@ -1263,16 +1245,16 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
*/
while(size > 0) {
- h5_mpiposix_io_t bytes_in = 0; /* # of bytes to write */
- h5_mpiposix_io_ret_t bytes_wrote = -1; /* # of bytes actually written */
+ h5_posix_io_t bytes_in = 0; /* # of bytes to write */
+ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes actually written */
/* Trying to write more bytes than the return type can handle is
* undefined behavior in POSIX.
*/
- if(size > H5_MPIPOSIX_MAX_IO_BYTES_g)
- bytes_in = H5_MPIPOSIX_MAX_IO_BYTES_g;
+ if(size > H5_POSIX_MAX_IO_BYTES)
+ bytes_in = H5_POSIX_MAX_IO_BYTES;
else
- bytes_in = (h5_mpiposix_io_t)size;
+ bytes_in = (h5_posix_io_t)size;
do {
bytes_wrote = HDwrite(file->fd, buf, bytes_in);
@@ -1283,7 +1265,7 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
time_t mytime = HDtime(NULL);
HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed: time = %s, file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset);
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file write failed: time = %s, file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)myoffset);
} /* end if */
if(0 == bytes_wrote) {