diff --git a/pydra/engine/core.py b/pydra/engine/core.py index 0760da00e..26eaf259e 100644 --- a/pydra/engine/core.py +++ b/pydra/engine/core.py @@ -903,7 +903,7 @@ def _check_for_hash_changes(self): f"- the {field.type} object passed to '{changed}' field appears to " f"have an unstable hash. The {field.type}.__bytes_repr__() method " "can be implemented to provide stable hashes for this type. " - "See pydra/utils.hash.py for examples.\n" + "See pydra/utils/hash.py for examples.\n" ) if hash_changes: raise RuntimeError( diff --git a/pydra/engine/submitter.py b/pydra/engine/submitter.py index 91bdad511..2295cbd25 100644 --- a/pydra/engine/submitter.py +++ b/pydra/engine/submitter.py @@ -182,6 +182,7 @@ async def expand_workflow(self, wf, rerun=False): } graph_checksums = dict(wf.inputs._graph_checksums) + hashes_have_changed = False for task, waiting_on in outstanding.items(): if not waiting_on: continue @@ -193,13 +194,25 @@ async def expand_workflow(self, wf, rerun=False): f"Current values and hashes: {pred.inputs}, " f"{pred.inputs._hashes}\n" ) + hashes_have_changed = True elif pred not in outstanding: msg += ( - f" - undiagnosed issues in '{pred.name}' node " - "(potentially related to the file-system)" + f" - undiagnosed issues in '{pred.name}' node, " + "potentially related to file-system access issues " ) msg += "\n" - msg += "Set loglevel to 'debug' in order to track hash changes" + if hashes_have_changed: + msg += ( + "Set loglevel to 'debug' in order to track hash changes " + "throughout the execution of the workflow.\n\n " + "These issues may have been caused by `bytes_repr()` methods " + "that don't return stable hash values for specific object " + "types across multiple processes (see bytes_repr() " + '"singledispatch "function in pydra/utils/hash.py).' + "You may need to implement a specific `bytes_repr()` " + '"singledispatch overload"s or `__bytes_repr__()` ' + "dunder methods to handle one or more types in " + ) raise RuntimeError(msg) for task in tasks: # grab inputs if needed