Skip to content

Commit

Permalink
Fix number of CPUs for AdvancedTreeSearch (#448)
Browse files Browse the repository at this point in the history
Specifying `cpu=2` lead the job to still only consume 100% (un-normalized, so only one core) of CPU, because `OMP_NUM_THREADS=1`.

Removing the division by two leads the job to consume the desired 200%, i.e. 2 cores.
  • Loading branch information
NeoLegends authored and Atticus1806 committed Oct 2, 2023
1 parent 66c16ac commit 219d000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recognition/advanced_tree_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def create_files(self):
self.feature_flow.write_to_file("feature.flow")
util.write_paths_to_file(self.out_lattice_bundle, self.out_single_lattice_caches.values())
extra_code = "export OMP_NUM_THREADS={0}\nexport TF_DEVICE='{1}'".format(
math.ceil(self.cpu / 2), "gpu" if self.use_gpu else "cpu"
math.ceil(self.cpu), "gpu" if self.use_gpu else "cpu"
)
self.write_run_script(self.exe, "recognition.config", extra_code=extra_code)

Expand Down

0 comments on commit 219d000

Please sign in to comment.