[petsc-users] Transpose of rectangular dense parallel matrix

Ghosh, Swarnava sghosh2012 at gatech.edu
Tue Feb 3 23:07:29 CST 2015


Hi,

  I am trying to calculate the transpose of a dense rectangular matrix (pSddft->YOrb, size=Npts x Nstates) and then MatMatMult  
  I am creating the dense matrix first of size (Nstates x Npts) and then doing an inplace transpose. 
  Both the dense rectangular matrices have the same parallel communicator PetscObjectComm((PetscObject)pSddft->da).
  
  The following steps are the steps

      
       PetscInt rowloc,colloc;
       MatGetLocalSize(pSddft->YOrb,&rowloc,&colloc);      

       MatCreate(PetscObjectComm((PetscObject)pSddft->da),&pSddft->YOrbTranspose);
            
       MatSetSizes(pSddft->YOrbTranspose,colloc,rowloc,PETSC_DETERMINE,PETSC_DETERMINE);       
       MatSetType(pSddft->YOrbTranspose,MATDENSE);
       MatSetFromOptions(pSddft->YOrbTranspose);       
       MatSetUp(pSddft->YOrbTranspose); 
       
       MatTranspose(pSddft->YOrb,MAT_INITIAL_MATRIX,&pSddft->YOrbTranspose);
       
       MatMatMultNumeric(pSddft->YOrbTranspose,HpsiMat,HsubDense);

The matrix HpsiMat has the same parallel communicator as pSddft->YOrb
The code works fine on 1 core but I am getting segmentation fault in the MatMatMultNumeric step for more than 1 cores.
So I think the problem is due to the way I am setting up the communicator of transpose matrix.

Could you please tell me if there is a general way of creating a transpose of a rectangular dense parallel matrix and use it for matrix matrix multiplication?








       

-- 
Swarnava Ghosh
PhD Candidate,
Structural Engineering, Mechanics and Materials
School of Civil and Environmental Engineering
Georgia Institute of Technology
Atlanta, GA 30332


More information about the petsc-users mailing list