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

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

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

revision 387 by gross, Tue Dec 20 00:37:20 2005 UTC revision 435 by gross, Thu Jan 19 03:57:30 2006 UTC
# Line 27  __version__="$Revision:$" Line 27  __version__="$Revision:$"
27  __date__="$Date:$"  __date__="$Date:$"
28    
29  import os,socket,time,sys  import os,socket,time,sys
30    from esys.escript import setNumberOfThreads
31    
32  class BenchmarkSuite(object):  class BenchmarkSuite(object):
33     """     """
# Line 120  class BenchmarkSuite(object): Line 121  class BenchmarkSuite(object):
121             out+=self[i].getHTML(filter=filter,level=min(level+1,self.MAX_LEVEL))             out+=self[i].getHTML(filter=filter,level=min(level+1,self.MAX_LEVEL))
122             out+="<p>\n"             out+="<p>\n"
123         if level==1:         if level==1:
124             out+="<hr><p align=\"center\">by %s at %s</p>\n"%(os.getlogin(),time.strftime('%X %x %Z'))             try:
125                   name=os.getlogin()
126                   out+="<hr><p align=\"center\">by %s at %s</p>\n"%(name,time.strftime('%X %x %Z'))
127               except OSError:
128                   out+="<hr><p align=\"center\">%s</p>\n"%(time.strftime('%X %x %Z'))
129                  
130             out+="</BODY></HTML>\n"             out+="</BODY></HTML>\n"
131         return out         return out
132    
# Line 201  class Benchmark(object): Line 207  class Benchmark(object):
207               s=scale               s=scale
208            row=[]            row=[]
209            if s>0:            if s>0:
210                  t0=time.time()
211                  print "%s with %s threads started."%(r.__class__,s)
212                for p in self.__options:                for p in self.__options:
213                    os.environ['OMP_NUM_THREADS']=str(s)                    setNumberOfThreads(s)
214                    row.append(r.run(p))                    row.append(r.run(p))
215                  t0=time.time()-t0
216                  print "%s with %s threads finished (walltime =%s sec)."%(r.__class__,s,t0)
217            self.__results.append(row)            self.__results.append(row)
218     def getHTML(self,filter,level=1):     def getHTML(self,filter,level=1):
219         """         """

Legend:
Removed from v.387  
changed lines
  Added in v.435

  ViewVC Help
Powered by ViewVC 1.1.26