From bf79e1bd766c0660ecd5b26daf2658b98f2732a0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 27 Nov 2018 22:15:34 -0600 Subject: Added 'notify' callback for async requests; switched VOL class and info comparison to return comparison value as parameter, so they can return error values; "cancelled" -> "canceled"; switched order of 'wrap_object' and 'free_wrap_ctx' management callbacks. --- examples/h5_vol_external_log_native.c | 1 + src/H5ESpublic.h | 2 +- src/H5Pfapl.c | 14 ++- src/H5VL.c | 3 +- src/H5VLcallback.c | 184 ++++++++++++++++++++++++++++++---- src/H5VLint.c | 64 +++++++----- src/H5VLnative.c | 47 ++++----- src/H5VLprivate.h | 7 +- src/H5VLpublic.h | 13 ++- src/H5trace.c | 4 +- 10 files changed, 257 insertions(+), 82 deletions(-) diff --git a/examples/h5_vol_external_log_native.c b/examples/h5_vol_external_log_native.c index accae03..24fc254 100644 --- a/examples/h5_vol_external_log_native.c +++ b/examples/h5_vol_external_log_native.c @@ -120,6 +120,7 @@ static const H5VL_class_t H5VL_log_g = { }, { /* request_cls */ NULL, /* wait */ + NULL, /* notify */ NULL, /* cancel */ NULL, /* specific */ NULL, /* optional */ diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h index 2df1a6e..e3b1b56 100644 --- a/src/H5ESpublic.h +++ b/src/H5ESpublic.h @@ -29,7 +29,7 @@ typedef enum H5ES_status_t { H5ES_STATUS_IN_PROGRESS, /* Operation has not yet completed */ H5ES_STATUS_SUCCEED, /* Operation has completed, successfully */ H5ES_STATUS_FAIL, /* Operation has completed, but failed */ - H5ES_STATUS_CANCELLED /* Operation has not completed and was cancelled */ + H5ES_STATUS_CANCELED /* Operation has not completed and was canceled */ } H5ES_status_t; diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index a792e57..e802e3b 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5309,7 +5309,8 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED const H5VL_connector_prop_t *info1 = (const H5VL_connector_prop_t *)_info1; /* Create local aliases for values */ const H5VL_connector_prop_t *info2 = (const H5VL_connector_prop_t *)_info2; H5VL_class_t *cls1, *cls2; /* connector class for each property */ - int cmp_value; /* Value from comparison */ + int cmp_value = 0; /* Value from comparison */ + herr_t status; /* Status from info comparison */ int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -5324,7 +5325,9 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED HGOTO_DONE(-1) if(NULL == (cls2 = (H5VL_class_t *)H5I_object(info2->connector_id))) HGOTO_DONE(1) - if(0 != (cmp_value = H5VL_cmp_connector_cls(cls1, cls2))) + status = H5VL_cmp_connector_cls(&cmp_value, cls1, cls2); + HDassert(status >= 0); + if(cmp_value != 0) HGOTO_DONE(cmp_value); /* At this point, we should be able to assume that we are dealing with @@ -5336,8 +5339,11 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED * info objects */ HDassert(cls1->info_cmp == cls2->info_cmp); - if(0 != (cmp_value = H5VL_cmp_connector_info(cls1, info1->connector_info, info2->connector_info))) - HGOTO_DONE(cmp_value); + status = H5VL_cmp_connector_info(cls1, &cmp_value, info1->connector_info, info2->connector_info); + HDassert(status >= 0); + + /* Set return value */ + ret_value = cmp_value; done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5VL.c b/src/H5VL.c index 5eeb201..268b9d2 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -512,7 +512,8 @@ H5VLcmp_connector_cls(int *cmp, hid_t connector_id1, hid_t connector_id2) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID") /* Compare the two VOL connector classes */ - *cmp = H5VL_cmp_connector_cls(cls1, cls2); + if(H5VL_cmp_connector_cls(cmp, cls1, cls2) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector classes") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 2c77416..74448af 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -171,6 +171,8 @@ static herr_t H5VL__datatype_close(void *obj, const H5VL_class_t *cls, hid_t dxp void **req); static herr_t H5VL__request_wait(void *req, const H5VL_class_t *cls, uint64_t timeout, H5ES_status_t *status); +static herr_t H5VL__request_notify(void *req, const H5VL_class_t *cls, + H5VL_request_notify_t cb, void *ctx); static herr_t H5VL__request_cancel(void *req, const H5VL_class_t *cls); static herr_t H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific_t specific_type, va_list arguments); @@ -403,44 +405,53 @@ done: /*------------------------------------------------------------------------- * Function: H5VL_cmp_connector_info * - * Purpose: Compare VOL info for a connector + * Purpose: Compare VOL info for a connector. Sets *cmp_value to + * positive if INFO1 is greater than INFO2, negative if + * INFO2 is greater than INFO1 and zero if INFO1 and + * INFO2 are equal. * - * Return: Positive if VALUE1 is greater than VALUE2, negative if - * VALUE2 is greater than VALUE1 and zero if VALUE1 and - * VALUE2 are equal. + * Return: Success: Non-negative + * Failure: Negative * *------------------------------------------------------------------------- */ -int -H5VL_cmp_connector_info(const H5VL_class_t *connector, const void *info1, - const void *info2) +herr_t +H5VL_cmp_connector_info(const H5VL_class_t *connector, int *cmp_value, + const void *info1, const void *info2) { - int cmp_value; /* Value from comparison */ - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(connector); + HDassert(cmp_value); + + /* Take care of cases where one or both pointers is NULL */ + if(info1 == NULL && info2 != NULL) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED); + } /* end if */ + if(info1 != NULL && info2 == NULL) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED); + } /* end if */ + if(info1 == NULL && info2 == NULL) { + *cmp_value = 0; + HGOTO_DONE(SUCCEED); + } /* end if */ /* Use the class's info comparison routine to compare the info objects, * if there is a a callback, otherwise just compare the info objects as * memory buffers */ if(connector->info_cmp) { - if(0 != (cmp_value = (connector->info_cmp)(info1, info2))) - HGOTO_DONE(cmp_value); + if((connector->info_cmp)(cmp_value, info1, info2) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector info") } /* end if */ else { - if(info1 == NULL && info2 != NULL) - HGOTO_DONE(-1); - if(info1 != NULL && info2 == NULL) - HGOTO_DONE(1); - if(info1) { - HDassert(connector->info_size > 0); - if(0 != (cmp_value = HDmemcmp(info1, info2, connector->info_size))) - HGOTO_DONE(cmp_value); - } /* end if */ + HDassert(connector->info_size > 0); + *cmp_value = HDmemcmp(info1, info2, connector->info_size); } /* end else */ done: @@ -478,7 +489,7 @@ H5VLcmp_connector_info(int *cmp, hid_t connector_id, const void *info1, const vo /* Compare the two VOL connector info objects */ if(cmp) - *cmp = H5VL_cmp_connector_info(cls, info1, info2); + H5VL_cmp_connector_info(cls, cmp, info1, info2); done: FUNC_LEAVE_API(ret_value) @@ -5846,6 +5857,9 @@ done: * * Purpose: Waits on an asychronous request through the VOL * + * Note: Releases the request if the operation has completed and the + * connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * @@ -5882,6 +5896,9 @@ done: * * Purpose: Waits on an asychronous request through the VOL * + * Note: Releases the request if the operation has completed and the + * connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * @@ -5922,6 +5939,9 @@ done: * * Purpose: Waits on a request * + * Note: Releases the request if the operation has completed and the + * connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * @@ -5950,10 +5970,128 @@ done: /*------------------------------------------------------------------------- + * Function: H5VL__request_notify + * + * Purpose: Registers a user callback to be invoked when an asynchronous + * operation completes + * + * Note: Releases the request, if connector callback succeeds + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL__request_notify(void *req, const H5VL_class_t *cls, H5VL_request_notify_t cb, + void *ctx) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(req); + HDassert(cls); + + /* Check if the corresponding VOL callback exists */ + if(NULL == cls->request_cls.notify) + HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "VOL connector has no 'async notify' method") + + /* Call the corresponding VOL callback */ + if((cls->request_cls.notify)(req, cb, ctx) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "request notify failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL__request_notify() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_request_notify + * + * Purpose: Registers a user callback to be invoked when an asynchronous + * operation completes + * + * Note: Releases the request, if connector callback succeeds + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, + void *ctx) +{ + hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(vol_obj); + + /* Set wrapper info in API context */ + if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info") + vol_wrapper_set = TRUE; + + /* Call the corresponding internal VOL routine */ + if(H5VL__request_notify(vol_obj->data, vol_obj->connector->cls, cb, ctx) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "request notify failed") + +done: + /* Reset object wrapping info in API context */ + if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) + HDONE_ERROR(H5E_VOL, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_request_notify() */ + + +/*------------------------------------------------------------------------- + * Function: H5VLrequest_notify + * + * Purpose: Registers a user callback to be invoked when an asynchronous + * operation completes + * + * Note: Releases the request, if connector callback succeeds + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, + void *ctx) +{ + H5VL_class_t *cls; /* VOL connector's class struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API_NOINIT + + /* Get class pointer */ + if(NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a VOL connector ID") + + /* Call the corresponding internal VOL routine */ + if(H5VL__request_notify(req, cls, cb, ctx) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "unable to register notify callback for request") + +done: + FUNC_LEAVE_API_NOINIT(ret_value) +} /* end H5VLrequest_notify() */ + + +/*------------------------------------------------------------------------- * Function: H5VL__request_cancel * * Purpose: Cancels an asynchronous request through the VOL * + * Note: Releases the request, if connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * @@ -5988,6 +6126,8 @@ done: * * Purpose: Cancels an asynchronous request through the VOL * + * Note: Releases the request, if connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * @@ -6027,6 +6167,8 @@ done: * * Purpose: Cancels a request * + * Note: Releases the request, if connector callback succeeds + * * Return: Success: Non-negative * Failure: Negative * diff --git a/src/H5VLint.c b/src/H5VLint.c index 167d098..82886cd 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -883,47 +883,65 @@ done: * *------------------------------------------------------------------------- */ -int -H5VL_cmp_connector_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls2) +herr_t +H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_class_t *cls2) { - int cmp_value; /* Value from comparison */ - int ret_value = 0; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(cls1); - HDassert(cls1); + HDassert(cls2); /* Compare connector "values" */ - if(cls1->value < cls2->value) - HGOTO_DONE(-1) - if(cls1->value > cls2->value) - HGOTO_DONE(1) + if(cls1->value < cls2->value) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->value > cls2->value) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->value == cls2->value); /* Compare connector names */ - if(cls1->name == NULL && cls2->name != NULL) - HGOTO_DONE(-1); - if(cls1->name != NULL && cls2->name == NULL) - HGOTO_DONE(1); - if(0 != (cmp_value = HDstrcmp(cls1->name, cls2->name))) - HGOTO_DONE(cmp_value); + if(cls1->name == NULL && cls2->name != NULL) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->name != NULL && cls2->name == NULL) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(0 != (*cmp_value = HDstrcmp(cls1->name, cls2->name))) + HGOTO_DONE(SUCCEED) /* Compare connector VOL API versions */ - if(cls1->version < cls2->version) - HGOTO_DONE(-1) - if(cls1->version > cls2->version) - HGOTO_DONE(1) + if(cls1->version < cls2->version) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->version > cls2->version) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->version == cls2->version); /* Compare connector info */ - if(cls1->info_size < cls2->info_size) - HGOTO_DONE(-1) - if(cls1->info_size > cls2->info_size) - HGOTO_DONE(1) + if(cls1->info_size < cls2->info_size) { + *cmp_value = -1; + HGOTO_DONE(SUCCEED) + } /* end if */ + if(cls1->info_size > cls2->info_size) { + *cmp_value = 1; + HGOTO_DONE(SUCCEED) + } /* end if */ HDassert(cls1->info_size == cls2->info_size); + /* Set comparison value to 'equal' */ + *cmp_value = 0; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_cmp_connector_cls() */ diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 3fad8e1..6c51d95 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -134,8 +134,8 @@ static H5VL_class_t H5VL_native_cls_g = { NULL, /* str to info */ NULL, /* get_object */ NULL, /* get_wrap_ctx */ - NULL, /* free_wrap_ctx */ NULL, /* wrap_object */ + NULL, /* free_wrap_ctx */ { /* attribute_cls */ H5VL__native_attr_create, /* create */ H5VL__native_attr_open, /* open */ @@ -197,6 +197,7 @@ static H5VL_class_t H5VL_native_cls_g = { }, { /* request_cls */ NULL, /* wait */ + NULL, /* notify */ NULL, /* cancel */ NULL, /* specific */ NULL, /* optional */ @@ -292,7 +293,7 @@ done: * * Purpose: Creates an attribute on an object. * - * Return: Success: attr id. + * Return: Success: Pointer to attribute object * Failure: NULL * *------------------------------------------------------------------------- @@ -365,9 +366,9 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_attr_open * - * Purpose: Opens a attr inside a native h5 file. + * Purpose: Opens an attr inside a native H5 file. * - * Return: Success: attr id. + * Return: Success: Pointer to attribute object * Failure: NULL * * Programmer: Mohamad Chaarawi @@ -423,9 +424,9 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_attr_read * - * Purpose: Reads in data from attribute. + * Purpose: Reads data from attribute. * - * Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Mohamad Chaarawi * March, 2012 @@ -456,9 +457,9 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_attr_write * - * Purpose: Writes out data to attribute. + * Purpose: Writes data to attribute. * - * Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Mohamad Chaarawi * March, 2012 @@ -489,7 +490,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_attr_get * - * Purpose: Gets certain information about an attribute + * Purpose: Gets information about an attribute * * Return: Success: 0 * Failure: -1 @@ -673,7 +674,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_attr_specific * - * Purpose: Specific operations for attributes + * Purpose: Specific operation on attribute * * Return: Success: 0 * Failure: -1 @@ -1176,7 +1177,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_dataset_specific * - * Purpose: Specific operations for datasets + * Purpose: Specific operation on dataset * * Return: SUCCEED/FAIL * @@ -1496,7 +1497,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_file_get * - * Purpose: Gets certain data about a file + * Purpose: Get info about a file * * Return: SUCCEED/FAIL * @@ -1648,7 +1649,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_file_specific * - * Purpose: Perform an operation + * Purpose: Specific operation on file * * Return: SUCCEED/FAIL * @@ -2307,7 +2308,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_group_get * - * Purpose: Gets data about a group + * Purpose: Get info about a group * * Return: SUCCEED/FAIL * @@ -2754,7 +2755,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_link_get * - * Purpose: Gets certain data about a link + * Purpose: Get info about a link * * Return: Success: 0 * Failure: -1 @@ -2847,7 +2848,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_link_specific * - * Purpose: Specific operations with links + * Purpose: Specific operation on a link * * Return: Success: 0 * Failure: -1 @@ -2959,7 +2960,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_object_open * - * Purpose: Opens a object inside a native h5 file. + * Purpose: Opens an object inside a native h5 file. * * Return: Success: object id. * Failure: NULL @@ -3040,10 +3041,10 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_object_copy * - * Purpose: Copys a object inside a native h5 file. + * Purpose: Copies an object inside a native h5 file. * - * Return: Success: object id. - * Failure: NULL + * Return: Success: 0 + * Failure: -1 * * Programmer: Mohamad Chaarawi * March, 2012 @@ -3174,7 +3175,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_object_specific * - * Purpose: Perform a connector-specific operation for an objectibute + * Purpose: Specific operation on an object * * Return: SUCCEED/FAIL * @@ -3533,7 +3534,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_datatype_get * - * Purpose: Gets certain information about a datatype + * Purpose: Get information about a datatype * * Return: Success: 0 * Failure: -1 @@ -3639,7 +3640,7 @@ done: /*------------------------------------------------------------------------- * Function: H5VL__native_datatype_close * - * Purpose: Closes an datatype. + * Purpose: Closes a datatype. * * Return: Success: 0 * Failure: -1, datatype not closed. diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index ca0c87e..ef5a81e 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -63,7 +63,7 @@ typedef enum H5VL_get_connector_kind_t { /* Utility functions */ H5_DLL herr_t H5VL_init(void); -H5_DLL int H5VL_cmp_connector_cls(const H5VL_class_t *cls1, const H5VL_class_t *cls); +H5_DLL herr_t H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_class_t *cls2); H5_DLL herr_t H5VL_conn_copy(H5VL_connector_prop_t *value); H5_DLL herr_t H5VL_conn_free(const H5VL_connector_prop_t *info); @@ -110,8 +110,8 @@ H5_DLL herr_t H5VL_register_using_existing_id(H5I_type_t type, void *object, H5V /* Connector "management" functions */ H5_DLL int H5VL_copy_connector_info(const H5VL_class_t *connector, void **dst_info, const void *src_info); -H5_DLL int H5VL_cmp_connector_info(const H5VL_class_t *connector, const void *info1, - const void *info2); +H5_DLL herr_t H5VL_cmp_connector_info(const H5VL_class_t *connector, int *cmp_value, + const void *info1, const void *info2); H5_DLL herr_t H5VL_free_connector_info(const H5VL_class_t *connector, void *info); /* Attribute functions */ @@ -175,6 +175,7 @@ H5_DLL herr_t H5VL_datatype_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, v /* Asynchronous functions */ H5_DLL herr_t H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout, H5ES_status_t *status); +H5_DLL herr_t H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void *ctx); H5_DLL herr_t H5VL_request_cancel(const H5VL_object_t *vol_obj); H5_DLL herr_t H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_t specific_type, ...); H5_DLL herr_t H5VL_request_optional(const H5VL_object_t *vol_obj, ...); diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 92664aa..b89946d 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -337,9 +337,13 @@ typedef struct H5VL_object_class_t { herr_t (*optional)(void *obj, hid_t dxpl_id, void **req, va_list arguments); } H5VL_object_class_t; -/* Async operation routines */ +/* Asynchronous request 'notify' callback */ +typedef herr_t (*H5VL_request_notify_t)(void *ctx, H5ES_status_t status); + +/* Async request operation routines */ typedef struct H5VL_request_class_t { herr_t (*wait)(void *req, uint64_t timeout, H5ES_status_t *status); + herr_t (*notify)(void *req, H5VL_request_notify_t cb, void *ctx); herr_t (*cancel)(void *req); herr_t (*specific)(void *req, H5VL_request_specific_t specific_type, va_list arguments); herr_t (*optional)(void *req, va_list arguments); @@ -383,14 +387,14 @@ typedef struct H5VL_class_t { herr_t (*terminate)(void); /* Connector termination callback */ size_t info_size; /* size of the vol info */ void * (*info_copy)(const void *info); /* Callback to create a copy of the vol info */ - int (*info_cmp)(const void *info1, const void *info2); /* Callback to compare vol info */ + herr_t (*info_cmp)(int *cmp_value, const void *info1, const void *info2); /* Callback to compare vol info */ herr_t (*info_free)(void *info); /* Callback to release the vol info copy */ herr_t (*info_to_str)(const void *info, char **str); /* Callback to serialize connector's info into a string */ herr_t (*str_to_info)(const char *str, void **info); /* Callback to deserialize a string into connector's info */ void * (*get_object)(const void *obj); /* Callback to retrieve underlying object */ herr_t (*get_wrap_ctx)(const void *obj, void **wrap_ctx); /* Callback to retrieve the object wrapping context for the connector */ - herr_t (*free_wrap_ctx)(void *wrap_ctx); /* Callback to release the object wrapping context for the connector */ void* (*wrap_object)(void *obj, void *wrap_ctx); /* Callback to wrap an object */ + herr_t (*free_wrap_ctx)(void *wrap_ctx); /* Callback to release the object wrapping context for the connector */ /* Data Model */ H5VL_attr_class_t attr_cls; /* attribute class callbacks */ @@ -454,8 +458,8 @@ H5_DLL herr_t H5VLconnector_info_to_str(const void *info, hid_t connector_id, ch H5_DLL herr_t H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info); H5_DLL void *H5VLget_object(void *obj, hid_t connector_id); H5_DLL herr_t H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx); -H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id); H5_DLL void *H5VLwrap_object(void *obj, hid_t connector_id, void *wrap_ctx); +H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id); /* Public wrappers for attribute callbacks */ H5_DLL void *H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); @@ -524,6 +528,7 @@ H5_DLL herr_t H5VLdatatype_close(void *dt, hid_t connector_id, hid_t dxpl_id, vo /* Public wrappers for asynchronous request callbacks */ H5_DLL herr_t H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout, H5ES_status_t *status); +H5_DLL herr_t H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, void *ctx); H5_DLL herr_t H5VLrequest_cancel(void *req, hid_t connector_id); H5_DLL herr_t H5VLrequest_specific(void *req, hid_t connector_id, H5VL_request_specific_t specific_type, va_list arguments); H5_DLL herr_t H5VLrequest_optional(void *req, hid_t connector_id, va_list arguments); diff --git a/src/H5trace.c b/src/H5trace.c index db26d83..d69ab28 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -834,8 +834,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5ES_STATUS_FAIL: HDfprintf(out, "H5ES_STATUS_FAIL"); break; - case H5ES_STATUS_CANCELLED: - HDfprintf(out, "H5ES_STATUS_CANCELLED"); + case H5ES_STATUS_CANCELED: + HDfprintf(out, "H5ES_STATUS_CANCELED"); break; default: -- cgit v0.12