Switch 'get execution time' operation for async request tokens to be an optional operation and query if connector supports operation before retrieving it.

This commit is contained in:
Quincey Koziol 2021-04-10 21:29:42 -05:00
parent f684d660b3
commit 5ac92014da
3 changed files with 33 additions and 14 deletions

View File

@ -587,14 +587,27 @@ H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status)
/* Set appropriate info for callback */
if (H5VL_REQUEST_STATUS_SUCCEED == ev_status) {
uint64_t supported; /* Whether 'execution time' operation is supported by VOL connector */
/* Translate status */
op_status = H5ES_STATUS_SUCCEED;
/* Retrieve the execution time info */
if (H5VL_request_specific(ev->request, H5VL_REQUEST_GET_EXEC_TIME, &ev->op_info.op_exec_ts,
&ev->op_info.op_exec_time) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL,
"unable to retrieve execution time info for operation")
/* Check for 'execution time' callback */
supported = 0;
if (H5VL_introspect_opt_query(ev->request, H5VL_SUBCLS_REQUEST, H5VL_REQUEST_GET_EXEC_TIME, &supported) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL, "can't check for 'get execution time' operation")
if (supported & H5VL_OPT_QUERY_SUPPORTED) {
/* Retrieve the execution time info */
if (H5VL_request_optional(ev->request, H5VL_REQUEST_GET_EXEC_TIME, &ev->op_info.op_exec_ts,
&ev->op_info.op_exec_time) < 0)
HGOTO_ERROR(H5E_EVENTSET, H5E_CANTGET, FAIL,
"unable to retrieve execution time info for operation")
} /* end if */
else {
/* Set invalid values for execution timestamp and duration */
ev->op_info.op_exec_ts = UINT64_MAX;
ev->op_info.op_exec_time = UINT64_MAX;
} /* end else */
}
else
/* Translate status */

View File

@ -202,13 +202,15 @@ typedef enum H5VL_request_status_t {
/* types for async request SPECIFIC callback */
typedef enum H5VL_request_specific_t {
H5VL_REQUEST_GET_ERR_STACK, /* Retrieve error stack for failed operation */
H5VL_REQUEST_GET_TIME_ESTIMATE, /* Retrieve time estimate for completing operation */
H5VL_REQUEST_GET_EXEC_TIME /* Retrieve execution time for operation */
H5VL_REQUEST_GET_TIME_ESTIMATE /* Retrieve time estimate for completing operation */
} H5VL_request_specific_t;
/* Typedef and values for native VOL connector request optional VOL operations */
/* Typedef and values for VOL connector request optional VOL operations */
/* (This is an unusual case - we'd like to pre-define these operations, even
* though the native VOL connector doesn't implement them. QAK - 2021/04/10)
*/
typedef int H5VL_request_optional_t;
/* (No optional request VOL operations currently) */
#define H5VL_REQUEST_GET_EXEC_TIME 0 /* Retrieve execution time for operation */
/* types for 'blob' SPECIFIC callback */
typedef enum H5VL_blob_specific_t {

View File

@ -3364,10 +3364,6 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_REQUEST_GET_TIME_ESTIMATE");
break;
case H5VL_REQUEST_GET_EXEC_TIME:
H5RS_acat(rs, "H5VL_REQUEST_GET_EXEC_TIME");
break;
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@ -3715,7 +3711,15 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
{
H5VL_request_optional_t optional = (H5VL_request_optional_t)HDva_arg(ap, int);
H5RS_asprintf_cat(rs, "%ld", (long)optional);
switch (optional) {
case H5VL_REQUEST_GET_EXEC_TIME:
H5RS_acat(rs, "H5VL_REQUEST_GET_EXEC_TIME");
break;
default:
H5RS_asprintf_cat(rs, "%ld", (long)optional);
break;
} /* end switch */
} /* end block */
break;