コード例 #1
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
コード例 #2
0
def runctx(statement, globals, locals, filename=None):
    """Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    """
    prof = Profile()
    try:
        prof = prof.runctx(statement, globals, locals)
    except SystemExit:
        pass
    pytau.stop()
コード例 #3
0
def run(statement, filename=None, sort=-1):
    """Run statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    """
    prof = Profile()
    try:
        prof = prof.run(statement)
    except SystemExit:
        pass
    pytau.stop()
コード例 #4
0
ファイル: timing.py プロジェクト: qsnake/gpaw
 def stop(self, name=None):
     Timer.stop(self, name)
     pytau.stop(self.tau_timers[name])
コード例 #5
0
ファイル: ipsTiming.py プロジェクト: batterysim/oas
def stop(timer):
    if timer != None:
        #import pytau
        pytau.stop(timer)
    else:
        pass
コード例 #6
0
 def stop(self, name=None):
     Timer.stop(self, name)
     pytau.stop(self.tau_timers[name])
コード例 #7
0
 def trace_dispatch_c_return(self, frame):
     if self.c_func_name == "start" or self.c_func_name == "stop" or self.c_func_name == "profileTimer":
         pass
     else:
         pytau.stop()
コード例 #8
0
 def trace_dispatch_return(self, frame):
     # exclude the "? <string>" timer
     if not frame.f_code.co_filename == "<string>":
         pytau.stop()