From 69c5a2bc3cb8522a6237c247270065dac9053bfe Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Wed, 8 Jan 2020 14:59:07 -0800 Subject: [PATCH] Warn if OMP_NUM_THREADS is set (#6729) --- doc/source/iter.rst | 4 ++-- python/ray/worker.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/source/iter.rst b/doc/source/iter.rst index 42bd6ec2c..f3e068307 100644 --- a/doc/source/iter.rst +++ b/doc/source/iter.rst @@ -109,8 +109,8 @@ element ``x_{i+1}`` is fetched from the source actor. This is useful if you need update the source actor between iterator steps. Note that for async gather, this ordering only applies per shard. -**Operator state**: Operator state is preserved for each shard. This means that you can pass a stateful callable to ``.foreach()``: -For example, this means you can pass a stateful callable to ``.foreach()``: +**Operator state**: Operator state is preserved for each shard. +This means that you can pass a stateful callable to ``.foreach()``: .. code-block:: python diff --git a/python/ray/worker.py b/python/ray/worker.py index 38e9d4745..1ff4677b7 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -675,6 +675,11 @@ def init(address=None, else: driver_mode = SCRIPT_MODE + if "OMP_NUM_THREADS" in os.environ: + logger.warning("OMP_NUM_THREADS={} is set, this may impact " + "object transfer performance.".format( + os.environ["OMP_NUM_THREADS"])) + if setproctitle is None: logger.warning( "WARNING: Not updating worker name since `setproctitle` is not "