Comments (11)
@aarchiba I really want this. I even started writing it a long time ago, but had to move on to other things. Hopefully I, or someone else, will get a chance to do it soon.
from ipyparallel.
Well, since I kind of need it now and I just wrote an MPI-based Executor, maybe the thing to do is write a standalone wrapper module; it can go into ipyparallel when it's ready. I don't actually need the callback thing (yet? actually it would be nice), which is the only thing that wants modifications to ipyparallel.
from ipyparallel.
Yup, a simple wrapper exposing the right API would be the place to start. If you are working on that, feel free to link to it here.
from ipyparallel.
See https://github.com/aarchiba/futuretools . Needs more testing (e.g. workers appearing and disappearing, cleanliness of shutdown).
from ipyparallel.
In terms of what would be needed to improve/simplify the wrapper, the main thing is that right now it has to poll - check the AsyncResults repeatedly to see if any have finished yet. Client.wait() almost does the right thing, except that I want to wait until any result is available - including one from a request that hadn't been submitted when I start waiting. But since Client.wait() has to poll anyway there's not too much to be gained here.
The other thing is that it's not so easy to tell when a node goes idle - queue_status turns out to require a round-trip to the node (and wait for the currently-executing job to complete) so that's no good. Right now I just keep track of how many jobs are in flight and how many workers I have and send more jobs if there are fewer jobs than workers.
concurrent.futures never interupts a Future that is in progress, so I don't actually use abort(). It probably makes sense to make the AsyncResult object available from the Future (beware race conditions; maybe just an abort method) so that users can do this if they want to.
from ipyparallel.
That's awesome!
What I would do is probably subclass Client and hook up ZMQStreams on the zmq sockets and run a tornado IOLoop in a thread. That way, callbacks will fire as zmq messages arrive, rather than ever calling Client.wait
. I'm sure that upon subclassing I would find a few methods to split up differently for re-use.
Are you interested in tackling that? This sounds pretty fun to me, but I'm not sure when I'll get a chance to put it together.
from ipyparallel.
If tornado IOLoop gives you a poll-free way to wait on messages, then it should be used to implement Client.wait(). In fact the thing to do would be to generalize Client.wait() to permit waiting for any message, as well as all messages. I haven't used tornado or zmq directly at all, so it'd take me a little while to get up to speed. For the moment I need to do some tests to see how nestle (python nested sampling) behaves with larger numbers of cores.
from ipyparallel.
I think it makes sense to create a PR to include this code. I'm having trouble getting ipyparallel working from git, though. What are its dependencies? pyzmq, obviously, but I'm getting complaints about a missing ipykernel module.
from ipyparallel.
pip install -e .
should get all the dependencies. I think it's just ipykernel, though.
from ipyparallel.
@aarchiba do you think you may have a chance to work on this? I added some Future support in pyzmq recently, so now I have some ideas for how this might work.
from ipyparallel.
I might take a stab at making Client's IO use IOLoop and Futures internally this weekend. That should clear much of the path for wrapping a view in an Executor interface.
from ipyparallel.
Related Issues (20)
- No module named 'jupyter_server' HOT 2
- How to make it work with torch DDP HOT 4
- Transition from `CompositeError` to builtin `ExceptionGroup` HOT 1
- ipcluster nbextension enable not working after notebook upgrade HOT 2
- Print in multiprocessing.Process crashing the engine HOT 7
- Windows ssh support by ipcluster HOT 39
- map_sync with pandas operation function does not finish. HOT 1
- Py3.10 code serialization does not work on PyPy3.10
- sync_imports not working as intended HOT 9
- ipyparallel and pymoo doesn't work HOT 2
- AsyncResult.join doesn't work
- AsyncResult.abort() call hangs if not all jobs can be stopped HOT 1
- Question: engines and databases HOT 1
- BroadcastView map Not Implemented HOT 3
- Cannot run ipythonparallel with openmpi HOT 7
- 60s timeout on get_connection_info() is not configurable HOT 1
- please release/tag/pypi the current version as it supports JupyterLab 4.x HOT 2
- SSHEngineLauncher does not work as expected HOT 2
- Outstanding task on client but hub says completed when using broadcast view
- Entrypoints should be phased out HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipyparallel.