Threads
Map
a parallel implementation of map
Calling Sequence
Parameters
Description
Examples
Map( fcn, expr, arg1, ..., argN )
Map[n]( fcn, arg1, ..., argn-1, expr, argn, ..., argN )
Map[evalhf]( fcn, expr, ... )
Map[inplace]( fcn, expr, ... )
Map[ tasksize = s ]( fcn, expr, ... )
fcn
-
(procedure or name)
expr
any expression
argi
(optional) further arguments to fcn
n
(posint)
s
(optional, posint) maximum task size
The Map command is a parallel implementation of the map command. For a complete description of the calling sequence of Map, see the map help page.
Map is implemented using the Task programming model.
Map attempts to determine how to divide the input into separate tasks to spread the work across all available cores. However in some situations Map may not choose the optimal size. In particular a small number of long running tasks may not be spread evenly over all threads. In this case, you can specify the maximum task size using the tasksize option. Map will divide the input into tasks that compute at most tasksize elements within a single task.
with⁡Threads:
Map⁡f,x+y⁢z
f⁡y⁢z+f⁡x
Map⁡f,y⁢z
f⁡y⁢f⁡z
Map⁡f,a,b,c
f⁡a,f⁡b,f⁡c
Map⁡x↦x2,x+y
x2+y2
Map( proc( x, y ) x^2+y end proc, [ 1, 2, 3, 4], 2 );
3,6,11,18
See Also
map
Threads[Add]
Threads[Mul]
Threads[Seq]
Download Help Document