ScaLAPACK example code assembly query

Open discussion regarding features, bugs, issues, vendors, etc.

ScaLAPACK example code assembly query

Postby ravi » Thu Apr 21, 2005 8:57 am

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:
ravi
 
Posts: 9
Joined: Wed Apr 13, 2005 7:08 am

Postby Julien Langou » Thu Apr 21, 2005 5:42 pm

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
Julien Langou
 
Posts: 734
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to User Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron