mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-10-30 10:48:12 +01:00
Added Node module in parallel
This commit is contained in:
parent
1896d9c45f
commit
0897beabd5
@ -55,6 +55,26 @@ let broadcast_vec x =
|
||||
Lacaml.D.Vec.of_array a
|
||||
|
||||
|
||||
module Node = struct
|
||||
|
||||
let name = Unix.gethostname ()
|
||||
|
||||
let comm_node =
|
||||
Mpi.allgather (name, rank) Mpi.comm_world
|
||||
|> Array.to_list
|
||||
|> List.filter (fun (n, r) -> name = n)
|
||||
|> List.map snd
|
||||
|> Array.of_list
|
||||
|> Mpi.(group_incl (comm_group comm_world))
|
||||
|> Mpi.(comm_create comm_world)
|
||||
|
||||
let rank =
|
||||
Mpi.comm_rank comm_node
|
||||
|
||||
let master = rank = 0
|
||||
|
||||
end
|
||||
|
||||
|
||||
module Vec = struct
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user