<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Matthew,
<div class=""><br class="">
</div>
<div class="">Thanks for your email. I tried first what you suggested and it didn’t work. However, I actually tried also commenting the same function in Section and worked! This is the working code:</div>
<div class=""><br class="">
</div>
<div class="">
<pre style="background-color: rgb(255, 255, 255); color: rgb(74, 92, 110); font-family: Menlo; font-size: 14px;" class=""><span style="color: rgb(242, 137, 49);" class="">def </span><span style="color: rgb(167, 95, 0);" class="">createfields</span>(dm):<br class="">    <span style="color: rgb(139, 205, 123); font-style: italic;" class="">"""Set up the solution field"""<br class=""></span><span style="color: rgb(139, 205, 123); font-style: italic;" class=""><br class=""></span><span style="color: rgb(139, 205, 123); font-style: italic;" class="">    </span>dim = dm.getDimension()<br class="">    <span style="color: rgb(159, 159, 159);" class=""># The number of solution fields<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>numFields = <span style="color: rgb(93, 151, 196);" class="">1<br class=""></span><span style="color: rgb(93, 151, 196);" class="">    </span>dm.setNumFields(numFields)<br class="">    <span style="color: rgb(159, 159, 159);" class=""># numComp - An array of size numFields that holds the number of components for each field<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>numComp = np.array([dim]<span style="color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(255, 140, 96);" class="">dtype</span>=np.int32)<br class="">    <span style="color: rgb(159, 159, 159);" class=""># numDof - An array of size numFields*(dim+1) which holds<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    # the number of dof for each field on a mesh piece of dimension d<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>numDof = np.zeros(numFields*(dim+<span style="color: rgb(93, 151, 196);" class="">1</span>)<span style="color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(255, 140, 96);" class="">dtype</span>=np.int32)<br class="">    numDof[<span style="color: rgb(93, 151, 196);" class="">0</span>] = dim <span style="color: rgb(159, 159, 159);" class=""># u is defined on vertices<br class=""></span><span style="color: rgb(159, 159, 159);" class=""><br class=""></span><span style="color: rgb(159, 159, 159);" class="">    # Create a PetscSection based upon the dof layout specification provided<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    # PetscSection: Mapping from integers in a designated range to contiguous sets of integers<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>section = dm.createSection(numComp<span style="color: rgb(242, 137, 49);" class="">, </span>numDof)<br class="">    <span style="color: rgb(159, 159, 159);" class=""># Sets the name of a field in the PetscSection, 0 is the field number and "u" is the field name<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>section.setFieldName(<span style="color: rgb(93, 151, 196);" class="">0</span><span style="color: rgb(242, 137, 49);" class="">, </span><span style="color: rgb(166, 202, 145);" class="">"u"</span>)<br class="">    <span style="color: rgb(159, 159, 159);" class=""># Set the PetscSection encoding the local data layout for the DM<br class=""></span><span style="color: rgb(159, 159, 159);" class="">    </span>dm.setDefaultSection(section)<br class=""><br class="">    <span style="color: rgb(242, 137, 49);" class="">return </span>dm</pre>
<div class=""><br class="">
</div>
</div>
<div class="">The question I now have is whether PETSc 3.13 and the matching petsc4py will change functionality to the point that this code will no longer work. Would that be the case?</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Verdana; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">
— Alejandro</div>
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 28 Mar 2020, at 18:14, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div dir="ltr" class="">On Fri, Mar 27, 2020 at 10:09 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div dir="ltr" class="">On Fri, Mar 27, 2020 at 3:31 AM Alejandro Aragon - 3ME <<a href="mailto:A.M.Aragon@tudelft.nl" target="_blank" class="">A.M.Aragon@tudelft.nl</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div style="word-wrap: break-word;" class="">
<div class="">Dear Matthew,</div>
<div class=""><br class="">
</div>
<div class="">Thanks for your email. I have attached the python code that reproduces the following error in my computer:</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I think I see the problem. There were changes in DM in order to support fields which only occupy part of the domain.</div>
<div class="">Now you need to tell the DM about the fields before it builds a Section. I think in your code, you only need</div>
<div class=""><br class="">
</div>
<div class="">  f = PetscContainer()</div>
<div class="">  f.setName("potential")</div>
<div class="">  dm.addField(field = f)</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">So Nicolas Barral found a much better way to do this. You only need</div>
<div class=""><br class="">
</div>
<div class="">  dm.setNumFields(1)</div>
<div class=""><br class="">
</div>
<div class="">  Thanks,</div>
<div class=""><br class="">
</div>
<div class="">     Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div class="gmail_quote">
<div class="">from <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mcs.anl.gov_petsc_petsc-2Dcurrent_docs_manualpages_DM_DMAddField.html&d=DwMFaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=U1Pry6bTDByPujjSnTcPY6KNXqrym6APfmtom-lIPFA&m=UZjBC-wnFeOXp0s_J1LfjZeUVWAtsWXRKX6gZQ64z7Q&s=ICc46rZbM067ZBpFcy0TKivavc07pbkZe1e8Bu4SmIA&e=" target="_blank" class="">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMAddField.html</a><span class="Apple-converted-space"> </span>before
 the createSection().</div>
