예제 #1
0
    def trace_dispatch_call(self, frame):
        fcode = frame.f_code

        classname = ""
        if frame.f_locals:
            obj = frame.f_locals.get("self", None)
            if not obj is None:
                classname = obj.__class__.__name__ + "::"
            else:
                classname = ""

        methodname = fcode.co_name
        # methods with "?" are usually the files themselves (no method)
        # we now name them based on the file
        if methodname == "?":
            methodname = fcode.co_filename
            methodname = methodname[methodname.rfind("/") + 1:]
        tauname = classname + methodname
        filename = fcode.co_filename[fcode.co_filename.rfind("/") + 1:]
        tautype = '[{' + filename + '}{' + str(fcode.co_firstlineno) + '}]'

        # exclude the "? <string>" timer
        if not fcode.co_filename == "<string>":
            tautimer = pytau.profileTimer(tauname, tautype)
            pytau.start(tautimer)
예제 #2
0
파일: timing.py 프로젝트: robwarm/gpaw-symm
 def __init__(self):
     Timer.__init__(self)
     import pytau
     self.pytau = pytau
     self.tau_timers = {}
     pytau.setNode(mpi.rank)
     self.tau_timers[self.top_level] = pytau.profileTimer(self.top_level)
     pytau.start(self.tau_timers[self.top_level])
예제 #3
0
파일: timing.py 프로젝트: thonmaker/gpaw
 def __init__(self):
     Timer.__init__(self)
     import pytau
     self.pytau = pytau
     self.tau_timers = {}
     pytau.setNode(mpi.rank)
     self.tau_timers[self.top_level] = pytau.profileTimer(self.top_level)
     pytau.start(self.tau_timers[self.top_level])
예제 #4
0
파일: tau.py 프로젝트: UO-OACISS/tau2
 def runctx(self, cmd, globals, locals):
     self.enable()
     try:
         import pytau
         x = pytau.profileTimer(cmd)
         pytau.start(x)
         exec(cmd, globals, locals)
         pytau.stop(x)
     finally:
         self.disable()
     return self
예제 #5
0
파일: timing.py 프로젝트: qsnake/gpaw
 def start(self, name):
     Timer.start(self, name)
     self.tau_timers[name] = pytau.profileTimer(name)
     pytau.start(self.tau_timers[name])
예제 #6
0
파일: ipsTiming.py 프로젝트: batterysim/oas
def start(timer):
    if timer != None:
        #import pytau
        pytau.start(timer)
    else:
        pass
예제 #7
0
 def start(self, name):
     Timer.start(self, name)
     self.tau_timers[name] = pytau.profileTimer(name)
     pytau.start(self.tau_timers[name])
예제 #8
0
 def trace_dispatch_c_call(self, frame):
     if self.c_func_name == "start" or self.c_func_name == "stop" or self.c_func_name == "profileTimer" or self.c_func_name == "setprofile":
         pass
     else:
         tautimer = pytau.profileTimer(self.c_func_name, "")
         pytau.start(tautimer)