Threads - Maple Help

Online Help

All Products    Maple    MapleSim


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

Threads

  

Seq

  

a parallel implementation of seq

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Seq( f, i = m..n )

Seq( f, i = m..n, step )

Seq( f, i = 1..n, step )

Seq( f, i = x )

Seq( f, i in x )

Seq( i = m..n, step )

Seq[ tasksize = s ]( ... )

Parameters

f

-

(expression) any expression

i

-

(name)

m,n

-

(numeric) values to range over

x

-

(expression)

step

-

(numeric) (optional)

s

-

(optional, posint) maximum task size

Description

• 

The Seq command is a parallel implementation of the seq command. For a complete description of the calling sequences of Seq see the seq help page.

• 

Seq is implemented using the Task programming model.

• 

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

Examples

withThreads:

Seqi2,i=1..5

1,4,9,16,25

(1)

Seqsinπi6,i=0..6

0,12,123,1,123,12,0

(2)

Seqxi,i=1..7

x1,x2,x3,x4,x5,x6,x7

(3)

XSeqi,i=0..6

X:=0,1,2,3,4,5,6

(4)

Seqi2mod7,i=X

0,1,2,4

(5)

YSeqi2,i=X

Y:=0,1,4,9,16,25,36

(6)

SeqXi,Yi,i=1..nopsX

0,0,1,1,2,4,3,9,4,16,5,25,6,36

(7)

Seqi,i=Hello

H,e,l,l,o

(8)

Seqi,i=a..f

a,b,c,d,e,f

(9)

[Seq( i, i=0..-infinity )];
C := proc( f, x )
   local i;
   [Seq( coeff( f, x, i ), i=0..degree(f,x) )];
end proc;

C:=procf,xlocali;Threads:-Seqcoefff,x,i,i=0..degreef,xend proc

(10)

C2x4+x3,x

4,2,0,1

(11)

See Also

seq

Threads

Threads[Add]

Threads[Map]

Threads[Mul]

 


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