module Mspmlbase: sig end
Very often used functions
val replicate : 'a -> 'a Mspml.par
replicate x gives a parallel vector with the value x on each
process.
val parfun : ('a -> 'b) -> 'a Mspml.par -> 'b Mspml.par
parfun f <x0,...,x(p-1)> = <f x0,...,f x(p-1)>
val parfun2 : ('a -> 'b -> 'c) -> 'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par
val parfun3 : ('a -> 'b -> 'c -> 'd) ->
'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par -> 'd Mspml.par
val parfun4 : ('a -> 'b -> 'c -> 'd -> 'e) ->
'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par -> 'd Mspml.par -> 'e Mspml.par
Same thing as parfun but with a function of arity 2, 3 or 4.
val apply2 : ('a -> 'b -> 'c) Mspml.par -> 'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par
val apply3 : ('a -> 'b -> 'c -> 'd) Mspml.par ->
'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par -> 'd Mspml.par
val apply4 : ('a -> 'b -> 'c -> 'd -> 'e) Mspml.par ->
'a Mspml.par -> 'b Mspml.par -> 'c Mspml.par -> 'd Mspml.par -> 'e Mspml.par
Same thing as apply but with aa function of arity 2, 3 or 4.
val applyat : int -> ('a -> 'b) -> ('a -> 'b) -> 'a Mspml.par -> 'b Mspml.par
applyat n f1 f2 applies the function f1 at the data held
at process n and f2 at the datas helds at the other processes.
val applyif : (int -> bool) -> ('a -> 'b) -> ('a -> 'b) -> 'a Mspml.par -> 'b Mspml.par
applyif p f1 f2 applies the function f1 at the data held
at process i if (p i) is true and applies f2 otherwise.
val procs : unit -> int list
procs() returns the list of the process numbers
val this : unit -> int Mspml.par
this() returns the parallel vector such as each process hold its number
val last : unit -> int
last()=p-1
val within_bounds : int -> bool
within_bounds n is true is n is between 0 and p-1, false otherwise.
val print : ('a -> unit) -> int -> 'a Mspml.par -> unit Mspml.par
print print_element pid element prints the value of element at process
pid using the printer print_element
val parprint : ('a -> unit) -> 'a Mspml.par -> unit Mspml.par
parprint print v print the parallel vector
v using the
printer
print, one line per process, each line beginning with
the number of the process. For example,
(parprint print_int (this())) will
give the following for 4 processes:
0: 0
1: 0
2: 0
3: 0