<?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 DSS solver not thread safe? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DSS-solver-not-thread-safe/m-p/876077#M8956</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have been experimenting with OMP and was getting funny crashes (access violation) from calls to dss_solve_real.&lt;BR /&gt;&lt;BR /&gt;The back substitutions were inside an OMP parallel loop, and from what I can read from the documentation the dss routines should be thread-safe, but this appears not to be the case for me. &lt;BR /&gt;&lt;BR /&gt;My question is now: has anyone succesfully done these backsubstitutions in parallel succesfully?&lt;BR /&gt;&lt;BR /&gt;I have included a sample program that crashes in case i am doing something wrong. Im using MKL ver 10.0.3.021 and intel fortran 10.1.019.&lt;BR /&gt;&lt;BR /&gt;Thanks for any pointers,&lt;BR /&gt;Henrik&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----- Sample program&lt;BR /&gt; program dss_bug&lt;BR /&gt; use mkl_dss &lt;BR /&gt; use omp_Lib&lt;BR /&gt;&lt;BR /&gt; implicit none&lt;BR /&gt; ! matrix&lt;BR /&gt; integer, parameter :: nRows = 5, nNonZero = 9&lt;BR /&gt; real(8), dimension(nNonZero) :: rValues&lt;BR /&gt; real(8), dimension(nRows, 4) :: rhs, solution, correct&lt;BR /&gt; integer, dimension(nNonZero) :: columns&lt;BR /&gt; integer, dimension(nRows+1) :: rowIndex&lt;BR /&gt; real(8), dimension(4) :: Norm&lt;BR /&gt; type(MKL_DSS_HANDLE) :: handle&lt;BR /&gt; integer :: i, IAM, error&lt;BR /&gt; &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; rValues = (/ 9.0, 1.5, 6.0, .75, 3.0, 0.5, 12.0, .625, 16.0 /)&lt;BR /&gt; rhs(:,1) = (/ 1, 2, 3, 4, 5 /)&lt;BR /&gt; rhs(:,2) = rhs(:,1) + 1&lt;BR /&gt; rhs(:,3) = rhs(:,2) + 1&lt;BR /&gt; rhs(:,4) = rhs(:,3) + 1&lt;BR /&gt; &lt;BR /&gt; ! initialize solver&lt;BR /&gt; error = dss_create(handle, MKL_DSS_DEFAULTS)&lt;BR /&gt; error = dss_define_structure( handle, MKL_DSS_SYMMETRIC, rowIndex, nRows, nRows, columns, nNonZero )&lt;BR /&gt; error = dss_reorder(handle, MKL_DSS_AUTO_ORDER, (/0/))&lt;BR /&gt; error = dss_factor_real(handle, MKL_DSS_DEFAULTS, rValues)&lt;BR /&gt; error = dss_solve_real( handle, MKL_DSS_DEFAULTS, rhs, 4, correct) &lt;BR /&gt;!$OMP PARALLEL &lt;BR /&gt;!$OMP DO SCHEDULE(STATIC,1)&lt;BR /&gt; do i = 1, 10000&lt;BR /&gt; IAM = OMP_GET_THREAD_NUM()+1&lt;BR /&gt; ! write(*,*) "thread: ", IAM, " of ", OMP_GET_NUM_THREADS()&lt;BR /&gt; error = dss_solve_real( handle, MKL_DSS_DEFAULTS, rhs(:,IAM), 1, solution(:,IAM)) &lt;BR /&gt; norm(IAM) = sqrt(dot_product(solution(:,IAM)-correct(:,IAM), solution(:,IAM)-correct(:,IAM)))&lt;BR /&gt; if (norm(IAM) &amp;gt; 1.0) write(*,*) "FAIL! : ", IAM&lt;BR /&gt; end do&lt;BR /&gt;!$OMP END DO&lt;BR /&gt;!$OMP END PARALLEL &lt;BR /&gt; end program dss_bug&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Jun 2008 12:39:30 GMT</pubDate>
    <dc:creator>hmoller</dc:creator>
    <dc:date>2008-06-09T12:39:30Z</dc:date>
    <item>
      <title>DSS solver not thread safe?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DSS-solver-not-thread-safe/m-p/876077#M8956</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have been experimenting with OMP and was getting funny crashes (access violation) from calls to dss_solve_real.&lt;BR /&gt;&lt;BR /&gt;The back substitutions were inside an OMP parallel loop, and from what I can read from the documentation the dss routines should be thread-safe, but this appears not to be the case for me. &lt;BR /&gt;&lt;BR /&gt;My question is now: has anyone succesfully done these backsubstitutions in parallel succesfully?&lt;BR /&gt;&lt;BR /&gt;I have included a sample program that crashes in case i am doing something wrong. Im using MKL ver 10.0.3.021 and intel fortran 10.1.019.&lt;BR /&gt;&lt;BR /&gt;Thanks for any pointers,&lt;BR /&gt;Henrik&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;----- Sample program&lt;BR /&gt; program dss_bug&lt;BR /&gt; use mkl_dss &lt;BR /&gt; use omp_Lib&lt;BR /&gt;&lt;BR /&gt; implicit none&lt;BR /&gt; ! matrix&lt;BR /&gt; integer, parameter :: nRows = 5, nNonZero = 9&lt;BR /&gt; real(8), dimension(nNonZero) :: rValues&lt;BR /&gt; real(8), dimension(nRows, 4) :: rhs, solution, correct&lt;BR /&gt; integer, dimension(nNonZero) :: columns&lt;BR /&gt; integer, dimension(nRows+1) :: rowIndex&lt;BR /&gt; real(8), dimension(4) :: Norm&lt;BR /&gt; type(MKL_DSS_HANDLE) :: handle&lt;BR /&gt; integer :: i, IAM, error&lt;BR /&gt; &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; rValues = (/ 9.0, 1.5, 6.0, .75, 3.0, 0.5, 12.0, .625, 16.0 /)&lt;BR /&gt; rhs(:,1) = (/ 1, 2, 3, 4, 5 /)&lt;BR /&gt; rhs(:,2) = rhs(:,1) + 1&lt;BR /&gt; rhs(:,3) = rhs(:,2) + 1&lt;BR /&gt; rhs(:,4) = rhs(:,3) + 1&lt;BR /&gt; &lt;BR /&gt; ! initialize solver&lt;BR /&gt; error = dss_create(handle, MKL_DSS_DEFAULTS)&lt;BR /&gt; error = dss_define_structure( handle, MKL_DSS_SYMMETRIC, rowIndex, nRows, nRows, columns, nNonZero )&lt;BR /&gt; error = dss_reorder(handle, MKL_DSS_AUTO_ORDER, (/0/))&lt;BR /&gt; error = dss_factor_real(handle, MKL_DSS_DEFAULTS, rValues)&lt;BR /&gt; error = dss_solve_real( handle, MKL_DSS_DEFAULTS, rhs, 4, correct) &lt;BR /&gt;!$OMP PARALLEL &lt;BR /&gt;!$OMP DO SCHEDULE(STATIC,1)&lt;BR /&gt; do i = 1, 10000&lt;BR /&gt; IAM = OMP_GET_THREAD_NUM()+1&lt;BR /&gt; ! write(*,*) "thread: ", IAM, " of ", OMP_GET_NUM_THREADS()&lt;BR /&gt; error = dss_solve_real( handle, MKL_DSS_DEFAULTS, rhs(:,IAM), 1, solution(:,IAM)) &lt;BR /&gt; norm(IAM) = sqrt(dot_product(solution(:,IAM)-correct(:,IAM), solution(:,IAM)-correct(:,IAM)))&lt;BR /&gt; if (norm(IAM) &amp;gt; 1.0) write(*,*) "FAIL! : ", IAM&lt;BR /&gt; end do&lt;BR /&gt;!$OMP END DO&lt;BR /&gt;!$OMP END PARALLEL &lt;BR /&gt; end program dss_bug&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jun 2008 12:39:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DSS-solver-not-thread-safe/m-p/876077#M8956</guid>
      <dc:creator>hmoller</dc:creator>
      <dc:date>2008-06-09T12:39:30Z</dc:date>
    </item>
  </channel>
</rss>

