From 7c52629c6bb7c24bc87b997145745bea97cc5a88 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 28 Jan 2020 17:57:29 +0100 Subject: [PATCH] Fixed serial code --- Parallel_serial/Parallel.ml | 15 +++++++++++++++ Parallel_serial/Parallel.mli | 26 ++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Parallel_serial/Parallel.ml b/Parallel_serial/Parallel.ml index 937d658..d8e9910 100644 --- a/Parallel_serial/Parallel.ml +++ b/Parallel_serial/Parallel.ml @@ -37,6 +37,21 @@ module Node = struct end +module InterNode = struct + + let comm = None + + let rank = 0 + + let master = true + + let broadcast x = Lazy.force x + + let barrier () = () + +end + + module Vec = struct type t = diff --git a/Parallel_serial/Parallel.mli b/Parallel_serial/Parallel.mli index cde3ac9..77a6c8d 100644 --- a/Parallel_serial/Parallel.mli +++ b/Parallel_serial/Parallel.mli @@ -40,19 +40,37 @@ module Node : sig (** Always [None] *) val rank : int - (** Rank of the current process in the node *) + (** Always zero *) val master : bool - (** If true, master process of the node *) + (** Always true *) val broadcast : 'a lazy_t -> 'a - (** Broadcasts data to all the processes of the current node. *) + (** Same as Lazy.force *) val barrier : unit -> unit - (** Wait for all processes among the node to reach this point. *) + (** Does nothing. *) end +(** {5 Inter-node operations} *) +module InterNode : sig + + val comm : 'a option + (** Always [None] *) + + val rank : int + (** Always zero *) + + val master : bool + (** Always true *) + + val broadcast : 'a lazy_t -> 'a + (** Same as Lazy.force *) + + val barrier : unit -> unit + (** Does nothing. *) +end (** {5 Vector operations} *) module Vec : sig