mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r4327] Purpose:
More code cleanups Description: Wrap up the code cleanups for changing the dataset transfer property lists over to using the generic property list code. Platforms tested: IRIX64 6.5 (modi4)
This commit is contained in:
parent
d24ae52673
commit
80c02cc6f1
@ -50,7 +50,10 @@ nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id )
|
||||
return ret_value;
|
||||
}
|
||||
*/
|
||||
c_prp_id = H5Pcreate(c_classtype);
|
||||
if (H5I_GENPROP_CLS == H5Iget_type((hid_t)*classtype))
|
||||
c_prp_id = H5Pcreate_list((hid_t)*classtype);
|
||||
else
|
||||
c_prp_id = H5Pcreate(c_classtype);
|
||||
|
||||
if ( c_prp_id < 0 ) ret_value = -1;
|
||||
*prp_id = (hid_t_f)c_prp_id;
|
||||
@ -71,10 +74,13 @@ int_f
|
||||
nh5pclose_c ( hid_t_f *prp_id )
|
||||
{
|
||||
int ret_value = 0;
|
||||
hid_t c_prp_id;
|
||||
hid_t c_prp_id=(*prp_id);
|
||||
|
||||
c_prp_id = *prp_id;
|
||||
if ( H5Pclose(c_prp_id) < 0 ) ret_value = -1;
|
||||
if (H5I_GENPROP_LST == H5Iget_type(c_prp_id)) {
|
||||
if ( H5Pclose_list(c_prp_id) < 0 ) ret_value = -1;
|
||||
} else {
|
||||
if ( H5Pclose(c_prp_id) < 0 ) ret_value = -1;
|
||||
}
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@ -1133,7 +1139,8 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_
|
||||
int ret_value = -1;
|
||||
hid_t c_prp_id;
|
||||
herr_t ret;
|
||||
int c_mdc_nelmts, c_rdcc_nelmts;
|
||||
int c_mdc_nelmts;
|
||||
size_t c_rdcc_nelmts;
|
||||
size_t c_rdcc_nbytes;
|
||||
hid_t c_memb_plist;
|
||||
double c_rdcc_w0;
|
||||
|
@ -248,7 +248,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags,
|
||||
h5p_flags[0] = H5P_FILE_CREATE;
|
||||
h5p_flags[1] = H5P_FILE_ACCESS;
|
||||
h5p_flags[2] = H5P_DATASET_CREATE;
|
||||
h5p_flags[3] = H5P_DATASET_XFER;
|
||||
h5p_flags[3] = H5P_DATASET_XFER_NEW;
|
||||
h5p_flags[4] = H5P_MOUNT;
|
||||
h5p_flags[5] = H5P_DEFAULT;
|
||||
|
||||
|
@ -162,7 +162,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
|
||||
OutCount = 0;
|
||||
BitOffset = 0;
|
||||
|
||||
DataMask = (WORD)((1L << ((GifHead->PackedField & 0x07) +1)) -1);
|
||||
DataMask = (1L << ((GifHead->PackedField & 0x07) +1)) -1;
|
||||
Raster = GifImageDesc->GIFImage;
|
||||
|
||||
/* Check for image seperator */
|
||||
|
@ -340,7 +340,8 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
|
||||
H5TRACE2("e","iDt",dxpl_id,xfer_mode);
|
||||
|
||||
/* Check arguments */
|
||||
if (H5P_DATASET_XFER!=H5Pget_class(dxpl_id))
|
||||
if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) ||
|
||||
TRUE!=H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW))
|
||||
HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
|
||||
if (H5FD_MPIO_INDEPENDENT!=xfer_mode &&
|
||||
H5FD_MPIO_COLLECTIVE!=xfer_mode)
|
||||
@ -383,7 +384,8 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/)
|
||||
FUNC_ENTER(H5Pget_dxpl_mpio, FAIL);
|
||||
H5TRACE2("e","ix",dxpl_id,xfer_mode);
|
||||
|
||||
if (H5P_DATASET_XFER!=H5Pget_class(dxpl_id))
|
||||
if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) ||
|
||||
TRUE!=H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW))
|
||||
HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
|
||||
if (H5FD_MPIO!=H5P_get_driver(dxpl_id))
|
||||
HRETURN_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
|
||||
@ -1082,6 +1084,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
|
||||
#endif
|
||||
assert(file);
|
||||
assert(H5FD_MPIO==file->pub.driver_id);
|
||||
/* Make certain we have the correct type of property list */
|
||||
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
|
||||
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
|
||||
|
||||
/* some numeric conversions */
|
||||
if (haddr_to_MPIOff(addr, &mpi_off/*out*/)<0)
|
||||
@ -1097,7 +1102,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
|
||||
#endif
|
||||
|
||||
/* Obtain the data transfer properties */
|
||||
if (H5P_DEFAULT==dxpl_id || H5FD_MPIO!=H5P_get_driver(dxpl_id)) {
|
||||
if (H5FD_MPIO!=H5P_get_driver(dxpl_id)) {
|
||||
_dx.xfer_mode = H5FD_MPIO_INDEPENDENT; /*the default*/
|
||||
dx = &_dx;
|
||||
} else {
|
||||
@ -1312,7 +1317,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, haddr_t addr,
|
||||
H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t addr,
|
||||
size_t size, const void *buf)
|
||||
{
|
||||
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
|
||||
@ -1335,6 +1340,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/,
|
||||
#endif
|
||||
assert(file);
|
||||
assert(H5FD_MPIO==file->pub.driver_id);
|
||||
/* Make certain we have the correct type of property list */
|
||||
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
|
||||
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
|
||||
|
||||
/* some numeric conversions */
|
||||
if (haddr_to_MPIOff(addr, &mpi_off)<0)
|
||||
@ -1352,7 +1360,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/,
|
||||
#endif
|
||||
|
||||
/* Obtain the data transfer properties */
|
||||
if (H5P_DEFAULT==dxpl_id || H5FD_MPIO!=H5P_get_driver(dxpl_id)) {
|
||||
if (H5FD_MPIO!=H5P_get_driver(dxpl_id)) {
|
||||
_dx.xfer_mode = H5FD_MPIO_INDEPENDENT; /*the default*/
|
||||
dx = &_dx;
|
||||
} else {
|
||||
|
@ -585,7 +585,7 @@ dataset_writeAll(char *filename)
|
||||
}
|
||||
|
||||
/* set up the collective transfer properties list */
|
||||
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
|
||||
xfer_plist = H5Pcreate_list (H5P_DATASET_XFER_NEW);
|
||||
VRFY((xfer_plist >= 0), "");
|
||||
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
|
||||
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
|
||||
@ -617,7 +617,7 @@ dataset_writeAll(char *filename)
|
||||
/* to create them again.*/
|
||||
H5Sclose(file_dataspace);
|
||||
H5Sclose(mem_dataspace);
|
||||
H5Pclose(xfer_plist);
|
||||
H5Pclose_list(xfer_plist);
|
||||
|
||||
/* Dataset2: each process takes a block of columns. */
|
||||
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
|
||||
@ -649,7 +649,7 @@ dataset_writeAll(char *filename)
|
||||
}
|
||||
|
||||
/* set up the collective transfer properties list */
|
||||
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
|
||||
xfer_plist = H5Pcreate_list (H5P_DATASET_XFER_NEW);
|
||||
VRFY((xfer_plist >= 0), "");
|
||||
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
|
||||
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
|
||||
@ -678,7 +678,7 @@ dataset_writeAll(char *filename)
|
||||
/* release all temporary handles. */
|
||||
H5Sclose(file_dataspace);
|
||||
H5Sclose(mem_dataspace);
|
||||
H5Pclose(xfer_plist);
|
||||
H5Pclose_list(xfer_plist);
|
||||
|
||||
|
||||
/*
|
||||
@ -800,7 +800,7 @@ dataset_readAll(char *filename)
|
||||
}
|
||||
|
||||
/* set up the collective transfer properties list */
|
||||
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
|
||||
xfer_plist = H5Pcreate_list (H5P_DATASET_XFER_NEW);
|
||||
VRFY((xfer_plist >= 0), "");
|
||||
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
|
||||
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
|
||||
@ -839,7 +839,7 @@ dataset_readAll(char *filename)
|
||||
/* to create them again.*/
|
||||
H5Sclose(file_dataspace);
|
||||
H5Sclose(mem_dataspace);
|
||||
H5Pclose(xfer_plist);
|
||||
H5Pclose_list(xfer_plist);
|
||||
|
||||
/* Dataset2: each process takes a block of rows. */
|
||||
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
|
||||
@ -863,7 +863,7 @@ dataset_readAll(char *filename)
|
||||
}
|
||||
|
||||
/* set up the collective transfer properties list */
|
||||
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
|
||||
xfer_plist = H5Pcreate_list (H5P_DATASET_XFER_NEW);
|
||||
VRFY((xfer_plist >= 0), "");
|
||||
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
|
||||
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
|
||||
@ -900,7 +900,7 @@ dataset_readAll(char *filename)
|
||||
/* release all temporary handles. */
|
||||
H5Sclose(file_dataspace);
|
||||
H5Sclose(mem_dataspace);
|
||||
H5Pclose(xfer_plist);
|
||||
H5Pclose_list(xfer_plist);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -162,7 +162,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
|
||||
OutCount = 0;
|
||||
BitOffset = 0;
|
||||
|
||||
DataMask = (WORD)((1L << ((GifHead->PackedField & 0x07) +1)) -1);
|
||||
DataMask = (1L << ((GifHead->PackedField & 0x07) +1)) -1;
|
||||
Raster = GifImageDesc->GIFImage;
|
||||
|
||||
/* Check for image seperator */
|
||||
|
Loading…
Reference in New Issue
Block a user