<div class="">My Python may not be correct since I never use that interface.</div>
<div class=""><br class="">
</div>
<div class="">  Thanks,</div>
<div class=""><br class="">
</div>
<div class="">     Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div style="word-wrap: break-word;" class="">
<div class="">
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">(.pydev)<span class="Apple-converted-space"> </span></span><span style="color: rgb(255, 99, 85);" class="">➜ <span class="Apple-converted-space"> </span></span><span style="color: rgb(93, 253, 255);" class="">dmplex_fem</span><span class=""><span class="Apple-converted-space"> </span>mpirun
 -np 2  python Cpp2Python.py</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">Traceback (most recent call last):</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 383, in <module></span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    sys.exit(Cpp2Python())</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 357, in Cpp2Python</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    dm = createfields(dm)</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 62, in createfields</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    section.setFieldName(0, "u")</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "PETSc/Section.pyx", line 59, in petsc4py.PETSc.Section.setFieldName</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">petsc4py.PETSc.Error: error code 63</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[1] PetscSectionSetFieldName() line 427 in /private/tmp/pip-install-laf1l3br/petsc/src/vec/is/section/interface/section.c</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[1] Argument out of range</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[1] Section field 0 should be in [0, 0)</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">Traceback (most recent call last):</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 383, in <module></span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    sys.exit(Cpp2Python())</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 357, in Cpp2Python</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    dm = createfields(dm)</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "Cpp2Python.py", line 62, in createfields</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">    section.setFieldName(0, "u")</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  File "PETSc/Section.pyx", line 59, in petsc4py.PETSc.Section.setFieldName</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">petsc4py.PETSc.Error: error code 63</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[0] PetscSectionSetFieldName() line 427 in /private/tmp/pip-install-laf1l3br/petsc/src/vec/is/section/interface/section.c</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[0] Argument out of range</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">[0] Section field 0 should be in [0, 0)</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">-------------------------------------------------------</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">Primary job  terminated normally, but 1 process returned</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">a non-zero exit code.. Per user-direction, the job has been aborted.</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">-------------------------------------------------------</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">--------------------------------------------------------------------------</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">mpirun detected that one or more processes exited with non-zero status, thus causing</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">the job to be terminated. The first process to do so was:</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16); min-height: 25px;" class="">
<span class=""></span><br class="">
</div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  Process name: [[23972,1],0]</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">  Exit code:    1</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">--------------------------------------------------------------------------</span></div>
</div>
<div class=""><br class="">
</div>
<div class="">I’m using Python 3.8 and this is the output of ‘pip freeze'</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">(.pydev)<span class="Apple-converted-space"> </span></span><span style="color: rgb(255, 99, 85);" class="">➜ <span class="Apple-converted-space"> </span></span><span style="color: rgb(93, 253, 255);" class="">dmplex_fem</span><span class=""><span class="Apple-converted-space"> </span>pip
 freeze</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">cachetools==4.0.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">cycler==0.10.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">kiwisolver==1.1.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">llvmlite==0.31.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">matplotlib==3.2.1</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">mpi4py==3.0.3</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">numba==0.48.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">numpy==1.18.2</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">petsc==3.12.4</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">petsc4py==3.12.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">plexus==0.1.0</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">pyparsing==2.4.6</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">python-dateutil==2.8.1</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">scipy==1.4.1</span></div>
