Containment Domains C++ API  0.1
Containment Domains C++ API v0.1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Groups Pages
Classes | Functions
Detection and Recovery Methods

Classes

class  RecoverObject
 Recovery method that can be inherited and specialized by user. More...
 

Functions

CDErrT cd::CDHandle::CDAssert (bool test_true, const SysErrT *error_to_report=0)
 User-provided detection function for failing a CD. More...
 
CDErrT cd::CDHandle::CDAssertFail (bool test_true, const SysErrT *error_to_report=0)
 User-provided detection function for failing a CD. More...
 
CDErrT cd::CDHandle::CDAssertNotify (bool test_true, const SysErrT *error_to_report=0)
 User-provided detection function for failing a CD. More...
 
std::vector< SysErrT > cd::CDHandle::Detect (CDErrT *err_ret_val=0)
 Check whether any errors occurred while CD the executed. More...
 
CDErrT cd::CDHandle::RegisterDetection (uint system_name_mask, uint system_loc_mask,)
 Declare that this CD can detect certain errors/failures by user-defined detectors. More...
 
CDErrT cd::CDHandle::RegisterRecovery (uint error_name_mask, uint error_loc_mask, RecoverObject *recover_object=0)
 Register that this CD can recover from certain errors/failures. More...
 

Detailed Description

Function Documentation

CDErrT cd::CDHandle::CDAssert ( bool  test_true,
const SysErrT error_to_report = 0 
)

User-provided detection function for failing a CD.

A user may call CDAssert() at any time during CD execution to assert correct execution behavior. If the test fails, the CD fails and must recover.

The CD runtime implementation may choose whether the CD fails at the point that the CDAssert() fails or whether the assertion failure is registered but only acted upon during the CD detection phase.

Returns
kOK when the assertion call completed successfully (regardless of whether the test was true or false) and kError if the action taken by the runtime on CDAssert() failure did not succeed.
Parameters
[in]test_trueBoolean to be asserted as true.
[in,out]error_to_reportAn optional error report that will be used during recovery and for system diagnostics.
CDErrT cd::CDHandle::CDAssertFail ( bool  test_true,
const SysErrT error_to_report = 0 
)

User-provided detection function for failing a CD.

A user may call CDAssertFail() at any time during CD execution to assert correct execution behavior. If the test fails, the CD fails and must recover.

CDAssertFail() fails immediately and calls recovery.

Returns
kOK when the assertion call completed successfully (regardless of whether the test was true or false) and kError if the action taken by the runtime on CDAssert() failure did not succeed.
Warning
May not be implemented yet.
Parameters
[in]test_trueBoolean to be asserted as true.
[in,out]error_to_reportAn optional error report that will be used during recovery and for system diagnostics.
CDErrT cd::CDHandle::CDAssertNotify ( bool  test_true,
const SysErrT error_to_report = 0 
)

User-provided detection function for failing a CD.

A user may call CDAssert() at any time during CD execution to assert correct execution behavior. If the test fails, the CD fails and must recover.

CDAssertNotify() registers the assertion failure, which is only acted upon during the CD detection phase.

Returns
kOK when the assertion call completed successfully (regardless of whether the test was true or false) and kError if the action taken by the runtime on CDAssert() failure did not succeed.
Parameters
[in]test_trueBoolean to be asserted as true.
[in,out]error_to_reportAn optional error report that will be used during recovery and for system diagnostics.
std::vector<SysErrT> cd::CDHandle::Detect ( CDErrT err_ret_val = 0)

Check whether any errors occurred while CD the executed.

Only checks for those errors that the CD registered for, This function is only used for those errors that are logged during execution and not those that require immediate recovery.

This requires more thought and a more precise description.

Returns
any errors or failures detected during this CDs execution.
Parameters
[in,out]err_ret_valPointer to a variable for optionally returning a CD runtime error code indicating some bug with Detect().
CDErrT cd::CDHandle::RegisterDetection ( uint  system_name_mask,
uint  system_loc_mask 
)

Declare that this CD can detect certain errors/failures by user-defined detectors.

The intent of this method is to specify to the autotuner that detection is possible. This is needed in order to balance between fine-grained and coarse-grained CDs and associated recovery.

Returns
kOK on success.
Parameters
[in]system_name_maskeach 1 in the mask indicates that this CD should be able to detect any errors that are meaningful to the application (in the error type mask).
[in]system_loc_maskeach 1 in the mask indicates that this CD should be able to detect any errors that are meaningful to the application (in the error type mask).
CDErrT cd::CDHandle::RegisterRecovery ( uint  error_name_mask,
uint  error_loc_mask,
RecoverObject recover_object = 0 
)

Register that this CD can recover from certain errors/failures.

This method serves two purposes:

It extends the specification of intent to recover provided in

Create().

It enables registering a customized recovery routine by

inheriting from the RecoverObject class.

Returns
kOK on success.
See also
Create(), RecoverObject
Todo:
Does registering recovery also imply turning on detection? Or is that done purely through RequireErrorProbability()?
Parameters
[in]error_name_maskeach 1 in the mask indicates that this CD should be able to recover from that error type.
[in]error_loc_maskeach 1 in the mask indicates that this CD should be able to recover from that error type.
[in]recover_objectpointer to an object that contains the customized recovery routine; if unspecified, default recovery is used.