mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-14 09:36:52 +02:00
[core] TaskManager: handle compatibility error outside dfsToProcess()
This commit is contained in:
parent
3f3a6c0e83
commit
3fc09ddade
2 changed files with 22 additions and 2 deletions
|
@ -733,8 +733,6 @@ class Graph(BaseObject):
|
||||||
if vertex.hasStatus(Status.SUCCESS):
|
if vertex.hasStatus(Status.SUCCESS):
|
||||||
# stop branch visit if discovering a node already computed
|
# stop branch visit if discovering a node already computed
|
||||||
raise StopBranchVisit()
|
raise StopBranchVisit()
|
||||||
if self._computationBlocked[vertex]:
|
|
||||||
raise RuntimeError("Can't compute node '{}'".format(vertex.name))
|
|
||||||
|
|
||||||
def finishVertex(vertex, graph):
|
def finishVertex(vertex, graph):
|
||||||
chunksToProcess = []
|
chunksToProcess = []
|
||||||
|
|
|
@ -181,6 +181,11 @@ class TaskManager(BaseObject):
|
||||||
nodes, edges = graph.dfsOnFinish(startNodes=toNodes)
|
nodes, edges = graph.dfsOnFinish(startNodes=toNodes)
|
||||||
else:
|
else:
|
||||||
nodes, edges = graph.dfsToProcess(startNodes=toNodes)
|
nodes, edges = graph.dfsToProcess(startNodes=toNodes)
|
||||||
|
if not nodes:
|
||||||
|
logging.warning('Nothing to compute')
|
||||||
|
return
|
||||||
|
self.checkCompatibilityNodes(nodes, "COMPUTATION") # name of the context is important for QML
|
||||||
|
|
||||||
nodes = [node for node in nodes if not self.contains(node)] # be sure to avoid non-real conflicts
|
nodes = [node for node in nodes if not self.contains(node)] # be sure to avoid non-real conflicts
|
||||||
chunksInConflict = self.getAlreadySubmittedChunks(nodes)
|
chunksInConflict = self.getAlreadySubmittedChunks(nodes)
|
||||||
|
|
||||||
|
@ -268,6 +273,18 @@ class TaskManager(BaseObject):
|
||||||
self._nodes.add(node)
|
self._nodes.add(node)
|
||||||
self._nodesExtern.append(node)
|
self._nodesExtern.append(node)
|
||||||
|
|
||||||
|
def checkCompatibilityNodes(self, nodes, context):
|
||||||
|
compatNodes = []
|
||||||
|
for node in nodes:
|
||||||
|
if node in self._graph._compatibilityNodes.values():
|
||||||
|
compatNodes.append(node.nameToLabel(node.name))
|
||||||
|
if compatNodes:
|
||||||
|
# Warning: Syntax and terms are parsed on QML side to recognize the error
|
||||||
|
# Syntax : [Context] ErrorType: ErrorMessage
|
||||||
|
raise RuntimeError("[{}] Compatibility Issue:\n"
|
||||||
|
"Cannot compute because of these incompatible nodes:\n"
|
||||||
|
"{}".format(context, sorted(compatNodes)))
|
||||||
|
|
||||||
def submit(self, graph=None, submitter=None, toNodes=None):
|
def submit(self, graph=None, submitter=None, toNodes=None):
|
||||||
"""
|
"""
|
||||||
Nodes are send to the renderfarm
|
Nodes are send to the renderfarm
|
||||||
|
@ -309,6 +326,11 @@ class TaskManager(BaseObject):
|
||||||
self._nodesExtern = []
|
self._nodesExtern = []
|
||||||
|
|
||||||
nodesToProcess, edgesToProcess = graph.dfsToProcess(startNodes=toNodes)
|
nodesToProcess, edgesToProcess = graph.dfsToProcess(startNodes=toNodes)
|
||||||
|
if not nodesToProcess:
|
||||||
|
logging.warning('Nothing to compute')
|
||||||
|
return
|
||||||
|
self.checkCompatibilityNodes(nodesToProcess, "SUBMITTING") # name of the context is important for QML
|
||||||
|
|
||||||
flowEdges = graph.flowEdges(startNodes=toNodes)
|
flowEdges = graph.flowEdges(startNodes=toNodes)
|
||||||
edgesToProcess = set(edgesToProcess).intersection(flowEdges)
|
edgesToProcess = set(edgesToProcess).intersection(flowEdges)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue