[petsc-users] error in petsc-dev

Mohammad Mirzadeh mirzadeh at gmail.com
Wed Apr 25 13:03:05 CDT 2012


Hong,

> Did you follow same procedural call as petsc examples,
e.g., petsc-dev/src/ksp/ksp/examples/tutorials/ex2.c:
>   ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);
>  ierr = MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,m*n,m*n);CHKERRQ(ierr);
>  ierr = MatSetFromOptions(A);CHKERRQ(ierr);
>  ierr =
MatMPIAIJSetPreallocation(A,5,PETSC_NULL,5,PETSC_NULL);CHKERRQ(ierr);
>  ierr = MatSeqAIJSetPreallocation(A,5,PETSC_NULL);CHKERRQ(ierr);

Well what I do is *similar*

MatCreate(comm, &A);
MatSetSizes(A, localRowSize, localColumnSize, globalRowSize,
globalColumnSize);
MatSetType(A, MATMPIAIJ);
MatMPIAIJSetPreallocation(A, 0, d_nnz, 0, o_nnz);
MatSetFromOptions(A);
MatGetOwnershipRange(A, &rStart, &rEnd);


This (even without MatSetType(A, MATMPIAIJ);) works with 3.2-p6 but not
dev. The only difference I can see is 1) the order of MatSetFromOptions and
2) I do not call MatSeqAIJSetPreallocation which I think I do not need
anyway. Is there something I'm doing wrong?

Mohammd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120425/0ccae1d1/attachment-0001.htm>


More information about the petsc-users mailing list