<?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 'pbtrf' and 'pbtrs' directly from a C# .Net Core  library in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-pbtrf-and-pbtrs-directly-from-a-C-Net-Core-library/m-p/1166605#M28282</link>
    <description>&lt;P&gt;I'm currently porting a small Fortran FE solver to C#. The solver uses MKL, and I'm trying to get the best of both worlds by calling the MKL functions in question directly from C#.&lt;BR /&gt;According to Intels documentation, this can be done by using the DllImport statement in C# and calling the relevant function in mkl_rt.dll directly. This&amp;nbsp;&lt;A href="https://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program"&gt;Intel tutorial&lt;/A&gt;&amp;nbsp;gives a short description of how this can be done, and even provides some C# code examples.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The examples provided compile&amp;nbsp;on my computer, What I want to do is basically exactly the same, only targeting the functions 'pbtrf' and 'pbtrs'. But it seems these functions are not exposed from mkl_rt.dll. Using Dependency Walker, I looked into mkl_rt.dll and found that only the F77-versions are available. So I tried setting up a function call using 'dpbtrf' and 'dpbtrs' instead. These require several more arguments than the F95-versions.&lt;/P&gt;&lt;P&gt;About the case:&lt;/P&gt;&lt;P&gt;My setup is in the attached .cs file (also shown in below image). Some input is hardcoded for testing purposes. The actual case is not provided, but it is a simple static FE problem with a stiffness matrix and a load vector. Mathematically, the stiffness matrix is a band matrix of size n x n. In the code, it is written in compact form as a matrix of size (nSuperDiagonals + 1) x n, that is 4 x n. Only one right hand side is used, i.e. the load vector of length n.&lt;/P&gt;&lt;P&gt;The call does not throw any error messages; I get info=1&amp;nbsp;in return (not 0) and the stiffness matrix is never&amp;nbsp;factorized.&lt;/P&gt;&lt;P&gt;I know that this specific case will run when the whole shebang is coded in Fortran on the same computer.&lt;/P&gt;&lt;P&gt;.Any thoughts on what the issue could be?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="LaPack in CSharp.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10691iA9F370B68C54F364/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="LaPack in CSharp.png" alt="LaPack in CSharp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 16:23:15 GMT</pubDate>
    <dc:creator>Stokke__Einar</dc:creator>
    <dc:date>2020-04-20T16:23:15Z</dc:date>
    <item>
      <title>Calling 'pbtrf' and 'pbtrs' directly from a C# .Net Core  library</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-pbtrf-and-pbtrs-directly-from-a-C-Net-Core-library/m-p/1166605#M28282</link>
      <description>&lt;P&gt;I'm currently porting a small Fortran FE solver to C#. The solver uses MKL, and I'm trying to get the best of both worlds by calling the MKL functions in question directly from C#.&lt;BR /&gt;According to Intels documentation, this can be done by using the DllImport statement in C# and calling the relevant function in mkl_rt.dll directly. This&amp;nbsp;&lt;A href="https://software.intel.com/en-us/articles/using-intel-mkl-in-your-c-program"&gt;Intel tutorial&lt;/A&gt;&amp;nbsp;gives a short description of how this can be done, and even provides some C# code examples.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The examples provided compile&amp;nbsp;on my computer, What I want to do is basically exactly the same, only targeting the functions 'pbtrf' and 'pbtrs'. But it seems these functions are not exposed from mkl_rt.dll. Using Dependency Walker, I looked into mkl_rt.dll and found that only the F77-versions are available. So I tried setting up a function call using 'dpbtrf' and 'dpbtrs' instead. These require several more arguments than the F95-versions.&lt;/P&gt;&lt;P&gt;About the case:&lt;/P&gt;&lt;P&gt;My setup is in the attached .cs file (also shown in below image). Some input is hardcoded for testing purposes. The actual case is not provided, but it is a simple static FE problem with a stiffness matrix and a load vector. Mathematically, the stiffness matrix is a band matrix of size n x n. In the code, it is written in compact form as a matrix of size (nSuperDiagonals + 1) x n, that is 4 x n. Only one right hand side is used, i.e. the load vector of length n.&lt;/P&gt;&lt;P&gt;The call does not throw any error messages; I get info=1&amp;nbsp;in return (not 0) and the stiffness matrix is never&amp;nbsp;factorized.&lt;/P&gt;&lt;P&gt;I know that this specific case will run when the whole shebang is coded in Fortran on the same computer.&lt;/P&gt;&lt;P&gt;.Any thoughts on what the issue could be?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="LaPack in CSharp.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/10691iA9F370B68C54F364/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="LaPack in CSharp.png" alt="LaPack in CSharp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 16:23:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-pbtrf-and-pbtrs-directly-from-a-C-Net-Core-library/m-p/1166605#M28282</guid>
      <dc:creator>Stokke__Einar</dc:creator>
      <dc:date>2020-04-20T16:23:15Z</dc:date>
    </item>
  </channel>
</rss>

