/[escript]/trunk/escript/py_src/__init__.py
ViewVC logotype

Diff of /trunk/escript/py_src/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2344 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2009 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 25  from util import * Line 25  from util import *
25  import os  import os
26  import atexit  import atexit
27    
28  def escriptOnExitProfiling():  # To have this function called automatically
29    def escriptLogMemoryStatusNow(prefix='memescript'):
30      if os.name=='posix':      if os.name=='posix':
31      pid=os.getpid()      pid=os.getpid()
32      os.system("cat /proc/%d/status > memescript.%d"%(pid,pid))      os.system("cat /proc/%d/status > %s.%d"%(pid,prefix,pid))
33            
34  if 'escriptExitProfiling' in os.environ:  if 'escriptExitProfiling' in os.environ:
35      atexit.register(escriptOnExitProfiling)      atexit.register(escriptLogMemoryStatusNow)

Legend:
Removed from v.2344  
changed lines
  Added in v.2548

  ViewVC Help
Powered by ViewVC 1.1.26