Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Access violation in spline function

netphilou31
New Contributor II
5,360 Views
Hi,

In an effort to remove IMSL library from our projects (because of the new licensing policy) I am giving a try to the MKL library. I mainly use cubic spline functions using Intel Visual Fortran Compiler XE on IA-32, version 12.1.1 (Package ID: w_fcompxe_2011.7.258). I have started with from an existing project that compiles and links fine with IMSL (the project exports functions used in Excel through VBA to provide spline features). I have added a new function that uses the spline possibilities of the MKL (10.3 update 10). The call to the function from VBA works fine, but I get an Access violation when calling the function dfdConstruct1D(). It seems that the problem is located in the mkl at location : _mkl_df_kernel_n8_dDFAkimaCubicSpline1D() + 0x1765c octets. The source code was created from an example provided in the documentation and I don't understand what I am doing wrong. The source file is attached.

Best regards.

0 Kudos
29 Replies
netphilou31
New Contributor II
1,053 Views
Hi, I did some tests with the last release of the MKL (10.3 Update 12) and it seems that the main problems are fixed. However I have found that there are still some differences with the DCSAKM function of the IMSL library. With the following, relatively smooth, data, one can see a different behavior between IMSL and the MKL. [plain]XDATA = [ 50, 60, 70, 80, 90, 100 ] YDATA = [ 32.5, 44, 60, 76, 88, 100 ][/plain] If you compare the values predicted by both routines, they are exactly the same except for the intervals [50-60], [70-80] and [80-90]. The subroutine I have used to perform the calculation is attached. Best regards, Phil.
0 Kudos
VictoriyaS_F_Intel
1,053 Views
Hello Phil, Could you please tell me which type of boundary conditions are you using to construct Akima spline with MKL? In order to construct the same spline as with DCSAKM please use DF_NO_BC. Best regards, Vika
0 Kudos
netphilou31
New Contributor II
1,053 Views
Hi Victoriya, Thanks for your quick reply. I have used [fortran]bc_type = DF_BC_NOT_A_KNOT[/fortran] I will try with your suggestion [fortran]bc_type = DF_NO_BC[/fortran] and keep you informed of the results. Best regards, Phil.
0 Kudos
netphilou31
New Contributor II
1,053 Views
Hi Victoriya, Sorry but it doesn't work better (in fact it's worst !). Best regards, Phil
0 Kudos
netphilou31
New Contributor II
1,053 Views
Victoriya, For your information (I don't known if it can help) it seems that the derivative calculated at X=80 is equal to zero !. Moreover the derivative for the first point seems also to be badly estimated (but the difference with IMSL is lesser). Have you tried to download the ZIP file containing my routine ? (because this does not works for me; I get "page not found" !) Best regards, Phil.
0 Kudos
VictoriyaS_F_Intel
1,053 Views
Phil, The issue was reproduced on our side and the bug report related to this issue was re-opened. Root-causing of the problem is in progress currently. I also failed to download .zip archive. Could you try uploading it once again? Thanks, Vika
0 Kudos
netphilou31
New Contributor II
1,053 Views
Victoriya, Please find another attempt to attach the ZIP file containing my subroutine. I have another side question concerning the size of the generated DLLs including the MKL. In CVF, my dll which uses IMSL has a size around 750 kB, the same dll generated using IVF with MKL (use of interpolation routines only) sizes now 9800 kB !!! That's huge in comparison ! (note that I am using static linking in both projects). Do you have an explanation of such a difference ? Best regards, Phil.
0 Kudos
Alzaki_F_
Beginner
1,053 Views

Hey 

What is the deference between the Akima  method and the cubic spline method  

How can code the akima in SAs I know how to code the cubic spline in SAS 

0 Kudos
VictoriyaS_F_Intel
1,053 Views

Hello Alzaki,

Akima spline and natural cubic spline are the different types of cubic splines. They use different algorithms to construct the coefficients of the spline.

Please see this paper for the definition of Akima spline: "A New Method of Interpolation and Smooth Curve Fitting Based on Local Procedures" by Hiroshi Akima.

Best regards,

Vika

0 Kudos
Reply