Grid - Maple Programming Help

Home : Support : Online Help : Toolboxes : Grid Computing : Grid/Wait

Grid

 Wait
 wait for parallel computation to finish

 Calling Sequence Wait() Wait(node1, node2, ...)

Parameters

 node - integer

Description

 • The Wait command stops execution until one or more remote compute nodes are finished processing.
 • When node is given as a parameter, the current process will wait until that specified node is finished. If the given node was finished prior to calling Wait (or never started a job), Wait will return immediately.
 • When no parameters are given, the call to Wait will block until all compute nodes are finished processing.
 • The Wait command is intended to be called by the main Maple session, not the compute nodes. See the Barrier command for information about syncing up remote compute nodes.
 • The Wait command is only available in local Grid mode.

Examples

In this example we start 1 job and wait for it to finish

 > $\mathrm{Grid}:-\mathrm{Setup}\left(\mathrm{numnodes}=4\right):$
 > $\mathrm{Grid}:-\mathrm{Run}\left(1,"for i from 1 to 10^6 do od:"\right)$
 > $\mathrm{Grid}:-\mathrm{Wait}\left(1\right)$

In this example we start multiple jobs and wait for them to finish

 > $\mathrm{Grid}:-\mathrm{Run}\left(0,"for i from 1 to 10^5 do od: i;"\right)$
 > $\mathrm{Grid}:-\mathrm{Run}\left(1,"for i from 1 to 10^6 do od: i;"\right)$
 > $\mathrm{Grid}:-\mathrm{Run}\left(2,"for i from 1 to 10^7 do od: i;"\right)$
 > $\mathrm{Grid}:-\mathrm{Wait}\left(\right)$
 > $\mathrm{Grid}:-\mathrm{GetLastResult}\left(0\right)$
 ${100001}$ (1)
 > $\mathrm{Grid}:-\mathrm{GetLastResult}\left(1\right)$
 ${1000001}$ (2)
 > $\mathrm{Grid}:-\mathrm{GetLastResult}\left(2\right)$
 ${10000001}$ (3)

Compatibility

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