Excessive memory use in ElmerGrid conversion from gmsh

Clearly defined bug reports and their fixes
Post Reply
cozzyd
Posts: 2
Joined: 17 Dec 2013, 06:29
Antispam: Yes
Location: Cambridge, MA
Contact:

Excessive memory use in ElmerGrid conversion from gmsh

Post by cozzyd »

Hi,

ElmerGrid can use extremely large amounts of memory when converting meshes from gmsh (e.g. ElmerGrid 14 2 foo.msh). I've encountered situations where the 32G of ram available to me is insufficient and ElmerGrid will crash with a failure to malloc in imatrix. The issue appears to be the invtopo matrix in femknot.c, will will allocate enough space for the maximum number of possible elements for each node. I have remedied the issue for myself with the attached patch, which replaces the matrix structure with a jagged array (with reallocation when necessary). It probably is more expensive computationally, but it drastically reduces memory use.
Attachments
invtopo.patch
(3.1 KiB) Downloaded 393 times
Post Reply