diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-03-21 15:10:17 (GMT) |
commit | eb89d7b53ab95623ab454186a602e1cafc7391f0 (patch) | |
tree | ceafe458b3011e38853e765352d3c7e59bbecce1 /src/H5FDmpio.c | |
parent | 3e468e6ff65d540a439e99ea568a6bff7add7cea (diff) | |
download | hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2 |
[svn-r22105] Description:
Bring r20557:22085 from trunk to this branch, also fixing some other
issues/failures in the branch simultaneously. The h5repack tests are still
failing, but Neil will be checking into those, so the branch can be fully
functional again.
Tested on:
Mac OSX/64 10.7.3 (amazon) w/debug
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r-- | src/H5FDmpio.c | 118 |
1 files changed, 45 insertions, 73 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index b382fb4..d780ceb 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -65,6 +65,7 @@ typedef struct H5FD_mpio_t { /* Private Prototypes */ /* Callbacks */ +static herr_t H5FD_mpio_term(void); static void *H5FD_mpio_fapl_get(H5FD_t *_file); static void *H5FD_mpio_fapl_copy(const void *_old_fa); static herr_t H5FD_mpio_fapl_free(void *_fa); @@ -98,6 +99,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = { "mpio", /*name */ HADDR_MAX, /*maxaddr */ H5F_CLOSE_SEMI, /* fc_degree */ + H5FD_mpio_term, /*terminate */ NULL, /*sb_size */ NULL, /*sb_encode */ NULL, /*sb_decode */ @@ -169,7 +171,7 @@ DESCRIPTION static herr_t H5FD_mpio_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpio_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_mpio_init()) } /* H5FD_mpio_init_interface() */ @@ -200,7 +202,7 @@ H5FD_mpio_init(void) #endif /* H5FDmpio_DEBUG */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if (H5I_VFL!=H5I_get_type(H5FD_MPIO_g)) H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g,sizeof(H5FD_class_mpi_t),FALSE); @@ -234,24 +236,22 @@ done: * * Purpose: Shut down the VFD * - * Return: <none> + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_mpio_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpio_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_MPIO_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpio_term() */ @@ -321,7 +321,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iMcMi", fapl_id, comm, info); if(fapl_id == H5P_DEFAULT) @@ -392,7 +392,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, comm, info); if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -466,7 +466,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDt", dxpl_id, xfer_mode); if(dxpl_id==H5P_DEFAULT) @@ -516,7 +516,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_dxpl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", dxpl_id, xfer_mode); if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) @@ -563,7 +563,7 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_collective_opt, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDc", dxpl_id, opt_mode); if(dxpl_id == H5P_DEFAULT) @@ -615,7 +615,7 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDh", dxpl_id, opt_mode); if(dxpl_id == H5P_DEFAULT) @@ -662,7 +662,7 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt_num, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", dxpl_id, num_chunk_per_proc); if(dxpl_id == H5P_DEFAULT) @@ -709,7 +709,7 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt_ratio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", dxpl_id, percent_num_proc_per_chunk); if(dxpl_id == H5P_DEFAULT) @@ -758,7 +758,7 @@ H5FD_mpio_fapl_get(H5FD_t *_file) H5FD_mpio_fapl_t *fa = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); HDassert(H5FD_MPIO == file->pub.driver_id); @@ -801,7 +801,7 @@ H5FD_mpio_fapl_copy(const void *_old_fa) const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa; H5FD_mpio_fapl_t *new_fa = NULL; - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "enter H5FD_mpio_fapl_copy\n"); @@ -855,7 +855,7 @@ H5FD_mpio_fapl_free(void *_fa) herr_t ret_value = SUCCEED; H5FD_mpio_fapl_t *fa = (H5FD_mpio_fapl_t*)_fa; - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_free, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "in H5FD_mpio_fapl_free\n"); @@ -867,7 +867,6 @@ fprintf(stderr, "in H5FD_mpio_fapl_free\n"); H5FD_mpi_comm_info_free(&fa->comm, &fa->info); H5MM_xfree(fa); -done: #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); @@ -940,10 +939,10 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, MPI_Info info_dup=MPI_INFO_NULL; H5FD_t *ret_value; /* Return value */ #ifndef H5_HAVE_MPI_GET_SIZE - struct stat stat_buf; + h5_stat_t stat_buf; #endif - FUNC_ENTER_NOAPI(H5FD_mpio_open, NULL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) { @@ -1103,7 +1102,7 @@ H5FD_mpio_close(H5FD_t *_file) int mpi_code; /* MPI return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1156,19 +1155,18 @@ done: static herr_t H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) { - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_mpio_query, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ + *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1197,18 +1195,13 @@ static haddr_t H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } @@ -1237,17 +1230,15 @@ static herr_t H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); file->eoa = addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1284,18 +1275,13 @@ static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_get_eof, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->eof; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eof) } @@ -1319,7 +1305,7 @@ H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1417,7 +1403,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1701,7 +1687,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1876,7 +1862,7 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing) int mpi_code; /* mpi return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) @@ -1920,7 +1906,7 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) H5FD_mpio_t *file = (H5FD_mpio_t*)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) @@ -2010,18 +1996,13 @@ static int H5FD_mpio_mpi_rank(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_mpi_rank, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_rank; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_rank) } /* end H5FD_mpio_mpi_rank() */ @@ -2044,18 +2025,13 @@ static int H5FD_mpio_mpi_size(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_mpi_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_size; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_size) } /* end H5FD_mpio_mpi_size() */ @@ -2079,18 +2055,14 @@ static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - MPI_Comm ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_communicator, MPI_COMM_NULL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->comm; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->comm) } #endif /* H5_HAVE_PARALLEL */ + |