This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Excessive memory usage of a simple 3D Poisson with Fenics 1.6

+3 votes

Dear all,

I am running the simplest possible 3D problem, a scalar Poisson, with Fenics 1.6. I have used a grid of 200x200x200 P1 tetrahedra. I am using GMRES with incomplete Cholesky preconditioner to solve the system. Incomplete Cholesky should consume (worst case scenario) the same amount of memory as the sparse matrix. The mesh should consume about 1GB and the matrix maximum around 2.5 GB. In total around 6GB. However, when building the dofmap from UFC

Elapsed wall, usr, sys time: 11.3979, 10.67, 0.73 (Init dofmap from
UFC dofmap)

The memory consumption goes up to 20GB. Is it supposed to? I tried to deactivate some options for example
a) parameters["mesh_partitioner"] = "None"
b) parameters["dof_ordering_library"] = "Boost"
c) parameters["reorder_of_serial"] = False

in the hope that I will turn of all reordering and mesh partitioning stuff that consume time and possibly increase memory. Options a) and b) did not help and Option c) helped but then the whole thing got stack at

Elapsed wall, usr, sys time: 476.788, 48.82, 380.86 (Boost graph
coloring (from dolfin::Graph))

from dolfin import *

info(parameters, True)
set_log_level(DEBUG)
list_krylov_solver_preconditioners()
parameters["mesh_partitioner"] = "None"
parameters["num_threads"]      = 1
parameters["dof_ordering_library"]      = "Boost"
parameters["reorder_dofs_serial"]       = False

mesh = UnitCubeMesh(200, 200, 200)
V = FunctionSpace(mesh, 'Lagrange', 1)

u0 = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]+x[2]*x[2]')

def u0_boundary(x, on_boundary):
    return on_boundary

bc = DirichletBC(V, u0, u0_boundary)

# Define variational problem
u = TrialFunction(V)
v = TestFunction(V)
f = Constant(-6.0) 


a = inner(grad(u), grad(v))*dx

L = f*v*dx


u = Function(V)
problem = LinearVariationalProblem(a, L, u, bc)
solver  = LinearVariationalSolver(problem)
solver.parameters['linear_solver']  = "gmres"

solver.parameters['preconditioner'] = "icc"
gmres_params = solver.parameters["krylov_solver"]
gmres_params['relative_tolerance'] = 1.0e-6
gmres_params['maximum_iterations'] = 1000
gmres_params['monitor_convergence'] = True

solver.solve()
asked Nov 7, 2015 by Panos FEniCS Novice (190 points)

2 Answers

0 votes

Hello everybody,
Was anybody able to verify the same problem? Can somebody confirm. I have observed that issue on both Linux and OSX platforms.

answered Nov 13, 2015 by Panos FEniCS Novice (190 points)
0 votes

Hi, I have Ubuntu 14.04 running FEniCS 1.6. I can confirm. The 16GB of RAM quickly run out but still the problem is solved after 5 min. However, FEniCS is swapping at some point. I also removed some of your options and I used the default ones. More precisely I removed

parameters["mesh_partitioner"] = "None"
parameters["num_threads"]      = 1
parameters["dof_ordering_library"]      = "Boost"
parameters["reorder_dofs_serial"]       = False

but the problem persists. I do not know if any options helps. We have to wait for the developers to give a hint.

answered Nov 13, 2015 by archwndas FEniCS Novice (150 points)
...