[petsc-users] Getting 0 for both start and end with MatGetOwnershipRange()

Daniel Christian Weflen Daniel.Weflen at Colorado.EDU
Thu May 10 12:52:06 CDT 2012


I changed the type from MATSEQMAIJ to MATSEQAIJ and it works correctly. 
mat_size is not 0, should I still send the standalone executable?

-Dan

On 05/10/2012 05:21 AM, Matthew Knepley wrote:
> On Wed, May 9, 2012 at 8:09 PM, Daniel Christian Weflen 
> <Daniel.Weflen at colorado.edu <mailto:Daniel.Weflen at colorado.edu>> wrote:
>
>     I still get 0 for both the start and end rows.
>
>
> 1) Is mat_size 0?
>
> 2) If not, put these line in a standalone executable that shows the 
> bug and send it.
>
>    Thanks,
>
>      Matt
>
>     -Dan
>
>
>     On 05/09/2012 05:35 PM, Lisandro Dalcin wrote:
>
>         On 9 May 2012 20:01, Daniel Christian
>         Weflen<Daniel.Weflen at colorado.edu
>         <mailto:Daniel.Weflen at colorado.edu>>  wrote:
>
>             I have the following code:
>
>                 Mat H;
>                 PetscInt mat_size=x_npts*y_npts;
>                 ierr=MatCreate(PETSC_COMM_WORLD,&H);CHKERRQ(ierr);
>
>             ierr=MatSetSizes(H,PETSC_DECIDE,PETSC_DECIDE,mat_size,mat_size);CHKERRQ(ierr);
>                 ierr=MatSetType(H,MATSEQMAIJ);CHKERRQ(ierr);
>                 PetscInt* nonzeros;
>                 PetscInt start_row,end_row,row_index;
>                 MatGetOwnershipRange(H,&start_row,&end_row);
>
>             When I check the values of start_row and end_row right
>             after calling
>             MatGetOwnershipRange, both are 0. What am I doing wrong
>             here? Am I calling
>             MatCreate(), MatSetSizes() and MatSetType() in the wrong
>             order?
>
>         Call MatSetUp() after MatSetType().
>
>
>
>
>
> -- 
> What most experimenters take for granted before they begin their 
> experiments is infinitely more interesting than any results to which 
> their experiments lead.
> -- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120510/2dd9289a/attachment.htm>


More information about the petsc-users mailing list