Skip to content

Commit 0b8392c

Browse files
Merge pull request #63 from HPC-SimTools/remove_pytau
Remove pytau timings
2 parents 7d13c13 + d2e0a75 commit 0b8392c

10 files changed

+2
-430
lines changed

ipsframework/component.py

-29
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
import weakref
88
from copy import copy
99

10-
try:
11-
if os.environ['IPS_TIMING'] == '1':
12-
try:
13-
import pytau
14-
except ImportError:
15-
raise
16-
IPS_TIMING = True
17-
except KeyError:
18-
pass
19-
2010

2111
class Component:
2212
"""
@@ -28,9 +18,6 @@ def __init__(self, services, config):
2818
"""
2919
Set up config values and reference to services.
3020
"""
31-
# pytau.setNode(1)
32-
# timer = pytau.profileTimer("component.__init__", "", str(os.getpid()))
33-
# pytau.start(timer)
3421
self.component_id = None
3522
self.invocation_q = None
3623
self.services = weakref.proxy(services)
@@ -42,11 +29,8 @@ def __init__(self, services, config):
4229
setattr(self, i, config[i])
4330
except Exception as e:
4431
print('Error setting Component parameter : ', i, ' - ', e)
45-
# pytau.stop(timer)
4632
raise
4733

48-
# pytau.stop(timer)
49-
5034
def __copy__(self):
5135
cls = self.__class__
5236
result = cls.__new__(cls)
@@ -61,16 +45,11 @@ def __initialize__(self, component_id, invocation_q, start_time=0.0):
6145
"""
6246
Establish connection to *invocation_q*.
6347
"""
64-
# timer = pytau.profileTimer("component.__initialize__", "", str(os.getpid()))
65-
# pytau.start(timer)
6648
self.component_id = component_id
6749
self.invocation_q = invocation_q
6850
self.start_time = start_time
6951
# setattr(sys, 'exit', sys.exit)
7052

71-
# pytau.stop(timer)
72-
return
73-
7453
def __my_exit__(self, arg=0):
7554
"""
7655
Produce message and exception about exit.
@@ -86,8 +65,6 @@ def __run__(self):
8665
Wait for incoming commands delivered via the *invocation_q*, and
8766
dispatch the incoming methods accordingly.
8867
"""
89-
# timer = pytau.profileTimer(self.component_id.__str__() + ".__run__", "", str(os.getpid()))
90-
# pytau.start(timer)
9168

9269
tmp = sys.exit
9370
sys.exit = self.__my_exit__
@@ -131,7 +108,6 @@ def __run__(self):
131108
(errno, strerror) = oserr.args
132109
self.services.exception('Error creating directory %s : %s',
133110
workdir, strerror)
134-
# pytau.stop(timer)
135111
raise
136112
os.chdir(workdir)
137113
self.services.debug('Running - CompID = %s',
@@ -140,9 +116,6 @@ def __run__(self):
140116
if (self.services.profile):
141117
self.services.debug('Instrumenting - CompID = %s',
142118
self.component_id.get_serialization())
143-
pytau.setNode(int(self.component_id.get_seq_num()))
144-
pytau.dbPurge()
145-
self.services._make_timers()
146119
self.services._init_event_service()
147120

148121
while True:
@@ -175,7 +148,6 @@ def __run__(self):
175148
call_id,
176149
Message.SUCCESS, retval)
177150
self.services.fwk_in_q.put(response_msg)
178-
# pytau.stop(timer)
179151

180152
def init(self, timestamp=0.0, **keywords):
181153
"""
@@ -241,7 +213,6 @@ def terminate(self, status):
241213
Clean up services and call :py:obj:`sys_exit`.
242214
"""
243215
# print self.services.full_comp_id, ": terminate() method called"
244-
self.services._cleanup()
245216
# self.services.debug('###(1) %s %s', str(self), str(self.__dict__))
246217

247218
if (status == Message.SUCCESS):

0 commit comments

Comments
 (0)