<?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 Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error, Invalid termination level in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893333#M10588</link>
    <description>&lt;P class="sectionBodyText"&gt;Hello.&lt;/P&gt;
&lt;P&gt;I need to use MKL-routines in C# code.&lt;/P&gt;
&lt;P&gt;I'd written small C# wrapper over C++ handmade dll. C++ dll's and C# wrapper's code is showing below:&lt;/P&gt;
&lt;P&gt;C++ dll's code&lt;/P&gt;
&lt;P&gt;#include "stdafx.h"&lt;BR /&gt;#include "mkl_dss.h"&lt;BR /&gt;&lt;BR /&gt;extern "C" __declspec(dllexport) _INTEGER_t MKL_dss_create(_MKL_DSS_HANDLE_t	&amp;amp;handle, _INTEGER_t			opt)&lt;BR /&gt;{&lt;BR /&gt; _INTEGER_t result = dss_create(handle, opt);&lt;BR /&gt; return result;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;C# wrapper&lt;/P&gt;
&lt;P&gt;namespace MKL&lt;BR /&gt;{&lt;BR /&gt; public class DSS&lt;BR /&gt; {&lt;BR /&gt; const string MKL_DLL_Name = @"MKL_DSS.dll";&lt;BR /&gt;&lt;BR /&gt; [DllImport(MKL_DLL_Name, CallingConvention = CallingConvention.Cdecl, CharSet=CharSet.Unicode)]&lt;BR /&gt; private static extern int MKL_dss_create(ref IntPtr handle, ref int opt);&lt;/P&gt;
&lt;P&gt;public static int Create(ref IntPtr handle, ref int opt)&lt;BR /&gt; {&lt;BR /&gt; int res = MKL_dss_create(ref handle, ref opt);&lt;BR /&gt; return res;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;When I trying to call dss_create wrapper, it aborts with error message "MKL-DSS-DSS-Error, Invalid termination level". What does mean this message? And what I can wrote incorrectly?&lt;/P&gt;
&lt;P&gt;Direct calling dss_create from C++ sample works without faults and return error code 0.&lt;/P&gt;
&lt;P&gt;Test C# code here:&lt;/P&gt;
&lt;P&gt;static void Main(string[] args)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; IntPtr handle = new IntPtr();&lt;BR /&gt; &lt;BR /&gt;int error, opt = 0;&lt;/P&gt;
&lt;P&gt;error = DSS.Create(ref handle, ref opt);&lt;BR /&gt;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;C++ test sample:&lt;/P&gt;
&lt;P&gt;int _tmain(int argc, _TCHAR* argv[]) &lt;BR /&gt;{&lt;BR /&gt; _MKL_DSS_HANDLE_t handle;&lt;BR /&gt; _INTEGER_t error;&lt;BR /&gt;_INTEGER_t opt = MKL_DSS_DEFAULTS;&lt;BR /&gt; &lt;BR /&gt; error = MKL_dss_create(handle, opt);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;I think I have made an error while programming wrapper. But where...?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2010 23:07:59 GMT</pubDate>
    <dc:creator>vd19</dc:creator>
    <dc:date>2010-02-12T23:07:59Z</dc:date>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error, Invalid termination level</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893333#M10588</link>
      <description>&lt;P class="sectionBodyText"&gt;Hello.&lt;/P&gt;
&lt;P&gt;I need to use MKL-routines in C# code.&lt;/P&gt;
&lt;P&gt;I'd written small C# wrapper over C++ handmade dll. C++ dll's and C# wrapper's code is showing below:&lt;/P&gt;
&lt;P&gt;C++ dll's code&lt;/P&gt;
&lt;P&gt;#include "stdafx.h"&lt;BR /&gt;#include "mkl_dss.h"&lt;BR /&gt;&lt;BR /&gt;extern "C" __declspec(dllexport) _INTEGER_t MKL_dss_create(_MKL_DSS_HANDLE_t	&amp;amp;handle, _INTEGER_t			opt)&lt;BR /&gt;{&lt;BR /&gt; _INTEGER_t result = dss_create(handle, opt);&lt;BR /&gt; return result;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;C# wrapper&lt;/P&gt;
&lt;P&gt;namespace MKL&lt;BR /&gt;{&lt;BR /&gt; public class DSS&lt;BR /&gt; {&lt;BR /&gt; const string MKL_DLL_Name = @"MKL_DSS.dll";&lt;BR /&gt;&lt;BR /&gt; [DllImport(MKL_DLL_Name, CallingConvention = CallingConvention.Cdecl, CharSet=CharSet.Unicode)]&lt;BR /&gt; private static extern int MKL_dss_create(ref IntPtr handle, ref int opt);&lt;/P&gt;
&lt;P&gt;public static int Create(ref IntPtr handle, ref int opt)&lt;BR /&gt; {&lt;BR /&gt; int res = MKL_dss_create(ref handle, ref opt);&lt;BR /&gt; return res;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;When I trying to call dss_create wrapper, it aborts with error message "MKL-DSS-DSS-Error, Invalid termination level". What does mean this message? And what I can wrote incorrectly?&lt;/P&gt;
&lt;P&gt;Direct calling dss_create from C++ sample works without faults and return error code 0.&lt;/P&gt;
&lt;P&gt;Test C# code here:&lt;/P&gt;
&lt;P&gt;static void Main(string[] args)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; IntPtr handle = new IntPtr();&lt;BR /&gt; &lt;BR /&gt;int error, opt = 0;&lt;/P&gt;
&lt;P&gt;error = DSS.Create(ref handle, ref opt);&lt;BR /&gt;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;C++ test sample:&lt;/P&gt;
&lt;P&gt;int _tmain(int argc, _TCHAR* argv[]) &lt;BR /&gt;{&lt;BR /&gt; _MKL_DSS_HANDLE_t handle;&lt;BR /&gt; _INTEGER_t error;&lt;BR /&gt;_INTEGER_t opt = MKL_DSS_DEFAULTS;&lt;BR /&gt; &lt;BR /&gt; error = MKL_dss_create(handle, opt);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;I think I have made an error while programming wrapper. But where...?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2010 23:07:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893333#M10588</guid>
      <dc:creator>vd19</dc:creator>
      <dc:date>2010-02-12T23:07:59Z</dc:date>
    </item>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893334#M10589</link>
      <description>&lt;P&gt;Hello, vd19,&lt;/P&gt;
&lt;P&gt;Why do you pass ref opt? Your C++ wrapper expects for a value while C# wrapper passes a pointer.&lt;/P&gt;
&lt;P&gt;Try to remove 'ref' for the 'opt'.&lt;/P&gt;
&lt;P&gt;error = DSS.Create(ref handle, opt);&lt;BR /&gt;&lt;BR /&gt;private static extern int MKL_dss_create(ref IntPtr handle, int opt);&lt;BR /&gt;&lt;BR /&gt;public static int Create(ref IntPtr handle, int opt)&lt;BR /&gt;&lt;BR /&gt; int res = MKL_dss_create(ref handle, opt);&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Vladimir&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2010 20:58:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893334#M10589</guid>
      <dc:creator>Vladimir_Koldakov__I</dc:creator>
      <dc:date>2010-02-13T20:58:26Z</dc:date>
    </item>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893335#M10590</link>
      <description>&lt;P&gt;Vladimir.. You are really right. Thank you. &lt;BR /&gt;&lt;BR /&gt;But I don't understand single error: why program closes during incorrect calling of some procedures of DSS interface? Incorrect calling for example - such as shown above (calling dss_create with error passing 'opt') or below (calling dss_define structure with passing not square matrix).. It's meaning that the procedure returns some error code (MKL_DSS_SUCCESS, MKL_DSS_STATE_ERR, MKL_DSS_NOT_SQUARE), but don't stops with crashing message in console's window.. This error appears as well in C/C++ integrate MKL sample (dss_sym_c.c) if change NCOLS or NROWS from 5 to 6.&lt;/P&gt;
&lt;P&gt;I'm using two versions of MKL - 10.2.3.029 and the last 10.2.4.032&lt;/P&gt;
&lt;P&gt;Test sample: calling dss_define_structure with passing not square matrix:&lt;/P&gt;
&lt;P&gt;const int&lt;BR /&gt; nRows = 5,&lt;BR /&gt;nCols = 6,&lt;BR /&gt;nNonZeros = 9;&lt;BR /&gt;&lt;BR /&gt; int[]&lt;BR /&gt; rowIndex = { 1, 6, 7, 8, 9, 10 },&lt;BR /&gt; columns = { 1, 2, 3, 4, 5, 2, 3, 4, 5 };&lt;BR /&gt; &lt;BR /&gt; IntPtr handle = new IntPtr();&lt;BR /&gt; &lt;BR /&gt;int error, opt = 0, sym = 536870976;&lt;BR /&gt;&lt;BR /&gt; error = DSS.MKL_dss_create(ref handle, opt);&lt;BR /&gt; error = DSS.MKL_dss_define_structure(ref handle, sym, rowIndex, nRows, nCols, columns, nNonZeros);&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2010 20:34:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893335#M10590</guid>
      <dc:creator>vd19</dc:creator>
      <dc:date>2010-02-18T20:34:41Z</dc:date>
    </item>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893336#M10591</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;If I understand you right, you have something like:&lt;/P&gt;
&lt;P style="padding-left: 20pt;"&gt;Run dss example&lt;BR /&gt; dss.exe&lt;BR /&gt;ret = 0&lt;BR /&gt;MKL-DSS-DSS-Error, Not a square matrix&lt;BR /&gt;NMAKE : fatal error U1077: 'dss.exe' : return code '0xfffffff8'&lt;BR /&gt;Stop.&lt;BR /&gt;NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'&lt;BR /&gt;Stop.&lt;/P&gt;
&lt;P&gt;For the code:&lt;/P&gt;
&lt;P style="padding-left: 20pt;"&gt;&lt;BR /&gt;error = DSS.MKL_dss_create(ref handle, opt);&lt;BR /&gt;Console.WriteLine("ret = " + error);&lt;BR /&gt;error = DSS.MKL_dss_define_structure(ref handle, sym, rowIndex, nRows, nCols, columns, nNonZeros);&lt;BR /&gt;Console.WriteLine("ret = " + error);&lt;/P&gt;
&lt;P&gt;Ive made the only change in you code, set termination level option (MKL_DSS_TERM_LVL_FATAL)&lt;/P&gt;
&lt;P style="padding-left: 20pt;"&gt;&lt;BR /&gt;int error, opt = 1073741872, sym = 536870976;&lt;/P&gt;
&lt;P&gt;And then I have:&lt;BR /&gt;Run dss example&lt;BR /&gt; dss.exe&lt;BR /&gt;ret = 0&lt;BR /&gt;MKL-DSS-DSS-Error, Not a square matrix&lt;BR /&gt;ret = -8&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Note, according the mklman.pdf:&lt;/P&gt;
&lt;P&gt;The settings for message and termination levels can be set on any call to a DSS routine. However, once set to a particular level, they remain at that level until they are changed in another call to a DSS routine.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Vladimir&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2010 13:36:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893336#M10591</guid>
      <dc:creator>Vladimir_Koldakov__I</dc:creator>
      <dc:date>2010-02-22T13:36:34Z</dc:date>
    </item>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893337#M10592</link>
      <description>&lt;P&gt;Thank you, Vladimir.&lt;BR /&gt;Yes, you understand me right. Set 'opt' to MKL_DSS_TERM_LVL_FATAL eliminates this trouble.&lt;BR /&gt;What do you think about why MKL integrated sample of using DSS interface contains different checkings of return code after calling different routines?&lt;BR /&gt;Default value of 'opt' = MKL_DSS_DEFAULTS which means MKL_DSS_MSG_LVL_WARNING + MKL_DSS_TERM_LVL_ERROR. It is absurd I think, it will never activates if some error appears.&lt;BR /&gt;&lt;BR /&gt;Or may be I am mistaken?&lt;/P&gt;
&lt;P&gt;P.S. Whats different between MKL_DSS_TERM_LVL_ERROR andMKL_DSS_TERM_LVL_FATAL?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2010 19:12:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893337#M10592</guid>
      <dc:creator>vd19</dc:creator>
      <dc:date>2010-02-22T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Calling Sparce Solver routines from C# fault: MKL-DSS-DSS-Error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893338#M10593</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;Let me describe here the difference between MKL_DSS_TERM_LVL_ERROR and MKL_DSS_TERM_LVL_FATAL.&lt;/P&gt;
&lt;P&gt;First of all each issue inside DSS interface have its own severity (most of them have "ERROR" severity while several critical ones have "FATAL" severity). For every issue DSS compares issue.severity with message level (defined by MKL_DSS_MSG_LVL_* value) and termination level (defined by MKL_DSS_TERM_LVL_* value).&lt;/P&gt;
&lt;P&gt;If issue.severity &amp;gt;= "message level" then some information about this issue is printed by DSS routine.&lt;/P&gt;
&lt;P&gt;If issue.severity &amp;gt;= "termination level" then DSS routine calls exit( ) function which terminates current program.&lt;/P&gt;
&lt;P&gt;So with MKL_DSS_TERM_LVL_ERROR most issues (which have ERROR or FATAL severity) will result in immediate exit from DSS routine while with MKL_DSS_TERM_LVL_FATAL the exit( ) function will be called only for critical issues (with FATAL severity).&lt;/P&gt;
&lt;P&gt;Actually these parameters should be described better in Intel MKL manual.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sergey&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 10:11:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Sparce-Solver-routines-from-C-fault-MKL-DSS-DSS-Error/m-p/893338#M10593</guid>
      <dc:creator>Sergey_P_Intel2</dc:creator>
      <dc:date>2010-02-25T10:11:09Z</dc:date>
    </item>
  </channel>
</rss>

