Skip to content

Commit

Permalink
Fixing num_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin Petersohn authored and Devin Petersohn committed Sep 22, 2018
1 parent 49ccb05 commit ba3dd32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modin/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
from .datetimes import to_datetime # noqa: 402
from .reshape import get_dummies # noqa: 402

# Set this so that Pandas doesn't try to multithread by itself
os.environ['OMP_NUM_THREADS'] = "1"

try:
if threading.current_thread().name == "MainThread":
ray.init(
Expand All @@ -31,9 +34,6 @@
except AssertionError:
pass

# Set this so that Pandas doesn't try to multithread by itself
os.environ['OMP_NUM_THREADS'] = "1"

num_cpus = ray.global_state.cluster_resources()['CPU']
DEFAULT_NPARTITIONS = int(num_cpus)

Expand Down

0 comments on commit ba3dd32

Please sign in to comment.