<div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Inconsolata-dz; color: rgb(16, 16, 16);" class="">
<span class="">six==1.14.0</span></div>
</div>
<div class=""><br class="">
</div>
<div class="">I’m looking forward to getting your insight on the issue.</div>
<div class="">Best regards,</div>
<br class="">
<div class="">
<div style="font-family: Verdana; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class="">
— Alejandro</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
<div style="word-wrap: break-word;" class="">
<div class=""></div>
</div>
<div style="word-wrap: break-word;" class="">
<div class=""></div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 25 Mar 2020, at 17:37, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">On Wed, Mar 25, 2020 at 12:29 PM Alejandro Aragon - 3ME <<a href="mailto:A.M.Aragon@tudelft.nl" target="_blank" class="">A.M.Aragon@tudelft.nl</a>> wrote:<br class="">
</div>
<div class="">
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;" class="">
<div style="word-wrap: break-word;" class="">
<div class="">Dear everyone,</div>
<div class=""><br class="">
</div>
<div class="">I’m new to petsc4py and I’m trying to run a simple finite element code that uses DMPLEX to load a .msh file (created by Gmsh). In version 3.10 the code was working but I recently upgraded to 3.12 and I get the following error:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">(.pydev)<span class="Apple-converted-space"> </span></span><span style="color: rgb(180, 36, 25);" class="">➜ <span class="Apple-converted-space"> </span></span><span style="color: rgb(46, 174, 187);" class="">testmodule</span><span class=""><span class="Apple-converted-space"> </span></span><span style="color: rgb(64, 11, 217);" class="">git:(</span><span style="color: rgb(180, 36, 25);" class="">e0bc9ae</span><span style="color: rgb(64, 11, 217);" class="">)<span class="Apple-converted-space"> </span></span><span style="color: rgb(159, 160, 28);" class="">✗</span><span class=""><span class="Apple-converted-space"> </span>mpirun
 -np 2 python testmodule/__main__.py</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">{3: <testmodule.constitutive.elastic.Elastic object at 0x10feea520>}</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">{3: <testmodule.constitutive.elastic.Elastic object at 0x10d96d520>}</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">Traceback (most recent call last):</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "testmodule/__main__.py", line 32, in <module></span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    sys.exit(main(sys.argv))</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "testmodule/__main__.py", line 29, in main</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    step.solve(m)</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "/Users/aaragon/Local/testmodule/testmodule/fem/analysis/static.py", line 33, in solve</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    self.Amat.assemblyBegin(assembly=0)  # FINAL_ASSEMBLY = 0</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "PETSc/Mat.pyx", line 1039, in petsc4py.PETSc.Mat.assemblyBegin</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">petsc4py.PETSc.Error: error code 63</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] MatAssemblyBegin() line 5182 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/interface/matrix.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] MatAssemblyBegin_MPIAIJ() line 810 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/impls/aij/mpi/mpiaij.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] MatStashScatterBegin_Private() line 462 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] MatStashScatterBegin_BTS() line 931 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] PetscCommBuildTwoSidedFReq() line 555 in /private/tmp/pip-install-zurcx_6k/petsc/src/sys/utils/mpits.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] Argument out of range</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[1] toranks[0] 2 not in comm size 2</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">Traceback (most recent call last):</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "testmodule/__main__.py", line 32, in <module></span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    sys.exit(main(sys.argv))</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "testmodule/__main__.py", line 29, in main</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    step.solve(m)</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "/Users/aaragon/Local/testmodule/testmodule/fem/analysis/static.py", line 33, in solve</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">    self.Amat.assemblyBegin(assembly=0)  # FINAL_ASSEMBLY = 0</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  File "PETSc/Mat.pyx", line 1039, in petsc4py.PETSc.Mat.assemblyBegin</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">petsc4py.PETSc.Error: error code 63</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] MatAssemblyBegin() line 5182 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/interface/matrix.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] MatAssemblyBegin_MPIAIJ() line 810 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/impls/aij/mpi/mpiaij.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] MatStashScatterBegin_Private() line 462 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] MatStashScatterBegin_BTS() line 931 in /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] PetscCommBuildTwoSidedFReq() line 555 in /private/tmp/pip-install-zurcx_6k/petsc/src/sys/utils/mpits.c</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] Argument out of range</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">[0] toranks[0] 2 not in comm size 2</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">-------------------------------------------------------</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">Primary job  terminated normally, but 1 process returned</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">a non-zero exit code.. Per user-direction, the job has been aborted.</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">-------------------------------------------------------</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">--------------------------------------------------------------------------</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">mpirun detected that one or more processes exited with non-zero status, thus causing</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">the job to be terminated. The first process to do so was:</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); min-height: 25px; font-size: 13px;" class="">
