diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-10-31 21:46:58 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-10-31 21:46:58 (GMT) |
commit | d677a77c4d56460b7e0238ba512933c7fd67e3d6 (patch) | |
tree | af5e59454b544db6056964d08d010febd3e56647 /src/H5FPserver.c | |
parent | 61d964625ebb39af5326bc11dc52790ab39c8202 (diff) | |
download | hdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.zip hdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.tar.gz hdf5-d677a77c4d56460b7e0238ba512933c7fd67e3d6.tar.bz2 |
[svn-r7805] Purpose:
Bug Fix
Description:
The End of Address information needed to be kept by the SAP. Some
processes were trying to get the EOA information in collective mode,
but the action wasn't collective at the time.
Solution:
Keep the EOA information for the file on the SAP. Clients query the
SAP to get/set it when needed.
Platforms tested:
Linux (w/ FPHDF5)
Copper (w/o FPHDF5)
(FPHDF5 specific, so no need for full testing)
Misc. update:
Diffstat (limited to 'src/H5FPserver.c')
-rw-r--r-- | src/H5FPserver.c | 112 |
1 files changed, 95 insertions, 17 deletions
diff --git a/src/H5FPserver.c b/src/H5FPserver.c index 5d85021..06ac060 100644 --- a/src/H5FPserver.c +++ b/src/H5FPserver.c @@ -164,6 +164,8 @@ static herr_t H5FP_sap_handle_flush_request(H5FP_request_t *req); static herr_t H5FP_sap_handle_close_request(H5FP_request_t *req); static herr_t H5FP_sap_handle_alloc_request(H5FP_request_t *req); static herr_t H5FP_sap_handle_free_request(H5FP_request_t *req); +static herr_t H5FP_sap_handle_get_eoa_request(H5FP_request_t *req); +static herr_t H5FP_sap_handle_set_eoa_request(H5FP_request_t *req); static herr_t H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req); /* @@ -240,6 +242,12 @@ H5FP_sap_receive_loop(void) case H5FP_REQ_FREE: hrc = H5FP_sap_handle_free_request(&req); break; + case H5FP_REQ_GET_EOA: + hrc = H5FP_sap_handle_get_eoa_request(&req); + break; + case H5FP_REQ_SET_EOA: + hrc = H5FP_sap_handle_set_eoa_request(&req); + break; case H5FP_REQ_UPDATE_EOMA_EOSDA: hrc = H5FP_sap_handle_update_eoma_eosda_request(&req); break; @@ -1529,8 +1537,8 @@ H5FP_sap_handle_alloc_request(H5FP_request_t *req) "SAP unable to allocate file memory"); } - /* Get the EOA from the file. This call doesn't fail. */ - sap_alloc.eoa = ((H5FD_t*)&info->file)->cls->get_eoa((H5FD_t*)&info->file); + /* Get the EOA. */ + sap_alloc.eoa = ((H5FD_fphdf5_t*)&info->file)->eoa; sap_alloc.status = H5FP_STATUS_OK; } else { sap_alloc.addr = HADDR_UNDEF; @@ -1579,8 +1587,8 @@ H5FP_sap_handle_free_request(H5FP_request_t *req) "SAP unable to free metadata block"); } - /* Get the EOA - This call doesn't fail */ - sap_alloc.eoa = ((H5FD_t*)&info->file)->cls->get_eoa((H5FD_t*)&info->file); + /* Get the EOA. */ + sap_alloc.eoa = ((H5FD_fphdf5_t*)&info->file)->eoa; sap_alloc.status = H5FP_STATUS_OK; } else { sap_alloc.status = H5FP_STATUS_CANT_FREE; @@ -1595,6 +1603,77 @@ done: } /* + * Function: H5FP_sap_handle_get_eoa_request + * Purpose: Handle a request for the EOA of the file. + * Return: Success: SUCCEED + * Failure: FAIL + * Programmer: Bill Wendling, 31. October 2003 + * Modifications: + */ +static herr_t +H5FP_sap_handle_get_eoa_request(H5FP_request_t *req) +{ + H5FP_eoa_t sap_eoa; + H5FP_file_info *info; + int mrc; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOINIT(H5FP_sap_handle_get_eoa_request); + + sap_eoa.req_id = req->req_id; + sap_eoa.file_id = req->file_id; + + if ((info = H5FP_find_file_info(req->file_id)) != NULL) { + /* Get the EOA. */ + sap_eoa.eoa = ((H5FD_fphdf5_t*)&info->file)->eoa; + sap_eoa.status = H5FP_STATUS_OK; + } else { + sap_eoa.eoa = HADDR_UNDEF; + sap_eoa.status = H5FP_STATUS_CANT_ALLOC; + ret_value = FAIL; + } + +done: + if ((mrc = MPI_Send(&sap_eoa, 1, H5FP_eoa, (int)req->proc_rank, + H5FP_TAG_EOA, H5FP_SAP_COMM)) != MPI_SUCCESS) + HMPI_DONE_ERROR(FAIL, "MPI_Send failed", mrc); + + FUNC_LEAVE_NOAPI(ret_value); +} + +/* + * Function: H5FP_sap_handle_set_eoa_request + * Purpose: Handle a request setting the EOA of the file. + * Return: Success: SUCCEED + * Failure: FAIL + * Programmer: Bill Wendling, 31. October 2003 + * Modifications: + */ +static herr_t +H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) +{ + H5FP_status_t exit_state = H5FP_STATUS_OK; + H5FP_file_info *info; + int mrc; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOINIT(H5FP_sap_handle_set_eoa_request); + + if ((info = H5FP_find_file_info(req->file_id)) != NULL) { + /* Get the EOA. */ + ((H5FD_fphdf5_t*)&info->file)->eoa = req->addr; + exit_state = H5FP_STATUS_OK; + } else { + exit_state = H5FP_STATUS_CANT_ALLOC; + ret_value = FAIL; + } + +done: + H5FP_send_reply(req->proc_rank, req->req_id, req->file_id, exit_state); + FUNC_LEAVE_NOAPI(ret_value); +} + +/* * Function: H5FP_sap_handle_update_eoma_eosda_request * Purpose: Handle a request to update the EOMA and EOSDA for a file. * Return: Success: SUCCEED @@ -1605,7 +1684,7 @@ done: static herr_t H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req) { - H5FP_alloc_t sap_alloc; + H5FP_eoa_t sap_eoa; H5FP_file_info *info; H5FP_status_t exit_state = H5FP_STATUS_OK; herr_t ret_value = SUCCEED; @@ -1613,10 +1692,9 @@ H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req) FUNC_ENTER_NOINIT(H5FP_sap_handle_update_eoma_eosda_request); - sap_alloc.req_id = req->req_id; - sap_alloc.file_id = req->file_id; - sap_alloc.status = H5FP_STATUS_OK; - sap_alloc.addr = HADDR_UNDEF; + sap_eoa.req_id = req->req_id; + sap_eoa.file_id = req->file_id; + sap_eoa.status = H5FP_STATUS_OK; if ((info = H5FP_find_file_info(req->file_id)) != NULL) { H5FD_t *f = (H5FD_t*)&info->file; @@ -1625,7 +1703,7 @@ H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req) if (H5FD_free(f, H5FD_MEM_DEFAULT, H5P_DEFAULT, f->eoma, f->cur_meta_block_size) != SUCCEED) { exit_state = H5FP_STATUS_CANT_FREE; - sap_alloc.status = H5FP_STATUS_CANT_FREE; + sap_eoa.status = H5FP_STATUS_CANT_FREE; HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "SAP unable to free metadata block"); } @@ -1638,7 +1716,7 @@ H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req) if (H5FD_free(f, H5FD_MEM_DRAW, H5P_DEFAULT, f->eosda, f->cur_sdata_block_size) != SUCCEED) { exit_state = H5FP_STATUS_CANT_FREE; - sap_alloc.status = H5FP_STATUS_CANT_FREE; + sap_eoa.status = H5FP_STATUS_CANT_FREE; HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "SAP unable to free 'small data' block"); } @@ -1647,16 +1725,16 @@ H5FP_sap_handle_update_eoma_eosda_request(H5FP_request_t *req) f->eosda = 0; f->cur_sdata_block_size = 0; - /* Get the EOA from the file. This call doesn't fail. */ - sap_alloc.eoa = ((H5FD_t*)&info->file)->cls->get_eoa((H5FD_t*)&info->file); + /* Get the EOA. */ + sap_eoa.eoa = ((H5FD_fphdf5_t*)&info->file)->eoa; } else { - sap_alloc.eoa = HADDR_UNDEF; - sap_alloc.status = H5FP_STATUS_CANT_FREE; + sap_eoa.eoa = HADDR_UNDEF; + sap_eoa.status = H5FP_STATUS_CANT_FREE; } done: - if ((mrc = MPI_Send(&sap_alloc, 1, H5FP_alloc, (int)req->proc_rank, - H5FP_TAG_ALLOC, H5FP_SAP_COMM)) != MPI_SUCCESS) + if ((mrc = MPI_Send(&sap_eoa, 1, H5FP_eoa, (int)req->proc_rank, + H5FP_TAG_EOA, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_DONE_ERROR(FAIL, "MPI_Send failed", mrc); FUNC_LEAVE_NOAPI(ret_value); |