GetLastResult - Maple Help

Grid

 GetLastResult
 get the last computed value from a remote parallel compute node

 Calling Sequence GetLastResult(node)

Parameters

 node - integer

Description

 • The GetLastResult command gets the last result computed on the specified grid node.
 • The last result could be any activity initiated by the Launch, Run, Set, or Get commands.
 • This command can only be used when a node is finished computing. If the specified node is not yet done computing, GetLastResult will block and wait for the computation to finish.
 • The GetLastResult command is only available in local Grid mode.

Examples

 > $\mathrm{Grid}:-\mathrm{Run}\left(0,\mathrm{int},\left[x,x\right]\right)$
 > $\mathrm{Grid}:-\mathrm{Run}\left(1,\mathrm{int},\left['\mathrm{sin}\left(x\right)',x\right]\right)$
 > $\mathrm{Grid}:-\mathrm{GetLastResult}\left(1\right)$
 ${-}{\mathrm{cos}}{}\left({x}\right)$ (1)
 > $\mathrm{Grid}:-\mathrm{GetLastResult}\left(0\right)$
 $\frac{{{x}}^{{2}}}{{2}}$ (2)

The NULL value is a valid result that can be returned. The print command returns NULL. Note that without waiting, you may not see the displayed output in sequence. This should not be confused with the returned result.

 > $\mathrm{Grid}:-\mathrm{Run}\left(1,\mathrm{print},\left[42\right]\right)$
 > $r≔\mathrm{Grid}:-\mathrm{GetLastResult}\left(1\right)$
 > $\mathrm{evalb}\left(r=\mathrm{NULL}\right)$
 ${\mathrm{true}}$ (3)

Compatibility

 • The Grid[GetLastResult] command was introduced in Maple 2015.