On Wed, Mar 25, 2020 at 12:29 PM Alejandro Aragon - 3ME < a.m.ara...@tudelft.nl> wrote:
> Dear everyone, > > 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: > > (.pydev) ➜ testmodule git:(e0bc9ae) ✗ mpirun -np 2 python > testmodule/__main__.py > {3: <testmodule.constitutive.elastic.Elastic object at 0x10feea520>} > {3: <testmodule.constitutive.elastic.Elastic object at 0x10d96d520>} > Traceback (most recent call last): > File "testmodule/__main__.py", line 32, in <module> > sys.exit(main(sys.argv)) > File "testmodule/__main__.py", line 29, in main > step.solve(m) > File > "/Users/aaragon/Local/testmodule/testmodule/fem/analysis/static.py", line > 33, in solve > self.Amat.assemblyBegin(assembly=0) # FINAL_ASSEMBLY = 0 > File "PETSc/Mat.pyx", line 1039, in petsc4py.PETSc.Mat.assemblyBegin > petsc4py.PETSc.Error: error code 63 > [1] MatAssemblyBegin() line 5182 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/interface/matrix.c > [1] MatAssemblyBegin_MPIAIJ() line 810 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/impls/aij/mpi/mpiaij.c > [1] MatStashScatterBegin_Private() line 462 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c > [1] MatStashScatterBegin_BTS() line 931 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c > [1] PetscCommBuildTwoSidedFReq() line 555 in > /private/tmp/pip-install-zurcx_6k/petsc/src/sys/utils/mpits.c > [1] Argument out of range > [1] toranks[0] 2 not in comm size 2 > Traceback (most recent call last): > File "testmodule/__main__.py", line 32, in <module> > sys.exit(main(sys.argv)) > File "testmodule/__main__.py", line 29, in main > step.solve(m) > File > "/Users/aaragon/Local/testmodule/testmodule/fem/analysis/static.py", line > 33, in solve > self.Amat.assemblyBegin(assembly=0) # FINAL_ASSEMBLY = 0 > File "PETSc/Mat.pyx", line 1039, in petsc4py.PETSc.Mat.assemblyBegin > petsc4py.PETSc.Error: error code 63 > [0] MatAssemblyBegin() line 5182 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/interface/matrix.c > [0] MatAssemblyBegin_MPIAIJ() line 810 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/impls/aij/mpi/mpiaij.c > [0] MatStashScatterBegin_Private() line 462 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c > [0] MatStashScatterBegin_BTS() line 931 in > /private/tmp/pip-install-zurcx_6k/petsc/src/mat/utils/matstash.c > [0] PetscCommBuildTwoSidedFReq() line 555 in > /private/tmp/pip-install-zurcx_6k/petsc/src/sys/utils/mpits.c > [0] Argument out of range > [0] toranks[0] 2 not in comm size 2 > ------------------------------------------------------- > Primary job terminated normally, but 1 process returned > a non-zero exit code.. Per user-direction, the job has been aborted. > ------------------------------------------------------- > -------------------------------------------------------------------------- > mpirun detected that one or more processes exited with non-zero status, > thus causing > the job to be terminated. The first process to do so was: > > Process name: [[46994,1],0] > Exit code: 1 > -------------------------------------------------------------------------- > > > This is in the call to assembly, which looks like this: > > # Begins assembling the matrix. This routine should be called after > completing all calls to MatSetValues(). > self.Amat.assemblyBegin(assembly=0) # FINAL_ASSEMBLY = 0 > # Completes assembling the matrix. This routine should be called after > MatAssemblyBegin(). > self.Amat.assemblyEnd(assembly=0) > > 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. > It looks like you have an inconsistent build, or a memory overwrite. Since you are in Python, I suspect the former. Can you build PETSc from scratch and try this? Does it work in serial? Can you send a small code that reproduces this? Thanks, Matt > Best regards, > > — Alejandro > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>