-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Parallel: output of %px and %px${suffix} is inconsistent #1989
Comments
Yes, this is expected. The initial view created for magics has the non-default initial state |
What do you mean by initial view? The one associated with the return value of the first invocation of Client() ? Is it possible to block the Client() function s.t. it blocks until the cluster is available? Until now I have observed 3 different return types/values of the Client function: one where |
When you create a client for the first time, it does this: view = rc.direct_view(targets='all')
view.block = True
view.activate() The result is a blocking view always mapping to all engines, which can be a function of time.
Sure. To wait for the connection file: from IPython.utils.path import get_security_file
# 100 * 0.1 = 10s timeout
for i in range(100):
try:
cf = get_security_file('ipcontroller-client.json')
except IOError:
time.sleep(0.1)
else:
break To wait for a specific number of engines: while len(rc) < expected_engines:
time.sleep(0.1)
rc.spin() It makes sense for the first case to be builtin to the Client itself (engines already do this). It does not make sense for the second, because a cluster with zero engines is perfectly valid, and there is no mechanism for the client to know how many engines to expect beyond you just telling it, and it is trivial for you to do this waiting yourself. I could add a |
Thx, your get_security_file() code does the trick! I would be +1 for a builtin version. |
%px print a
outputs the content ofa
, whereas%pxroot print a
outputsasync.execute
. The %pxroot magic was created withdv.activate(suffix='root')
. The outputs are inconsistent. Is this desired ?The text was updated successfully, but these errors were encountered: