What does `foo` in the Parallel Computing docs refer to?

parallel

#1

On this page: https://docs.julialang.org/en/latest/manual/parallel-computing.html#Global-variables-1

we have the following code snippet:

A = rand(10,10)
remotecall_fetch(()->foo(A), 2)

This function foo is repeated several times, but there is no explanation of what foo is. Do I use the actual function foo? Do I use any random identifier? Does this function need to exist on the local or the worker process? Can anyone clarify?

Thanks.


#2

Foo and bar are common words used as placeholders in programming. Wikipedia explains it better than I can: “… used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.”

So in this case, foo refers to any function.


#3

In that case the documentation needs to be updated. Any code example should actually work when you type it out unless the person writing the docs is trying really hard to frustrate readers.


#4

In this case foo is expected to be a function that takes 2D array as a parameter, and is defined in the remote process. So you could, for example, think of the term foo being replaced with the function norm. I agree this is confiusing as written.

Regards

Avik


#5

Thanks avik, now if we could just get this answer into the docs :slight_smile:


#6

Why don’t you try making a Pull Request. For things like this you can edit the file directly on GitHub using the pencil icon.


#7

Click the pencil and type away :slight_smile:. This is how Julia’s docs get better.


#8

Thanks all, this is now a pull request: https://github.com/JuliaLang/julia/pull/22317


#9

Thanks Phillip for the PR!