Page 1 of 1

ScaLAPACK example code assembly query

PostPosted: Thu Apr 21, 2005 8:57 am
by ravi
thank u all

now i m able to run the example code of Scalapack but the query i m having is that .....after solving the equation
A*x = B where, A(n.n) and B(n,1) and x(n,1)

the solution vector, after the call of pdgesv() is distributed within the processor grid....then how to get and assemble it on each processor....

can any body help me out of this.....
i will be very much thankfull to u
thanks in advance
ravi :cry:

PostPosted: Thu Apr 21, 2005 5:42 pm
by Julien Langou
Hello,

one way of doing this is by using PxGEMR2D.

So if you want the solution (at the end of PDGESVD in B, DESCB ) on all the process,
declare X, DESCX a new array to store it on all the process
Code: Select all
   INTEGER            MXLLDX
   PARAMETER          ( MXLLDX=9 )
   DOUBLE PRECISION   X(  MXLLDX, MXRHSC )
   INTEGER            DESCX( DLEN_ )

then initialize the new array descriptor DESCX so that each processor has a continuous vector of size (N,NRHS) in the processor grid NPROWxNPCOL,
Code: Select all
      CALL DESCINIT( DESCX, N*NPROW, NPCOL*NRHS,
     &                              N, NRHS, 0, 0, ICTXT, MXLLDX, INFO )

then use PxGEMR2D to copy B (of gobal size (N,NRHS)) in each of its new location
Code: Select all
      DO I=1,NPROW
         DO J=1,NPCOL
            CALL PDGEMR2D(N,NRHS,B,1,1,DESCB,X,
     &                (I-1)*N+1,(J-1)*NRHS+1,DESCX,ICTXT)
         ENDDO
      ENDDO


and that shall do it,

Julien