- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi~, I am developing a program and use a routine in intel math kernel library. I am in a trouble and I will appreciate your helps.
The subroutine used from intel mkl is "dspev".
When I compile without "-heap-arrays" option, it works very well, but if I compile with "-heap-arrays" it gives an error:
--------------------------------------------------------------------------------------------------------------------
forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
mkl_avx2.dll 00007FF9FE337F0F Unknown Unknown Unknown
mkl_core.dll 00007FFA00216E60 Unknown Unknown Unknown
mkl_sequential.dl 00007FFA02460C4C Unknown Unknown Unknown
mkl_core.dll 00007FFA0020FDEB Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C1519619 Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C1506E1B Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C150280D Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C150BC83 Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C1509D0E Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C1519C0E Unknown Unknown Unknown
Imp_subspace-m1a. 00007FF7C1519FDC Unknown Unknown Unknown
KERNEL32.DLL 00007FFA3AEA8102 Unknown Unknown Unknown
ntdll.dll 00007FFA3BA5C5B4 Unknown Unknown Unknown
Press any key to continue . . .
--------------------------------------------------------------------------------------------------------------------
My compile option is: /nologo /O2 /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc140.pdb" /libs:dll /threads /Qmkl:sequential /c -heap-arrays.
I am using Windows 10 64bit and Intel® Parallel Studio XE 2016 Update 2 Composer Edition for Fortran Windows.
I will really appreciate your helps!
Thank you!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A test program would be really useful. Since I have to guess, I'll surmise that you're running off the end of an array somewhere (maybe by passing the wrong size to MKL) and that the lack of an error when not using -heap-arrays doesn't mean the program is running correctly.
But looking at the traceback, where I see mkl_avx2, makes me wonder if MKL is assuming (or requiring) that the data be naturally aligned and what you're passing isn't. I think this might also trigger an access violation if an AVX2 instruction tried to load unaligned data. (I am sure that Tim P or others will jump in to correct me if I'm wrong - that's not a subject I am very familiar with.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for comment, steve.
I have a big program in which a subroutine calls "dspev". The subroutine (let us denote ABC) which calls "dspev" is called several times. Because the program is a little bit big, it is hard to post the program.
The subroutine "dspev" is called like: call DSPEV('N','L',ctt,BRT(1:nctt),DD(1:ctt),DUMQ(1,1:ctt),1,WORK(1:3*ctt),info) where ctt and nctt have different values when the subroutine ABC is called.
---------------------------------------------------------------------------------------------------------------------
Oh, I found what is the problem, I am sorry steve.
Thank you very much steve, have a nice day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ki-Tae K. wrote:
Thanks for comment, steve.
I have a big program in which a subroutine calls "dspev". The subroutine (let us denote ABC) which calls "dspev" is called several times. Because the program is a little bit big, it is hard to post the program.
The subroutine "dspev" is called like: call DSPEV('N','L',ctt,BRT(1:nctt),DD(1:ctt),DUMQ(1,1:ctt),1,WORK(1:3*ctt),info) where ctt and nctt have different values when the subroutine ABC is called.
---------------------------------------------------------------------------------------------------------------------
Oh, I found what is the problem, I am sorry steve.
Thank you very much steve, have a nice day!
I would hope that that correct USE files would cause the compiler to point out any problems with passing an array subsection to OUT and INOUT arguments.
We can't see how MKL dspev was built; as Steve mentioned, it is possible that it could be coded with aligned move simd intrinsics. I doubt that this could account for any access violation. Setting the compile option -align:array64byte might help to comply with the advice about alignment in the MKL docs. Surprisingly, I worked recently with an application which ran slower with the -align settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please tell us what you found so that other readers can learn from it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve,
It was because wrong input arguments, I made a mistake in my program. So, it works fine with "-heap-arrays" option without any problems.
Thanks for all your comments!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page