8000 WQ+Python: Higher Level Abstractions · Issue #2685 · cooperative-computing-lab/cctools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
WQ+Python: Higher Level Abstractions #2685
Closed
@dthain

Description

@dthain

Add several higher level abstractions to the Work Queue Python interface, something like the follows:

wq.map( f, a ) -> [ f(a[0]), f(a[1]), ... ]
wq.allpairs( f, a, b ) -> [ f( a[0], b[0] ), f( a[0], b[1] ), . . . ]
wq.treereduce( f, a ) -> f( f( a[0], a[1] ), f( a[2], a[3] ) ) 

These should work by generating functions in the PythonTask interface, and then submitting and waiting as needed.
For the first implementation, each element of the array should be a single task, which should be pretty straightforward.
Make that a PR with a nice writeup in the manual.

The second iteration will be more tricky. Consider the case where each element of the array is very fast to compute. It won't make sense to have the overhead of a separate function for each element. Instead, multiple elements will have to be grouped within a task in order to get an acceptable runtime. Let's talk about that more once version #1 is in place.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0