[petsc-users] petsc4py Vec().setSizes()

Weston Lowrie wlowrie at uw.edu
Mon Feb 4 16:01:27 CST 2013


Hi,
I'm confused what the Vec().setSizes() routine is doing in petsc4py.
 Consider this example:

#!/usr/bin/env python
import sys,os
from petsc4py import PETSc
from numpy import *

mpi_rank = PETSc.COMM_WORLD.getRank()
mpi_size = PETSc.COMM_WORLD.getSize()

sizes = zeros(4)
sizes[0] = 35675
sizes[1] = 365510
sizes[2] = 365742
sizes[3] = 35443

X = PETSc.Vec().create(comm=PETSc.COMM_WORLD)
X.setSizes(mpi_size*sizes[mpi_rank],bsize=1)
X.setFromOptions()
ilow,ihigh = X.getOwnershipRange()

print "rank: ",mpi_rank,"low/high: ",ilow,ihigh



Why is it that when setting the local sizes explicitly do I need to
multiply by the mpi_size?  My understanding is that when using this routine
it is telling PETSc what the local processor core size should be.  It seems
to divide it by total number of processors cores.

Thanks,
Wes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130204/bf86150a/attachment.html>


More information about the petsc-users mailing list