From 45d3f202fc8d9ff193353f8463f7107b440205cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 5 Jan 2023 16:44:55 +0100 Subject: [PATCH 1/2] Display the "Computed Externally" icon whenever the node runs externally A node running externally used to mean it was running on a submitter. This definition has been extended and a node is now considered to be external if it is running on a submitter or running in another instance of Meshroom. The "Computed Externally" is updated to reflect that change. --- meshroom/core/node.py | 1 + meshroom/ui/qml/GraphEditor/Node.qml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 7a9c057c55..0ef0c96ac6 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -1085,6 +1085,7 @@ def canBeCanceled(self): globalExecModeChanged = Signal() globalExecMode = Property(str, globalExecMode.fget, notify=globalExecModeChanged) + isExternal = Property(bool, isExtern, notify=globalExecModeChanged) isComputed = Property(bool, _isComputed, notify=globalStatusChanged) aliveChanged = Signal() alive = Property(bool, alive.fget, alive.fset, notify=aliveChanged) diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 213e73eb01..8ec12f0792 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -235,7 +235,7 @@ Item { // Submitted externally indicator MaterialLabel { - visible: ["SUBMITTED", "RUNNING"].includes(node.globalStatus) && node.chunks.count > 0 && node.globalExecMode === "EXTERN" + visible: ["SUBMITTED", "RUNNING"].includes(node.globalStatus) && node.chunks.count > 0 && node.isExternal text: MaterialIcons.cloud padding: 2 font.pointSize: 7 From 9a956df4d4290a6c5433aaa78d8190e608a9e929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 5 Jan 2023 17:13:20 +0100 Subject: [PATCH 2/2] [core] Check all chunks' execution mode to determine if a node is external Prior to this commit, a node was considered external if its first chunk's execution mode was EXTERN. In some cases, a node can be submitted externally but have its first chunk's execution mode as LOCAL. This can occur if computations are started locally then stopped and resumed externally. If any chunk completed its computations locally, then its execution mode will remain LOCAL, even if the node is submitted externally later on. A node is now considered external if at least one of its chunks' execution mode is external. --- meshroom/core/node.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 0ef0c96ac6..08a0f1adaf 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -764,7 +764,14 @@ def alreadySubmittedChunks(self): return [ch for ch in self._chunks if ch.isAlreadySubmitted()] def isExtern(self): - return self._chunks.at(0).isExtern() + """ Return True if at least one chunk of this Node has an external execution mode, False otherwise. + + It is not enough to check whether the first chunk's execution mode is external, because computations + may have been started locally, interrupted, and restarted externally. In that case, if the first + chunk has completed locally before the computations were interrupted, its execution mode will always + be local, even if computations resume externally. + """ + return any(chunk.isExtern() for chunk in self._chunks) @Slot() def clearSubmittedChunks(self):