Respect max-concurrency in makescene, dmrecon, scene2pset

pull/921/head
Piero Toffanin 2019-04-12 13:58:25 -04:00
rodzic 460e263588
commit 9c3e63571f
2 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -17,14 +17,16 @@ def get_ccd_widths():
return dict(zip(map(string.lower, sensor_data.keys()), sensor_data.values()))
def run(cmd, env_paths=[context.superbuild_bin_path]):
def run(cmd, env_paths=[context.superbuild_bin_path], env_vars={}):
"""Run a system command"""
log.ODM_DEBUG('running %s' % cmd)
env = None
env = os.environ.copy()
if len(env_paths) > 0:
env = os.environ.copy()
env["PATH"] = env["PATH"] + ":" + ":".join(env_paths)
for k in env_vars:
env[k] = str(env_vars[k])
retcode = subprocess.call(cmd, shell=True, env=env)

Wyświetl plik

@ -57,7 +57,7 @@ class ODMMveCell(ecto.Cell):
# run mve makescene
if not io.dir_exists(tree.mve_views):
system.run('%s %s %s' % (context.makescene_path, tree.mve_path, tree.mve))
system.run('%s %s %s' % (context.makescene_path, tree.mve_path, tree.mve), env_vars={'OMP_NUM_THREADS': args.max_concurrency})
# Compute mve output scale based on depthmap_resolution
max_width = 0
@ -123,14 +123,14 @@ class ODMMveCell(ecto.Cell):
log.ODM_INFO('')
log.ODM_INFO("Running dense reconstruction. This might take a while. Please be patient, the process is not dead or hung.")
log.ODM_INFO(" Process is running")
system.run('%s %s %s' % (context.dmrecon_path, ' '.join(dmrecon_config), tree.mve))
system.run('%s %s %s' % (context.dmrecon_path, ' '.join(dmrecon_config), tree.mve), env_vars={'OMP_NUM_THREADS': args.max_concurrency})
scene2pset_config = [
"-F%s" % mve_output_scale
]
# run scene2pset
system.run('%s %s "%s" "%s"' % (context.scene2pset_path, ' '.join(scene2pset_config), tree.mve, tree.mve_model))
system.run('%s %s "%s" "%s"' % (context.scene2pset_path, ' '.join(scene2pset_config), tree.mve, tree.mve_model), env_vars={'OMP_NUM_THREADS': args.max_concurrency})
else:
log.ODM_WARNING('Found a valid MVE reconstruction file in: %s' %
tree.mve_model)