[petsc-users] petsc4py csr sparse matrix different number of local rows at each processor
Cetinbas, Cankur Firat
ccetinbas at anl.gov
Wed Dec 6 10:40:44 CST 2017
Hello,
Is there a way to set different number of local rows for each processor when using createAIJ with csr option with petsc4py? In petsc documentation it is clearly shown ( set int m) but I couldn't figure it out with petsc4py.
I tried the following but it did not work (ploc is the local number of rows, ptot is the total number of rows and it is square sparse matrix)
pA = PETSc.Mat().createAIJ(size=(ploc, ptot, ptot, ptot), csr=(indptr.astype(dtype='int32'), indices.astype(dtype='int32'), data))
For petsc4py the createAIJ inputs are as follows:
def petsc.Mat.Mat.createAIJ<https://sourcecodebrowser.com/petsc4py/0.7.5/classpetsc_1_1_mat_1_1_mat.html#a341230aed3f44e60da185aaf83572399>
(
self,
size,
bsize = None,
nz = None,
d_nz = None,
o_nz = None,
csr = None,
comm = None
)
Thanks,
Firat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171206/4cd86b0c/attachment.html>
More information about the petsc-users
mailing list