Grid - Maple Help

Online Help

All Products    Maple    MapleSim


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

Grid

  

Interrupt

  

interrupt computation on a specified node

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Interrupt()

Interrupt(node)

Parameters

node

-

integer, identifying the node to interrupt

Description

• 

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 Grid[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](..).

Examples

p := proc()
    uses Grid;
    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;

Warning, `i` is implicitly declared local to procedure `p`

p:=proclocali;ifGrid:-MyNode=0thenGrid:-ReceiveelifGrid:-MyNode=1thenforifrom2toGrid:-NumNodes1doGrid:-Interruptiend do;Grid:-Util:-Send0,trueelsedoend doend ifend proc

(1)

Grid:-Launch3,p

true

(2)

Compatibility

• 

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

Grid[MyNode]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam