Grid
Interrupt
interrupt computation on a specified node
Calling Sequence
Parameters
Description
Examples
Compatibility
Interrupt()
Interrupt(node)
node
-
integer, identifying the node to interrupt
The Interrupt command causes the computation running on the specified external node to be terminated. Interrupts can be initiated from compute nodes.
The node parameter is the specific node as determined by MyNode in the external process. For a description of node numbers, see Grid:-MyNode.
The no-argument version of Interrupt can be used in the main thread to terminate jobs started by the Grid:-Run command.
Node 0 cannot be interrupted on a job initiated by the Launch command because that would terminate the whole parallel job.
A node also cannot interrupt itself.
Note that interrupting a node can cause a deadlock if other nodes are blocked, waiting for a message to arrive from the interrupted node. Such deadlocks will be detected and the job will be automatically aborted.
The Interrupt command is not implemented when running the Grid package in "mpi" mode. It can be called but does nothing.
This function is part of the Grid package, so it can be used in the short form Interrupt(..) only after executing the command with(Grid). However, it can always be accessed through the long form of the command by using Grid[Interrupt](..).
p := proc() uses Grid; local i; if MyNode()=0 then Receive(); # wait for a message elif MyNode()=1 then # interrupt everybody else for i from 2 to NumNodes()-1 do Interrupt(i); end do; # notify node 0 Grid:-Util:-Send(0, true); else # all other nodes are in an infinite loop while true do end do; end if; end proc;
p ≔ proclocali;ifGrid:-MyNode⁡=0thenGrid:-Receive⁡elifGrid:-MyNode⁡=1thenforifrom2toGrid:-NumNodes⁡ − 1doGrid:-Interrupt⁡iend do;Grid:-Util:-Send⁡0,trueelsedoend doend ifend proc
Grid:-Launch⁡3,p
true
The Grid[Interrupt] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
The Grid[Interrupt] command was updated in Maple 2015.
See Also
Grid:-MyNode
Download Help Document