IMSL_SET_FUNCTIONS_THREAD_SAFE, intsetting (Input) If nonzero, user supplied functions are assumed to be thread-safe. This allows user functions to be evaluated in parallel with different arguments. Default: User supplied functions are not assumed to be thread-safe and are not evaluated in parallel by IMSL C Math Library functions.
IMSL_GET_FUNCTIONS_THREAD_SAFE, int*psetting (Output) Sets the integer pointed to by psetting to zero if user functions are not assumed to be thread-safe and to one if they are assumed to be thread-safe.
Description
The performance of some IMSL C Math Library functions can be improved if they evaluate user supplied functions in parallel. Unfortunately, incorrect results can occur if the user supplied functions are not thread-safe. By default, the IMSL C Math Library assumes user supplied functions are not thread-safe and thus will not evaluate them in parallel. To change this assumption, use the optional argument IMSL_SET_FUNCTIONS_THREAD_SAFE with its argument equal to one.
This function can be used multiple times in an application to change the thread-safe assumption.
Example
This example computes the integral . A call to the function imsl_omp_options is used to indicate that function fcn is thread-safe and so can be safely evaluated by multiple, simultaneous threads.