/[escript]/trunk/finley/test/python/time_chunks.py
ViewVC logotype

Diff of /trunk/finley/test/python/time_chunks.py

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

revision 1569 by gross, Thu May 22 12:07:35 2008 UTC revision 1570 by gross, Sat May 24 21:31:04 2008 UTC
# Line 5  REPEAT=10 Line 5  REPEAT=10
5  HEADER="""from esys.escript import *  HEADER="""from esys.escript import *
6  from esys.finley import Rectangle,Brick  from esys.finley import Rectangle,Brick
7  from esys.escript.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
8  SOLVER_TOL=1.e-4  SOLVER_TOL=1.e-2
9  REL_TOL=1.e-1  REL_TOL=1.
10  OPTIMIZE=False  OPTIMIZE=False
11  SOLVER_VERBOSE=True  SOLVER_VERBOSE=True
12  FAC_DIAG=1.  FAC_DIAG=1.
# Line 106  if error>REL_TOL*Lsup(u_ex): raise Runti Line 106  if error>REL_TOL*Lsup(u_ex): raise Runti
106  """  """
107    
108    
109  for n in [1000, 10000, 50000, 100000]:  for n in [10000, 50000, 100000]:
110  # for n in [1000, 10000]:  # for n in [1000, 10000]:
111   #for prop in [ (1,2), (2,2), (1,3), (2,3) ]:   #for prop in [ (1,2), (2,2), (1,3), (2,3) ]:
112   for prop in [ (1,2), (1,3) ]:   for prop in [ (1,2), (1,3) ]:
# Line 148  for n in [1000, 10000, 50000, 100000]: Line 148  for n in [1000, 10000, 50000, 100000]:
148        prog+=SOLVE_AND_TEST        prog+=SOLVE_AND_TEST
149        # run code:        # run code:
150        print >> file("__prog","w"), prog        print >> file("__prog","w"), prog
151        for CHUNK in [-1,10,100,1000,10000, 100000]:        for CHUNK in [1,10,100,1000,10000, 100000]:
152          if CHUNK <= n:         for CHUNK_PCG in [1,10,100,1000,10000, 100000]:
153            if CHUNK*NUM_THREADS <= n and CHUNK_PCG*NUM_THREADS <=n:
154           time_per_iter=0           time_per_iter=0
155           for i in range(REPEAT):           for i in range(REPEAT):
156              os.system("export OMP_NUM_THREADS=%d;export PASO_CHUNK_SIZE_MVM=%d; python __prog > __out;"%(NUM_THREADS,CHUNK))              os.system("export OMP_NUM_THREADS=%d;export PASO_CHUNK_SIZE_MVM=%d; export PASO_CHUNK_SIZE_PCG=%d; python __prog > __out;"%(NUM_THREADS,CHUNK,CHUNK_PCG))
157              out=file("__out","r").read()              out=file("__out","r").read()
158              for i in out.split("\n"):              for i in out.split("\n"):
159                 if i.startswith(TEST_STR): time_per_iter+=float(i[len(TEST_STR):-3].strip())                 if i.startswith(TEST_STR): time_per_iter+=float(i[len(TEST_STR):-3].strip())
160           print CHUNK,time_per_iter/REPEAT           print CHUNK,CHUNK_PCG,time_per_iter/REPEAT
161    

Legend:
Removed from v.1569  
changed lines
  Added in v.1570

  ViewVC Help
Powered by ViewVC 1.1.26