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 if __name__ == '__main__':
0010     f = Fold.Load(symbol="f")
0011     print(repr(f))
0012 
0013     rp = f.runprof
0014     assert rp.ndim == 2 and rp.shape[1] == 3 and rp.shape[0] > 0 
0015 
0016     st = ( rp[:,0] - rp[0,0])/1e6   # seconds
0017     vm = rp[:,1]/1e6   # GB
0018     rs = rp[:,2]/1e6   # GB 
0019 
0020 
0021     expr0 = "f.run/1e6 " 
0022     note0 = "%s : %s " % ( expr0, eval(expr0) )
0023     
0024     expr1 = "f.run*16*4/1e9 # GB estimate " 
0025     note1 = "%s : %s " % ( expr1, eval(expr1) )
0026 
0027     title_ = "~/opticks/sysrap/tests/NPFold_clear_test.sh TEST:%s CLEAR:%s " % ( f.run_meta.TEST, f.run_meta.CLEAR )  
0028     title = "\n".join([title_, note0, note1])
0029 
0030     fig, ax = mp.subplots(figsize=SIZE/100.)
0031     fig.suptitle(title)
0032 
0033     for idx in range(len(f.run)):
0034         fmt = "%0.3d" % idx 
0035         w = np.where( np.char.endswith( f.runprof_names, fmt ) )[0]  
0036 
0037         if "VM" in os.environ:
0038             ax.plot( st[w], vm[w], label="%s : VM[GB] vs time[s]" % fmt  ) 
0039         pass
0040         ax.plot( st[w], rs[w], label="%s : RSS[GB] vs time[s] " % fmt ) 
0041         ax.scatter( st[w], rs[w], label="%s : RSS[GB] vs time[s]" % fmt  ) 
0042     pass
0043 
0044     ax.legend()    
0045     fig.show()    
0046 pass
0047