mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-08-30 00:03:42 +02:00
Use Patched version of ocamlmpi
This commit is contained in:
parent
774d977d99
commit
a2859ad69c
@ -123,25 +123,18 @@ module InterNode = struct
|
||||
Mpi.group_incl world_group ranks
|
||||
in
|
||||
|
||||
let result =
|
||||
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
|
||||
Mpi.comm_create Mpi.comm_world new_group
|
||||
|
||||
|
||||
let rank =
|
||||
match comm with
|
||||
| Some c-> Mpi.comm_rank c
|
||||
| None -> -1
|
||||
if comm <> Mpi.comm_none then
|
||||
Mpi.comm_rank c
|
||||
else 0
|
||||
|
||||
let master = rank = 0
|
||||
|
||||
let broadcast_generic broadcast x =
|
||||
match comm with
|
||||
| Some comm ->
|
||||
if Mpi.comm_rank <> Mpi.comm_none then
|
||||
begin
|
||||
let x =
|
||||
if master then Some (Lazy.force x)
|
||||
@ -150,15 +143,18 @@ module InterNode = struct
|
||||
match broadcast x 0 comm with
|
||||
| Some x -> x
|
||||
| None -> assert false
|
||||
end
|
||||
| None -> Lazy.force x
|
||||
else
|
||||
Lazy.force x
|
||||
|
||||
let broadcast x = broadcast_generic Mpi.broadcast x
|
||||
(* TODO : temporary single-node fix
|
||||
let broadcast x = Lazy.force x
|
||||
*)
|
||||
|
||||
let barrier () =
|
||||
match comm with
|
||||
| Some comm -> Mpi.barrier comm
|
||||
| None -> ()
|
||||
if comm <> Mpi.comm_none then
|
||||
Mpi.barrier comm
|
||||
else ()
|
||||
|
||||
let _ = barrier ()
|
||||
|
||||
|
@ -60,7 +60,7 @@ end
|
||||
(** {5 Inter-node operations} *)
|
||||
module InterNode : sig
|
||||
|
||||
val comm : Mpi.communicator option
|
||||
val comm : Mpi.communicator
|
||||
(** MPI Communicator among the master processes of the each node *)
|
||||
|
||||
val rank : Mpi.rank
|
||||
|
@ -96,7 +96,7 @@ let () =
|
||||
Simulation.of_filenames ~f12 ~charge ~multiplicity ~nuclei:nuclei_file basis_file
|
||||
in
|
||||
|
||||
let hf = HartreeFock.make ~guess:`Huckel simulation in
|
||||
let hf = HartreeFock.make ~guess:`Hcore simulation in
|
||||
if Parallel.master then
|
||||
Format.fprintf ppf "@[%a@]@." HartreeFock.pp hf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user