Comments (7)
If I understand corrctly, this is how IPython parallel already works. You can iterate through an AsyncResult, and it will yield results as they arrive.
Can you describe a bit more detail about what you are trying to accomplish?
from ipyparallel.
Thanks for your answer.
I see in the documentation that the view.map
does indeed have an AsyncResult. Let me see if that works in our situation.
from ipyparallel.
It seems that our use case does not work with view.map
.
We want something like this:
from ipyparallel import Client
def p():
for i in range(10):
do_yield(i)
rc = Client()
view = rc[:]
result = view.apply(p)
for v in result:
print v
I think this is different from view.map
because in this case it's the applied code that is responsible for the yielding.
The view.map
alternative is subtly different:
result = view.map(lambda v: v, range(10))
for v in result:
print v
from ipyparallel.
Just to clarify from your example above, you want all engines to run the same function p
with the same arguments?
from ipyparallel.
No, we want 1 engine to run the p
function.
This would be correct:
rc = Client()
view = rc[0]
from ipyparallel.
Here's an example of running a generator remotely. The gist is to:
- call the generator function on the engine
- create an iterator on the generator
- use
apply(next, Reference('iterator'))
to yield each item from the remote generator
Then you get a local generator yielding results from a remote generator.
from ipyparallel.
Thanks! This looks very promising.
from ipyparallel.
Related Issues (20)
- Leftover resource_tracker processes
- 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
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.