From 32ec6c6568fc611a2d16a0c42f88c10d150573af Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 19 Sep 2013 18:41:05 -0500 Subject: [svn-r24173] - update checksum verification to check for properties for enabling/disabling checksums. - done for raw data, scratch pads. to do KV pairs. --- examples/h5ff_client_dset.c | 20 ++++ src/H5FF.c | 144 ------------------------- src/H5FFpublic.h | 5 - src/H5Pdxpl.c | 2 +- src/H5Pfapl.c | 6 +- src/H5Prcapl.c | 4 +- src/H5VLiod.c | 257 ++++++++++++++++++++++++++++++++++++++++---- src/H5VLiod.h | 4 + src/H5VLiod_attr.c | 39 ++++--- src/H5VLiod_client.c | 37 +++++-- src/H5VLiod_client.h | 2 + src/H5VLiod_common.h | 64 +++++------ src/H5VLiod_dset.c | 125 ++++++++++++++------- src/H5VLiod_dtype.c | 19 +++- src/H5VLiod_encdec.c | 4 +- src/H5VLiod_file.c | 34 ++++-- src/H5VLiod_group.c | 21 ++-- src/H5VLiod_link.c | 15 ++- src/H5VLiod_map.c | 23 +++- src/H5VLiod_obj.c | 16 ++- src/H5VLiod_trans.c | 3 +- src/H5VLiod_util.c | 1 - 22 files changed, 536 insertions(+), 309 deletions(-) diff --git a/examples/h5ff_client_dset.c b/examples/h5ff_client_dset.c index d09a6bb..a595b4c 100644 --- a/examples/h5ff_client_dset.c +++ b/examples/h5ff_client_dset.c @@ -39,6 +39,7 @@ int main(int argc, char **argv) { int num_requests = 0; unsigned int i = 0; uint32_t cs = 0,read1_cs = 0, read2_cs = 0; + uint32_t cs_scope = 0; herr_t ret; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); @@ -78,6 +79,11 @@ int main(int argc, char **argv) { event_q = H5EQcreate(fapl_id); assert(event_q); + /* set the metada data integrity checks to happend at transfer through mercury */ + cs_scope |= H5_CHECKSUM_TRANSFER; + ret = H5Pset_metadata_integrity_scope(fapl_id, cs_scope); + assert(ret == 0); + /* create the file. */ file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); assert(file_id > 0); @@ -135,6 +141,12 @@ int main(int argc, char **argv) { dxpl_id = H5Pcreate (H5P_DATASET_XFER); cs = H5checksum(wdata1, sizeof(int32_t) * nelem, NULL); H5Pset_dxpl_checksum(dxpl_id, cs); + + /* tell HDF5 to disable all data integrity checks for this write */ + cs_scope = 0; + ret = H5Pset_rawdata_integrity_scope(dxpl_id, cs_scope); + assert(ret == 0); + ret = H5Dwrite_ff(did1, dtid, sid, sid, dxpl_id, wdata1, tid1, event_q); assert(ret == 0); @@ -144,6 +156,13 @@ int main(int argc, char **argv) { cs = H5checksum(wdata2, sizeof(int32_t) * nelem, NULL); H5Pset_dxpl_checksum(dxpl_id, cs); H5Pset_dxpl_inject_corruption(dxpl_id, 1); + + /* tell HDF5 to disable data integrity checks stored at IOD for this write; + The transfer checksum will still capture the corruption. */ + cs_scope |= H5_CHECKSUM_IOD; + ret = H5Pset_rawdata_integrity_scope(dxpl_id, cs_scope); + assert(ret == 0); + ret = H5Dwrite_ff(did2, dtid, sid, sid, dxpl_id, wdata2, tid1, event_q); assert(ret == 0); @@ -237,6 +256,7 @@ int main(int argc, char **argv) { H5Pset_dxpl_inject_corruption(dxpl_id, 1); /* Give a location to the DXPL to store the checksum once the read has completed */ H5Pset_dxpl_checksum_ptr(dxpl_id, &read2_cs); + ret = H5Dread_ff(did2, dtid, sid, sid, dxpl_id, rdata2, rid2, event_q); assert(ret == 0); H5Pclose(dxpl_id); diff --git a/src/H5FF.c b/src/H5FF.c index 9831a9f..c576f7f 100644 --- a/src/H5FF.c +++ b/src/H5FF.c @@ -113,150 +113,6 @@ H5FF__init_interface(void) /*------------------------------------------------------------------------- - * Function: H5Pset_metadata_integrity_scope - * - * Purpose: Set the scope of checksum generation and verification - * in the FF stack. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * September 2013 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_metadata_integrity_scope(hid_t fapl_id, uint32_t scope) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - - if(H5_CHECKSUM_NONE > scope || scope > H5_CHECKSUM_ALL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - - /* Set property */ - if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_metadata_integrity_scope() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_metadata_integrity_scope - * - * Purpose: Get the current bit flag indicating the data integrity scope. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * September 2013 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_metadata_integrity_scope(hid_t fapl_id, uint32_t *scope) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - - if(scope) { - /* Get property */ - if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); - } - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_metadata_integrity_scope() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pset_rawdata_integrity_scope - * - * Purpose: Set the scope of checksum generation and verification - * in the FF stack. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * September 2013 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_rawdata_integrity_scope(hid_t dxpl_id, uint32_t scope) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - - if(H5_CHECKSUM_NONE > scope || scope > H5_CHECKSUM_ALL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - - /* Set property */ - if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_rawdata_integrity_scope() */ - - -/*------------------------------------------------------------------------- - * Function: H5Pget_rawdata_integrity_scope - * - * Purpose: Get the current bit flag indicating the data integrity scope. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * September 2013 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pget_rawdata_integrity_scope(hid_t dxpl_id, uint32_t *scope) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - - if(scope) { - /* Get property */ - if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); - } - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pget_rawdata_integrity_scope() */ - - -/*------------------------------------------------------------------------- * Function: H5Fcreate_ff * * Purpose: Asynchronous wrapper around H5Fcreate(). diff --git a/src/H5FFpublic.h b/src/H5FFpublic.h index f88a867..ec41261 100644 --- a/src/H5FFpublic.h +++ b/src/H5FFpublic.h @@ -72,11 +72,6 @@ typedef enum H5FF_checksum_bitflag_t { /*********************/ /* Public Prototypes */ /*********************/ -H5_DLL herr_t H5Pset_metadata_integrity_scope(hid_t fapl_id, uint32_t scope); -H5_DLL herr_t H5Pget_metadata_integrity_scope(hid_t fapl_id, uint32_t *scope); - -H5_DLL herr_t H5Pset_rawdata_integrity_scope(hid_t dxpl_id, uint32_t scope); -H5_DLL herr_t H5Pget_rawdata_integrity_scope(hid_t dxpl_id, uint32_t *scope); /* API wrappers */ H5_DLL hid_t H5Fcreate_ff(const char *filename, unsigned flags, hid_t fcpl, diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 1cd29ca..536b6be 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -62,7 +62,7 @@ /* definitions for checksum scope in FF stack */ #define H5D_XFER_CHECKSUM_SCOPE_SIZE sizeof(uint32_t) -#define H5D_XFER_CHECKSUM_SCOPE_DEF 0 +#define H5D_XFER_CHECKSUM_SCOPE_DEF 7 #define H5D_XFER_CHECKSUM_SCOPE_ENC H5P__encode_unsigned #define H5D_XFER_CHECKSUM_SCOPE_DEC H5P__decode_unsigned diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 1f48aa4..f337a35 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -63,9 +63,9 @@ /* definitions for checksum scope in FF stack */ #define H5F_ACS_CHECKSUM_SCOPE_SIZE sizeof(uint32_t) -#define H5F_ACS_CHECKSUM_SCOPE_DEF 0 -#define H5F_ACS_CHECKSUM_SCOPE_ENC H5P__encode_unsigned -#define H5F_ACS_CHECKSUM_SCOPE_DEC H5P__decode_unsigned +#define H5F_ACS_CHECKSUM_SCOPE_DEF 7 +#define H5F_ACS_CHECKSUM_SCOPE_ENC H5P__encode_unsigned +#define H5F_ACS_CHECKSUM_SCOPE_DEC H5P__decode_unsigned #endif /* H5_HAVE_EFF */ diff --git a/src/H5Prcapl.c b/src/H5Prcapl.c index a858ef9..1e24e09 100644 --- a/src/H5Prcapl.c +++ b/src/H5Prcapl.c @@ -47,8 +47,8 @@ /* Definitions for Container Version being Acquired */ #define H5RC_ACQUIRE_CV_REQUEST_SIZE sizeof(H5RC_request_t) #define H5RC_ACQUIRE_CV_REQUEST_DEF H5RC_EXACT -#define H5RC_ACQUIRE_CV_REQUEST_ENC H5P__encode_uint8_t -#define H5RC_ACQUIRE_CV_REQUEST_DEC H5P__decode_uint8_t +#define H5RC_ACQUIRE_CV_REQUEST_ENC H5P__encode_unsigned +#define H5RC_ACQUIRE_CV_REQUEST_DEC H5P__decode_unsigned /******************/ /* Local Typedefs */ diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 669e7d9..504388c 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -1031,6 +1031,150 @@ done: /*------------------------------------------------------------------------- + * Function: H5Pset_metadata_integrity_scope + * + * Purpose: Set the scope of checksum generation and verification + * in the FF stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_metadata_integrity_scope(hid_t fapl_id, uint32_t scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + if(scope > H5_CHECKSUM_ALL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set property */ + if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_metadata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_metadata_integrity_scope + * + * Purpose: Get the current bit flag indicating the data integrity scope. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_metadata_integrity_scope(hid_t fapl_id, uint32_t *scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(scope) { + /* Get property */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_metadata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_rawdata_integrity_scope + * + * Purpose: Set the scope of checksum generation and verification + * in the FF stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_rawdata_integrity_scope(hid_t dxpl_id, uint32_t scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + if(scope > H5_CHECKSUM_ALL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set property */ + if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_rawdata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_rawdata_integrity_scope + * + * Purpose: Get the current bit flag indicating the data integrity scope. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_rawdata_integrity_scope(hid_t dxpl_id, uint32_t *scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(scope) { + /* Get property */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_rawdata_integrity_scope() */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_dxpl_inject_corruption * * Purpose: Temporary routine to set a boolean flag that tells the @@ -1199,6 +1343,7 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl H5P_genplist_t *plist = NULL; /* Property list pointer */ H5VL_iod_file_t *file = NULL; file_create_in_t input; + uint32_t cs_scope; void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -1218,6 +1363,9 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl if(NULL == (fa = (H5VL_iod_fapl_t *)H5P_get_vol_info(plist))) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't get IOD info struct") + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, &cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get scope for data integrity checks"); + /* allocate the file object that is returned to the user */ if(NULL == (file = H5FL_CALLOC(H5VL_iod_file_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD file struct"); @@ -1241,6 +1389,7 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl /* create the file object that is passed to the API layer */ file->file_name = HDstrdup(name); file->flags = flags; + file->md_integrity_scope = cs_scope; if((file->remote_file.fcpl_id = H5Pcopy(fcpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy fcpl"); if((file->fapl_id = H5Pcopy(fapl_id)) < 0) @@ -1297,6 +1446,7 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, H5VL_iod_file_t *file = NULL; file_open_in_t input; hid_t rcxt_id; + uint32_t cs_scope; void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -1312,6 +1462,9 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, if(H5P_get(plist, H5VL_ACQUIRE_RC_ID, &rcxt_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't set property value for rxct id") + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, &cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get scope for data integrity checks"); + if(FAIL != rcxt_id) { input.acquire = TRUE; } @@ -1339,6 +1492,7 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, MPI_Comm_size(fa->comm, &file->num_procs); file->file_name = HDstrdup(name); file->flags = flags; + file->md_integrity_scope = cs_scope; if((file->fapl_id = H5Pcopy(fapl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy fapl"); file->nopen_objs = 1; @@ -1603,6 +1757,7 @@ H5VL_iod_file_close(void *_file, hid_t UNUSED dxpl_id, void **req) input.coh = file->remote_file.coh; input.root_oh = file->remote_file.root_oh; input.root_id = file->remote_file.root_id; + input.cs_scope = file->md_integrity_scope; if(file->num_req) { H5VL_iod_request_t *cur_req = file->request_list_head; @@ -1725,6 +1880,7 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t UNUSED loc_params, const cha input.lcpl_id = lcpl_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; /* setup the local group struct */ /* store the entire path of the group locally */ @@ -1835,6 +1991,7 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t UNUSED loc_params, const char input.name = name; input.gapl_id = gapl_id; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Group Open %s LOC ID %llu, axe id %llu\n", @@ -2085,6 +2242,7 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t UNUSED loc_params, input.space_id = space_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; /* setup the local dataset struct */ /* store the entire path of the dataset locally */ @@ -2204,6 +2362,7 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t UNUSED loc_params, const cha input.name = name; input.dapl_id = dapl_id; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; /* setup the local dataset struct */ /* store the entire path of the dataset locally */ @@ -2369,6 +2528,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.dset_type_id = dset->remote_dset.type_id; input.mem_type_id = mem_type_id; input.rcxt_num = rc->c_version; + input.cs_scope = dset->common.file->md_integrity_scope; input.trans_num = 0; } else { @@ -2380,6 +2540,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input_vl.space_id = file_space_id; input_vl.mem_type_id = mem_type_id; input_vl.rcxt_num = rc->c_version; + input_vl.cs_scope = dset->common.file->md_integrity_scope; } /* allocate structure to receive status of read operation @@ -2407,6 +2568,9 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, /* store the pointer to the buffer where the checksum needs to be placed */ if(H5P_get(plist, H5D_XFER_CHECKSUM_PTR_NAME, &info->cs_ptr) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum pointer value"); + /* store the raw data integrity scope */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, &info->raw_cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum pointer value"); /* If the read is of VL data, then we need the read parameters to perform the actual read when the wait is called (i.e. when we @@ -2483,6 +2647,8 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, size_t num_parents = 0; hid_t trans_id; H5TR_t *tr = NULL; + uint32_t user_cs; + uint32_t raw_cs_scope = 0; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -2521,37 +2687,50 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, if(!buf) buf = &fake_char; - /* allocate a bulk data transfer handle */ - if(NULL == (bulk_handle = (hg_bulk_t *)H5MM_malloc(sizeof(hg_bulk_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate a buld data transfer handle"); - - /* compute checksum and create bulk handle */ - if(H5VL_iod_pre_write(mem_type_id, mem_space_id, buf, - &internal_cs, bulk_handle, &vl_string_len) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't generate write parameters"); - - /* get the transaction ID */ + /* get the plist pointer */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - if(H5P_get(plist, H5VL_TRANS_ID, &trans_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for trans_id"); /* get the TR object */ + if(H5P_get(plist, H5VL_TRANS_ID, &trans_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for trans_id"); if(NULL == (tr = (H5TR_t *)H5I_object_verify(trans_id, H5I_TR))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Transaction ID") - /* Verify the checksum value if the dxpl contains a user defined checksum */ - if(H5P_DATASET_XFER_DEFAULT != dxpl_id) { - uint32_t user_cs; + /* get the data integrity scope */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, &raw_cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get scope for data integrity checks"); - if(H5P_get(plist, H5D_XFER_CHECKSUM_NAME, &user_cs) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum value"); + /* allocate a bulk data transfer handle */ + if(NULL == (bulk_handle = (hg_bulk_t *)H5MM_malloc(sizeof(hg_bulk_t)))) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate a buld data transfer handle"); - if(user_cs != internal_cs) { - fprintf(stderr, "Errrr.. In memory Data corruption. expecting %u, got %u\n", - user_cs, internal_cs); - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "Checksum verification failed"); - } + if(raw_cs_scope) { + /* compute checksum and create bulk handle */ + if(H5VL_iod_pre_write(mem_type_id, mem_space_id, buf, + &internal_cs, bulk_handle, &vl_string_len) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't generate write parameters"); + } + else { +#if H5VL_IOD_DEBUG + printf("NO DATA INTEGRITY CHECKS ON RAW DATA WRITTEN\n"); +#endif + /* compute checksum and create bulk handle */ + if(H5VL_iod_pre_write(mem_type_id, mem_space_id, buf, + NULL, bulk_handle, &vl_string_len) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't generate write parameters"); + internal_cs = 0; + } + + /* Verify the checksum value if the dxpl contains a user defined checksum */ + if(H5P_get(plist, H5D_XFER_CHECKSUM_NAME, &user_cs) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to get checksum value"); + + if((raw_cs_scope & H5_CHECKSUM_MEMORY) && user_cs && + user_cs != internal_cs) { + fprintf(stderr, "Errrr.. In memory Data corruption. expecting %u, got %u\n", + user_cs, internal_cs); + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "Checksum verification failed"); } if(NULL == (parent_reqs = (H5VL_iod_request_t **) @@ -2575,6 +2754,7 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.mem_type_id = mem_type_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = dset->common.file->md_integrity_scope; status = (int *)malloc(sizeof(int)); @@ -2669,6 +2849,7 @@ H5VL_iod_dataset_set_extent(void *_dset, const hsize_t size[], input.dims.size = size; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = dset->common.file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Dataset Set Extent, axe id %llu\n", g_axe_id); @@ -2947,6 +3128,7 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t UNUSED loc_params, const input.type_id = type_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Datatype Commit %s IOD ID %llu, axe id %llu\n", @@ -3062,6 +3244,7 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t UNUSED loc_params, const ch input.name = name; input.tapl_id = tapl_id; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Datatype Open %s LOC ID %llu, axe id %llu\n", @@ -3335,6 +3518,7 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * input.space_id = space_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; /* setup the local attribute struct */ /* store the entire path of the attribute locally */ @@ -3471,6 +3655,7 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at input.path = loc_name; input.attr_name = attr_name; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Attribute Open %s LOC ID %llu, axe id %llu\n", @@ -3598,6 +3783,7 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo input.type_id = type_id; input.space_id = attr->remote_attr.space_id; input.rcxt_num = rc->c_version; + input.cs_scope = attr->common.file->md_integrity_scope; input.trans_num = 0; /* allocate structure to receive status of read operation (contains return value and checksum */ @@ -3710,6 +3896,7 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl input.space_id = attr->remote_attr.space_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = attr->common.file->md_integrity_scope; status = (int *)malloc(sizeof(int)); @@ -3804,6 +3991,7 @@ H5VL_iod_attribute_remove(void *_obj, H5VL_loc_params_t loc_params, const char * input.attr_name = attr_name; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; status = (int *)malloc(sizeof(int)); @@ -3984,6 +4172,7 @@ H5VL_iod_attribute_get(void *_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, input.attr_name = attr_name; input.path = loc_name; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.trans_num = 0; #if H5VL_IOD_DEBUG @@ -4311,6 +4500,7 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; if(H5VL__iod_create_and_forward(H5VL_LINK_CREATE_ID, HG_LINK_CREATE, obj, 1, num_parents, parent_reqs, @@ -4435,6 +4625,7 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, input.lapl_id = lapl_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = src_obj->file->md_integrity_scope; status = (herr_t *)malloc(sizeof(herr_t)); @@ -4552,6 +4743,7 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.trans_num = 0; input.path = loc_name; @@ -4585,6 +4777,7 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.trans_num = 0; input.path = loc_name; @@ -4622,6 +4815,7 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.path = loc_name; if(NULL == (result = (link_get_val_out_t *)malloc @@ -4724,6 +4918,7 @@ H5VL_iod_link_remove(void *_obj, H5VL_loc_params_t loc_params, hid_t dxpl_id, vo input.path = loc_name; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Link Remove axe %llu: %s ID %llu\n", @@ -4805,6 +5000,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.name = "."; input.dapl_id = H5P_DATASET_ACCESS_DEFAULT; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; dset->dapl_id = H5P_DATASET_ACCESS_DEFAULT; @@ -4844,6 +5040,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.name = "."; input.tapl_id = H5P_DATATYPE_ACCESS_DEFAULT; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; dtype->tapl_id = H5P_DATATYPE_ACCESS_DEFAULT; @@ -4882,6 +5079,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.name = "."; input.gapl_id = H5P_GROUP_ACCESS_DEFAULT; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; grp->gapl_id = H5P_GROUP_ACCESS_DEFAULT; @@ -4922,6 +5120,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.name = "."; input.mapl_id = H5P_GROUP_ACCESS_DEFAULT; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; map->mapl_id = H5P_GROUP_ACCESS_DEFAULT; @@ -4971,6 +5170,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.coh = obj->file->remote_file.coh; input.loc_name = loc_name; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; /* H5Oopen has to be synchronous */ if(H5VL__iod_create_and_forward(H5VL_OBJECT_OPEN_ID, HG_OBJECT_OPEN, @@ -5242,6 +5442,7 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t UNUSED loc_params1, const input.ocpypl_id = ocpypl_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = src_obj->file->md_integrity_scope; status = (herr_t *)malloc(sizeof(herr_t)); @@ -5360,6 +5561,7 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ input.path = loc_name; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Attribute Rename %s to %s LOC ID %llu, axe id %llu\n", @@ -5397,6 +5599,7 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ input.path = loc_name; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; status = (herr_t *)malloc(sizeof(herr_t)); @@ -5512,6 +5715,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.loc_name = loc_name; #if H5VL_IOD_DEBUG @@ -5565,6 +5769,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.path = loc_name; if(comment) input.length = size; @@ -5610,6 +5815,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t input.loc_id = iod_id; input.loc_oh = iod_oh; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; input.loc_name = loc_name; #if H5VL_IOD_DEBUG @@ -5720,6 +5926,7 @@ H5VL_iod_map_create(void *_obj, H5VL_loc_params_t UNUSED loc_params, const char input.lcpl_id = lcpl_id; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Map Create %s, IOD ID %llu, axe id %llu\n", @@ -5815,6 +6022,7 @@ H5VL_iod_map_open(void *_obj, H5VL_loc_params_t UNUSED loc_params, const char *n input.name = name; input.mapl_id = mapl_id; input.rcxt_num = rc->c_version; + input.cs_scope = obj->file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("Map Open %s LOC ID %llu, axe id %llu\n", @@ -5925,6 +6133,7 @@ H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, input.val.buf = value; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = map->common.file->md_integrity_scope; status = (int *)malloc(sizeof(int)); @@ -6007,6 +6216,7 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, input.val_is_vl = val_is_vl; input.val_size = val_size; input.rcxt_num = rc->c_version; + input.cs_scope = map->common.file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("MAP Get, axe id %llu\n", g_axe_id); @@ -6121,6 +6331,7 @@ H5VL_iod_map_get_count(void *_map, hsize_t *count, hid_t rcxt_id, void **req) input.iod_oh = map->remote_map.iod_oh; input.iod_id = map->remote_map.iod_id; input.rcxt_num = rc->c_version; + input.cs_scope = map->common.file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("MAP Get count, axe id %llu\n", g_axe_id); @@ -6177,6 +6388,7 @@ H5VL_iod_map_exists(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf_size = key_size; input.key.buf = key; input.rcxt_num = rc->c_version; + input.cs_scope = map->common.file->md_integrity_scope; input.trans_num = 0; #if H5VL_IOD_DEBUG @@ -6255,6 +6467,7 @@ H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf = key; input.trans_num = tr->trans_num; input.rcxt_num = tr->c_version; + input.cs_scope = map->common.file->md_integrity_scope; #if H5VL_IOD_DEBUG printf("MAP DELETE, axe id %llu\n", g_axe_id); diff --git a/src/H5VLiod.h b/src/H5VLiod.h index f18c1d4..c38a782 100644 --- a/src/H5VLiod.h +++ b/src/H5VLiod.h @@ -66,6 +66,10 @@ H5_DLL herr_t H5Pset_dxpl_checksum(hid_t dxpl_id, uint32_t value); H5_DLL herr_t H5Pget_dxpl_checksum(hid_t dxpl_id, uint32_t *value); H5_DLL herr_t H5Pset_dxpl_checksum_ptr(hid_t dxpl_id, uint32_t *value); H5_DLL herr_t H5Pget_dxpl_checksum_ptr(hid_t dxpl_id, uint32_t **value); +H5_DLL herr_t H5Pset_metadata_integrity_scope(hid_t fapl_id, uint32_t scope); +H5_DLL herr_t H5Pget_metadata_integrity_scope(hid_t fapl_id, uint32_t *scope); +H5_DLL herr_t H5Pset_rawdata_integrity_scope(hid_t dxpl_id, uint32_t scope); +H5_DLL herr_t H5Pget_rawdata_integrity_scope(hid_t dxpl_id, uint32_t *scope); H5_DLL herr_t H5Pset_dxpl_inject_corruption(hid_t dxpl_id, hbool_t flag); H5_DLL herr_t H5Pget_dxpl_inject_corruption(hid_t dxpl_id, hbool_t *flag); H5_DLL herr_t H5Pset_dcpl_append_only(hid_t dcpl_id, hbool_t flag); diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c index 9f4a8f9..da25cb6 100644 --- a/src/H5VLiod_attr.c +++ b/src/H5VLiod_attr.c @@ -53,6 +53,7 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t attr_id = input->attr_id; /* The ID of the attribute that needs to be created */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t attr_oh, attr_kv_oh, obj_oh, mdkv_oh; /* object handles */ iod_obj_id_t obj_id, mdkv_id; const char *loc_name = input->path; /* path to start hierarchy traversal */ @@ -103,8 +104,6 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, /* for the process that succeeded in creating the attribute, update the parent scratch pad, create attribute scratch pad */ if(0 == ret) { - iod_checksum_t sp_cs; - /* create the metadata KV object for the attribute */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &mdkv_id, NULL) < 0) @@ -115,11 +114,19 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, sp[1] = IOD_ID_UNDEFINED; sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); /* set scratch pad in attribute */ - if (iod_obj_set_scratch(attr_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; + + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if (iod_obj_set_scratch(attr_oh, wtid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { + if (iod_obj_set_scratch(attr_oh, wtid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* Open Metadata KV object for write */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) @@ -150,7 +157,7 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -237,6 +244,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t loc_handle = input->loc_oh; /* location handle to start traversal */ iod_obj_id_t loc_id = input->loc_id; /* location ID */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t attr_kv_oh, attr_oh, obj_oh, mdkv_oh; iod_obj_id_t obj_id; iod_obj_id_t attr_id; @@ -262,7 +270,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -303,7 +311,7 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(attr_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -405,6 +413,7 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, hid_t type_id = input->type_id; /* datatype ID of data */ hid_t space_id = input->space_id; /* dataspace of attribute */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; hg_bulk_block_t bulk_block_handle; /* HG block handle */ hg_bulk_request_t bulk_request; /* HG request */ iod_mem_desc_t *mem_desc = NULL; /* memory descriptor used for reading array */ @@ -441,7 +450,7 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(iod_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -580,6 +589,7 @@ H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine, hid_t space_id = input->space_id; /* dataspace of attribute */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; hg_bulk_block_t bulk_block_handle; /* HG block handle */ hg_bulk_request_t bulk_request; /* HG request */ iod_mem_desc_t *mem_desc; /* memory descriptor used for writing array */ @@ -640,7 +650,7 @@ H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(iod_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -748,6 +758,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t loc_handle = input->loc_oh; /* location handle to start lookup */ iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh; /* current object handle accessed */ iod_handle_t attr_kv_oh; /* KV handle holding attributes for object */ iod_obj_id_t obj_id; @@ -773,7 +784,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -862,6 +873,7 @@ H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine, const char *new_name = input->new_attr_name; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_kv_params_t kvs; /* KV lists for objects - used to unlink attribute object */ iod_kv_t kv; /* KV entry */ H5VL_iod_link_t iod_link; @@ -883,7 +895,7 @@ H5VL_iod_server_attr_rename_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -979,6 +991,7 @@ H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine, const char *attr_name = input->attr_name; /* attribute's name */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_kv_params_t kvs; iod_kv_t kv; H5VL_iod_link_t iod_link; @@ -1000,7 +1013,7 @@ H5VL_iod_server_attr_remove_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index 8d83777..3fb2bdd 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -562,18 +562,25 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) } else { uint32_t internal_cs = 0; + uint32_t raw_cs_scope = info->raw_cs_scope; /* calculate a checksum for the data recieved */ internal_cs = H5S_checksum(info->buf_ptr, info->type_size, info->nelmts, info->space); /* verify data integrity */ - if(internal_cs != read_status->cs) { + if((raw_cs_scope & H5_CHECKSUM_TRANSFER) && + internal_cs != read_status->cs) { fprintf(stderr, "Errrrr! Dataset Read integrity failure (expecting %u got %u).\n", read_status->cs, internal_cs); req->status = H5AO_FAILED; req->state = H5VL_IOD_COMPLETED; } +#if H5VL_IOD_DEBUG + if(!raw_cs_scope & H5_CHECKSUM_TRANSFER) { + printf("NO TRANSFER DATA INTEGRITY CHECKS ON RAW DATA READ\n"); + } +#endif if(info->space && H5S_close(info->space) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace"); @@ -1998,11 +2005,13 @@ H5VL_iod_pre_write(hid_t type_id, hid_t space_id, const void *buf, free(bulk_segments); bulk_segments = NULL; - /* compute checksum of length array and the actual stings array */ - cs.a = cs.b = cs.c = cs.state = 0; - cs.total_length = buf_size; - for(u = 0; u < udata.curr_seq ; u++) { - checksum = H5_checksum_lookup4(udata.off[u], udata.len[u], &cs); + if(_checksum) { + /* compute checksum of length array and the actual stings array */ + cs.a = cs.b = cs.c = cs.state = 0; + cs.total_length = buf_size; + for(u = 0; u < udata.curr_seq ; u++) { + checksum = H5_checksum_lookup4(udata.off[u], udata.len[u], &cs); + } } /* cleanup */ @@ -2039,7 +2048,10 @@ H5VL_iod_pre_write(hid_t type_id, hid_t space_id, const void *buf, type_size = H5T_get_size(dt); buf_size = type_size * nelmts; - checksum = H5S_checksum(buf, type_size, nelmts, space); + + if(_checksum) { + checksum = H5S_checksum(buf, type_size, nelmts, space); + } /* If the memory selection is contiguous, create simple HG Bulk Handle */ if(H5S_select_is_contiguous(space)) { @@ -2130,8 +2142,10 @@ H5VL_iod_pre_write(hid_t type_id, hid_t space_id, const void *buf, cs.a = cs.b = cs.c = cs.state = 0; cs.total_length = buf_size; - for(u = 0; u < udata.curr_seq ; u++) { - checksum = H5_checksum_lookup4(udata.off[u], udata.len[u], &cs); + if(_checksum) { + for(u = 0; u < udata.curr_seq ; u++) { + checksum = H5_checksum_lookup4(udata.off[u], udata.len[u], &cs); + } } /* cleanup */ @@ -2148,8 +2162,9 @@ H5VL_iod_pre_write(hid_t type_id, hid_t space_id, const void *buf, HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "unsupported datatype"); } - *_checksum = checksum; - + if(_checksum) { + *_checksum = checksum; + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_pre_write */ diff --git a/src/H5VLiod_client.h b/src/H5VLiod_client.h index 4438976..9cc0e69 100644 --- a/src/H5VLiod_client.h +++ b/src/H5VLiod_client.h @@ -206,6 +206,7 @@ typedef struct H5VL_iod_file_t { H5VL_iod_remote_file_t remote_file; char *file_name; unsigned flags; + uint32_t md_integrity_scope; hid_t fapl_id; int my_rank; int num_procs; @@ -265,6 +266,7 @@ typedef struct H5VL_iod_io_info_t { size_t type_size; struct H5S_t *space; uint32_t *cs_ptr; + uint32_t raw_cs_scope; hid_t file_space_id; hid_t mem_type_id; hid_t dxpl_id; diff --git a/src/H5VLiod_common.h b/src/H5VLiod_common.h index 0febef5..557255a 100644 --- a/src/H5VLiod_common.h +++ b/src/H5VLiod_common.h @@ -106,11 +106,11 @@ MERCURY_GEN_PROC(file_open_out_t, ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh) ((uint64_t)(blob_oid_index)) ((iod_obj_id_t)(root_id)) ((uint64_t)(c_version)) ((hid_t)(fcpl_id))) -MERCURY_GEN_PROC(file_close_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(file_close_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh)) ((iod_obj_id_t)(root_id))) -MERCURY_GEN_PROC(attr_create_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_create_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(attr_id)) @@ -118,50 +118,50 @@ MERCURY_GEN_PROC(attr_create_in_t, ((axe_t)(axe_info)) ((hg_const_string_t)(attr_name)) ((hid_t)(acpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) MERCURY_GEN_PROC(attr_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(attr_open_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_open_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path)) ((hg_const_string_t)(attr_name))) MERCURY_GEN_PROC(attr_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(acpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(attr_op_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_op_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path)) ((hg_const_string_t)(attr_name))) -MERCURY_GEN_PROC(attr_rename_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_rename_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path)) ((hg_const_string_t)(old_attr_name)) ((hg_const_string_t)(new_attr_name))) -MERCURY_GEN_PROC(attr_io_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_io_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(space_id)) ((hid_t)(type_id)) ((hg_bulk_t)(bulk_handle))) -MERCURY_GEN_PROC(attr_close_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(attr_close_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(group_create_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(group_create_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(grp_id)) ((hg_const_string_t)(name)) ((hid_t)(gapl_id)) ((hid_t)(gcpl_id)) ((hid_t)(lcpl_id))) MERCURY_GEN_PROC(group_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(group_open_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(group_open_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(name)) ((hid_t)(gapl_id))) MERCURY_GEN_PROC(group_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(gcpl_id))) -MERCURY_GEN_PROC(group_close_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(group_close_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(map_create_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_create_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(map_id)) @@ -170,21 +170,21 @@ MERCURY_GEN_PROC(map_create_in_t, ((axe_t)(axe_info)) ((hid_t)(mapl_id)) ((hid_t)(mcpl_id)) ((hid_t)(lcpl_id))) MERCURY_GEN_PROC(map_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(map_open_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_open_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(name)) ((hid_t)(mapl_id))) MERCURY_GEN_PROC(map_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(keytype_id)) ((hid_t)(valtype_id)) ((hid_t)(mcpl_id))) -MERCURY_GEN_PROC(map_set_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_set_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(key_maptype_id)) ((hid_t)(key_memtype_id)) ((binary_buf_t)(key)) ((hid_t)(val_maptype_id)) ((hid_t)(val_memtype_id)) ((binary_buf_t)(val)) ((hid_t)(dxpl_id))) -MERCURY_GEN_PROC(map_get_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_get_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) @@ -192,11 +192,11 @@ MERCURY_GEN_PROC(map_get_in_t, ((axe_t)(axe_info)) ((hid_t)(val_maptype_id)) ((hid_t)(val_memtype_id)) ((hbool_t)(val_is_vl)) ((size_t)(val_size)) ((hid_t)(dxpl_id))) MERCURY_GEN_PROC(map_get_out_t, ((int32_t)(ret)) ((size_t)(val_size)) ((value_t)(val))) -MERCURY_GEN_PROC(map_get_count_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_get_count_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(map_op_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(map_op_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) @@ -204,7 +204,7 @@ MERCURY_GEN_PROC(map_op_in_t, ((axe_t)(axe_info)) MERCURY_GEN_PROC(map_close_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(dset_create_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dset_create_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(dset_id)) @@ -212,25 +212,25 @@ MERCURY_GEN_PROC(dset_create_in_t, ((axe_t)(axe_info)) ((hid_t)(dapl_id)) ((hid_t)(dcpl_id)) ((hid_t)(lcpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) MERCURY_GEN_PROC(dset_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(dset_open_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dset_open_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(name)) ((hid_t)(dapl_id))) MERCURY_GEN_PROC(dset_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(dcpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(dset_set_extent_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dset_set_extent_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((dims_t)(dims))) -MERCURY_GEN_PROC(dset_io_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dset_io_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(dset_type_id)) ((hid_t)(mem_type_id)) ((hid_t)(space_id)) ((hid_t)(dxpl_id)) ((uint32_t)(checksum)) ((hg_bulk_t)(bulk_handle))) -MERCURY_GEN_PROC(dset_get_vl_size_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dset_get_vl_size_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(mem_type_id)) @@ -239,7 +239,7 @@ MERCURY_GEN_PROC(dset_read_out_t, ((int32_t)(ret)) ((uint32_t)(cs)) ((size_t)(bu MERCURY_GEN_PROC(dset_close_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(dtype_commit_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dtype_commit_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(dtype_id)) @@ -247,17 +247,17 @@ MERCURY_GEN_PROC(dtype_commit_in_t, ((axe_t)(axe_info)) ((hid_t)(tapl_id)) ((hid_t)(tcpl_id)) ((hid_t)(lcpl_id)) ((hid_t)(type_id))) MERCURY_GEN_PROC(dtype_commit_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(dtype_open_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dtype_open_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(name)) ((hid_t)(tapl_id))) MERCURY_GEN_PROC(dtype_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(tcpl_id)) ((hid_t)(type_id))) -MERCURY_GEN_PROC(dtype_close_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(dtype_close_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id))) -MERCURY_GEN_PROC(link_create_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(link_create_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((int8_t)(create_type)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) @@ -266,7 +266,7 @@ MERCURY_GEN_PROC(link_create_in_t, ((axe_t)(axe_info)) ((hg_const_string_t)(target_name)) ((hg_const_string_t)(link_value)) ((hid_t)(lapl_id)) ((hid_t)(lcpl_id))) -MERCURY_GEN_PROC(link_move_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(link_move_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((hbool_t)(copy_flag)) ((iod_handle_t)(coh)) ((iod_handle_t)(src_loc_oh)) ((iod_obj_id_t)(src_loc_id)) @@ -274,19 +274,19 @@ MERCURY_GEN_PROC(link_move_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(dst_loc_oh)) ((iod_obj_id_t)(dst_loc_id)) ((hg_const_string_t)(dst_loc_name)) ((hid_t)(lapl_id)) ((hid_t)(lcpl_id))) -MERCURY_GEN_PROC(link_op_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(link_op_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path))) -MERCURY_GEN_PROC(link_get_val_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(link_get_val_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path)) ((uint64_t)(length))) MERCURY_GEN_PROC(link_get_val_out_t, ((int32_t)(ret)) ((value_t)(value))) -MERCURY_GEN_PROC(object_op_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(object_op_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) @@ -294,7 +294,7 @@ MERCURY_GEN_PROC(object_op_in_t, ((axe_t)(axe_info)) MERCURY_GEN_PROC(object_open_out_t, ((int32_t)(obj_type)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(cpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(object_copy_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(object_copy_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(src_loc_oh)) ((iod_obj_id_t)(src_loc_id)) @@ -302,12 +302,12 @@ MERCURY_GEN_PROC(object_copy_in_t, ((axe_t)(axe_info)) ((iod_handle_t)(dst_loc_oh)) ((iod_obj_id_t)(dst_loc_id)) ((hg_const_string_t)(dst_loc_name)) ((hid_t)(ocpypl_id)) ((hid_t)(lcpl_id))) -MERCURY_GEN_PROC(object_set_comment_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(object_set_comment_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((uint64_t)(trans_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((hg_const_string_t)(path)) ((hg_const_string_t)(comment))) -MERCURY_GEN_PROC(object_get_comment_in_t, ((axe_t)(axe_info)) +MERCURY_GEN_PROC(object_get_comment_in_t, ((axe_t)(axe_info)) ((uint32_t)(cs_scope)) ((uint64_t)(rcxt_num)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index a536713..6ff3987 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -48,7 +48,8 @@ typedef struct { static herr_t H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, hid_t type_id, hbool_t write_op, void *buf, - size_t buf_size, iod_trans_id_t tid); + size_t buf_size, uint32_t cs, uint32_t cs_scope, + iod_trans_id_t tid); static herr_t H5VL__iod_server_vl_data_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, @@ -88,6 +89,7 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t dset_id = input->dset_id; /* The ID of the dataset that needs to be created */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t dset_oh, cur_oh, mdkv_oh; iod_obj_id_t cur_id, mdkv_id, attr_id; const char *name = input->name; /* name of dset including path to create */ @@ -151,8 +153,6 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* for the process that succeeded in creating the dataset, update the parent KV, create scratch pad */ if(0 == ret) { - iod_checksum_t sp_cs; - /* create the attribute KV object for the dataset */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &attr_id, NULL) < 0) @@ -169,11 +169,18 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); - /* set scratch pad in dataset */ - if (iod_obj_set_scratch(dset_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; + + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if (iod_obj_set_scratch(dset_oh, wtid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { + if (iod_obj_set_scratch(dset_oh, wtid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* Open Metadata KV object for write */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) @@ -286,6 +293,7 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t loc_handle = input->loc_oh; /* location handle to start lookup */ iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; const char *name = input->name; /* name of dset including path to open */ iod_obj_id_t dset_id; /* ID of the dataset to open */ iod_handle_t dset_oh, mdkv_oh; @@ -307,7 +315,7 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(dset_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -440,15 +448,17 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t iod_id = input->iod_id; /* dset ID */ hg_bulk_t bulk_handle = input->bulk_handle; /* bulk handle for data */ hid_t space_id = input->space_id; /* file space selection */ - hid_t dxpl_id = input->dxpl_id; /* transfer property list */ + hid_t dxpl_id; hid_t src_id = input->dset_type_id; /* the datatype of the dataset's element */ hid_t dst_id = input->mem_type_id; /* the memory type of the elements */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; hg_bulk_block_t bulk_block_handle; /* HG block handle */ hg_bulk_request_t bulk_request; /* HG request */ size_t size, buf_size; void *buf = NULL; /* buffer to hold outgoing data */ uint32_t cs = 0; /* checksum value */ + uint32_t raw_cs_scope; hbool_t is_vl_data; size_t nelmts; /* number of elements selected to read */ na_addr_t dest = HG_Handler_get_addr(op_data->hg_handle); /* destination address to push data to */ @@ -464,6 +474,14 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, opened_locally = TRUE; } + if(H5P_DEFAULT == input->dxpl_id) + input->dxpl_id = H5Pcopy(H5P_DATASET_XFER_DEFAULT); + dxpl_id = input->dxpl_id; + + /* get the scope for data integrity checks for raw data */ + if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + /* retrieve size of bulk data asked for to be read */ size = HG_Bulk_handle_get_size(bulk_handle); @@ -488,7 +506,7 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, if(!is_vl_data) { /* If the data is not VL, we can read the data from the array the normal way */ if(H5VL__iod_server_final_io(coh, iod_oh, space_id, src_id, - FALSE, buf, buf_size, rtid) < 0) { + FALSE, buf, buf_size, 0, raw_cs_scope, rtid) < 0) { fprintf(stderr, "can't read from array object\n"); ret_value = FAIL; goto done; @@ -518,11 +536,17 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); - /* calculate a checksum for the data to be sent */ - cs = H5checksum(buf, size, NULL); - + if(!(raw_cs_scope & H5_CHECKSUM_NONE)) { + /* calculate a checksum for the data to be sent */ + cs = H5checksum(buf, size, NULL); + } +#if H5VL_IOD_DEBUG + else { + fprintf(stderr, "NO TRANSFER DATA INTEGRITY CHECKS ON RAW DATA\n"); + } +#endif /* MSC - check if client requested to corrupt data */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) + if(H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); if(flag) { fprintf(stderr, "Injecting a bad data value to cause corruption \n"); @@ -587,8 +611,10 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, } } #endif - /* calculate a checksum for the data to be sent */ - cs = H5checksum(buf, buf_size, NULL); + if(!(raw_cs_scope & H5_CHECKSUM_NONE)) { + /* calculate a checksum for the data to be sent */ + cs = H5checksum(buf, buf_size, NULL); + } } /* Create a new block handle to write the data */ @@ -662,6 +688,7 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, hid_t space_id = input->space_id; /* file space selection */ hid_t dxpl_id = input->dxpl_id; /* transfer property list */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; size_t buf_size; void *buf = NULL; /* buffer to hold blob IDs */ size_t nelmts; /* number of elements selected to read */ @@ -877,17 +904,19 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t iod_id = input->iod_id; /* dset ID */ hg_bulk_t bulk_handle = input->bulk_handle; /* bulk handle for data */ hid_t space_id = input->space_id; /* file space selection */ - hid_t dxpl_id = input->dxpl_id; /* transfer property list */ uint32_t cs = input->checksum; /* checksum recieved for data */ hid_t src_id = input->mem_type_id; /* the memory type of the elements */ hid_t dst_id = input->dset_type_id; /* the datatype of the dataset's element */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; + hid_t dxpl_id; hg_bulk_block_t bulk_block_handle; /* HG block handle */ hg_bulk_request_t bulk_request; /* HG request */ size_t size, buf_size; hbool_t is_vl_data; uint32_t data_cs = 0; + uint32_t raw_cs_scope; unsigned u; void *buf = NULL; size_t nelmts; /* number of elements selected to read */ @@ -909,6 +938,10 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, opened_locally = TRUE; } + if(H5P_DEFAULT == input->dxpl_id) + input->dxpl_id = H5Pcopy(H5P_DATASET_XFER_DEFAULT); + dxpl_id = input->dxpl_id; + /* retrieve size of incoming bulk data */ size = HG_Bulk_handle_get_size(bulk_handle); @@ -931,24 +964,31 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); /* MSC - check if client requested to corrupt data */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) + if(H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); if(flag) { ((int *)buf)[0] = 10; } - /* If client specified a checksum, verify it */ - if(dxpl_id != H5P_DEFAULT && H5Pget_dxpl_checksum(dxpl_id, &data_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); - if(data_cs != 0) { - cs = H5checksum(buf, size, NULL); + /* get the scope for data integrity checks for raw data */ + if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + + /* verify data if transfer flag is set */ + if(raw_cs_scope & H5_CHECKSUM_TRANSFER) { + data_cs = H5checksum(buf, size, NULL); if(cs != data_cs) { fprintf(stderr, "Errrr.. Network transfer Data corruption. expecting %u, got %u\n", - data_cs, cs); + cs, data_cs); ret_value = FAIL; goto done; } } +#if H5VL_IOD_DEBUG + else { + fprintf(stderr, "NO TRANSFER DATA INTEGRITY CHECKS ON RAW DATA\n"); + } +#endif nelmts = (size_t)H5Sget_select_npoints(space_id); buf_size = 0; @@ -970,7 +1010,7 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") if(H5VL__iod_server_final_io(coh, iod_oh, space_id, dst_id, - TRUE, buf, buf_size, wtid) < 0) + TRUE, buf, buf_size, cs, raw_cs_scope, wtid) < 0) HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); #if H5VL_IOD_DEBUG @@ -1063,6 +1103,7 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t iod_id = input->iod_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; /* int rank = input->dims.rank; rank of dataset */ hbool_t opened_locally = FALSE; herr_t ret_value = SUCCEED; @@ -1097,7 +1138,7 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(iod_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -1231,7 +1272,8 @@ done: static herr_t H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, hid_t type_id, hbool_t write_op, void *buf, - size_t buf_size, iod_trans_id_t tid) + size_t buf_size, uint32_t cs, uint32_t cs_scope, + iod_trans_id_t tid) { int ndims, i; /* dataset's rank/number of dimensions */ hssize_t num_descriptors = 0, n; /* number of IOD file descriptors needed to describe filespace selection */ @@ -1281,10 +1323,17 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, (sizeof(iod_array_io_t) * (size_t)num_descriptors))) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate iod array"); - /* allocate cs array */ - if(NULL == (cs_list = (iod_checksum_t *)calloc - (sizeof(iod_checksum_t), (size_t)num_descriptors))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate checksum array"); + if(cs_scope & H5_CHECKSUM_IOD) { + /* allocate cs array */ + if(NULL == (cs_list = (iod_checksum_t *)calloc + (sizeof(iod_checksum_t), (size_t)num_descriptors))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate checksum array"); + } +#if H5VL_IOD_DEBUG + else { + fprintf(stderr, "NO IOD DATA INTEGRITY CHECKS ON RAW DATA\n"); + } +#endif /* allocate return array */ if(NULL == (ret_list = (iod_ret_t *)calloc @@ -1308,7 +1357,7 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, mem_desc->frag[0].len = (iod_size_t)num_bytes; /* If this is a write op, compute the checksum for each memory fragment */ - if(write_op) + if(write_op && (cs_scope & H5_CHECKSUM_IOD)) cs_list[n] = H5checksum(buf_ptr, (size_t)num_bytes, NULL); buf_ptr += num_bytes; @@ -1329,7 +1378,10 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, io_array[n].hints = NULL; io_array[n].mem_desc = mem_desc; io_array[n].io_desc = &file_desc; - io_array[n].cs = &cs_list[n]; + if(cs_scope & H5_CHECKSUM_IOD) + io_array[n].cs = &cs_list[n]; + else + io_array[n].cs = NULL; io_array[n].ret = &ret_list[n]; } @@ -1358,15 +1410,12 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, #if 0 /* If this is a read operation, compute checksum for each IOD read, and compare it against checksum returned from IOD */ - if(!write_op) { + if(!write_op && (cs_scope & H5_CHECKSUM_IOD)) { hsize_t num_bytes = 0; hsize_t num_elems = 1; uint32_t checksum; - H5_checksum_seed_t cs; buf_ptr = (uint8_t *)buf; - cs.a = cs.b = cs.c = cs.state = 0; - cs.total_length = buf_size; for(n=0 ; ndtype_id; /* The ID of the datatype that needs to be created */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t dtype_oh, cur_oh, mdkv_oh; iod_obj_id_t cur_id, mdkv_id, attr_id; const char *name = input->name; /* name of dtype including path to commit */ @@ -114,11 +115,18 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); - /* set scratch pad in datatype */ - if (iod_obj_set_scratch(dtype_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; + + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if (iod_obj_set_scratch(dtype_oh, wtid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { + if (iod_obj_set_scratch(dtype_oh, wtid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* Store Metadata in scratch pad */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) @@ -267,6 +275,7 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t dtype_oh, mdkv_oh; const char *name = input->name; /* name of dtype including path to open */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; size_t buf_size; /* size of serialized datatype */ void *buf = NULL; iod_mem_desc_t *mem_desc = NULL; /* memory descriptor used for reading */ @@ -291,7 +300,7 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(dtype_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index 6cf4d75..670511d 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -441,6 +441,7 @@ static int hg_proc_plist_t(hg_proc_t proc, hid_t *data) case HG_ENCODE: plist_id = *data; + /* if(H5P_FILE_CREATE_DEFAULT != plist_id && H5P_GROUP_CREATE_DEFAULT != plist_id && H5P_LINK_CREATE_DEFAULT != plist_id && H5P_DATASET_CREATE_DEFAULT != plist_id && H5P_FILE_ACCESS_DEFAULT != plist_id && H5P_GROUP_ACCESS_DEFAULT != plist_id && @@ -448,7 +449,8 @@ static int hg_proc_plist_t(hg_proc_t proc, hid_t *data) H5P_DATASET_ACCESS_DEFAULT != plist_id && H5P_DATASET_XFER_DEFAULT != plist_id && H5P_DATATYPE_CREATE_DEFAULT != plist_id && H5P_DATATYPE_ACCESS_DEFAULT != plist_id && H5P_LINK_ACCESS_DEFAULT != plist_id && H5P_RC_ACQUIRE_DEFAULT != plist_id && - H5P_TR_START_DEFAULT != plist_id && H5P_TR_FINISH_DEFAULT != plist_id) { + H5P_TR_START_DEFAULT != plist_id && H5P_TR_FINISH_DEFAULT != plist_id) */ + if(H5P_OBJECT_COPY_DEFAULT != plist_id) { if(H5Pencode(plist_id, NULL, &plist_size) < 0) { HG_ERROR_DEFAULT("PLIST encode Proc error"); return HG_FAIL; diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c index 5be610bd..338cebc 100644 --- a/src/H5VLiod_file.c +++ b/src/H5VLiod_file.c @@ -57,13 +57,13 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t mdkv_id, attr_id; /* metadata and attribute KV IDs for the file */ iod_ret_t ret; iod_trans_id_t first_tid = 0; + uint32_t cs_scope = 0; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Start file create %s %d %d\n", - input->name, input->fapl_id, input->fcpl_id); + fprintf(stderr, "Start file create %s\n", input->name); #endif /* convert HDF5 flags to IOD flags */ @@ -71,6 +71,9 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, if (input->flags&H5F_ACC_CREAT) mode |= IOD_CONT_CREATE; + if(H5Pget_metadata_integrity_scope(input->fapl_id, &cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + /* Create the Container */ if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't create container"); @@ -98,7 +101,6 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, void *key = NULL; void *value = NULL; hid_t fcpl_id; - iod_checksum_t sp_cs; /* create the metadata KV object for the root group */ if(iod_obj_create(coh, first_tid, NULL, IOD_OBJ_KV, @@ -116,11 +118,21 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; - /* set scratch pad in root group */ - if (iod_obj_set_scratch(root_oh, first_tid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + /* set scratch pad in root group */ + if (iod_obj_set_scratch(root_oh, first_tid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { +#if H5VL_IOD_DEBUG + fprintf(stderr, "METADATA INTEGRITY DISABLED\n"); +#endif + if (iod_obj_set_scratch(root_oh, first_tid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* Store Metadata in scratch pad */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) @@ -128,11 +140,9 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, /* store metadata */ - if(H5P_DEFAULT == input->fcpl_id) input->fcpl_id = H5Pcopy(H5P_FILE_CREATE_DEFAULT); fcpl_id = input->fcpl_id; - /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, first_tid, fcpl_id, NULL, NULL, NULL) < 0) @@ -243,6 +253,7 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, iod_checksum_t sp_cs = 0; iod_container_tids_t tids; iod_trans_id_t rtid; + uint32_t cs_scope = 0; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -251,6 +262,9 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start file open %s %d %d\n", input->name, input->flags, input->fapl_id); #endif + if(H5Pget_metadata_integrity_scope(input->fapl_id, &cs_scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + /* open the container */ if(iod_container_open(input->name, NULL /*hints*/, mode, &coh, NULL /*event*/)) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open file"); @@ -274,7 +288,7 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(root_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for root object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index 9dca946..6aa7301 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -56,6 +56,7 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, const char *name = input->name; /* path relative to loc_id and loc_oh */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t grp_oh, cur_oh, mdkv_oh; iod_obj_id_t cur_id, mdkv_id, attr_id; char *last_comp = NULL; /* the name of the group obtained from traversal function */ @@ -93,8 +94,6 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, /* for the process that succeeded in creating the group, create the scratch pad for it too */ if(0 == ret) { - iod_checksum_t sp_cs; - /* create the metadata KV object for the group */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &mdkv_id, NULL) < 0) @@ -111,11 +110,18 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); - /* set scratch pad in group */ - if (iod_obj_set_scratch(grp_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; + + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if (iod_obj_set_scratch(grp_oh, wtid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { + if (iod_obj_set_scratch(grp_oh, wtid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* store metadata */ /* Open Metadata KV object for write */ @@ -214,6 +220,7 @@ H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; /* The ID of the current location object */ const char *name = input->name; /* group name including path to open */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_obj_id_t grp_id; /* The ID of the group that needs to be opened */ iod_handle_t grp_oh, mdkv_oh; /* The group handle and its metadata KV handle */ scratch_pad sp; @@ -234,7 +241,7 @@ H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(grp_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index 25389f4..1028f78 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -50,6 +50,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t coh = input->coh; /* the container handle */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t src_oh; /* The handle for creation src object */ iod_obj_id_t src_id; /* The ID of the creation src object */ iod_handle_t target_oh; @@ -95,7 +96,7 @@ H5VL_iod_server_link_create_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(target_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -204,6 +205,7 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t coh = input->coh; /* the container handle */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t src_oh; /* The handle for src object group */ iod_obj_id_t src_id; /* The ID of the src object */ iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ @@ -279,7 +281,7 @@ H5VL_iod_server_link_move_cb(AXE_engine_t UNUSED axe_engine, /* get scratch pad */ if(iod_obj_get_scratch(target_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -386,6 +388,7 @@ H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t cur_id; const char *loc_name = input->path; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; char *last_comp = NULL; htri_t ret = -1; iod_size_t kv_size = 0; @@ -471,6 +474,7 @@ H5VL_iod_server_link_get_info_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t cur_id; const char *loc_name = input->path; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; char *last_comp = NULL; H5VL_iod_link_t iod_link; herr_t ret_value = SUCCEED; @@ -571,6 +575,7 @@ H5VL_iod_server_link_get_val_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; size_t length = input->length; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t cur_oh; iod_obj_id_t cur_id; const char *loc_name = input->path; @@ -619,7 +624,8 @@ H5VL_iod_server_link_get_val_cb(AXE_engine_t UNUSED axe_engine, done: #if H5VL_IOD_DEBUG - fprintf(stderr, "Done with get link_val, sending (%s) response to client\n", output.value.val); + fprintf(stderr, "Done with get link_val, sending (%s) response to client\n", + (char *)output.value.val); #endif if(ret_value < 0) { output.ret = ret_value; @@ -670,6 +676,7 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t cur_oh; iod_obj_id_t cur_id; const char *loc_name = input->path; @@ -724,7 +731,7 @@ H5VL_iod_server_link_remove_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_map.c b/src/H5VLiod_map.c index 7181553..8b70025 100644 --- a/src/H5VLiod_map.c +++ b/src/H5VLiod_map.c @@ -61,6 +61,7 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, hid_t valtype = input->valtype_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t map_oh, cur_oh, mdkv_oh; iod_obj_id_t cur_id, mdkv_id, attr_id; char *last_comp; /* the name of the group obtained from traversal function */ @@ -115,11 +116,19 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, sp[1] = attr_id; sp[2] = IOD_ID_UNDEFINED; sp[3] = IOD_ID_UNDEFINED; - sp_cs = H5checksum(&sp, sizeof(sp), NULL); /* set scratch pad in map */ - if (iod_obj_set_scratch(map_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + if(cs_scope & H5_CHECKSUM_IOD) { + iod_checksum_t sp_cs; + + sp_cs = H5checksum(&sp, sizeof(sp), NULL); + if (iod_obj_set_scratch(map_oh, wtid, &sp, &sp_cs, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } + else { + if (iod_obj_set_scratch(map_oh, wtid, &sp, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + } /* Open Metadata KV object for write */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) @@ -214,6 +223,7 @@ H5VL_iod_server_map_open_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; const char *name = input->name; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_obj_id_t map_id; /* The ID of the map that needs to be opened */ iod_handle_t map_oh, mdkv_oh; scratch_pad sp; @@ -237,7 +247,7 @@ H5VL_iod_server_map_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(map_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -329,6 +339,7 @@ H5VL_iod_server_map_set_cb(AXE_engine_t UNUSED axe_engine, hid_t dxpl_id = input->dxpl_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; size_t key_size, val_size; iod_kv_t kv; hbool_t opened_locally = FALSE; @@ -438,6 +449,7 @@ H5VL_iod_server_map_get_cb(AXE_engine_t UNUSED axe_engine, binary_buf_t key = input->key; hid_t dxpl_id = input->dxpl_id; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; hbool_t val_is_vl = input->val_is_vl; size_t client_val_buf_size = input->val_size; hbool_t key_is_vl = FALSE; @@ -633,6 +645,7 @@ H5VL_iod_server_map_get_count_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t iod_oh = input->iod_oh; iod_obj_id_t iod_id = input->iod_id; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_size_t num; hbool_t opened_locally = FALSE; herr_t ret_value = SUCCEED; @@ -712,6 +725,7 @@ H5VL_iod_server_map_exists_cb(AXE_engine_t UNUSED axe_engine, hid_t key_maptype_id = input->key_maptype_id; binary_buf_t key = input->key; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; size_t key_size; iod_size_t val_size; hbool_t opened_locally = FALSE; @@ -799,6 +813,7 @@ H5VL_iod_server_map_delete_cb(AXE_engine_t UNUSED axe_engine, binary_buf_t key = input->key; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; size_t key_size; iod_kv_t kv; iod_kv_params_t kvs; diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c index 275f45d..45e026d 100644 --- a/src/H5VLiod_obj.c +++ b/src/H5VLiod_obj.c @@ -49,6 +49,7 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, object_open_out_t output; iod_handle_t coh = input->coh; /* the container handle */ iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh; /* The handle for object */ iod_obj_id_t obj_id; /* The ID of the object */ iod_handle_t mdkv_oh; @@ -71,7 +72,7 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -264,6 +265,7 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t coh = input->coh; /* the container handle */ iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t dst_oh; /* The handle for the dst object where link is created*/ iod_obj_id_t dst_id; /* The ID of the dst object where link is created*/ iod_obj_id_t obj_id; /* The ID of the object to be moved/copied */ @@ -303,7 +305,7 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -459,6 +461,7 @@ H5VL_iod_server_object_exists_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t loc_oh = input->loc_oh; iod_obj_id_t loc_id = input->loc_id; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh; iod_obj_id_t obj_id; const char *loc_name = input->loc_name; @@ -529,6 +532,7 @@ H5VL_iod_server_object_get_info_cb(AXE_engine_t UNUSED axe_engine, iod_handle_t loc_oh = input->loc_oh; iod_obj_id_t loc_id = input->loc_id; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh, mdkv_oh, attrkv_oh; iod_obj_id_t obj_id; scratch_pad sp; @@ -550,7 +554,7 @@ H5VL_iod_server_object_get_info_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -662,6 +666,7 @@ H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; iod_trans_id_t wtid = input->trans_num; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh, mdkv_oh; iod_obj_id_t obj_id; const char *loc_name = input->path; @@ -680,7 +685,7 @@ H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); @@ -760,6 +765,7 @@ H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, iod_obj_id_t loc_id = input->loc_id; size_t length = input->length; iod_trans_id_t rtid = input->rcxt_num; + uint32_t cs_scope = input->cs_scope; iod_handle_t obj_oh, mdkv_oh; iod_obj_id_t obj_id; const char *loc_name = input->path; @@ -778,7 +784,7 @@ H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); - if(sp_cs) { + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); diff --git a/src/H5VLiod_trans.c b/src/H5VLiod_trans.c index f8db2e3..e975c2f 100644 --- a/src/H5VLiod_trans.c +++ b/src/H5VLiod_trans.c @@ -62,8 +62,9 @@ H5VL_iod_server_rcxt_acquire_cb(AXE_engine_t UNUSED axe_engine, input->rcapl_id = H5Pcopy(H5P_RC_ACQUIRE_DEFAULT); rcapl_id = input->rcapl_id; - if(H5Pget_rcapl_version_request(rcapl_id, &acquire_req) < 0) + if(H5Pget_rcapl_version_request(rcapl_id, &acquire_req) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't get acquire request property"); + } switch(acquire_req) { case H5RC_EXACT: diff --git a/src/H5VLiod_util.c b/src/H5VLiod_util.c index 82bc2f8..f5de7ee 100644 --- a/src/H5VLiod_util.c +++ b/src/H5VLiod_util.c @@ -477,7 +477,6 @@ H5VL_iod_insert_plist(iod_handle_t oh, iod_trans_id_t tid, hid_t plist_id, kv.key = (char *)key; kv.value = value; kv.value_len = (iod_size_t)buf_size; - /* insert kv pair into KV object */ if (iod_kv_set(oh, tid, hints, &kv, cs, event) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); -- cgit v0.12