summaryrefslogtreecommitdiffstats
path: root/src/H5FDfphdf5.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-03-27 21:34:21 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-03-27 21:34:21 (GMT)
commitfc295015d8500f495f5de9d6c9b007c45d21ca3e (patch)
treea083a96c2fbcfd2a3d26ff5cff69b829115c09fa /src/H5FDfphdf5.c
parent5d51e5adebb7d20c132eab84ca5b3d16354d2acc (diff)
downloadhdf5-fc295015d8500f495f5de9d6c9b007c45d21ca3e.zip
hdf5-fc295015d8500f495f5de9d6c9b007c45d21ca3e.tar.gz
hdf5-fc295015d8500f495f5de9d6c9b007c45d21ca3e.tar.bz2
[svn-r6527] Purpose:
Bug Fix & Update Description: FPHDF5 was creating files which didn't have the EOA field in the superblock set correctly. It turns out that the SAP was keeping this information to itself instead of giving it to the client processes. Naughty SAP! Solution: Have the SAP send this information back to the clients so that they can update the superblock as necessary. This now creates a file (with just the root group) that looks correct! Only problem is that there's extra file space being allocated. Also, at program termination, there's an infinite loop... Platforms tested: H5committests (run by hand on burrwhite, arabica, and modi4) Misc. update:
Diffstat (limited to 'src/H5FDfphdf5.c')
-rw-r--r--src/H5FDfphdf5.c57
1 files changed, 12 insertions, 45 deletions
diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c
index ce293bb..3cbe426 100644
--- a/src/H5FDfphdf5.c
+++ b/src/H5FDfphdf5.c
@@ -1402,9 +1402,6 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
FUNC_ENTER_NOAPI(H5FD_fphdf5_write, FAIL);
-HDfprintf(stderr, "%s: Entering: rank==%d, addr==%a, size==%Zu\n",
- FUNC, file->mpi_rank, addr, size);
-
/* check args */
assert(file);
assert(file->pub.driver_id == H5FD_FPHDF5);
@@ -1447,9 +1444,6 @@ HDfprintf(stderr, "%s: Entering: rank==%d, addr==%a, size==%Zu\n",
&block_before_meta_write) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property");
-HDfprintf(stderr, "%s: %d: block_before_meta_write == %d\n", FUNC,
- H5FD_fphdf5_mpi_rank(_file), block_before_meta_write);
-
if (block_before_meta_write)
if ((mrc = MPI_Barrier(file->barrier_comm)) != MPI_SUCCESS)
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
@@ -1478,8 +1472,6 @@ HDfprintf(stderr, "%s:%d: Couldn't write metadata to SAP (%d)\n",
switch (sap_status) {
case H5FP_STATUS_OK:
-HDfprintf(stderr, "%s: %d: Wrote the data to the SAP\n", FUNC,
- H5FD_fphdf5_mpi_rank(_file));
/* WAH-HOO! We've written it! We can leave now */
/* Forget the EOF value (see H5FD_fphdf5_get_eof()) */
file->eof = HADDR_UNDEF;
@@ -1501,7 +1493,6 @@ HDfprintf(stderr, "%s: Couldn't write metadata to SAP (%d)\n",
ret_value = H5FD_fphdf5_write_real(_file, dxpl_id, mpi_off, size_i, buf);
done:
-HDfprintf(stderr, "%s: Leaving\n", FUNC);
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -1536,9 +1527,6 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
FUNC_ENTER_NOAPI(H5FD_fphdf5_write_real, FAIL);
-HDfprintf(stderr, "%s: %d: Entering: addr=%a, size=%Zu\n", FUNC,
- H5FD_fphdf5_mpi_rank(_file), (haddr_t)mpi_off, size);
-
/* check args */
assert(file);
assert(file->pub.driver_id == H5FD_FPHDF5);
@@ -1603,22 +1591,6 @@ HDfprintf(stderr, "%s: %d: Entering: addr=%a, size=%Zu\n", FUNC,
/* Write the data. */
assert(xfer_mode == H5FD_MPIO_INDEPENDENT || xfer_mode == H5FD_MPIO_COLLECTIVE);
- {
- int i;
-
- sleep(3);
- HDfprintf(stderr, "%s: writing at %a\n", FUNC, (haddr_t)mpi_off);
-
- for (i = 0; i < size; ++i) {
- if (i % 7 == 0)
- HDfprintf(stderr, "\n");
-
- HDfprintf(stderr, "\t0x%02x", 0xff & ((char*)buf)[i]);
- }
-
- HDfprintf(stderr, "\n");
- }
-
if (xfer_mode == H5FD_MPIO_INDEPENDENT) {
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
if ((mrc = MPI_File_write_at(file->f, mpi_off, (void*)buf,
@@ -1688,7 +1660,6 @@ HDfprintf(stderr, "%s: %d: Entering: addr=%a, size=%Zu\n", FUNC,
file->eof = HADDR_UNDEF;
done:
-HDfprintf(stderr, "%s: %d: Leaving (%d)\n", FUNC, H5FD_fphdf5_mpi_rank(_file), ret_value);
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -1715,9 +1686,6 @@ H5FD_fphdf5_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
FUNC_ENTER_NOAPI(H5FD_fphdf5_flush, FAIL);
-HDfprintf(stderr, "%s: %d: Entering\n",
- FUNC, H5FD_fphdf5_mpi_rank(_file));
-
/* check args */
assert(file);
assert(file->pub.driver_id == H5FD_FPHDF5);
@@ -1745,29 +1713,28 @@ HDfprintf(stderr, "%s: %d: Entering\n",
* finished making it the shorter length, potentially truncating
* the file and dropping the new data written)
*/
-HDfprintf(stderr, "%s: %d: MPI_Barrier==%d\n", FUNC, file->mpi_rank, file->barrier_comm);
- if ((mrc = MPI_Barrier(file->barrier_comm)) != MPI_SUCCESS)
+ if ((mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc);
/* Update the 'last' eoa value */
file->last_eoa = file->eoa;
}
- if (H5FP_request_flush_metadata(_file, file->file_id, dxpl_id,
- &req_id, &status) != SUCCEED) {
- /* FIXME: This failed */
+ /* Only the captain process needs to flush the metadata. */
+ if (H5FD_fphdf5_is_captain(_file)) {
+ if (H5FP_request_flush_metadata(_file, file->file_id, dxpl_id,
+ &req_id, &status) != SUCCEED) {
+ /* FIXME: This failed */
HDfprintf(stderr, "%s:%d: Flush failed (%d)\n", FUNC, __LINE__, status);
- }
+ }
- /* Only sync the file if we are not going to immediately close it */
- if (!closing)
- if ((mrc = MPI_File_sync(file->f)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc);
+ /* Only sync the file if we are not going to immediately close it */
+ if (!closing)
+ if ((mrc = MPI_File_sync(file->f)) != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mrc);
+ }
done:
-HDfprintf(stderr, "%s: %d: Leaving\n",
- FUNC, H5FD_fphdf5_mpi_rank(_file));
-
FUNC_LEAVE_NOAPI(ret_value);
}