Description | As described for V_initMT, on computers with many processor cores (from about 8 or 16 on), one might wish to limit the number of threads which each called OptiVec function may claim for itself. This is especially true, if an application generates several worker threads, and if each (or several) of them calls OptiVec functions. In the interest of a well-balanced use of the processor capacities, call V_limitThreadsPerFunc to set the number of threads available to each call of an OptiVec function. Be, however, rather generous: For example, with 16 cores and 4 application threads, give the OptiVec functions not only 16/4=4, but rather 8 threads each. The OS will take care of optimum scheduling of all these threads.
V_limitThreadsPerFunc should be called immediately after V_initMT. The number of threads thus set will be valid for all calls to OptiVec functions out of all application threads. In principle, it is possible to call V_limitThreadsPerFunc again to modify that number at some point in the application. Note, however, that V_limitThreadsPerFunc is not thread-safe, and it would be a matter of chance, which function calls would employ the "new" value and for which the "old" one would still be applied.
|