MyNode - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Grid

  

MyNode

  

query my node number

 

Calling Sequence

Description

Examples

Compatibility

Calling Sequence

MyNode()

Description

• 

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.

Examples

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;

whoproclocalme,i;meGrid:-MyNode;ifme=0thenreturn0,seqGrid:-Receive,i=1..Grid:-NumNodes1elseGrid:-Send0,meend ifend proc

(1)

rGrid:-Launchwho,numnodes=8

r0,1,2,3,4,5,6,7

(2)

sortr

0,1,2,3,4,5,6,7

(3)

Compatibility

• 

The Grid[MyNode] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Grid

Grid[NumNodes]