<?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 Hi Gennady, I can confirm in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180700#M29307</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Gennady, I can confirm that the issue is gone with 2018.1. Tested with Openmpi 3.0.0. Thanks for fixing! Feel free to close this thread and mark it as resolved, if there is such an option here on forums.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regards, Denis.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 08:51:03 GMT</pubDate>
    <dc:creator>davydden1</dc:creator>
    <dc:date>2017-11-27T08:51:03Z</dc:date>
    <item>
      <title>Problems with PDPOTRI for certain sizes</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180695#M29302</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Dear all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have issues when using Intel MKL to provide Blas+Lapack+ScaLapack. Specifically, i use it with &lt;STRONG&gt;OpenMPI+GCC&lt;/STRONG&gt; and link against libmkl_scalapack_lp64, libmkl_blacs_openmpi_lp64, libmkl_intel_lp64, libmkl_core, libmkl_sequential. The issues is with calling pdpotri after Cholesky factorization:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;pdpotri_ (&amp;amp;uplo,&amp;amp;n_columns, A_loc, &amp;amp;submatrix_row, &amp;amp;submatrix_column, descriptor,&amp;amp;info);&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="color: #000000"&gt;where&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void pdpotri_(const char *UPLO,
                const int *N,
                double *A, const int *IA, const int *JA, const int *DESCA,
                int *INFO);&lt;/PRE&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&lt;STRONG&gt;I don't have any issues with my code on both Ubuntu and macOS when using Netlib-Scalapack 2.0.2 + Openblas 0.2.20&lt;/STRONG&gt;. For those cases, calculation of Cholesky factorization followed by pdpotri produce correct results and agree with serial Lapack. &lt;SPAN style="font-family: Monaco; font-size: 11px;"&gt;Also note that &lt;STRONG&gt;other small test programs I have (i.e. calculate L1 norm or do Cholesky factorization) run ok with Intel-MKL&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;This suggest that something is wrong in Intel-MKL implementation of pdpotri.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;A bit more on the issue itself: this happens when run with 4 MPI cores (2x2 grid) and a small test program; the program runs ok with matrix 64x64 with 32 blocks but fails for 120x120 with 32 blocks. Specifically, i see a floating point exception from process rank 2. Not sure I can debug it further on my side.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;p.s. That's Intel-MKL 2017.3.196.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Monaco;"&gt;Regards, Denis&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 11:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180695#M29302</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2017-09-11T11:39:52Z</dc:date>
    </item>
    <item>
      <title>David, could you give the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180696#M29303</link>
      <description>&lt;P&gt;David, could you give the example to check the case on our side? or may you try if the problem still exists with the latest MKL 2018 which we released yesterday?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 03:31:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180696#M29303</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-09-13T03:31:53Z</dc:date>
    </item>
    <item>
      <title>Gennady, the code is attached</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180697#M29304</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Gennady, the code is attached. Run with "mpirun -np 4 example 120 32". While running a stand-alone example, GCC complained that error is during MPI_Bcast. NetlibScalapack+Openblas run ok. This is with GCC 5.4.0+OpenMPI 2.1.1. By printing out debug info I see that this happens indeed in pdpotri.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regards, Denis&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;mpi.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;iomanip&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;fstream&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;sstream&amp;gt;
#include &amp;lt;cmath&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;functional&amp;gt;
using namespace std;

// compile with:
// mpic++ -std=c++11 example.cc -o example -lscalapack -lopenblas
// mpic++ -std=c++11 example.cc -o example -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential


extern "C" {
  /* Cblacs declarations */
  void Cblacs_pinfo(int *, int *);
  void Cblacs_get(int, int, int *);
  void Cblacs_gridinit(int *, const char *, int, int);
  void Cblacs_gridinfo(int, int *, int *, int *,int *);
  void Cblacs_pcoord(int, int, int *, int *);
  void Cblacs_gridexit(int);
  void Cblacs_barrier(int, const char *);
  void Cdgerv2d(int, int, int, double *, int, int, int);
  void Cdgesd2d(int, int, int, double *, int, int, int);

  int numroc_ (const int *n, const int *nb, const int *iproc, const int *isproc, const int *nprocs);

  void pdpotrf_(const char *UPLO,
                const int *N,
                double *A, const int *IA, const int *JA, const int *DESCA,
                int *INFO);

  void descinit_ (int *desc, const int *m, const int *n, const int *mb, const int *nb, const int *irsrc, const int *icsrc, const int *ictxt, const int *lld, int *info);

  int indxl2g_ (const int *indxloc, const int *nb, const int *iproc, const int *isrcproc, const int *nprocs);

  void pdpotri_(const char *UPLO,
                const int *N,
                double *A, const int *IA, const int *JA, const int *DESCA,
                int *INFO);

}

