please help to slove "lapack to scalapack's problem"

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

please help to slove "lapack to scalapack's problem"

Postby wert7588 » Wed Aug 25, 2010 8:04 am

my english is not good,sorry!!!
use lapack,i write these code:
CALL DGETRF(NA+nmol1,NA+nmol1,A,MAXATM,IPIV,INFO)
CALL DGETRS('N',NA+nmol1,1,A,MAXATM,IPIV,B,MAXATM,INFO)
use lapack ,these code is correct,but use scalapack have some problem,please help me find where is wrong,thanks!!!

scalapack coda:
call blacs_pinfo(iam,nprocs)
call gridsetup (nprocs,nprow,npcol)
call blacs_get(0,0,context)
call blacs_gridinit(context,'r',nprow,npcol)
call blacs_gridinfo(context,nprow,npcol,myrow,mycol)
call blockset(nb,64,NA+nmol1,nprow,npcol)
l_nrowsa = numroc(NA+nmol1,nb,myrow,0,nprow)
l_ncolsa = numroc(NA+nmol1,nb,mycol,0,npcol)
call descinit(DESCA,NA+nmol1,NA+nmol1,
& nb,nb,0,0,context,l_nrowsa,INFO)
l_nrowsb = numroc(NA+nmol1,nb,myrow,0,nprow)
l_ncolsb = numroc(1,nb,mycol,0,npcol)
call descinit(DESCB,NA+nmol1,1,nb,1,
& 0,0,context,l_nrowsb,INFO)

CALL PDGETRF(NA+nmol1,NA+nmol1,A,1,
& 1,DESCA,IPIV,INFO)
CALL PDGETRS('N',NA+nmol1,1,A,1,1,DESCA,
& IPIV,B,1,1,DESCB,INFO)

call blacs_gridexit(context)
call blacs_exit(0)
----------------------------------------------------------------------------------------------------------------------------------------------------
subroutine gridsetup(nproc,nprow,npcol)
implicit none
integer nproc,nprow,npcol
integer sqrtnp,i
sqrtnp = int( sqrt( dble(nproc) ) + 1 )
do i=1,sqrtnp
if(mod(nproc,i).eq.0) nprow = i
end do
npcol = nproc/nprow
return
end

subroutine blockset( nb, nbuser, n, nprow, npcol)
implicit none
integer*8 N
integer nb, nprow, npcol, nbuser
nb = min ( n/nprow, n/npcol )
if(nbuser.gt.0) then
nb = min ( nb, nbuser )
endif
nb = max(nb,1)
return
end subroutine blockset
wert7588
 
Posts: 3
Joined: Wed Aug 25, 2010 7:51 am

Return to User Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests

cron