Skip to content

Commit

Permalink
.destroy() to prevent memory leak and docker compose addition
Browse files Browse the repository at this point in the history
  • Loading branch information
niravshah241 committed Aug 30, 2024
1 parent 95f47db commit 095d362
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
FROM dolfinx/dolfinx:v0.7.3

# Set work directory
RUN mkdir -p /home/app
WORKDIR /home/app
RUN mkdir -p /home/mdfenicsx
WORKDIR /home/mdfenicsx

# Install MDFEniCSx
# Install MDFEniCSx from github
RUN pip install git+https://github.com/niravshah241/MDFEniCSx.git

# Keep container alive
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
mdfenicsx:
image: mdfenicsx:no-tag
build:
context: .
dockerfile: Dockerfile
tags:
- "mdfenicsx:no-tag"
1 change: 1 addition & 0 deletions mdfenicsx/mesh_motion_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def solve(self):
ksp.getPC().setFactorSolverType("mumps")
ksp.setFromOptions()
ksp.solve(F, uh.vector)
# .destroy() objects which are no longer needed
ksp.destroy()
A.destroy()
F.destroy()
Expand Down

0 comments on commit 095d362

Please sign in to comment.