mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
Removed MPI busy waiting
This commit is contained in:
parent
0bae2bc9d1
commit
e226bd135e
@ -48,7 +48,13 @@ let run_parallel_server ~ordered stream =
|
||||
let fetch_result () : (task_id * 'a) option * int =
|
||||
let (message, rank, _tag) : (task_id * 'a) option * int * int =
|
||||
debug "Before receive_status";
|
||||
Mpi.receive_status Mpi.any_source Mpi.any_tag Mpi.comm_world
|
||||
(* Avoid busy receive *)
|
||||
let rec wait_and_receive () =
|
||||
match Mpi.iprobe Mpi.any_source Mpi.any_tag Mpi.comm_world with
|
||||
| Some _ -> Mpi.receive_status Mpi.any_source Mpi.any_tag Mpi.comm_world
|
||||
| None -> (Unix.sleepf 0.001 ; wait_and_receive ())
|
||||
in
|
||||
wait_and_receive ()
|
||||
in
|
||||
debug @@ Printf.sprintf "After receive_status %d %d" rank _tag;
|
||||
message, rank
|
||||
|
Loading…
Reference in New Issue
Block a user