This example uses the anames command to list all active variables. Note that until Grid:-Set is run, the compute nodes don't know about the variable f.
>
|
|
>
|
|
This example shows results from multi-node computations are returned in an array
>
|
|
>
|
|
>
|
|
After setting variables, it can be useful to run a quick job that prints their value
>
|
|
>
|
|
Variables that are local in the current scope will be global in the remote node.
>
|
p := proc()
local loc;
Grid:-Set(1,loc=4);
Grid:-Run(1,print,["the local variable",loc],'wait');
Grid:-Run(1,print,["the global variable",:-loc],'wait');
end;
|
| (3) |
"the local variable", 4
"the global variable", loc
| |
A common way to unassign variables is to use the syntax var = 'var'. Because there are two evaluations happening (once in the call to Set, and once on the remote node), two uneval quotes are needed:
>
|
|
>
|
|