<span class=""></span><br class="">
</div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  Process name: [[46994,1],0]</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">  Exit code:    1</span></div>
<div style="margin: 0px; line-height: normal; font-family: Inconsolata-dz; color: rgb(242, 242, 242); font-size: 13px;" class="">
<span class="">--------------------------------------------------------------------------</span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">This is in the call to assembly, which looks like this:</div>
<div class=""><br class="">
</div>
<div class="">
<pre style="background-color: rgb(255, 255, 255); color: rgb(74, 92, 110); font-family: Menlo; font-size: 15px;" class=""><span style="color: rgb(159, 159, 159);" class=""># Begins assembling the matrix. This routine should be called after completing all calls to MatSetValues().<br class=""></span><span style="color: rgb(218, 139, 209);" class="">self</span>.Amat.assemblyBegin(<span style="color: rgb(255, 140, 96);" class="">assembly</span>=<span style="color: rgb(93, 151, 196);" class="">0</span>)  <span style="color: rgb(159, 159, 159);" class=""># FINAL_ASSEMBLY = 0<br class=""></span><span style="color: rgb(159, 159, 159);" class=""># Completes assembling the matrix. This routine should be called after MatAssemblyBegin().<br class=""></span><span style="color: rgb(218, 139, 209);" class="">self</span>.Amat.assemblyEnd(<span style="color: rgb(255, 140, 96);" class="">assembly</span>=<span style="color: rgb(93, 151, 196);" class="">0</span>)<br class=""></pre>
<div class="">I would appreciate if someone can give me some insight on what has changed in the new version of petsc4py (or petsc for that matter) to make this code work again.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">It looks like you have an inconsistent build, or a memory overwrite. Since you are in Python, I suspect the former. Can you build</div>
<div class="">PETSc from scratch and try this? Does it work in serial? Can you send a small code that reproduces this?</div>
<div class=""><br class="">
</div>
<div class="">  Thanks,</div>
<div class=""><br class="">
</div>
<div class="">     Matt</div>
<div class=""> </div>
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;" class="">
<div style="word-wrap: break-word;" class="">
<div class="">Best regards,</div>
<br class="">
<div class="">
<div style="font-family: Verdana; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class="">
— Alejandro</div>
</div>
<br class="">
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cse.buffalo.edu_-7Eknepley_&d=DwMFaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=U1Pry6bTDByPujjSnTcPY6KNXqrym6APfmtom-lIPFA&m=WPJk3cZzX4wkA5n5wceeOf2wjrRxHYug5Gs78b9WHlc&s=vuuUnGL1h2Bfv_uY7e5cMSfiF1btYPrvwf5vKy1JoN0&e=" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cse.buffalo.edu_-7Eknepley_&d=DwMFaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=U1Pry6bTDByPujjSnTcPY6KNXqrym6APfmtom-lIPFA&m=UZjBC-wnFeOXp0s_J1LfjZeUVWAtsWXRKX6gZQ64z7Q&s=pgBjejAN8aAlWZNjhIiXXP8IhXJrAr2HeI7cLhj0wlM&e=" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cse.buffalo.edu_-7Eknepley_&d=DwMFaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=U1Pry6bTDByPujjSnTcPY6KNXqrym6APfmtom-lIPFA&m=UZjBC-wnFeOXp0s_J1LfjZeUVWAtsWXRKX6gZQ64z7Q&s=pgBjejAN8aAlWZNjhIiXXP8IhXJrAr2HeI7cLhj0wlM&e=" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>