NAG AD Library x10aa_a1w_f (config_handle_create_a1w)
Note:a1w denotes that first order adjoints are computed in working precision; this has the corresponding argument type nagad_a1w_w_rtype.
Also available is the t1w (first order tangent linear) mode, the interface of which is implied by replacing a1w by t1w throughout this document.
The method of codifying AD implementations in the routine name and corresponding argument types is described in the NAG AD Library Introduction.
x10aa_a1w_f initializes a configuration data structure for the NAG AD Library. It must be called prior to the first call to any routine from the NAG AD Library as listed in the Introduction to the NAG AD Library including any other routine in Chapter X10.
The routine may be called by the names x10aa_a1w_f or nagf_adutils_config_handle_create_a1w. The corresponding t1w variant of this routine is also available.
x10aa_a1w_f creates and initializes a configuration data object and returns a handle to the data object. This handle may then be passed to any routine in the NAG AD Library as listed in the Introduction to the NAG AD Library. The object must always be destroyed by a call to x10ab_a1w_f prior to exiting the application in which it was created.
Each handle should pass four stages in its life: initialization; mode setting; problem solution using the NAG AD Library; and, destruction.
The initialization by x10aa_a1w_f and destruction by x10ab_a1w_f mark the beginning and the end of the life of the handle. During this time the handle must only be modified by NAG AD Library routines. Working with a handle which has not been properly initialized is potentially very dangerous as it may cause unpredictable behaviour.
After the handle has been initialized, two routines are provided to set or get the computational mode to be used in algorithmic differentiation.
The handle is then passed to the computational routines of the NAG AD Library.
Note that separate configuration data objects can be initialized to contain different computational modes; for example, one handle for the symbolic computational mode (to be used when symbolic adjoints are possible and required) and one handle to contain the algorithmic computational mode.
When all AD computation is completed, the handle must be destroyed by x10ab_a1w_f.
On exit: holds a handle to the internal data structure where the computational AD configuration data, e.g., mode, is defined. You must not change the handle other than via NAG AD Library calls until it is destroyed by x10ab_a1w_f.
2: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
8Parallelism and Performance
x10aa_a1w_f is not threaded in any implementation.
The following examples show the procedure for calling a NAG AD Library routine (s01ba_a1w_f). x10aa_a1w_f is called to initialize the ad_handle; x10ac_a1w_fandx10ad_a1w_f are called to set and get the computational mode from the handle; and x10ab_a1w_f is called to destroy the handle.