Module type Bsmlsig.BSML


module type BSML = sig .. end


Types


type 'a par 
Abstract type for parallel vector of size p. In the following we will note <v0, ..., vp-1> the parallel vector with value vi at processor i

Machine parameters accessors


val argv : string array
Returns the arguments from command line with implementation-specific arguments removed.
val bsp_p : int
Number p of processes in the parallel machine.
val within_bounds : int -> bool
within_bounds n is true is n is between 0 and p-1, false otherwise.
val bsp_g : float
BSP parameter g of the parallel machine.
val bsp_l : float
BSP parameter l of the parallel machine.
val bsp_r : float
BSP parameter r of the parallel machine.

Exceptions


exception Invalid_processor of int
Raised when asked for a processor id that is not between 0 and bsp_p - 1. In particular, this exception can be raised by the functions that proj and put return.
exception Timer_failure of string

Parallel operators


val mkpar : (int -> 'a) -> 'a par
Parallel vector creation. Parameters :
Returns the parallel vector with f applied to each pid: <f 0, ..., f (p-1)>
val apply : ('a -> 'b) par -> 'a par -> 'b par
Pointwise parallel application. Parameters :
Returns the parallel vector <f0 v0, ..., fp-1 vp-1>
val put : (int -> 'a) par -> (int -> 'a) par
Global communication. Parameters :
Returns a parallel vector g = <g0, ..., gp-1> where gj i = fi j is the value received by processor j from processor i.
val proj : 'a par -> int -> 'a
projection (dual of mkpar). Makes all the elements of a parallel vector global. Parameters :
Returns a function f such that f i = vi
val abort : int -> string -> 'a
Aborts computation and quits. Parameters :
val start_timing : unit -> unit
val stop_timing : unit -> unit
val get_cost : unit -> float par
returns a parallel vector which contains, at each processor, the time elapsed between the calls to start_timing and stop_timing.
Raises Timer_failure if the call to one of those functions was meaningless (e.g. stop_timing called before start_timing).