Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Suggestion to IMSL

Averkov__Igor
Beginner
426 Views
Hello!

In IMSL (Intel Math Kernel Library ) there is some subroutines wich have to allocate memory by executing of program. In such cases user has to initialize a handle and then to pass it to sover. It allows multiple users to access the solver simultaneously. But allocation and deleting the handle (solver object) may cause decreasing of perfomance.

Below i have written an example of interface of an equation solver, wich has no need to allocate a memory by executing of program and has not to be recursive.

[fortran]! at first a stucture of solver object must be declared type TEquationSolver private .... ! - all data needed by solver end type ! each user has to declare an object of solver type(TEquationSolver) Solver ! then user has to initialize the solver call SolverInitialize(Solver, XStart, XMin, XMax, Epsilon, ItersMax) ! then user performs iterations keeping much control do call SolverIterate(Solver, YLast, XNext, ErrCode) ... end do[/fortran]
[bash]! To get some information for example the count of iterations should be special access functions: IterCount = SolverGetIterCount(Solver)[/bash]
advantages:
no need to delete handler
no need to allocate the memory
no need to be recursive

User self declare the object TEquationSolver of solver and so the memory is allocated in stack and not during execution of program. User can also allocate TEquationSolver by itself.


I think this concept may be useful

0 Kudos
1 Reply
mecej4
Honored Contributor III
426 Views
Your questions relate to the design of IMSL rather than to getting Fortran code using IMSL to run using Intel Fortran. As such, they would be placed better if stated on a Roguewave IMSL forum rather than here.

Secondly, I see a major drawback to what you propose. Roguewave would have to document all the needed internal variables used by the IMSL algorithms, keep the documentation up to date, and users would face the additional complication of understanding and managing these internal variables. In earlier releases of IMSL, intended to be called from Fortran 77 and Fortran 4, that was the situation and there used to be IMSL consultants at the institutional computer center.

Similar issues arise with some MKL solver routines, and I believe that the design of the user interface is quite sound: (i) make an initialize/allocate context request (ii) do calculations in that context (iii) release/terminate the context. The user has to declare, allocate and manage only those variables and structures that the designer of the library felt had to be exposed to the user in order to allow the library to be used effectively.
0 Kudos
Reply