Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions meshroom/submitters/localFarmSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class LocalFarmSubmitter(BaseSubmitter):

dryRun = False
environment = {}
disabled_rez = False

def __init__(self, parent=None):
super().__init__(parent=parent)
Expand Down Expand Up @@ -235,13 +236,13 @@ def getChunks(chunkParams) -> list[Chunk]:
it = [Chunk(i, item[0], item[-1]) for i, item in enumerate(slices) if i not in ignoreIterations]
return it

@staticmethod
def getExpandWrappedCmd(cmdArgs, rezPackages):
def getExpandWrappedCmd(self, cmdArgs, rezPackages):
# Wrap with create_chunks
cmdBin = wrapMeshroomBin("meshroom_createChunks")
cmd = f"{cmdBin} --submitter LocalFarm {cmdArgs}"
# Wrap with rez
cmd = rezWrapCommand(cmd, otherRezPkg=rezPackages)
if not self.disabled_rez:
cmd = rezWrapCommand(cmd, otherRezPkg=rezPackages)
return cmd

def __createChunkTasks(self, job: Job, parentTask: Task, children: List[Task], chunkParams: dict) -> Task:
Expand All @@ -253,7 +254,8 @@ def __createChunkTasks(self, job: Job, parentTask: Task, children: List[Task], c
meta["iteration"] = c.iteration
cmdBin = wrapMeshroomBin("meshroom_compute")
cmd = f"{cmdBin} {cmdArgs} --iteration {c.iteration}"
cmd = rezWrapCommand(cmd, otherRezPkg=self.reqPackages)
if not self.disabled_rez:
cmd = rezWrapCommand(cmd, otherRezPkg=self.reqPackages)
chunkTask = Task(name=name, command=cmd, metadata=meta, env=self.jobEnv)
job.addTask(chunkTask)
for child in children:
Expand Down Expand Up @@ -286,7 +288,8 @@ def createTask(self, meshroomFile: str, node) -> CreatedTask:
else:
cmdBin = wrapMeshroomBin("meshroom_compute")
cmd = f"{cmdBin} {cmdArgs} --iteration 0"
cmd = rezWrapCommand(cmd, otherRezPkg=self.reqPackages)
if not self.disabled_rez:
cmd = rezWrapCommand(cmd, otherRezPkg=self.reqPackages)
task = Task(name=node.name, command=cmd, metadata=metadata, env=self.jobEnv)
task = CreatedTask(task, None)

Expand Down
1 change: 1 addition & 0 deletions tests/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def processSubmit(node: Node, graph, tmp_path):
try:
print(f"submit {node}")
submitter = get_submitter()
submitter.disabled_rez = True
submitter.setFarmPath(tmp_path)
submitter.setJobEnv(getJobEnv())
nodesToProcess, edgesToProcess = [node], []
Expand Down
Loading