<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Yes, an apparition morphing in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118319#M24805</link>
    <description>&lt;P&gt;Yes, an apparition morphing into an occultation is a problem.&lt;/P&gt;

&lt;P&gt;If the underlying bug is not an optimizer bug, turning optimizations off may help to nail the apparition down.&lt;/P&gt;

&lt;P&gt;If the bug is caused by array overruns or by using variables that have not yet been defined, however, changing optimization options may cause the bug to disappear. If so, much trial and error will be needed during the course of creating a cut-down reproducer.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2017 14:50:00 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2017-06-01T14:50:00Z</dc:date>
    <item>
      <title>Access violation in dss_solve_real</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118315#M24801</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We are calling MKL from C# code by using general mechanism described in article &lt;A href="https://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program/"&gt;Using Intel® MKL in your C# program&lt;/A&gt;.&lt;BR /&gt;
	&lt;BR /&gt;
	The code is using DSS (Direct Sparse Solver) for a large system of equations with numerous different right-hand sides. That is, it makes one call to dss_factor_real and a lot of subsequent calls to dss_solve_real. Generally it works fine. But sometimes, at an advanced interation, an error ocurrs in dss_solve_real:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."&lt;BR /&gt;
	&lt;BR /&gt;
	So far no particular trigger for this error was detected. In the past I have noticed that if a memory allocation occurs after creating internal dss structures (i.e. after dss_factor_real which obviously must take up a lot of space due to LU decomposition), then a subsequent call to a computing dss function will likely cause an error above. And therefore I am careful not to make any explicit allocations when dss handle is in use. But the error still occurs once in a while.&lt;BR /&gt;
	Just in case, threading is disabled by setting MKL_NUM_THREADS=1.&lt;/P&gt;

&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 13:43:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118315#M24801</guid>
      <dc:creator>Maria_B_</dc:creator>
      <dc:date>2017-05-30T13:43:52Z</dc:date>
    </item>
    <item>
      <title>I tried to reproduce the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118316#M24802</link>
      <description>&lt;P&gt;I tried to reproduce the access violation that you described. I have a short Fortran program that reads a NIST Matrix Market RSA file and computes the solution using DSS. I modified the program by placing a loop around the invocation of dss_solve_real(), and tested it by running it on&amp;nbsp;&amp;nbsp;BCSSTK01,&amp;nbsp;&lt;SPAN style="font-size: 16.26px;"&gt;BCSSTK02,&amp;nbsp;BCSSTK13 and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 16.26px;"&gt;BCSSTK14. In each case, the solution was computed 100 times and compared to the known solution. No errors occurred.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 16.26px;"&gt;I suspect that the error message comes from some C# support component, because none of the MKL DLLs in &amp;lt;Intel Parallel Studio&amp;gt;\&lt;/SPAN&gt;compilers_and_libraries_2017.4.210\windows\redist\ia32_win\mkl contains the string "memory is corrupt".&lt;/P&gt;

&lt;P&gt;To investigate this problem further, we need from you a reproducer (source code, data files if needed, instructions to build, run and exhibit the claimed error).&lt;/P&gt;

&lt;P&gt;[Note: I posted a response earlier, but that note did not appear, so I am trying again].&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 02:39:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118316#M24802</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-05-31T02:39:12Z</dc:date>
    </item>
    <item>
      <title>Hi Maria,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118317#M24803</link>
      <description>&lt;P&gt;Hi Maria,&lt;/P&gt;

&lt;P&gt;The kind of problem may caused by unmanaged code debugging issue and common to see for some C# program. Would you mind share us a simple reproducer&amp;nbsp;with a VS project. We will check with the root cause. Thank you.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 07:35:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118317#M24803</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-05-31T07:35:41Z</dc:date>
    </item>
    <item>
      <title>Thank you, mecej4 and Fiona!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118318#M24804</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;A href="https://software.intel.com/en-us/user/9972" style="font-size: 11px; background-color: rgb(238, 238, 238);"&gt;mecej4&lt;/A&gt;&amp;nbsp;and Fiona!&lt;/P&gt;

&lt;P&gt;I will try to build one, though it is not an easy task. Apparition of this problem is extremely volatile. It may vanish from such subtle a change as renaming input data file. Not to say porting to another computer. But, of course, reproducing is the only option... &amp;nbsp;:)&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Maria&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 16:44:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118318#M24804</guid>
      <dc:creator>Maria_B_</dc:creator>
      <dc:date>2017-05-31T16:44:54Z</dc:date>
    </item>
    <item>
      <title>Yes, an apparition morphing</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118319#M24805</link>
      <description>&lt;P&gt;Yes, an apparition morphing into an occultation is a problem.&lt;/P&gt;

