5
votes

Suppose I have a smallish number of functions that I have defined in a cell in ijulia (I'm using JuliaBox).

I'd like to be able to call the main function in parallel n times. The annoyance is that the main makes calls to the dozen or so helper functions I have defined.

Do I have to put @everywhere in front of all of these helper functions, or is there some shorter syntax that would work?

e.g. is there a command that would share all functions defined at the global level to all of the processes? Or is there a way to share a list of functions (rather than putting @everywhere in the function declaration).

1

1 Answers

11
votes

When I want to do this in the notebook I usually wrap the entire cell containing helper functions in @everywhere like this:

@everywhere begin

... put functions we want to share across all processes here

end