Hi,<br>I'm confused what the Vec().setSizes() routine is doing in petsc4py. Consider this example:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font face="courier new, monospace">#!/usr/bin/env python</font><font face="courier new, monospace"><br>
</font><font face="courier new, monospace">import sys,os<br></font><font face="courier new, monospace">from petsc4py import PETSc<br></font><font face="courier new, monospace">from numpy import *<br></font><font face="courier new, monospace"><br>
</font><font face="courier new, monospace">mpi_rank = PETSc.COMM_WORLD.getRank()<br></font><font face="courier new, monospace">mpi_size = PETSc.COMM_WORLD.getSize()</font><font face="courier new, monospace"><br></font><font face="courier new, monospace"><br>
sizes = zeros(4)<br></font><font face="courier new, monospace">sizes[0] = 35675<br></font><font face="courier new, monospace">sizes[1] = 365510<br></font><font face="courier new, monospace">sizes[2] = 365742<br></font><font face="courier new, monospace">sizes[3] = 35443</font><font face="courier new, monospace"><br>
</font><font face="courier new, monospace"><br>X = PETSc.Vec().create(comm=PETSc.COMM_WORLD)<br></font><font face="courier new, monospace">X.setSizes(mpi_size*sizes[mpi_rank],bsize=1)<br></font><font face="courier new, monospace">X.setFromOptions()<br>
</font><font face="courier new, monospace">ilow,ihigh = X.getOwnershipRange()</font><font face="courier new, monospace"><br></font><font face="courier new, monospace"><br>print "rank: ",mpi_rank,"low/high: ",ilow,ihigh</font></blockquote>
<br><br>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.<br>
<div><br></div><div>Thanks,</div><div>Wes</div>