# PETSc matrix-matrix multiplication got signal number 11 error in parallel

**URL:** <https://fenicsproject.discourse.group/t/petsc-matrix-matrix-multiplication-got-signal-number-11-error-in-parallel/14000>\
**Category:** dolfinx\
**Tags:** mpi\
**Created:** [March 23, 2024, 7:13am UTC](https://fenicsproject.discourse.group/t/petsc-matrix-matrix-multiplication-got-signal-number-11-error-in-parallel/14000 "2024-03-23T07:13:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chenyongxin](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/chenyongxin/32/6501_2.png) [@chenyongxin](https://fenicsproject.discourse.group/u/chenyongxin)\
**Post date:** [March 29, 2024, 5:35am UTC](https://fenicsproject.discourse.group/t/petsc-matrix-matrix-multiplication-got-signal-number-11-error-in-parallel/14000/2 "2024-03-29T05:35:13Z")

</div>

To answer my own question:

> [@chenyongxin](#):
>
> `As = assemble_matrix(fem.form(ufl.inner(us, vs) * ufl.dx))`

The above return value PETSc.Mat `As` is not finalized as stated:

> <https://github.com/FEniCS/dolfinx/blob/6189a7e2f42a63cc2bafd10696862efb41f0c3f9/python/dolfinx/fem/assemble.py#L221C1-L252C8>

To make it completed, it should be followed by

```auto
As.assemble()

```

N.B. For a assembled vector (PETSc.Vec), its ghost info in parallell should be specified with

```auto
bs = assemble_vector(L)
b.ghostUpdate(...)

```

See

> [@Parallel Sparse PETSc Matrix Generation with dofs as rows and columns](https://fenicsproject.discourse.group/t/parallel-sparse-petsc-matrix-generation-with-dofs-as-rows-and-columns/6625/4):
>
> The key here is that you are only access local (owned) indices of the vector (when you call get\_local(), not the ghosted values. This means that you are ignoring several contributions to your matrix. I do not know of an easy way of getting those ghost values in dolfin, however, here is a code that does the same thing for dolfinx. from petsc4py import PETSc from mpi4py import MPI import dolfinx import dolfinx.geometry import basix import numpy as np import ufl el = 30 mesh = dolfinx.UnitInterv…

---

_[View the full topic](https://fenicsproject.discourse.group/t/petsc-matrix-matrix-multiplication-got-signal-number-11-error-in-parallel/14000)._
