10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 04:13:31 +01:00

Fixing walkers

This commit is contained in:
Anthony Scemama 2019-12-17 11:10:34 +01:00
parent 2cc2d713bc
commit 0485afda6f

View File

@ -218,7 +218,7 @@ let run ?(daemon=true) ezfio_filename =
(** Last time when the walkers were saved to disk. *) (** Last time when the walkers were saved to disk. *)
let last_save_walkers = let last_save_walkers =
ref (Unix.gettimeofday ()) ref 0.
in in
@ -226,20 +226,20 @@ let run ?(daemon=true) ezfio_filename =
let save_walkers () = let save_walkers () =
if (delta_t !last_save_walkers > 10. ) then if (delta_t !last_save_walkers > 10. ) then
begin begin
let t0 =
Unix.gettimeofday ()
in
Ezfio.set_electrons_elec_coord_pool_size walk_num_tot ; Ezfio.set_electrons_elec_coord_pool_size walk_num_tot ;
let walkers_list = let walkers_list =
Array.map Array.to_list walkers_array Array.map Array.to_list walkers_array
|> Array.to_list |> Array.to_list
|> List.concat |> List.concat
|> List.map float_of_string |> List.map float_of_string
in in
Ezfio.set_electrons_elec_coord_pool (Ezfio.ezfio_array_of_list Ezfio.set_electrons_elec_coord_pool (Ezfio.ezfio_array_of_list
~rank:3 ~dim:[| elec_num+1 ; 3 ; walk_num_tot |] ~data:walkers_list); ~rank:3 ~dim:[| elec_num+1 ; 3 ; walk_num_tot |] ~data:walkers_list);
let t0 =
Unix.gettimeofday ()
in
send_log "status" walk_num_tot t0 "Saved walkers"; send_log "status" walk_num_tot t0 "Saved walkers";
last_save_walkers := Unix.gettimeofday (); last_save_walkers := t0 ;
end end
in in
@ -737,10 +737,6 @@ let run ?(daemon=true) ezfio_filename =
recv_log log_msg ; recv_log log_msg ;
for i=0 to ((Array.length w)-1) for i=0 to ((Array.length w)-1)
do do
(*
Array.replace walkers_array (!last_walker) (fun _ -> Array.map
string_of_float w.(i));
*)
walkers_array.(!last_walker) <- Array.map string_of_float w.(i); walkers_array.(!last_walker) <- Array.map string_of_float w.(i);
increment_last_walker (); increment_last_walker ();
done; done;
@ -776,6 +772,7 @@ let run ?(daemon=true) ezfio_filename =
in handle msg in handle msg
in in
save_walkers ();
(* Main loop *) (* Main loop *)
while (!status <> Status.Stopped) while (!status <> Status.Stopped)
do do