Solve fails with segmentation fault: 11 only with MUMPS

Hi,

I’m using Apple M1 Mac Book Pro (16GB memory) and installed FEniCS with conda with the following command

conda create --override-channels -c conda-forge/osx-64 -c conda-forge/noarch -n fenics_test fenics

based on the command provided in here.

I noticed that I get memory issue only with MUMPS and not with other linear solvers. I have several conda environment with previous build number of FEniCS and these work completely fine with MUMPS. So the issue only seems to happen with the recent build.

Here is the minimum working example of the problem I have.

from dolfin import *
import sys

linear_solver = sys.argv[1]
# Create mesh and define function space
mesh = UnitSquareMesh(100, 100)
V = FunctionSpace(mesh, "Lagrange", 1)

# Define Dirichlet boundary (x = 0 or x = 1)
def boundary(x):
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS

# Define boundary condition
u0 = Constant(0.0)
bc = DirichletBC(V, u0, boundary)

# Define variational problem
u = TrialFunction(V)
v = TestFunction(V)
f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)", degree=2)
g = Expression("sin(5*x[0])", degree=2)
a = inner(grad(u), grad(v))*dx
L = f*v*dx + g*v*ds

# Compute solution
solver = LUSolver(Matrix(), linear_solver)
u = Function(V)
A = assemble(a)
b = assemble(L)
bc.apply(A, b)
solver.set_operator(A)
solver.solve(A, u.vector(), b)

and the outputs with different linear solver

$ python poisson.py mumps
Segmentation fault: 11

[02:27 PM]-[keiyamamoto@Keis-MacBook-Pro]-[~/Documents/FEniCS_sandbox_]- |main U:2 ?:9 ✗|
$ python poisson.py umfpack

[02:27 PM]-[keiyamamoto@Keis-MacBook-Pro]-[~/Documents/FEniCS_sandbox_]- |main U:2 ?:9 ✗|
$ python poisson.py superlu

[02:27 PM]-[keiyamamoto@Keis-MacBook-Pro]-[~/Documents/FEniCS_sandbox_]- |main U:2 ?:9 ✗|
$ python poisson.py superlu_dist

[02:28 PM]-[keiyamamoto@Keis-MacBook-Pro]-[~/Documents/FEniCS_sandbox_]- |main U:2 ?:9 ✗|
$ python poisson.py petsc

When I run the code first time with MUMPS, the output was

python(34586,0x2009bf2c0) malloc: Incorrect checksum for freed object 0x7ff681880800: probably modified after being freed.
Corrupt value: 0x100000000
python(34586,0x2009bf2c0) malloc: *** set a breakpoint in malloc_error_break to debug
Illegal instruction: 4

but it becamse simple segmentation fault:11 after that. If I reduce the mesh size it works fine, but the thing is that it only does not work with newer conda build. I have no problem running this problem with my old FEniCS conda environment, so I believe this is not hardware issue

1 Like

The solution to this problem was to specify the version of METIS to be 5.1.0. Somehow it did not work with the version 5.1.1

2 Likes

Adding a little context: Metis 5.1.1 has an ABI breakage, and mumps and/or petsc had been linked with 5.1.0, but accepted 5.1.1 at runtime, assuming ABI compatibility.

conda-forge has now patched dependencies so that packages built with metis 5.1.0 have a runtime dependency on ==5.1.0 instead of >=5.1.0,<5.2, so this shouldn’t affect future installs.

5 Likes