The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

pcgesvd problem (beginners issue)

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

pcgesvd problem (beginners issue)

Postby thombos » Sun Mar 16, 2008 2:52 am

Hello all,

I'm trying to use pcgesvd for the first time. As an example I have implemented a routine which uses a 40x40 matrix A, divided on a 2x2 process grid, blocksize of 20. First I'm running a workspace query, which works fine, then I'm trying to execute the svd (JOBU="V",JOBVT="V") and get these errors:

{ 0, 1}: On entry to PCUNMQR parameter number 1402 had an illegal value
{ 0, 1}: On entry to PCUNMLQ parameter number 1402 had an illegal value
{ 1, 1}: On entry to PCUNMQR parameter number 1402 had an illegal value
{ 1, 1}: On entry to PCUNMLQ parameter number 1402 had an illegal value
{ 1, 0}: On entry to PCUNMQR parameter number 1402 had an illegal value
{ 1, 0}: On entry to PCUNMLQ parameter number 1402 had an illegal value
{ 0, 0}: On entry to PCUNMQR parameter number 1402 had an illegal value
{ 0, 0}: On entry to PCUNMLQ parameter number 1402 had an illegal value

Any hint, what I might be doing wrong ?

Thanks, Thomas

edit: When I set JOBU='N' and JOBVT='N' the thing works and I get singular values returned in S (didn't check whether they are correct though).

Also (now trying to calculate just VT) when I increase the output matrix sizes U and VT the error changes to:
{ 1, 1}: On entry to PCUNMBR parameter number 1506 had an illegal value
{ 0, 1}: On entry to PCUNMBR parameter number 1506 had an illegal value
{ 1, 0}: On entry to PCUNMBR parameter number 1506 had an illegal value
{ 0, 0}: On entry to PCUNMBR parameter number 1506 had an illegal value
thombos
 
Posts: 30
Joined: Mon Nov 26, 2007 8:41 pm

Postby thombos » Tue Mar 18, 2008 3:55 pm

(stupid) question deleted.
Last edited by thombos on Tue Mar 18, 2008 3:59 pm, edited 1 time in total.
thombos
 
Posts: 30
Joined: Mon Nov 26, 2007 8:41 pm

Postby Julie » Tue Mar 18, 2008 3:58 pm

Thomas,
please post your code, otherwise it is hard to help you.
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Postby thombos » Tue Mar 18, 2008 4:20 pm

Hi Julie,

thanks for your help.
The second call in the snippet below causes the trouble.

A,U and VT are matrices of 40x40, all on a 2x2 grid with MB=NB=20 (i.e.
the descriptors for all three are identical). I have a local buffer for S on each process right now. I figured that 1402 stands for array argument 14, 2nd entry, meaning that the function that throws the error doesn't like the size of one of my matrices, as argument 14 is the descriptor.
Oh, and yes all IA,JA,IU,JU,IVT,JVT are all 1.

The code is a bit scattered in a larger framework, but I'm trying to provide a meaningful snippet here:

JOBU = 'N'; // its V or N
JOBVT = 'V'; // its V or N

SIZE = M < N ? M : N;
SIZEB = M > N ? M : N;

//the allocation of the workspaces is a little complicated
RWORK = new float[1+4*SIZEB];
LWORK = -1;
WORK = new std::complex<float>[100];
pcgesvd_(&JOBU,&JOBVT,&M,&N,
NULL,&IA,&JA,mDesc,
NULL,NULL,&IU,&JU,U.mDesc,
NULL,&IVT,&JVT,VT.mDesc,
WORK,&LWORK,RWORK, &INFO);
rworksize = static_cast<std::size_t>(RWORK[0]);
worksize = static_cast<std::size_t>(WORK[0].real());

delete [] WORK;
delete [] RWORK;
WORK = new std::complex<float>[worksize];
if(!WORK) {
std::cerr << "Cannot allocate sufficient work memory !" << std::endl;
exit(-1);
}

RWORK = new float[rworksize];
if(!RWORK) {
std::cerr << "Cannot allocate sufficient work memory !" << std::endl;
exit(-1);
}

LWORK = worksize;
pcgesvd_(&JOBU,&JOBVT,&M,&N,
mMtxData,&IA,&JA,mDesc,
S.mMtxData,U.mMtxData,&IU,&JU,U.mDesc,
VT.mMtxData,&IVT,&JVT,VT.mDesc,
WORK,&LWORK,RWORK, &INFO);
std::cout << "INFO: " << INFO << std::endl;

EDIT: Tracking this down, the error occurs in PCUNMQR which is called PCUNMBR and the argument the error is about, is the context of the VT matrix, which indicates some issues with the process grid, maybe ?
thombos
 
Posts: 30
Joined: Mon Nov 26, 2007 8:41 pm

Postby thombos » Tue Mar 18, 2008 5:15 pm

It appears that if I use the same CTXT for the A,U and VT matrix, that there is no more error message. So I need to make sure that all these matrices use the same context. Thats probably a fundamental scalapack concept that I have neglected.
thombos
 
Posts: 30
Joined: Mon Nov 26, 2007 8:41 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests