10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-25 20:27:28 +02:00

Use Patched version of ocamlmpi

This commit is contained in:
Anthony Scemama 2020-02-04 11:46:24 +01:00
parent 774d977d99
commit a2859ad69c
3 changed files with 15 additions and 19 deletions

View File

@ -123,25 +123,18 @@ module InterNode = struct
Mpi.group_incl world_group ranks Mpi.group_incl world_group ranks
in in
let result = Mpi.comm_create Mpi.comm_world new_group
Some (Mpi.comm_create Mpi.comm_world new_group)
in
try
ignore @@ List.find (fun x -> x = world_rank) @@ Array.to_list ranks;
result
with Not_found -> None
let rank = let rank =
match comm with if comm <> Mpi.comm_none then
| Some c-> Mpi.comm_rank c Mpi.comm_rank c
| None -> -1 else 0
let master = rank = 0 let master = rank = 0
let broadcast_generic broadcast x = let broadcast_generic broadcast x =
match comm with if Mpi.comm_rank <> Mpi.comm_none then
| Some comm ->
begin begin
let x = let x =
if master then Some (Lazy.force x) if master then Some (Lazy.force x)
@ -150,15 +143,18 @@ module InterNode = struct
match broadcast x 0 comm with match broadcast x 0 comm with
| Some x -> x | Some x -> x
| None -> assert false | None -> assert false
end else
| None -> Lazy.force x Lazy.force x
let broadcast x = broadcast_generic Mpi.broadcast x let broadcast x = broadcast_generic Mpi.broadcast x
(* TODO : temporary single-node fix
let broadcast x = Lazy.force x
*)
let barrier () = let barrier () =
match comm with if comm <> Mpi.comm_none then
| Some comm -> Mpi.barrier comm Mpi.barrier comm
| None -> () else ()
let _ = barrier () let _ = barrier ()

View File

@ -60,7 +60,7 @@ end
(** {5 Inter-node operations} *) (** {5 Inter-node operations} *)
module InterNode : sig module InterNode : sig
val comm : Mpi.communicator option val comm : Mpi.communicator
(** MPI Communicator among the master processes of the each node *) (** MPI Communicator among the master processes of the each node *)
val rank : Mpi.rank val rank : Mpi.rank

View File

@ -96,7 +96,7 @@ let () =
Simulation.of_filenames ~f12 ~charge ~multiplicity ~nuclei:nuclei_file basis_file Simulation.of_filenames ~f12 ~charge ~multiplicity ~nuclei:nuclei_file basis_file
in in
let hf = HartreeFock.make ~guess:`Huckel simulation in let hf = HartreeFock.make ~guess:`Hcore simulation in
if Parallel.master then if Parallel.master then
Format.fprintf ppf "@[%a@]@." HartreeFock.pp hf; Format.fprintf ppf "@[%a@]@." HartreeFock.pp hf;