Grid
MyNode
query my node number
Calling Sequence
Description
Examples
Compatibility
MyNode()
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() uses Grid; local me,i; me := MyNode(); if me = 0 then return [0, seq(Receive(),i=1..NumNodes()-1)]; else Send(0,me); end if; end proc;
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
r≔0,1,2,3,4,5,6,7
sort⁡r
0,1,2,3,4,5,6,7
The Grid[MyNode] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
See Also
Grid[NumNodes]
Download Help Document