mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 00:38:41 +02:00
[core] handle unsatisfied node parallelization requirements
* catch error in case the required attribute is not found in preceding nodes * set an empty list of chunks when this happens * avoid uncatched exceptions in the middle of an update
This commit is contained in:
parent
ccaac43b34
commit
80cad9386a
2 changed files with 17 additions and 7 deletions
|
@ -230,13 +230,17 @@ class Parallelization:
|
|||
Returns: (blockSize, fullSize, nbBlocks)
|
||||
"""
|
||||
if self.inputListParamName:
|
||||
# Look for this attribute on preceding nodes
|
||||
parentNodes, edges = node.graph.dfsOnFinish(startNodes=[node])
|
||||
for parentNode in parentNodes:
|
||||
if self.inputListParamName in parentNode.getAttributes().keys():
|
||||
fullSize = len(parentNode.attribute(self.inputListParamName))
|
||||
nbBlocks = int(math.ceil(float(fullSize) / float(self.blockSize)))
|
||||
return (self.blockSize, fullSize, nbBlocks)
|
||||
raise RuntimeError('Cannot find the "inputListParamName": "{}" in the list of input nodes: {} for node: {}'.format(self.inputListParamName, parentNodes, node.name))
|
||||
# No attribute has been found (parallelization won't work): raise
|
||||
raise RuntimeError(
|
||||
'Cannot find the "inputListParamName": "{}" in the list of input nodes: {} for node: {}'.format(
|
||||
self.inputListParamName, parentNodes, node.name))
|
||||
if self.staticNbBlocks:
|
||||
return (1, self.staticNbBlocks, self.staticNbBlocks)
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue