Skip to content

Commit 268b914

Browse files
committed
[core] Node : add defaultStatus in _createChunks
1 parent d73997d commit 268b914

File tree

11 files changed

+289
-164
lines changed

11 files changed

+289
-164
lines changed

bin/meshroom_createChunks

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ submittedStatuses = [Status.RUNNING]
7272
# Find job
7373
submitter, job = None, None
7474
# It's required if we want to spool chunks on different machines
75-
jobInfos = node._nodestatus.jobInfos
75+
jobInfos = node._nodeStatus.jobInfos
7676
submitterName, jid = jobInfos.get("submitterName"), jobInfos.get("jid")
7777
for subName, sub in submitters.items():
7878
if not sub._options.includes(SubmitterOptionsEnum.RETRIEVE):
@@ -86,6 +86,10 @@ if not (hasattr(node, '_chunksCreated') and node._chunksCreated):
8686
# Create node chunks
8787
# Once created we don't have to do it again even if we relaunch the job
8888
node._createChunks()
89+
# TODO
90+
# Notify that the chunk is submitted
91+
# for chunk in node._chunks:
92+
# chunk._status.initExternSubmit()
8993

9094
# Get chunks to process in the current process
9195
chunksToProcess = []

meshroom/core/desc/node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def processChunk(self, chunk):
162162

163163
def executeChunkCommandLine(self, chunk, cmd, env=None):
164164
try:
165-
with open(chunk.logFile, 'w') as logF:
165+
with open(chunk.getLogFile(), 'w') as logF:
166166
chunk.status.commandLine = cmd
167167
chunk.saveStatusFile()
168168
cmdList = shlex.split(cmd)
@@ -171,7 +171,7 @@ def executeChunkCommandLine(self, chunk, cmd, env=None):
171171

172172
print(f"Starting Process for '{chunk.node.name}'")
173173
print(f" - commandLine: {cmd}")
174-
print(f" - logFile: {chunk.logFile}")
174+
print(f" - logFile: {chunk.getLogFile()}")
175175
if prog:
176176
cmdList[0] = Path(prog).as_posix()
177177
print(f" - command full path: {cmdList[0]}")
@@ -216,7 +216,7 @@ def executeChunkCommandLine(self, chunk, cmd, env=None):
216216
pass
217217

218218
if chunk.subprocess.returncode != 0:
219-
with open(chunk.logFile, "r") as logF:
219+
with open(chunk.getLogFile(), "r") as logF:
220220
logContent = "".join(logF.readlines())
221221
raise RuntimeError(f'Error on node "{chunk.name}":\nLog:\n{logContent}')
222222
finally:

meshroom/core/graph.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ def dfsToProcess(self, startNodes=None):
10811081
visited nodes and edges that are not already computed (node.status != SUCCESS).
10821082
The order is defined by the visit and finishVertex event.
10831083
"""
1084+
print(f"[Graph] (dfsToProcess) startNodes={startNodes}")
10841085
nodes = []
10851086
edges = []
10861087
visitor = Visitor(reverse=False, dependenciesOnly=True)
@@ -1091,6 +1092,10 @@ def discoverVertex(vertex, graph):
10911092
raise StopBranchVisit()
10921093

10931094
def finishVertex(vertex, graph):
1095+
if not vertex.chunks:
1096+
# Chunks have not been initialized
1097+
nodes.append(vertex)
1098+
return
10941099
chunksToProcess = []
10951100
for chunk in vertex.chunks:
10961101
if chunk.status.status is not Status.SUCCESS:

0 commit comments

Comments
 (0)