module Nvector_parallel:sig
..end
The standard parallel nvectors of Sundials (requires MPI).
typedata =
Sundials.RealArray.t * int * Mpi.communicator
Parallel nvectors carry triples of a local bigarray of floats, a global length, and an MPI communicator.
type
kind
Represents the internal layout of a parallel nvector.
typet =
(data, kind) Nvector.t
The type of parallel nvectors.
type
Nvector.gdata +=
| |
Par of |
Generic wrapper for Nvector_parallel.data
.
exception IncorrectGlobalSize
Raised by make if the given global length is not consistent with the sum of local lengths across all parallel instances.
val make : ?context:Sundials.Context.t ->
?with_fused_ops:bool ->
int -> int -> Mpi.communicator -> float -> t
make nl ng c iv
creates a new parallel nvector with nl
local elements,
that is part of a global array with ng
elements. The local elements are
initialized to iv
, and communications occur on c
.
The optional argument enables the fused and array operations for a given nvector (they are disabled by default).
Config.NotImplementedBySundialsVersion
Fused and array operations not available.val clone : t -> t
Creates an nvector with a distinct underlying array but that shares the original global size and communicator.
val wrap : ?context:Sundials.Context.t ->
?with_fused_ops:bool -> data -> t
wrap a
creates a new parallel nvector from a
.
The optional arguments permit to enable all the fused and array operations for a given nvector (they are disabled by default).
Config.NotImplementedBySundialsVersion
Fused and array operations not available.val unwrap : t -> data
Aliases Nvector.unwrap
.
val pp : Stdlib.Format.formatter -> t -> unit
Pretty-print the local portion of a parallel nvector using the Format module.
val local_array : t -> Sundials.RealArray.t
local_array nv
returns the local array a
underlying the parallel
nvector nv
.
val local_length : t -> int
Returns the number of local elements for a parallel nvector.
val global_length : t -> int
Returns the number of global elements for a parallel nvector.
val communicator : t -> Mpi.communicator
Returns the communicator used for the parallel nvector.
val get_communicator : ('d, 'k) Nvector.t -> Mpi.communicator option
Return the communicator associated with any nvector.
val hide_communicator : Mpi.communicator -> Nvector_custom.communicator
Hides an MPI communicator for use in custom nvector functions.
val enable : ?with_fused_ops:bool ->
?with_linear_combination:bool ->
?with_scale_add_multi:bool ->
?with_dot_prod_multi:bool ->
?with_linear_sum_vector_array:bool ->
?with_scale_vector_array:bool ->
?with_const_vector_array:bool ->
?with_wrms_norm_vector_array:bool ->
?with_wrms_norm_mask_vector_array:bool ->
?with_scale_add_multi_vector_array:bool ->
?with_linear_combination_vector_array:bool ->
?with_dot_prod_multi_local:bool -> t -> unit
Selectively enable or disable fused and array operations.
The with_fused_ops
argument enables or disables all such operations.
Config.NotImplementedBySundialsVersion
Fused and array operations not available.module MakeOps(
A
:
sig
type
local_data
val get : local_data -> int -> float
val set : local_data -> int -> float -> unit
val fill : local_data -> float -> unit
val make : int -> float -> local_data
val clone : local_data -> local_data
val length : local_data -> int
end
)
:Nvector.NVECTOR_OPS
with type t = A.local_data * int * Mpi.communicator
Produce a set of parallel Nvector.NVECTOR_OPS
from basic
operations on an underlying array.
module Ops:Nvector.NVECTOR_OPS
with type t = t
Underlying nvector operations on parallel nvectors.
module DataOps:Nvector.NVECTOR_OPS
with type t = data
Nvector operations on Nvector_parallel.data
implemented in OCaml.
module Any:sig
..end
A generic nvector interface to parallel nvectors.