NumNodes - Maple Help

Grid

 NumNodes
 query total number of nodes participating in current computation

 Calling Sequence NumNodes()

Description

 • The NumNodes command is for use within the Maple code executed as part of a parallel computation.
 • When a parallel job is started on a specified number of nodes, say N, each node will be given an integer identifier between 0 and N-1 for the duration of this computation. NumNodes() returns N, the total number of nodes participating in this parallel computation.
 • This function is part of the Grid package, so it can be used in the short form NumNodes(..) only after executing the command with(Grid). However, it can always be accessed through the long form of the command by using Grid[NumNodes](..).

Examples

 > $\mathrm{Grid}:-\mathrm{Launch}\left("Grid:-NumNodes\left(\right);",\mathrm{numnodes}=5\right)$
 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    5
 ${5}$ (1)
 > $\mathrm{Grid}:-\mathrm{Launch}\left("Grid:-NumNodes\left(\right);",\mathrm{numnodes}=3\right)$
 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    3
 ${3}$ (2)

Compatibility

 • The Grid[NumNodes] command was introduced in Maple 15.