<?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 help to use pdgesvx_ in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/help-to-use-pdgesvx/m-p/872639#M8630</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need help to use pdgesvx. my code is below. I can use pdgesv_ and get correct results, but I have trouble with pdgesvx_. I couldn't understand how it work.it gives no result and no error, only program exits without anyexplanation.Please help ...&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;#include &lt;BR /&gt;#include &lt;BR /&gt;#include &lt;BR /&gt;#include "mpi.h"&lt;/P&gt;
&lt;P&gt;#define AA(i,j) AA[(i)*M+(j)]&lt;BR /&gt;#define BB(i,j) BB[(i)*N+(j)]&lt;/P&gt;
&lt;P&gt;int main(int argc, char **argv) {&lt;BR /&gt; int i, j, k;&lt;BR /&gt;/************ MPI ***************************/&lt;BR /&gt; int myrank_mpi, nprocs_mpi;&lt;BR /&gt; MPI_Init( &amp;amp;argc, &amp;amp;argv);&lt;BR /&gt; MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;myrank_mpi);&lt;BR /&gt; MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;nprocs_mpi);&lt;BR /&gt;/********************************************************/&lt;BR /&gt;/************ BLACS ***************************/&lt;BR /&gt; int ictxt, nprow, npcol, myrow, mycol,nb;&lt;BR /&gt; int info,itemp;&lt;BR /&gt; int ZERO=0,ONE=1;&lt;BR /&gt; nprow = 2; npcol = 2; nb =2;&lt;BR /&gt; Cblacs_pinfo( &amp;amp;myrank_mpi, &amp;amp;nprocs_mpi ) ;&lt;BR /&gt; Cblacs_get( -1, 0, &amp;amp;ictxt );&lt;BR /&gt; Cblacs_gridinit( &amp;amp;ictxt, "R", nprow, npcol );&lt;BR /&gt; Cblacs_gridinfo( ictxt, &amp;amp;nprow, &amp;amp;npcol, &amp;amp;myrow, &amp;amp;mycol );&lt;BR /&gt; int M=5;&lt;BR /&gt; double *AA = (double*) malloc(M*M*sizeof(double));&lt;BR /&gt; for(i=0;i for(j=0;j&amp;lt;M;j++)&lt;BR /&gt; {&lt;BR /&gt; if(i==j)&lt;BR /&gt; AA[i*M+j]=i*M+j+5;&lt;BR /&gt; else&lt;BR /&gt; AA[i*M+j]=i*M+j+1;&lt;BR /&gt; }&lt;BR /&gt; int N=5;&lt;BR /&gt; double *BB = (double*) malloc(M*N*sizeof(double));&lt;BR /&gt; for(i=0;i for(j=0;j BB[i*N+j]=i*(M+1)+j*(N+1)+1;&lt;BR /&gt; int descA[9],descB[9],descC[9];&lt;BR /&gt; int mA = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;myrow, &amp;amp;ZERO, &amp;amp;nprow );&lt;BR /&gt; int nA = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;mycol, &amp;amp;ZERO, &amp;amp;npcol );&lt;BR /&gt; int mB = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;myrow, &amp;amp;ZERO, &amp;amp;nprow );&lt;BR /&gt; int nB = numroc_( &amp;amp;N, &amp;amp;nb, &amp;amp;mycol, &amp;amp;ZERO, &amp;amp;npcol );&lt;/P&gt;
&lt;P&gt;descinit_(descA, &amp;amp;M, &amp;amp;M, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mA, &amp;amp;info);&lt;BR /&gt; descinit_(descB, &amp;amp;M, &amp;amp;N, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mB, &amp;amp;info);&lt;BR /&gt; double *A = (double*) calloc(mA*nA,sizeof(double));&lt;BR /&gt; double *B = (double*) calloc(mB*nB,sizeof(double));&lt;/P&gt;
&lt;P&gt;Cblacs_barrier(ictxt,"A");&lt;BR /&gt; printf("\\n");&lt;BR /&gt; int sat,sut;&lt;BR /&gt; for(i=0;i&amp;lt;mA;i++)&lt;BR /&gt; for(j=0;j&amp;lt;nA;j++){&lt;BR /&gt; sat= (myrow*nb)+i+(i/nb)*nb;&lt;BR /&gt; sut= (mycol*nb)+j+(j/nb)*nb;&lt;BR /&gt; A[j*mA+i]=AA(sat,sut);&lt;BR /&gt; }&lt;BR /&gt; for(i=0;i&amp;lt;mB;i++)&lt;BR /&gt; for(j=0;j&amp;lt;nB;j++){&lt;BR /&gt; sat= (myrow*nb)+i+(i/nb)*nb;&lt;BR /&gt; sut= (mycol*nb)+j+(j/nb)*nb;&lt;BR /&gt; B[j*mB+i]=BB(sat,sut);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;Cblacs_barrier(ictxt,"A");&lt;BR /&gt; int *ippiv = (int *)calloc(M+nb,sizeof(int)) ;&lt;BR /&gt; if (ippiv==NULL){ printf("error of memory allocation IPIV on proc %dx%d\\n",myrow,mycol); exit(0); }&lt;/P&gt;
&lt;P&gt;int descAf[9];&lt;BR /&gt; descinit_ (descAf, &amp;amp;M, &amp;amp;M, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mA, &amp;amp;info);&lt;BR /&gt; double *Af =(double *) calloc (mA * nA, sizeof (double));&lt;/P&gt;
&lt;P&gt;double rcond;&lt;BR /&gt; double *ferr = (double *)calloc(nB,sizeof(double)) ;&lt;BR /&gt; double *berr = (double *)calloc(nB,sizeof(double)) ;&lt;BR /&gt; double *r = (double *)calloc(mA,sizeof(double)) ;&lt;BR /&gt; double *c = (double *)calloc(mA,sizeof(double)) ;&lt;/P&gt;
&lt;P&gt;double *X = (double*) calloc(mB*nB,sizeof(double));&lt;BR /&gt; int descX[9];&lt;BR /&gt; descinit_ (descX, &amp;amp;M, &amp;amp;N, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mB, &amp;amp;info);&lt;/P&gt;
&lt;P&gt;int lwork=M+N;&lt;BR /&gt; double *work=(double *)calloc(M+N,sizeof(double)) ;&lt;/P&gt;
&lt;P&gt;int lrwork=M;&lt;BR /&gt; int *rwork = (int *)calloc(lrwork,sizeof(int)) ;&lt;/P&gt;
&lt;P&gt;pdgesvx_('N','N',&amp;amp;M,&amp;amp;N,A,&amp;amp;ONE,&amp;amp;ONE,descA,Af,&amp;amp;ONE,&amp;amp;ONE,descAf,ippiv,'N',r,c,B,&amp;amp;ONE,&amp;amp;ONE,descB,X,&amp;amp;ONE,&amp;amp;ONE,descB,&amp;amp;rcond,ferr,berr,work,&amp;amp;lwork,rwork,&amp;amp;lrwork,&amp;amp;info);&lt;BR /&gt; Cblacs_barrier(ictxt,"A");&lt;BR /&gt; Cblacs_gridexit( 0 );&lt;BR /&gt; MPI_Finalize();&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2010 22:34:14 GMT</pubDate>
    <dc:creator>oguren</dc:creator>
    <dc:date>2010-03-10T22:34:14Z</dc:date>
    <item>
      <title>help to use pdgesvx_</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/help-to-use-pdgesvx/m-p/872639#M8630</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I need help to use pdgesvx. my code is below. I can use pdgesv_ and get correct results, but I have trouble with pdgesvx_. I couldn't understand how it work.it gives no result and no error, only program exits without anyexplanation.Please help ...&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;#include &lt;BR /&gt;#include &lt;BR /&gt;#include &lt;BR /&gt;#include "mpi.h"&lt;/P&gt;
&lt;P&gt;#define AA(i,j) AA[(i)*M+(j)]&lt;BR /&gt;#define BB(i,j) BB[(i)*N+(j)]&lt;/P&gt;
&lt;P&gt;int main(int argc, char **argv) {&lt;BR /&gt; int i, j, k;&lt;BR /&gt;/************ MPI ***************************/&lt;BR /&gt; int myrank_mpi, nprocs_mpi;&lt;BR /&gt; MPI_Init( &amp;amp;argc, &amp;amp;argv);&lt;BR /&gt; MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;myrank_mpi);&lt;BR /&gt; MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;nprocs_mpi);&lt;BR /&gt;/********************************************************/&lt;BR /&gt;/************ BLACS ***************************/&lt;BR /&gt; int ictxt, nprow, npcol, myrow, mycol,nb;&lt;BR /&gt; int info,itemp;&lt;BR /&gt; int ZERO=0,ONE=1;&lt;BR /&gt; nprow = 2; npcol = 2; nb =2;&lt;BR /&gt; Cblacs_pinfo( &amp;amp;myrank_mpi, &amp;amp;nprocs_mpi ) ;&lt;BR /&gt; Cblacs_get( -1, 0, &amp;amp;ictxt );&lt;BR /&gt; Cblacs_gridinit( &amp;amp;ictxt, "R", nprow, npcol );&lt;BR /&gt; Cblacs_gridinfo( ictxt, &amp;amp;nprow, &amp;amp;npcol, &amp;amp;myrow, &amp;amp;mycol );&lt;BR /&gt; int M=5;&lt;BR /&gt; double *AA = (double*) malloc(M*M*sizeof(double));&lt;BR /&gt; for(i=0;i for(j=0;j&amp;lt;M;j++)&lt;BR /&gt; {&lt;BR /&gt; if(i==j)&lt;BR /&gt; AA[i*M+j]=i*M+j+5;&lt;BR /&gt; else&lt;BR /&gt; AA[i*M+j]=i*M+j+1;&lt;BR /&gt; }&lt;BR /&gt; int N=5;&lt;BR /&gt; double *BB = (double*) malloc(M*N*sizeof(double));&lt;BR /&gt; for(i=0;i for(j=0;j BB[i*N+j]=i*(M+1)+j*(N+1)+1;&lt;BR /&gt; int descA[9],descB[9],descC[9];&lt;BR /&gt; int mA = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;myrow, &amp;amp;ZERO, &amp;amp;nprow );&lt;BR /&gt; int nA = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;mycol, &amp;amp;ZERO, &amp;amp;npcol );&lt;BR /&gt; int mB = numroc_( &amp;amp;M, &amp;amp;nb, &amp;amp;myrow, &amp;amp;ZERO, &amp;amp;nprow );&lt;BR /&gt; int nB = numroc_( &amp;amp;N, &amp;amp;nb, &amp;amp;mycol, &amp;amp;ZERO, &amp;amp;npcol );&lt;/P&gt;
&lt;P&gt;descinit_(descA, &amp;amp;M, &amp;amp;M, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mA, &amp;amp;info);&lt;BR /&gt; descinit_(descB, &amp;amp;M, &amp;amp;N, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mB, &amp;amp;info);&lt;BR /&gt; double *A = (double*) calloc(mA*nA,sizeof(double));&lt;BR /&gt; double *B = (double*) calloc(mB*nB,sizeof(double));&lt;/P&gt;
&lt;P&gt;Cblacs_barrier(ictxt,"A");&lt;BR /&gt; printf("\\n");&lt;BR /&gt; int sat,sut;&lt;BR /&gt; for(i=0;i&amp;lt;mA;i++)&lt;BR /&gt; for(j=0;j&amp;lt;nA;j++){&lt;BR /&gt; sat= (myrow*nb)+i+(i/nb)*nb;&lt;BR /&gt; sut= (mycol*nb)+j+(j/nb)*nb;&lt;BR /&gt; A[j*mA+i]=AA(sat,sut);&lt;BR /&gt; }&lt;BR /&gt; for(i=0;i&amp;lt;mB;i++)&lt;BR /&gt; for(j=0;j&amp;lt;nB;j++){&lt;BR /&gt; sat= (myrow*nb)+i+(i/nb)*nb;&lt;BR /&gt; sut= (mycol*nb)+j+(j/nb)*nb;&lt;BR /&gt; B[j*mB+i]=BB(sat,sut);&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt;Cblacs_barrier(ictxt,"A");&lt;BR /&gt; int *ippiv = (int *)calloc(M+nb,sizeof(int)) ;&lt;BR /&gt; if (ippiv==NULL){ printf("error of memory allocation IPIV on proc %dx%d\\n",myrow,mycol); exit(0); }&lt;/P&gt;
&lt;P&gt;int descAf[9];&lt;BR /&gt; descinit_ (descAf, &amp;amp;M, &amp;amp;M, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mA, &amp;amp;info);&lt;BR /&gt; double *Af =(double *) calloc (mA * nA, sizeof (double));&lt;/P&gt;
&lt;P&gt;double rcond;&lt;BR /&gt; double *ferr = (double *)calloc(nB,sizeof(double)) ;&lt;BR /&gt; double *berr = (double *)calloc(nB,sizeof(double)) ;&lt;BR /&gt; double *r = (double *)calloc(mA,sizeof(double)) ;&lt;BR /&gt; double *c = (double *)calloc(mA,sizeof(double)) ;&lt;/P&gt;
&lt;P&gt;double *X = (double*) calloc(mB*nB,sizeof(double));&lt;BR /&gt; int descX[9];&lt;BR /&gt; descinit_ (descX, &amp;amp;M, &amp;amp;N, &amp;amp;nb, &amp;amp;nb, &amp;amp;ZERO, &amp;amp;ZERO, &amp;amp;ictxt, &amp;amp;mB, &amp;amp;info);&lt;/P&gt;
&lt;P&gt;int lwork=M+N;&lt;BR /&gt; double *work=(double *)calloc(M+N,sizeof(double)) ;&lt;/P&gt;
&lt;P&gt;int lrwork=M;&lt;BR /&gt; int *rwork = (int *)calloc(lrwork,sizeof(int)) ;&lt;/P&gt;
&lt;P&gt;pdgesvx_('N','N',&amp;amp;M,&amp;amp;N,A,&amp;amp;ONE,&amp;amp;ONE,descA,Af,&amp;amp;ONE,&amp;amp;ONE,descAf,ippiv,'N',r,c,B,&amp;amp;ONE,&amp;amp;ONE,descB,X,&amp;amp;ONE,&amp;amp;ONE,descB,&amp;amp;rcond,ferr,berr,work,&amp;amp;lwork,rwork,&amp;amp;lrwork,&amp;amp;info);&lt;BR /&gt; Cblacs_barrier(ictxt,"A");&lt;BR /&gt; Cblacs_gridexit( 0 );&lt;BR /&gt; MPI_Finalize();&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2010 22:34:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/help-to-use-pdgesvx/m-p/872639#M8630</guid>
      <dc:creator>oguren</dc:creator>
      <dc:date>2010-03-10T22:34:14Z</dc:date>
    </item>
  </channel>
</rss>

