[petsc-users] Simultaneous use petsc4py and fortran/petsc-based python module

Austin Herrema aherrema at iastate.edu
Tue Apr 4 13:24:25 CDT 2017


Hello all,

Another question in a fairly long line of questions from me. Thank you to
this community for all the help I've gotten.

I have a Fortran/PETSc-based code that, with the help of f2py and some of
you, I have compiled into a python module (we'll call it pc_fort_mod). So I
can now successfully execute my code with

import pc_fort_mod
pc_fort_mod.execute()

I am now hoping to use this analysis module in a large optimization problem
being solved with OpenMDAO <http://openmdao.org/>. OpenMDAO also makes use
of PETSc/petsc4py, which, unsurprisingly, does not play well with my
PETSc-based module. So doing

from petsc4py import PETSc
import pc_fort_mod
pc_fort_mod.execute()

causes the pc_fort_mod execution to fail (in particular, preallocation
fails with an exit code of 63, "input argument out of range." I assume the
matrix is invalid or something along those lines).

So my question is, is there any way to make this work? Or is this pretty
much out of the realm of what should be possible at this point?

Thank you,
Austin


-- 
*Austin Herrema*
PhD Student | Graduate Research Assistant | Iowa State University
Wind Energy Science, Engineering, and Policy | Mechanical Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170404/309cdf52/attachment-0001.html>


More information about the petsc-users mailing list