From 7f84097c24a5ad9b40a71b1c86a5926b42f1bcd9 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 5 Feb 2020 11:45:33 +0100 Subject: [PATCH] [core] Option to make chunks optional --- meshroom/__init__.py | 7 +++++-- meshroom/core/desc.py | 2 +- meshroom/core/node.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/meshroom/__init__.py b/meshroom/__init__.py index 7bda50a187..e2847226a3 100644 --- a/meshroom/__init__.py +++ b/meshroom/__init__.py @@ -1,10 +1,11 @@ __version__ = "2019.2.0" __version_name__ = __version__ +from distutils import util +from enum import Enum +import logging import os import sys -import logging -from enum import Enum # sys.frozen is initialized by cx_Freeze and identifies a release package isFrozen = getattr(sys, "frozen", False) @@ -21,6 +22,8 @@ # Allow override from env variable __version_name__ = os.environ.get("REZ_MESHROOM_VERSION", __version_name__) +useMultiChunks = util.strtobool(os.environ.get("MESHROOM_USE_MULTI_CHUNKS", "True")) + class Backend(Enum): STANDALONE = 1 diff --git a/meshroom/core/desc.py b/meshroom/core/desc.py index be6f52e589..07466d15f7 100755 --- a/meshroom/core/desc.py +++ b/meshroom/core/desc.py @@ -429,7 +429,7 @@ def buildCommandLine(self, chunk): if not alreadyInEnv: cmdPrefix = '{rez} {packageFullName} -- '.format(rez=os.environ.get('REZ_ENV'), packageFullName=chunk.node.packageFullName) cmdSuffix = '' - if chunk.range: + if chunk.node.isParallelized: cmdSuffix = ' ' + self.commandLineRange.format(**chunk.range.toDict()) return cmdPrefix + chunk.node.nodeDesc.commandLine.format(**chunk.node._cmdVars) + cmdSuffix diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 3865b6d520..0eeb13d402 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -592,7 +592,7 @@ def _buildCmdVars(self): @property def isParallelized(self): - return bool(self.nodeDesc.parallelization) + return bool(self.nodeDesc.parallelization) if meshroom.useMultiChunks else False @property def nbParallelizationBlocks(self):