generate a sequence, distributing computation over grid
Seq( f, i=m..n ))
Seq( f, i=x ))
Seq[tasksize=T]( f, i=... ))
The Seq command is used to construct a sequence of values in parallel. The most typical calling sequence is Seq(f(i), i = 1..n) which generates the sequence f(1), f(2), ..., f(n). Computation of each f(i) will be evenly distributed across all available nodes.
The Seq command is similar to the top-level seq command, and the Threads[Seq] commands. The top-level seq command evaluates the entire sequence serially. The Threads[Seq] command evaluates elements of the sequence in parallel on separate threads within the same process. The Grid:-Seq command evaluates elements of the sequence in parallel on separate processes, and potentially on different machines.
The Seq command attempts to initialize remote compute nodes by looking for named values inside of f and assigning those same names in the remote compute nodes. The i, m, n, and x parameters are not searched. If those depend on values that are not fully defined on the remote nodes, use the Grid:-Set command before calling Seq to set those values. Similarly, Grid:-Set may be needed to complete the definition of f, in particular, when f is a procedure that calls other locally defined procedures.
Seq will always try to use all compute nodes. It will typically subdivide the request into many more tasks than there are available nodes. This helps to more evenly distribute the load when the run-time of processing different requests is unevenly distributed. However, in some situations Seq may not choose the optimal size. In particular, when there are a large number of short-running tasks, doing more work in the remote nodes in each task may be more efficient. In this case, you can specify the task size using the tasksize option. Seq will divide the input into tasks that compute at most tasksize elements within a single task.
Seq is a high-level command that uses Send and Receive calls. Therefore, evaluation of f should not involve other Send and Receive calls.
Seq does not replicate the special evaluation rules of the Maple seq command. Structures with more than one dimension (like a Matrix) are not currently supported for the x parameter.
Setting infolevel[Grid:-Seq] := 3; will enable output of information messages relating to the progress of the computation.
When using "hpc" or "mpi" modes, Seq is designed to be called on all the nodes of a parallel computation, whereupon the result will only be available on node 0. If the resulting Maple expression is required for further computation on other nodes, it must be sent there explicitly using Send and Receive.
This example shows some simple calling sequences
A ≔ Array⁡1,2,3,4,5
In this example, we define two procedures such that Seq will not be able to automatically find all definitions to send to external nodes. The remote operation is not fully defined.
myfunc1 ≔ x→x2
myfunc2 ≔ x→myfunc1⁡x+x
The myfunc1 procedure was not defined in the external nodes. It needs to be set.
In this example, the work required for the computation at j=1 is much less than the computation at j=9. The sequence of heavy computations at the end of the list may require an adjustment to the default tasksize
The Grid[Seq] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
The Grid[Seq] command was updated in Maple 2015.
The T parameter was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
Download Help Document