<?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 it is cmake project: in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164113#M28117</link>
    <description>&lt;P&gt;it is cmake project:&lt;/P&gt;
&lt;PRE class="brush:plain; class-name:dark;"&gt;target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json -Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_blacs_openmpi_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_gnu_thread.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl ${HDF5_C_LIBRARIES} ${Boost_LIBRARIES} )&lt;/PRE&gt;

&lt;P&gt;mpirun -V&lt;BR /&gt;mpirun (Open MPI) 2.1.1&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there is no problem when compile and linking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 06:08:26 GMT</pubDate>
    <dc:creator>kalen__stoi</dc:creator>
    <dc:date>2019-06-13T06:08:26Z</dc:date>
    <item>
      <title>ScaLAPACK crash using different block sizes</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164109#M28113</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to use pzgesv routine to solve system of linear equations but it crashes if use block size 64 and e.g. with two processes&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it doesn't crash if i run the program with mpirun -np 1 ./myapp, or the block size is 4 and any number of processes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;number of rows = 116, nrhs = 4; openmpi, mpicxx -v:&amp;nbsp;gcc version 7.4.0&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the backtrace:&lt;/P&gt;&lt;P&gt;from the gdb&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;process 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thread 1 "myapp" received signal SIGSEGV, Segmentation fault.&lt;BR /&gt;0x00007ffff67483b2 in PMPI_Comm_size ()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from /usr/lib/x86_64-linux-gnu/libmpi.so.20&lt;BR /&gt;(gdb) bt&amp;nbsp;&lt;BR /&gt;#0 &amp;nbsp;0x00007ffff67483b2 in PMPI_Comm_size ()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from /usr/lib/x86_64-linux-gnu/libmpi.so.20&lt;BR /&gt;#1 &amp;nbsp;0x000055555897967a in MKLMPI_Comm_size ()&lt;BR /&gt;#2 &amp;nbsp;0x000055555568884c in PB_CpgemmMPI ()&lt;BR /&gt;#3 &amp;nbsp;0x000055555564e916 in pzgemm_ ()&lt;BR /&gt;#4 &amp;nbsp;0x00005555556355b0 in pzgetrf2_ ()&lt;BR /&gt;#5 &amp;nbsp;0x0000555555634aaf in pzgetrf_ ()&lt;BR /&gt;#6 &amp;nbsp;0x000055555562c60d in pzgesv_ ()&lt;BR /&gt;#7 &amp;nbsp;0x00005555555ed944 in main (argc=1, argv=0x7fffffffd6e8)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; at Main.cpp:159&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;process 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thread 1 "myapp" received signal SIGSEGV, Segmentation fault.&lt;BR /&gt;0x00007ffff67483b2 in PMPI_Comm_size ()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from /usr/lib/x86_64-linux-gnu/libmpi.so.20&lt;BR /&gt;(gdb) bt&lt;BR /&gt;#0 &amp;nbsp;0x00007ffff67483b2 in PMPI_Comm_size ()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;from /usr/lib/x86_64-linux-gnu/libmpi.so.20&lt;BR /&gt;#1 &amp;nbsp;0x000055555897967a in MKLMPI_Comm_size ()&lt;BR /&gt;#2 &amp;nbsp;0x000055555568884c in PB_CpgemmMPI ()&lt;BR /&gt;#3 &amp;nbsp;0x000055555564e916 in pzgemm_ ()&lt;BR /&gt;#4 &amp;nbsp;0x00005555556355b0 in pzgetrf2_ ()&lt;BR /&gt;#5 &amp;nbsp;0x0000555555634aaf in pzgetrf_ ()&lt;BR /&gt;#6 &amp;nbsp;0x000055555562c60d in pzgesv_ ()&lt;BR /&gt;#7 &amp;nbsp;0x00005555555ed944 in main (argc=1, argv=0x7fffffffd6e8)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; at Main.cpp:159&lt;/P&gt;&lt;P&gt;the descriptors and data looks OK.&lt;/P&gt;&lt;P&gt;any idea what is going on?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;sk&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 10:20:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164109#M28113</guid>
      <dc:creator>kalen__stoi</dc:creator>
      <dc:date>2019-06-12T10:20:20Z</dc:date>
    </item>
    <item>
      <title>Could you give us the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164110#M28114</link>
      <description>&lt;P&gt;Could you give us the reproducer which we may compile and run on our side?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 14:23:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164110#M28114</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-06-12T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Quote:Gennady F. (Blackbelt)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164111#M28115</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Gennady F. (Blackbelt) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you give us the reproducer which we may compile and run on our side?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not exactly the same code that gives the previous backtrace but the following one give similar behavior when I&amp;nbsp;set the blocksize (Mb=64) it fails&amp;nbsp;and pass with Mb=2&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;memory&amp;gt;
