-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add warning for when UCX_MEM_MMAP_HOOK_MODE is set #626
base: branch-0.16
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quasiben I added a few suggestions there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @quasiben !
Am seeing the following failure on CI. ___________________________ test_mem_mmap_hook_warn ____________________________
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f138eb82850>
def test_mem_mmap_hook_warn(caplog):
"""
Test warning for UCX_MEM_MMAP_HOOK_MODE
"""
import logging
os.environ["UCX_MEM_MMAP_HOOK_MODE"] = "none"
# ucp.init will only print INFO LINES
with caplog.at_level(logging.INFO):
import ucp
> ucp.init()
tests/test_mmap_warn.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
options = {}, env_takes_precedence = False, blocking_progress_mode = None
def init(options={}, env_takes_precedence=False, blocking_progress_mode=None):
"""Initiate UCX.
Usually this is done automatically at the first API call
but this function makes it possible to set UCX options programmable.
Alternatively, UCX options can be specified through environment variables.
Parameters
----------
options: dict, optional
UCX options send to the underlying UCX library
env_takes_precedence: bool, optional
Whether environment variables takes precedence over the `options`
specified here.
blocking_progress_mode: bool, optional
If None, blocking UCX progress mode is used unless the environment variable
`UCXPY_NON_BLOCKING_MODE` is defined.
Otherwise, if True blocking mode is used and if False non-blocking mode is used.
"""
global _ctx
if _ctx is not None:
raise RuntimeError(
> "UCX is already initiated. Call reset() and init() "
"in order to re-initate UCX with new options."
)
E RuntimeError: UCX is already initiated. Call reset() and init() in order to re-initate UCX with new options.
ucp/core.py:755: RuntimeError |
Hmmm, yeah testing for UCX variables can be really tricky. The "solution" for that would be calling |
Yeah that's ok with me. |
Related to #616
cc @pentschev