Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close /proc/meminfo at exit #89

Merged
merged 3 commits into from
Jun 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
close /proc/meminfo at exit
  • Loading branch information
davidhassell committed Jun 17, 2020
commit b3a7dde8dbee65c605cc10bdfaa563521c2f7625
12 changes: 12 additions & 0 deletions cf/functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import atexit
import csv
import logging
import os
Expand Down Expand Up @@ -60,6 +61,17 @@
from . import mpi_size


# Instruction to close /proc/mem at exit.
def _close_proc_meminfo():
print(999)
try:
_meminfo_file.close()
except:
pass


atexit.register(_close_proc_meminfo)

class DeprecationError(Exception):
pass

Expand Down