#include &amp;lt;complex&amp;gt;

#include &amp;lt;mpi.h&amp;gt;
#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;complex&amp;gt;
#include &amp;lt;mkl_scalapack.h&amp;gt;

extern "C"
{
/* BLACS C interface */
void Cblacs_pinfo(int* mypnum, int* nprocs);
void Cblacs_get( MKL_INT context, MKL_INT request, MKL_INT* value);
int  Cblacs_gridinit( MKL_INT* context, char * order, MKL_INT np_row, MKL_INT np_col);
void Cblacs_gridinfo( MKL_INT context, MKL_INT*  np_row, MKL_INT* np_col, MKL_INT*  my_row,
                      MKL_INT*  my_col);
void Cblacs_gridexit(MKL_INT ictxt);
void Cblacs_barrier(MKL_INT ictxt, char * order);
void Cblacs_exit(int);
void Czgerv2d(int, int, int, std::complex&amp;lt;double&amp;gt;*, int, int, int);
void Czgesd2d(int, int, int, std::complex&amp;lt;double&amp;gt;*, int, int, int);
void Cdgerv2d(int, int, int, double*, int, int, int);
void Cdgesd2d(int, int, int, double*, int, int, int);
}

int main(int argc, char ** argv)
{
    int dims[] = {0, 0};
    int myid, nprocs;
    MKL_INT nprows, npcols, context, myrow, mycol;
    Cblacs_pinfo(&amp;amp;myid, &amp;amp;nprocs);
    MPI_Dims_create(nprocs, 2, dims);
    nprows = (MKL_INT)dims[0];
    npcols = (MKL_INT)dims[1];

    int negone = -1, zero = 0, one = 1;
    Cblacs_get(negone, zero, &amp;amp;context);   //default system context.

    char row_major[] = "Row";
    Cblacs_gridinit(&amp;amp;context, row_major, nprows, npcols);
    Cblacs_gridinfo(context, &amp;amp;nprows, &amp;amp;npcols, &amp;amp;myrow, &amp;amp;mycol);

    MKL_INT Mb = 64, M = 9, nrhs = 1;
    MKL_INT myone = 1, info=0;

    auto lnrows = numroc_ (&amp;amp;M, &amp;amp;Mb, &amp;amp;myrow, &amp;amp;zero, &amp;amp;nprows);
    auto lncols = numroc_ (&amp;amp;M, &amp;amp;Mb, &amp;amp;mycol, &amp;amp;zero, &amp;amp;npcols);

    //GLOBAL
    std::complex&amp;lt;double&amp;gt; * A;
    A = new std::complex&amp;lt;double&amp;gt; [81] {19,3,1,12,1,16,1,3,11,-19,3,1,12,1,16,1,3,11,-19,-3,1,12,1,16,1,3,11,-19,-3,-1,12,1,16,1,3,11,-19, \
    -3,-1,-12,1,16,1,3,11,-19,-3,-1,-12,-1,16,1,3,11,-19,-3,-1,-12,-1,-16,1,3,11,-19,-3,-1,-12,-1,-16,-1,3,11,-19, \
    -3,-1,-12,-1,-16,-1,-3,11};

    //LOCAL
    auto a = new std::complex&amp;lt;double&amp;gt; [lnrows*lncols]();
    for(int lr=0;lr &amp;lt; lnrows; ++lr) {
        int gr = lr % Mb + Mb * myrow + (lr / Mb) * Mb * nprows;
        for (int lc = 0; lc &amp;lt; lncols; ++lc) {
            int gc = lc % Mb + Mb * mycol + (lc / Mb) * Mb * npcols;
            a[lr + lnrows * lc] = A[gr * M + gc]; //col-major &amp;lt;- row-major
        }
    }

    std::complex&amp;lt;double&amp;gt; * B = new std::complex&amp;lt;double&amp;gt; [9] {0,0,1,0,0,0,0,0,0};
    auto b = new std::complex&amp;lt;double&amp;gt; [lnrows*lncols]();
    for(int lr=0;lr &amp;lt; lnrows; ++lr) {
        int gr = lr % Mb + Mb * myrow + (lr / Mb) * Mb * nprows;
        b[lr] = B[gr]; //col-major &amp;lt;- row-major
    }

    MKL_INT* ipiv = new MKL_INT [lncols*M + Mb]();
    MKL_INT desca[9];
    desca[0] = 1; // descriptor type
    desca[1] = context; // blacs context
    desca[2] = M; // global numberh of rows
    desca[3] = M; // global number of columns
    desca[4] = Mb; // row block size
    desca[5] = Mb; // column block size
    desca[6] = 0; // initial process row
    desca[7] = 0; // initial process column
    desca[8] = lnrows; // leading dimension of local array
    MKL_INT descb[9];
    descb[0] = 1; // descriptor type
    descb[1] = context; // blacs context
    descb[2] = M; // global numberh of rows
    descb[3] = nrhs; // global number of columns
    descb[4] = Mb; // row block size
    descb[5] = Mb; // column block size
    descb[6] = 0; // initial process row
    descb[7] = 0; // initial process column
    descb[8] = lnrows; // leading dimension of local array

    std::cout &amp;lt;&amp;lt; "lnrows=" &amp;lt;&amp;lt; lnrows &amp;lt;&amp;lt; " nprows=" &amp;lt;&amp;lt; nprows&amp;lt;&amp;lt; " npcols=" &amp;lt;&amp;lt; npcols&amp;lt;&amp;lt; std::endl;

    pzgesv_(&amp;amp;M, &amp;amp;nrhs, (MKL_Complex16*)a, &amp;amp;myone, &amp;amp;myone, desca,ipiv,
            (MKL_Complex16*)b, &amp;amp;myone, &amp;amp;myone, descb, &amp;amp;info);

    if(info != 0) {
        std::cout &amp;lt;&amp;lt; "PDGESV problem! Info " &amp;lt;&amp;lt; info &amp;lt;&amp;lt; std::endl;
    }
    for(int i=0; i&amp;lt; lnrows; ++i){
       std::cout &amp;lt;&amp;lt; " sol[" &amp;lt;&amp;lt; i &amp;lt;&amp;lt; "]= " &amp;lt;&amp;lt; b&lt;I&gt;.real() &amp;lt;&amp;lt;std::endl;
    }
    delete [] ipiv;

    Cblacs_barrier(context, "All");
    Cblacs_gridexit(context);
    Cblacs_exit(0);

    return 0;

}
&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 19:31:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164111#M28115</guid>
      <dc:creator>kalen__stoi</dc:creator>
      <dc:date>2019-06-12T19:31:16Z</dc:date>
    </item>
    <item>
      <title>to be exactly on the same</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164112#M28116</link>
      <description>&lt;P&gt;to be exactly on the same page, please show how did you link and which version of mpi do you use?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 03:51:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164112#M28116</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-06-13T03:51:50Z</dc:date>
    </item>
    <item>
      <title>it is cmake project:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164113#M28117</link>
      <description>&lt;P&gt;it is cmake project:&lt;/P&gt;
&lt;PRE class="brush:plain; class-name:dark;"&gt;target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json -Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_blacs_openmpi_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_gnu_thread.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lgomp -lpthread -lm -ldl ${HDF5_C_LIBRARIES} ${Boost_LIBRARIES} )&lt;/PRE&gt;

&lt;P&gt;mpirun -V&lt;BR /&gt;mpirun (Open MPI) 2.1.1&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there is no problem when compile and linking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:08:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ScaLAPACK-crash-using-different-block-sizes/m-p/1164113#M28117</guid>
      <dc:creator>kalen__stoi</dc:creator>
      <dc:date>2019-06-13T06:08:26Z</dc:date>
    </item>
  </channel>
</rss>

