diff --git a/src/H5ESint.c b/src/H5ESint.c index 5f2ad7cdc2..6ce09d5e12 100644 --- a/src/H5ESint.c +++ b/src/H5ESint.c @@ -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 */ diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 25527dee80..49edea5505 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -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 { diff --git a/src/H5trace.c b/src/H5trace.c index ef945c36a9..64758c188a 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -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;