[petsc-users] Correct syntax for DMDA ownership ranges in petsc4py
Chris Eldred
chris.eldred at gmail.com
Wed Apr 6 06:01:57 CDT 2016
Hey All,
Does anyone know the correct syntax for setting ownership ranges for
DMDAs in petsc4py? For example, if I have a 1D DMDA with 20 vertices
and 3 processes, and I want to distribute the vertices as [8,8,4],
should the correct create call be:
da = PETSc.DMDA().create(dim=1,dof=1,sizes=[20,],proc_sizes=[nprocs,],boundary_type=[PETSc.DM.BoundaryType.PERIODIC,],
stencil_type= PETSc.DMDA.StencilType.BOX,
stencil_width=1,ownership_ranges=[8,8,4])
or
da = PETSc.DMDA().create(dim=1,dof=1,sizes=[20,],proc_sizes=[nprocs,],boundary_type=[PETSc.DM.BoundaryType.PERIODIC,],
stencil_type= PETSc.DMDA.StencilType.BOX,
stencil_width=1,ownership_ranges=[[8,8,4],])
For me, the 1st version fails with
ValueError: number of dimensions 1 and number ownership ranges 3
(which I expected)
but the 2nd version also fails with
TypeError: Expected tuple, got list
I have tried using tuples instead of lists and nothing changes.
Thanks in advance for any assistance!
Regards,
-Chris
--
Chris Eldred
Postdoctoral Fellow, LAGA, University of Paris 13
PhD, Atmospheric Science, Colorado State University, 2015
DOE Computational Science Graduate Fellow (Alumni)
B.S. Applied Computational Physics, Carnegie Mellon University, 2009
chris.eldred at gmail.com
More information about the petsc-users
mailing list