Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Towie__Ewan
New Contributor I
94 Views

Seg. fault using Data Fitting Akima spline

Hi,

I am encountering a problem with the Akima spline that causes my code to seg. fault.

Debugging the code with optimisations and debug symbols, I can repeat the problem. It occurs when dfdInterpolate1D is called with a value that is ~7e-18 within the upper boundary of the spline.

I realise that this value at double precision is near as dammit on the upper boundary, and it is a relatively rare occurrence in my code but it sadly it occasionally occurs.

Is there some underlying floating-point tolerance within the interpolation routine that might be causing this issue?

At the moment I can put in some boundary checking to catch values within tolerance to work around the problem, but ideally I would like to avoid this as it will slow down the code!

Thanks,

Ewan

0 Kudos
12 Replies
Pavel_D_Intel1
Employee
94 Views

Hi Ewan,
Thank you for your question.

Difference as 7e-18 is lower than epsilon of the double precision floating point format. Wrong code execution (e.g. segmentation fault in your case) is highly depended on the input data here.

Could you provide a code sample to reproduce this issue?
Or could you provide arrays of function values, breakpoints, spline’s coefficients and interpolation sites? This information would be useful in terms of problem investigation.

Best regards,
Pavel.

Towie__Ewan
New Contributor I
94 Views

Hi Pavel,

Let me see what I can do, will need to undo the boundary checking code to get the case to repeat.

Ewan

Gennady_F_Intel
Moderator
94 Views

Ewan, do you use MKL 2017, right? Could you check the problem with 2019u5 which we released the last week!

Towie__Ewan
New Contributor I
94 Views

Hi, I don't have access to the latest version of MKL, so it will not be possible for me to test at this time. Although I did manage to export the breakpoints and coefficients used by the Akima spline, along with an interpolation site that causes the seg. fault. If you have any more questions then don't hesitate to ask! Ewan
Pavel_D_Intel1
Employee
94 Views

Hi Ewan, 

Thank you for the provided data.
After the quick analysis I have found that the first spline’s coefficient looks strange:

i,"value"
0,34.183189094319935
1
2,-272819.29691743013

Looks like it’s not provided. Could you please check it in your data?
Also could you clarify the next question to align our assumptions: which operation system and compiler do you use?

Best regards,
Pavel.

Towie__Ewan
New Contributor I
94 Views

Hi Pavel, I have pasted the CSV data for the coefficient below, and the coefficient is 0 at index 1. Not sure the reasoning or justification for that! I am using CentOS 7.3 and we compile with GCC 7.3.0. Thanks, Ewan Spline Coefficeints:: "i","value" 0,34.183189094319935 1,0 2,-272819.29691743013 3,23622478.931319602 4,28.792177299788786 5,1.8796404722926996 6,118.17390088410954 7,-4228.5767665654257 8,28.840804925010126 9,1.8878088196473437 10,67.663616164991893 11,-3664.3860702890452 12,28.875745092136128 13,0.60269491432120581 14,-2202.1969513924614 15,161848.94789547904 16,28.823694005518277 17,-4.5142439576456539 18,575.6462456622296 19,-38356.04259861177 20,28.809940667723534 21,-1.6600484821584869 22,1021.5266744995755 23,-38050.136781186593 24,28.878588153028456 25,5.4037004186515771 26,2619.8798019522305 27,-3998.1254602418217 28,29.39832714919164 29,72.554514698887814 30,333366.16869595117 31,-20299958.191423111
Pavel_D_Intel1
Employee
94 Views

Hi Ewan,
thank you for the additional information.

I have created a code sample with the provided data. But I couldn’t reproduce a segmentation fault. Interpolation works correctly.

The last questions that I have (to completely align our assumptions):

  1. Which Intel MKL version do you use? You can check it with mkl_get_version function (https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-version).
  2. Which partition structure (xhint) have you set (is it DF_NON_UNIFORM_PARTITION)?
  3. What is the maximal derivative order to be computed at the interpolation site (ndorder)?

Hope it helps to reproduce your problem.

Best regards,
Pavel.

Towie__Ewan
New Contributor I
94 Views

Hi Pavel, I've answered your questions below:
Dyakov, Pavel (Intel) wrote:
  1. Which Intel MKL version do you use? You can check it with mkl_get_version function (https://software.intel.com/en-us/mkl-developer-reference-c-mkl-get-version).
  2. Which partition structure (xhint) have you set (is it DF_NON_UNIFORM_PARTITION)?
  3. What is the maximal derivative order to be computed at the interpolation site (ndorder)?
1. Yikes, it's actually an older version than I expected - v 11.0.5 2. Yes, I use DF_NON_UNIFORM_PARTITION. 3. ndorder = 3 when I'm using Akima, with dorder = {1,0,1}. I believe that means the 2nd-derivative is the highest order computed.. Thanks, Ewan
Pavel_D_Intel1
Employee
94 Views

Hi Ewan,
Case ndorder = 3 means that the 2nd is the highest order of derivative to be compute – you are right here.

Well, I have aligned all our assumptions and found that interpolation works incorrectly at the provided site (I haven’t received segmentation fault in my code sample, but interpolation results have been filled with 0).

But this problem is not reproduced with the latest available Intel MKL 2019 U5 – interpolation works correctly with the provided data.  

Actually several impotent updates and fixes have been made in Data Fitting functionality between Intel MKL 11.0.5 and Intel MKL 2019 U5 releases.

So that I suggest you to update your Intel MKL to the Intel MKL 2019 U5 version.

Feel free to ask more.

Best regards,
Pavel.

Towie__Ewan
New Contributor I
94 Views

Hi Pavel, Thanks for investigating this. As our production system is fairly complex, I can only place a request to update MKL to a much newer version and hope it gets completed quickly! If it was just down to me I would already have it updated. Could you possibly check the test case against the MKL version 2018 U4 to verify that it works correctly there too? Thanks, Ewan
Gennady_F_Intel
Moderator
94 Views

I independently checked the case with 2018 u4 and the latest 2019 u5 and don't see the problem on my side also. You may quickly test this case by installing MKL 2019 u5 on your local system. Here you may take the latest version for free.

Gennady_F_Intel
Moderator
94 Views

forget to add the link to the downloading page: https://software.intel.com/en-us/performance-libraries