Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:14

0001 #!/usr/bin/env python
0002 
0003 import os, numpy as np
0004 from opticks.ana.fold import Fold
0005 import matplotlib.pyplot as mp
0006 
0007 SIZE=np.array([1280, 720])
0008 
0009 
0010 if __name__ == '__main__':
0011     f = Fold.Load(symbol="f")
0012     print(repr(f))
0013 
0014     rp = f.runprof
0015     assert rp.ndim == 2 and rp.shape[1] == 3 and rp.shape[0] > 0 
0016 
0017     st = ( rp[:,0] - rp[0,0])/1e6   # seconds
0018     vm = rp[:,1]/1e6   # GB
0019     rs = rp[:,2]/1e6   # GB 
0020 
0021 
0022     expr0 = "f.run/1e6 " 
0023     note0 = "%s : %s " % ( expr0, eval(expr0) )
0024     
0025     expr1 = "f.run*16*4/1e9 # GB estimate " 
0026     note1 = "%s : %s " % ( expr1, eval(expr1) )
0027 
0028 
0029 
0030     title_ = "~/opticks/sysrap/tests/NP_delete_test.sh TEST:%s CLEAR:%s DELETE:%s " % ( f.run_meta.TEST, f.run_meta.CLEAR, f.run_meta.DELETE  )  
0031     title = "\n".join([title_, note0, note1])
0032 
0033     fig, ax = mp.subplots(figsize=SIZE/100.)
0034     fig.suptitle(title)
0035 
0036     for idx in range(len(f.run)):
0037         fmt = "%0.3d" % idx 
0038         w = np.where( np.char.endswith( f.runprof_names, fmt ) )[0]  
0039 
0040         if "VM" in os.environ:
0041             ax.plot( st[w], vm[w], label="%s : VM[GB] vs time[s]" % fmt  ) 
0042         pass
0043         ax.plot( st[w], rs[w], label="%s : RSS[GB] vs time[s] " % fmt ) 
0044         ax.scatter( st[w], rs[w], label="%s : RSS[GB] vs time[s]" % fmt  ) 
0045     pass
0046 
0047     ax.legend()    
0048     fig.show()    
0049 pass
0050