Skip to content

Commit 5eaa4cd

Browse files
author
George Bisbas
committed
advisor: More edits
1 parent ec30442 commit 5eaa4cd

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

devito/operator/profiling.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def __init__(self, name):
5555

5656
self.initialized = True
5757

58+
def add_include_dir(self, dir_path):
59+
self._include_dirs.append(dir_path)
60+
61+
def add_lib_dir(self, dir_path):
62+
self._lib_dirs.append(dir_path)
63+
5864
def analyze(self, iet):
5965
"""
6066
Analyze the Sections in the given IET. This populates `self._sections`.
@@ -371,9 +377,8 @@ def __init__(self, name):
371377
super().__init__(name)
372378
path = get_advisor_path()
373379
if path:
374-
self._include_dirs = [path.joinpath('include').as_posix()]
375-
libdir = path.joinpath('lib64').as_posix()
376-
self._lib_dirs = [libdir]
380+
self.add_include_dir(path.joinpath('include').as_posix())
381+
self.add_lib_dir(path.joinpath('lib64').as_posix())
377382
else:
378383
self.initialized = False
379384

@@ -510,9 +515,8 @@ def create_profile(name):
510515
if profiler.initialized:
511516
return profiler
512517
else:
513-
rlevel = 'advanced'
514-
warning(f"Couldn't set up `{level}` profiler; reverting to `{rlevel}`")
515-
profiler = profiler_registry[rlevel](name)
518+
warning(f"Couldn't set up `{level}` profiler; reverting to 'advanced'")
519+
profiler = profiler_registry['advanced'](name)
516520
# We expect the `advanced` profiler to always initialize successfully
517521
assert profiler.initialized
518522
return profiler

0 commit comments

Comments
 (0)