[svn-r5677] Purpose:

Code improvement

Description:
    Some small code cleanups and took out the code the was turning off the
    metadata cache for parallel I/O (!)

Platforms tested:
    IRIX64 6.5 (modi4) w/parallel
This commit is contained in:
Quincey Koziol 2002-06-19 12:07:52 -05:00
parent ea052ffd55
commit 3659ae4176
10 changed files with 52 additions and 71 deletions

View File

@ -38,7 +38,7 @@
#ifdef H5_HAVE_PARALLEL
/* Remove this if H5R_DATASET_REGION is no longer used in this file */
# include "H5Rpublic.h"
#endif
#endif /*H5_HAVE_PARALLEL*/
#define PABLO_MASK H5D_mask
@ -1544,7 +1544,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
/* If MPIO is used, no filter support yet. */
if(IS_H5FD_MPIO(f) && dcpl_pline.nfilters > 0)
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet");
#endif
#endif /*H5_HAVE_PARALLEL*/
/* Initialize the dataset object */
if(NULL == (new_dset = H5D_new(dcpl_id)))
@ -1724,13 +1724,13 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
* space allocate time is early; otherwise delay allocation until H5Dwrite.
*/
#ifdef H5_HAVE_PARALLEL
if (0==efl.nused && H5F_arr_create(f, &(new_dset->layout))<0) {
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL,
"unable to initialize storage");
} else if(0<efl.nused) {
if (0==efl.nused) {
if(H5F_arr_create(f, &(new_dset->layout))<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize storage");
} /* end if */
else
new_dset->layout.addr = HADDR_UNDEF;
}
#else
#else /*H5_HAVE_PARALLEL*/
if (0==efl.nused) {
if(dcpl_layout==H5D_CHUNKED || (dcpl_layout==H5D_CONTIGUOUS &&
space_time==H5D_SPACE_ALLOC_EARLY)) {
@ -1739,11 +1739,10 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
} /* end if */
else
new_dset->layout.addr = HADDR_UNDEF;
} else {
} /* end if */
else
new_dset->layout.addr = HADDR_UNDEF;
}
#endif
#endif /*H5_HAVE_PARALLEL*/
/* Update layout message */
if (H5O_modify (&(new_dset->ent), H5O_LAYOUT, 0, 0, &(new_dset->layout))<0)
@ -1779,13 +1778,12 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
#ifdef H5_HAVE_PARALLEL
if (H5D_init_storage(new_dset, space)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize storage");
#else
if(dcpl_layout==H5D_CHUNKED || (dcpl_layout==H5D_CONTIGUOUS &&
fill_time==H5D_FILL_TIME_ALLOC && ((space_time==H5D_SPACE_ALLOC_EARLY && !efl.nused) ||
(efl.nused))))
#else /*H5_HAVE_PARALLEL*/
if(fill_time==H5D_FILL_TIME_ALLOC &&
((space_time==H5D_SPACE_ALLOC_EARLY && !efl.nused) || (efl.nused)))
if (H5D_init_storage(new_dset, space)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize storage");
#endif
#endif /*H5_HAVE_PARALLEL*/
/* Success */
ret_value = new_dset;
@ -2017,7 +2015,7 @@ H5D_open_oid(H5G_entry_t *ent)
/* If MPIO is used, no filter support yet. */
if(IS_H5FD_MPIO(dataset->ent.file) && pline.nfilters > 0)
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel IO does not support filters yet");
#endif
#endif /*H5_HAVE_PARALLEL*/
/*
* Get the raw data layout info. It's actually stored in two locations:
@ -2223,7 +2221,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
H5FD_mpio_xfer_t xfer_mode; /*xfer_mode for this request */
hbool_t xfer_mode_changed=0; /*xfer_mode needs restore */
hbool_t doing_mpio=0; /*This is an MPIO access */
#endif
#endif /*H5_HAVE_PARALLEL*/
#ifdef H5S_DEBUG
H5_timer_t timer;
#endif
@ -2416,7 +2414,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
} /* end if */
#endif
} /* end if */
#endif
#endif /*H5_HAVE_PARALLEL*/
/*
* This is the general case.
*/
@ -2546,7 +2544,7 @@ done:
#endif
dx->xfer_mode = xfer_mode;
} /* end if */
#endif
#endif /*H5_HAVE_PARALLEL*/
/* Release selection iterators */
H5S_sel_iter_release(file_space,&file_iter);
H5S_sel_iter_release(mem_space,&mem_iter);
@ -2639,7 +2637,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
H5FD_mpio_xfer_t xfer_mode; /*xfer_mode for this request */
hbool_t xfer_mode_changed=0; /*xfer_mode needs restore */
hbool_t doing_mpio=0; /*This is an MPIO access */
#endif
#endif /*H5_HAVE_PARALLEL*/
#ifdef H5S_DEBUG
H5_timer_t timer;
#endif
@ -2678,7 +2676,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* support parallel access of that yet */
if (IS_H5FD_MPIO(dataset->ent.file) && H5T_get_class(mem_type)==H5T_VLEN)
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing VL datatypes yet");
#endif
#endif /*H5_HAVE_PARALLEL*/
#ifdef H5_HAVE_PARALLEL
/* If MPIO is used, no dataset region reference support yet. */
/* This is because they use the global heap in the file and we don't */
@ -2687,7 +2685,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
H5T_get_class(mem_type)==H5T_REFERENCE &&
H5T_get_ref_type(mem_type)==H5R_DATASET_REGION)
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet");
#endif
#endif /*H5_HAVE_PARALLEL*/
if (0==(H5F_get_intent(dataset->ent.file) & H5F_ACC_RDWR))
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file");
@ -2843,7 +2841,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
} /* end if */
#endif
} /* end if */
#endif
#endif /*H5_HAVE_PARALLEL*/
/*
* This is the general case.
*/
@ -2981,7 +2979,7 @@ done:
#endif
dx->xfer_mode = xfer_mode;
} /* end if */
#endif
#endif /*H5_HAVE_PARALLEL*/
/* Release selection iterators */
H5S_sel_iter_release(file_space,&file_iter);
H5S_sel_iter_release(mem_space,&mem_iter);

