Skip to content

Commit ba3dd32

Browse files
Devin PetersohnDevin Petersohn
authored andcommitted
Fixing num_threads
1 parent 49ccb05 commit ba3dd32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modin/pandas/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from .datetimes import to_datetime # noqa: 402
2323
from .reshape import get_dummies # noqa: 402
2424

25+
# Set this so that Pandas doesn't try to multithread by itself
26+
os.environ['OMP_NUM_THREADS'] = "1"
27+
2528
try:
2629
if threading.current_thread().name == "MainThread":
2730
ray.init(
@@ -31,9 +34,6 @@
3134
except AssertionError:
3235
pass
3336

34-
# Set this so that Pandas doesn't try to multithread by itself
35-
os.environ['OMP_NUM_THREADS'] = "1"
36-
3737
num_cpus = ray.global_state.cluster_resources()['CPU']
3838
DEFAULT_NPARTITIONS = int(num_cpus)
3939

0 commit comments

Comments
 (0)