mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-18 12:03:40 +01:00
Warn when nested parallel regions are found
This commit is contained in:
parent
58e1be95e5
commit
cadfbb1eef
3
CI/CI.ml
3
CI/CI.ml
@ -198,7 +198,8 @@ let make ?(n_states=1) det_space =
|
||||
let mo_basis = Ds.mo_basis det_space in
|
||||
|
||||
(* While in a sequential region, initiate the parallel
|
||||
4-idx transformation *)
|
||||
4-idx transformation
|
||||
*)
|
||||
ignore @@ MOBasis.two_e_ints mo_basis;
|
||||
|
||||
let f =
|
||||
|
@ -210,15 +210,31 @@ let run_parallel_client f =
|
||||
|
||||
|
||||
|
||||
let run_parallel ~ordered f stream =
|
||||
match Mpi.comm_rank Mpi.comm_world with
|
||||
| 0 -> run_parallel_server ~ordered stream
|
||||
| _ -> run_parallel_client f
|
||||
|
||||
let run_parallel ~ordered f stream =
|
||||
match Mpi.comm_rank Mpi.comm_world with
|
||||
| 0 -> run_parallel_server ~ordered stream
|
||||
| _ -> run_parallel_client f
|
||||
|
||||
|
||||
let nested = ref false
|
||||
|
||||
let run ?(ordered=true) ~f stream =
|
||||
match Mpi.comm_size Mpi.comm_world with
|
||||
| 1 -> run_sequential f stream
|
||||
| _ -> run_parallel ~ordered f stream
|
||||
if !nested then
|
||||
begin
|
||||
let message =
|
||||
"Nested parallel regions are not supported by Farm.ml"
|
||||
in
|
||||
Printf.eprintf "%s\n%!" message ;
|
||||
exit 1
|
||||
end;
|
||||
nested := true;
|
||||
let result =
|
||||
match Mpi.comm_size Mpi.comm_world with
|
||||
| 1 -> run_sequential f stream
|
||||
| _ -> run_parallel ~ordered f stream
|
||||
in
|
||||
nested := false;
|
||||
result
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user