View File

@ -167,7 +167,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_seq_readv, FAIL);
@ -209,7 +209,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -243,7 +243,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
"collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
@ -549,7 +549,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_seq_writev, FAIL);
@ -593,7 +593,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access on non-contiguous datasets not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -626,7 +626,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
if (max != min)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of

View File

@ -218,7 +218,7 @@ H5F_init_interface(void)
H5_mpi_1_metawrite_g = (int)HDstrtol (s, NULL, 0);
}
}
#endif
#endif /* H5_HAVE_PARALLEL */
/*
* Initialize the atom group for the file IDs. There are two groups:
@ -304,7 +304,7 @@ H5F_init_interface(void)
if ((status=H5FD_MULTI)<0) goto end_registration;
#ifdef H5_HAVE_PARALLEL
if ((status=H5FD_MPIO)<0) goto end_registration;
#endif
#endif /* H5_HAVE_PARALLEL */
#ifdef H5_HAVE_STREAM
if ((status=H5FD_STREAM)<0) goto end_registration;
#endif
@ -1337,9 +1337,6 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id)
{
H5F_t *f=NULL, *ret_value=NULL;
int n;
#ifdef H5_HAVE_PARALLEL
hid_t driver_id = -1;
#endif /* H5_HAVE_PARALLEL */
H5P_genplist_t *plist; /* Property list */
FUNC_ENTER_NOINIT(H5F_new);
@ -1391,20 +1388,6 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id)
if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &(f->shared->sieve_buf_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get sieve buffer size");
#ifdef H5_HAVE_PARALLEL
/*
* Disable cache if file is open using MPIO driver. Parallel
* does not permit caching. (maybe able to relax it for
* read only open.)
*/
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &driver_id) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID");
if (H5FD_MPIO==driver_id){
f->shared->rdcc_nbytes = 0;
f->shared->mdc_nelmts = 0;
}
#endif
/*
* Create a meta data cache with the specified number of elements.
* The cache might be created with a different number of elements and

View File

@ -2233,7 +2233,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz
/* collective transfer. */
/* The no-op case */
if (0==size) HRETURN(SUCCEED);
#endif
#endif /* H5_HAVE_PARALLEL */
/* Check if this information is in the metadata accumulator */
if((file->feature_flags&H5FD_FEAT_ACCUMULATE_METADATA) && type!=H5FD_MEM_DRAW) {
@ -2457,7 +2457,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
/* collective transfer. */
/* The no-op case */
if (0==size) HRETURN(SUCCEED);
#endif
#endif /* H5_HAVE_PARALLEL */
/* Check for accumulating metadata */
if((file->feature_flags&H5FD_FEAT_ACCUMULATE_METADATA) && type!=H5FD_MEM_DRAW) {

View File

@ -1878,4 +1878,4 @@ H5FD_mpio_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/)
FUNC_LEAVE(ret_value);
}
#endif /*H5_HAVE_PARALLEL*/
#endif /* H5_HAVE_PARALLEL */