int main(int argc, char **argv)
{
  int mpirank,nprocs;
  MPI_Init(&amp;amp;argc, &amp;amp;argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;mpirank);
  MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;nprocs);
  const char uplo('L');
  const int first_process_row(0);
  const int first_process_column(0);

  const bool mpiroot = (mpirank == 0);

  /* Scalapack / Blacs Vars */
  int N, M, Nb, Mb;

  if (argc &amp;lt; 3)
    {
      if (mpiroot)
        cerr &amp;lt;&amp;lt; "Provide N and Nb parameters" &amp;lt;&amp;lt; std::endl;

      MPI_Finalize();
      return 1;
    }
  else
    {
      /* Read command line arguments */
      stringstream stream;
      stream &amp;lt;&amp;lt; argv[1] &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; argv[2];
      stream &amp;gt;&amp;gt; N &amp;gt;&amp;gt; Nb;
      M = N;
      Mb = Nb;
    }
  if (mpiroot)
    cout &amp;lt;&amp;lt; "Running with N=" &amp;lt;&amp;lt; N &amp;lt;&amp;lt; " Nb=" &amp;lt;&amp;lt; Nb &amp;lt;&amp;lt; std::endl;

  int procrows = 0, proccols = 0;
  {
    const int n_processes_heuristic = int(std::ceil((1.*N)/Nb))*
                                      int(std::ceil((1.*M)/Mb));
    const int Np = std::min(n_processes_heuristic, nprocs);
    const double ratio = 1.0;
    const int Pc = std::sqrt(ratio * Np);
    proccols = std::min (Np, std::max(2, Pc));
    procrows = Np / proccols ;
  }

  /* Begin Cblas context */
  int ctxt = 0, myrow = 0, mycol = 0, numproc = nprocs;
  // Cblacs_pinfo(&amp;amp;myid, &amp;amp;numproc);
  Cblacs_get(0, 0, &amp;amp;ctxt);
  Cblacs_gridinit(&amp;amp;ctxt, "Row-major", procrows, proccols);
  Cblacs_gridinfo( ctxt, &amp;amp;procrows, &amp;amp;proccols, &amp;amp;myrow, &amp;amp;mycol );

  if (mpiroot)
    cout &amp;lt;&amp;lt; "Process grid " &amp;lt;&amp;lt; procrows &amp;lt;&amp;lt; "x"&amp;lt;&amp;lt;proccols &amp;lt;&amp;lt; "&amp;lt;=" &amp;lt;&amp;lt; numproc &amp;lt;&amp;lt; std::endl;

  if ((myrow &amp;gt; -1) &amp;amp;&amp;amp; (mycol &amp;gt; -1))
    {
      if (mpiroot)
        cout &amp;lt;&amp;lt; "setup..." &amp;lt;&amp;lt; std::endl;

      const int nrows = numroc_(&amp;amp;N, &amp;amp;Nb, &amp;amp;myrow, &amp;amp;first_process_row, &amp;amp;procrows);
      const int ncols = numroc_(&amp;amp;M, &amp;amp;Mb, &amp;amp;mycol, &amp;amp;first_process_column, &amp;amp;proccols);

      const int lda = max(1,nrows);
      int info=0;
      int descA[9];
      descinit_(descA, &amp;amp;N, &amp;amp;M, &amp;amp;Nb, &amp;amp;Mb,&amp;amp;first_process_row,&amp;amp;first_process_column,&amp;amp;ctxt, &amp;amp;lda, &amp;amp;info);
      if (info != 0)
        cerr &amp;lt;&amp;lt; "error in descinit_" &amp;lt;&amp;lt; std::endl;

      std::vector&amp;lt;double&amp;gt; A(nrows*ncols);

      // set to SPD
      {
        int seed = 13;
        srand(seed);
        std::vector&amp;lt;double&amp;gt; global_A(N*M);
        auto gind = [&amp;amp;] (const int row, const int col)
        {
          return col*M+row;
        };

        for (unsigned int c = 0; c &amp;lt; N; ++c)
          for (unsigned int r = c; r &amp;lt; M; ++r)
            {
              const double val = ((double) rand())/ ((double)RAND_MAX);
              if (r==c)
                global_A[gind(r,c)] = val + N;
              else
                {
                  global_A[gind(r,c)] = val;
                  global_A[gind(c,r)] = val;
                }
            }

        int k = 0;
        for (int c=1; c &amp;lt;= ncols; ++c)
          {
            const int glob_c = indxl2g_ (&amp;amp;c, &amp;amp;Nb, &amp;amp;mycol, &amp;amp;first_process_column, &amp;amp;proccols) - 1;
            for (int r = 1; r &amp;lt;= nrows; ++r)
              {
                const int glob_r = indxl2g_ (&amp;amp;r, &amp;amp;Mb, &amp;amp;myrow, &amp;amp;first_process_row, &amp;amp;procrows) - 1;
                A&lt;K&gt; = global_A[gind(glob_r,glob_c)];
                k++;
              }
          }
      }

      const int submatrix_row = 1;
      const int submatrix_column = 1;

      double *A_loc = &amp;amp;A[0];
      info = 0;
      if (mpiroot)
        cout &amp;lt;&amp;lt; "pdpotrf..." &amp;lt;&amp;lt; std::endl;
      pdpotrf_(&amp;amp;uplo,&amp;amp;N,A_loc,&amp;amp;submatrix_row,&amp;amp;submatrix_column,descA,&amp;amp;info);
      if (info != 0)
        {
          cerr &amp;lt;&amp;lt; "error in pdpotrf_ " &amp;lt;&amp;lt; info &amp;lt;&amp;lt; std::endl;
          return 1;
        }

      if (mpiroot)
        cout &amp;lt;&amp;lt; "pdpotri..." &amp;lt;&amp;lt; std::endl;
      pdpotri_ (&amp;amp;uplo,&amp;amp;N, A_loc, &amp;amp;submatrix_row, &amp;amp;submatrix_column, descA,&amp;amp;info);
      if (info != 0)
        {
          cerr &amp;lt;&amp;lt; "error in pdpotri_" &amp;lt;&amp;lt; info &amp;lt;&amp;lt; std::endl;
          return 1;
        }

      if (mpiroot)
        std::cout &amp;lt;&amp;lt; "done!" &amp;lt;&amp;lt; std::endl;

      Cblacs_gridexit(ctxt);
    }
  MPI_Finalize();
}
&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2017 15:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180697#M29304</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2017-09-13T15:49:00Z</dc:date>
    </item>
    <item>
      <title>Hello Denis,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180698#M29305</link>
      <description>&lt;P&gt;Hello Denis,&lt;/P&gt;

