Skip to content
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

remotecall does not allow do-blocks #11406

Closed
oxinabox opened this issue May 23, 2015 · 3 comments
Closed

remotecall does not allow do-blocks #11406

oxinabox opened this issue May 23, 2015 · 3 comments
Labels
needs decision A decision on this change is needed parallelism Parallel or distributed computation

Comments

@oxinabox
Copy link
Contributor

remotecall does no allow do-blocks to be used to specify the method to be runremotely.
Because it takes its arguments as remotecall(id,func,args...).

this means it can't be used with do-blocks
do-blocks can only be used if the function takes a function as its first arg.

map, filter, open, etc all do this and so can have do blocks.
remotecall is the only method (that i can bring to mind), which takes a function, not as its first arg.

I know I would really like to do remote call with do-blocks as I have many functions that exist only to be passed to remote call.


I'm not sure what the fix is.
The obvious one is:

remotecall(func, id, args...) which has the downside of not the args are not clearly associated with the function.
But on the other hand, with closures we don't need to have the function take its arguements as arguments:

So all func calls like remotecall(id,func,x) become

remotecall(id) do 
      func(x) 
end

Which is a improvement if func is define for this purpose -- you wouldn't literally write func in the closure you would define func as the closure.

if using an existing method you still have remotecall(func,id,x) which as stated is ugly.

We could have both, using multiple dispatch. Since functions and ints are obviously different types.
But perhaps tht might be too confusing?

What do people think?
Is it worth making do blocks work for remotecall?
Perhaps the do-block syntax is what needs to be changed instead.

@simonster simonster added needs decision A decision on this change is needed parallelism Parallel or distributed computation labels May 23, 2015
@malmaud
Copy link
Contributor

malmaud commented May 23, 2015

You can already pass a do-block to @spawnat. Is that not sufficient?

@andreasnoack
Copy link
Member

See also https://groups.google.com/forum/#!searchin/julia-users/Should$20we$20move$20the$20fn$20argument$20of$20remotecall$20and$20remotecall_fetch$20to$20first$20position$3F/julia-users/xxXFOIml7rA/bvhjT5Hx4kAJ

I think we should change the order to allow do-blocks and I was actually about to make the change. The solution I decided to try had the arguments to the function in a tuple, i.e. remotecall(f,args::Tuple,id).

@malmaud
Copy link
Contributor

malmaud commented Oct 14, 2015

This was changed at some point, and now the remotecall family of functions do take the function as the first argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision A decision on this change is needed parallelism Parallel or distributed computation
Projects
None yet
Development

No branches or pull requests

4 participants