&lt;P&gt;If the underlying bug is not an optimizer bug, turning optimizations off may help to nail the apparition down.&lt;/P&gt;

&lt;P&gt;If the bug is caused by array overruns or by using variables that have not yet been defined, however, changing optimization options may cause the bug to disappear. If so, much trial and error will be needed during the course of creating a cut-down reproducer.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118319#M24805</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-06-01T14:50:00Z</dc:date>
    </item>
    <item>
      <title>Hello and sorry for a long</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118320#M24806</link>
      <description>&lt;P&gt;Hello and sorry for a long pause.&lt;/P&gt;

&lt;P&gt;Here is a reproducer VS project in C#.&lt;BR /&gt;
	It can also&amp;nbsp;be launched without running VS: just open a console, change directory to Reproducer\bin\Debug and run the application with a parameter of input data file located in the same folder. For example:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;gt;Reproducer.exe P_54x78.txt&lt;/P&gt;

&lt;P&gt;Some more info in readme.txt. Thank you again.&lt;/P&gt;

&lt;P&gt;Maria&lt;/P&gt;</description>
      <pubDate>Sun, 18 Jun 2017 23:12:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118320#M24806</guid>
      <dc:creator>Maria_B_</dc:creator>
      <dc:date>2017-06-18T23:12:48Z</dc:date>
    </item>
    <item>
      <title>Hi Maria,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118321#M24807</link>
      <description>&lt;P&gt;Hi Maria,&lt;/P&gt;

&lt;P&gt;We can reproduce the problem, will&amp;nbsp;investigate the details.&lt;/P&gt;

&lt;P&gt;On the other hand, we happened to worked another C# issue, which also was proved be C# GC memory problem. Please see&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/737444"&gt;https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/737444&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It seems almost same place problem, (Handle internal memory).&amp;nbsp;If possible, &amp;nbsp;could you please try to change the call interface as below:&lt;/P&gt;

&lt;PRE&gt;[DllImport("mkl_rt.dll", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
        internal static extern int dtrnlspbc_init(
          &lt;STRONG&gt; ref IntPtr handle,
&lt;/STRONG&gt;           ref int n,
           ref int m,
           &lt;STRONG&gt;IntPtr x,
           IntPtr LW,
           IntPtr UP,
&lt;/STRONG&gt;           double[] eps,  ----&amp;gt;  IntPtr eps 
           ref int iter1,
           ref int iter2,
           ref double rs
        );
&lt;/PRE&gt;

&lt;P&gt;and&amp;nbsp; when you define&amp;nbsp;the input parameter (&amp;nbsp;x, LW, UP , EPS etc) , their pointer were stored in Handle. Please use&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;IntPtr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; handle = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;IntPtr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;IntPtr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; x = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;IntPtr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;[]&amp;nbsp;x = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;N&gt;;&lt;/N&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;PRE&gt;GCHandle x_handle = GCHandle.Alloc(x_init, GCHandleType.Pinned);
x = x_handle.AddrOfPinnedObject();
//use x pointer …
...
finally 
x_handle.Free();  -&amp;gt; manually collection. 
&lt;/PRE&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 01:53:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118321#M24807</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2017-06-29T01:53:36Z</dc:date>
    </item>
    <item>
      <title>Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118322#M24808</link>
      <description>&lt;P&gt;Ying,&lt;/P&gt;

&lt;P&gt;I cannot say enough how helpful this was. This completely solved our problem. In fact, since objects in managed code are moved around by the garbage collector, assuming their physical address being constant leads to access violation error. So pinning objects is the solution.&lt;/P&gt;

&lt;P&gt;Thank you! And thanks to everyone who was concerned with this matter.&lt;/P&gt;

&lt;P&gt;Maria&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 14:26:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118322#M24808</guid>
      <dc:creator>Maria_B_</dc:creator>
      <dc:date>2017-08-16T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Hi everyone, please note that</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118323#M24809</link>
      <description>&lt;P&gt;Hi everyone, please note that we have added a section about memory pinning in C# to the article &lt;A href="https://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program"&gt;Using Intel® MKL in your C# program&lt;/A&gt; along with some examples for the Direct Sparse Solvers interface and Trust Region Solvers with reverse communication interface. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 22:27:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-dss-solve-real/m-p/1118323#M24809</guid>
      <dc:creator>Keola_W_Intel</dc:creator>
      <dc:date>2017-09-14T22:27:45Z</dc:date>
    </item>
  </channel>
</rss>