&lt;P&gt;Thank you for reporting the issue. Yes, you are right,&amp;nbsp;&lt;SPAN style="font-size: 12px;"&gt;MKL 2017.3 contains the issue and it &lt;/SPAN&gt;occurs&amp;nbsp;&lt;SPAN style="font-size: 12px;"&gt;with OpenMPI only. The issue will be fixed in the next release. Currently, in order to avoid the issue you can use other MPI implementations (Intel MPI, MPICH, etc.).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Regards,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;Denis&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 22:55:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180698#M29305</guid>
      <dc:creator>Denis_S_Intel</dc:creator>
      <dc:date>2017-10-23T22:55:00Z</dc:date>
    </item>
    <item>
      <title>Hi Denis, could you check the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180699#M29306</link>
      <description>&lt;P&gt;Hi Denis, could you check the latest MKL 2018 update 1 where we fix this issue and let us know how this update will work on your side!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 04:47:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180699#M29306</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-11-27T04:47:49Z</dc:date>
    </item>
    <item>
      <title>Hi Gennady, I can confirm</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180700#M29307</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Gennady, I can confirm that the issue is gone with 2018.1. Tested with Openmpi 3.0.0. Thanks for fixing! Feel free to close this thread and mark it as resolved, if there is such an option here on forums.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regards, Denis.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 08:51:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180700#M29307</guid>
      <dc:creator>davydden1</dc:creator>
      <dc:date>2017-11-27T08:51:03Z</dc:date>
    </item>
    <item>
      <title>thanks Denis for letting us</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180701#M29308</link>
      <description>&lt;P&gt;thanks Denis for letting us know!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:57:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-with-PDPOTRI-for-certain-sizes/m-p/1180701#M29308</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-11-27T14:57:51Z</dc:date>
    </item>
  </channel>
</rss>

