query my node number
The MyNode command is for use as part of a parallel computation.
When a parallel job is started on a specified number of servers, say N, each server will be given an integer identifier between 0 and N-1 for the duration of this computation. MyNode() returns the integer identifier for the node that it is called on.
who := proc()
me := MyNode();
if me = 0 then
return [0, seq(Receive(),i=1..NumNodes()-1)];
who ≔ proclocalme,i;me ≔ Grid:-MyNode⁡;ifme=0thenreturn0,seq⁡Grid:-Receive⁡,i=1..Grid:-NumNodes⁡ − 1elseGrid:-Send⁡0,meend ifend proc
r ≔ Grid:-Launch⁡who,numnodes=8
The Grid[MyNode] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
Download Help Document