Skip to content

Commit

Permalink
[core] Option to make chunks optional
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Feb 5, 2020
1 parent 5e5cc7b commit 7f84097
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions meshroom/__init__.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meshroom/core/desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7f84097

Please sign in to comment.