Julia: Is there a short syntax for creating all the @ewherewhere features available

Suppose I have a small number of functions that I defined in a cell in ijulia (I use JuliaBox).

I would like to be able to call the main function in parallel n times. The annoyance is that the main call calls up a dozen helper functions that I defined.

Should I put @everywhere in front of all these helper functions, or is there some shorter syntax that will work?

eg. Is there a team that will share all the functions defined at the global level into all processes? Or is there a way to share a list of functions (rather than putting @everywhere in a function declaration).

+5
source share
1 answer

When I want to do this in a notebook, I usually wrap the entire cell containing helper functions in @everywhere as follows:

 @everywhere begin ... put functions we want to share across all processes here end 
+11
source

Source: https://habr.com/ru/post/1215716/


All Articles