Skip to content

Register local and vectorize functions with contexts#346

Closed
kwmsmith wants to merge 7 commits into
masterfrom
feature/register-local
Closed

Register local and vectorize functions with contexts#346
kwmsmith wants to merge 7 commits into
masterfrom
feature/register-local

Conversation

@kwmsmith
Copy link
Copy Markdown
Contributor

Based on our experience thus far, it is better to make explicit the context that a localized or vectorized function belongs to.

This PR adds two Context methods, localize() and vectorize(). These take a standalone function and add it to the context's namespace.

Other improvements:

  • reduce the number of roundtrips for calling localized and vectorized functions for obvious performance improvements;
  • remove calls to _execute(), replaced with a call to apply_async().
  • Testsuite updated and works with new design.

@kwmsmith kwmsmith added this to the 0.3 milestone Apr 29, 2014
@kwmsmith
Copy link
Copy Markdown
Contributor Author

This PR is not ready yet -- still getting master merged in, which is proving stubborn...

Comment thread distarray/decorators.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This arg and kwarg logic is duplicated below. So maybe it should be a method on DecoratorBase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the functions that are pushed to the engines, so it wouldn't make sense to have them as methods on DecoratorBase. I'd like to remove the duplication, but there isn't a clean way of doing so at the moment.

@cowlicks
Copy link
Copy Markdown
Contributor

What is the status on this @kwmsmith ?

@cowlicks
Copy link
Copy Markdown
Contributor

Can you describe the API you are aiming for here? And the problems we are trying to fix? The discussions about this are a little hazy to me now.

IIRC the problem with the decorators was that the function they decorated would not be pushed to the engines until run time. So we could not call the decorated functions in ways where the decorated function would be seen at compile time? If that makes sense. I'm trying to dig up the problem in old issues.

@kwmsmith
Copy link
Copy Markdown
Contributor Author

Closing this PR -- will redo based on top of the apply() improvements and cannibalize these commits as necessary.

@kwmsmith kwmsmith closed this May 29, 2014
@kwmsmith kwmsmith deleted the feature/register-local branch July 1, 2014 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants