Module Functory.Cores

module Cores: sig .. end

Several cores on the same machine.


val set_number_of_cores : int -> unit

set_number_of_cores n indicates that n computations can be done in parallel. It is typically less or equal to the number of actual cores on the machine, though it is not mandatory. Setting n to 1 is equivalent to a sequential execution (though the order in which tasks are performed may differ).

Generic API

For documentation, refer to module Sequential.

val compute : worker:('a -> 'b) ->
master:('a * 'c -> 'b -> ('a * 'c) list) -> ('a * 'c) list -> unit

Derived API

For documentation, refer to module Sequential.

val map : f:('a -> 'b) -> 'a list -> 'b list
val map_local_fold : f:('a -> 'b) -> fold:('c -> 'b -> 'c) -> 'c -> 'a list -> 'c
val map_remote_fold : f:('a -> 'b) -> fold:('c -> 'b -> 'c) -> 'c -> 'a list -> 'c
val map_fold_ac : f:('a -> 'b) -> fold:('b -> 'b -> 'b) -> 'b -> 'a list -> 'b
val map_fold_a : f:('a -> 'b) -> fold:('b -> 'b -> 'b) -> 'b -> 'a list -> 'b