View File

@ -17,7 +17,7 @@
# define H5FD_MPIO (H5FD_mpio_init())
#else
# define H5FD_MPIO (-1)
#endif
#endif /* H5_HAVE_PARALLEL */
/* Type of I/O for data transfer properties */
typedef enum H5FD_mpio_xfer_t {
@ -68,6 +68,6 @@ __DLL__ int H5FD_mpio_mpi_size(H5FD_t *_file);
}
#endif
#endif /*H5_HAVE_PARALLEL*/
#endif /* H5_HAVE_PARALLEL */
#endif

View File

@ -149,7 +149,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_arr_read, FAIL);
@ -198,7 +198,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -273,7 +273,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
if (max != min)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
for (z=0; z<nelmts; z++) {
/* Read directly from file if the dataset is in an external file */
@ -390,7 +390,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_arr_write, FAIL);
@ -438,7 +438,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -515,7 +515,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
if (max != min)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
for (z=0; z<nelmts; z++) {

View File

@ -50,7 +50,7 @@
* desired flags.
*/
#define H5F_MPIO_DEBUG_KEY "H5F_mpio_debug_key"
#endif
#endif /* H5_HAVE_PARALLEL */
/* The difference between a single file and a set of mounted files */
typedef enum H5F_scope_t {

View File

@ -167,7 +167,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_seq_readv, FAIL);
@ -209,7 +209,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode)
HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "collective access on non-contiguous datasets not supported yet");
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -243,7 +243,7 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
"collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of
@ -549,7 +549,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
H5P_genplist_t *plist=NULL; /* Property list */
#endif
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5F_seq_writev, FAIL);
@ -593,7 +593,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access on non-contiguous datasets not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@ -626,7 +626,7 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
if (max != min)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "collective access with unequal number of blocks not supported yet");
}
#endif
#endif /* H5_HAVE_PARALLEL */
/* Note: We can't use data sieve buffers for datasets in external files
* because the 'addr' of all external files is set to 0 (above) and
* all datasets in external files would alias to the same set of

View File

@ -43,7 +43,7 @@ static size_t H5S_nconv_g = 0; /*entries used*/
#ifdef H5_HAVE_PARALLEL
/* Global var whose value can be set from environment variable also */
hbool_t H5_mpi_opt_types_g = TRUE;
#endif
#endif /* H5_HAVE_PARALLEL */
/* Declare a free list to manage the H5S_simple_t struct */
H5FL_DEFINE(H5S_simple_t);
@ -98,7 +98,7 @@ H5S_init_interface(void)
H5_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0);
}
}
#endif
#endif /* H5_HAVE_PARALLEL */
FUNC_LEAVE(SUCCEED);
}