/[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 3343 by caltinay, Wed Oct 13 02:12:06 2010 UTC revision 3344 by caltinay, Thu Nov 11 23:26:52 2010 UTC
# Line 23  from escript import * Line 23  from escript import *
23  from util import *  from util import *
24  from datamanager import DataManager  from datamanager import DataManager
25    
 import os  
 import atexit  
   
26  # To have this function called automatically  # To have this function called automatically
27  def escriptLogMemoryStatusNow(prefix='memescript'):  def escriptLogMemoryStatusNow(prefix='memescript'):
28        import os
29      if os.name=='posix':      if os.name=='posix':
30      pid=os.getpid()          pid=os.getpid()
31      os.system("cat /proc/%d/status > %s.%d"%(pid,prefix,pid))          os.system("cat /proc/%d/status > %s.%d"%(pid,prefix,pid))
32            
33  if 'escriptExitProfiling' in os.environ:  try:
34      atexit.register(escriptLogMemoryStatusNow)      import os
35        if 'escriptExitProfiling' in os.environ:
36            import atexit
37            atexit.register(escriptLogMemoryStatusNow)
38    except:
39        pass
40    

Legend:
Removed from v.3343  
changed lines
  Added in v.3344

  ViewVC Help
Powered by ViewVC 1.1.26