Threads - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Multithreaded Programming : Threads/Add

Threads

  

Add

  

a parallel implementation of add

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Add( f, i = m..n )

Add( f, i = x )

Add( f, i in x )

Add[ tasksize = s ]( ... )

Parameters

f

-

(expression)

i

-

(name)

m, n

-

numeric values

x

-

(expression)

s

-

(optional, posint) maximum task size

Description

• 

The Add command is a parallel implementation of the add command. For a complete description of the calling sequence of Add see the add help page.

• 

Add is implemented using the Task programming model.

• 

Add attempts to determine how to divide the input into separate tasks to spread the work across all available cores.  However in some situations Add 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. Add will divide the input into tasks that compute at most tasksize elements within a single task.

Examples

withThreads:

Addi2,i=1..5

55

(1)

Lseqi,i=1..5

L:=1,2,3,4,5

(2)

Addi2,i=L

55

(3)

Addaixi,i=0..5

x5a5+x4a4+x3a3+x2a2+xa1+a0

(4)

Addi,i=∞..0

0

(5)

See Also

add

Threads

Threads[Map]

Threads[Mul]

Threads[Seq]

 


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