Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,21 @@ def pytest_runtest_makereport(item, call):
result.outcome = 'passed'


def pytest_make_parametrize_id(config, val, argname):
"""
Prevents pytest to make obsucre parameter names (param0, param1, ...)
and default to str(val) instead for better log readability.
"""
# First see if it has a name
if hasattr(val, '__name__'):
return val.__name__
# Then try str(val)
try:
return str(val)
except Exception:
return None # Fall back to default behavior


# A list of optimization options/pipelines to be used in testing
# regarding spatial and/or temporal blocking.
opts_tiling = ['advanced',
Expand Down
3 changes: 2 additions & 1 deletion devito/finite_differences/derivative.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def _validate_expr(expr):
try:
expr = diffify(expr)
except Exception as e:
raise ValueError("`expr` must be a `Differentiable` type object") from e
d = type(expr)
raise ValueError(f"`expr` must be a `Differentiable` not {d}") from e
return expr

@staticmethod
Expand Down
4 changes: 3 additions & 1 deletion devito/passes/iet/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ def create_call_graph(root, efuncs):
"""
dag = DAG(nodes=[root])
queue = [root]
defuncs = {root}

while queue:
caller = queue.pop(0)
callees = FindNodes(Call).visit(efuncs[caller])

for callee in filter_ordered([i.name for i in callees]):
if callee in efuncs: # Exclude foreign Calls, e.g., MPI calls
defuncs.add(callee)
try:
dag.add_node(callee)
queue.append(callee)
Expand All @@ -239,7 +241,7 @@ def create_call_graph(root, efuncs):
dag.add_edge(callee, caller)

# Sanity check
assert dag.size == len(efuncs)
assert dag.size == len(defuncs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what prompted these changes?

foreign calls should never appear inside efuncs


return dag

Expand Down
Loading