10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-21 11:53:30 +01:00

Bug fixes

This commit is contained in:
Anthony Scemama 2019-10-01 10:41:48 +02:00
parent be84027a8c
commit 161900c87a
6 changed files with 27 additions and 26 deletions

View File

@ -36,7 +36,7 @@ src/MAIN/qmc src/MAIN/qmc_create_walkers src/MAIN/qmcchem_info: lib/libezfio.a l
# OCaml # OCaml
# ----- # -----
ocaml/qmcchem: EZFIO/Ocaml/ezfio.ml ocaml/Property.ml ocaml/qmcchem: EZFIO/Ocaml/ezfio.ml $(wildcard ocaml/*.ml)
./scripts/compile_ocaml.sh ./scripts/compile_ocaml.sh
# Archive # Archive
@ -58,7 +58,7 @@ bin/qmcchem_info: src/MAIN/qmcchem_info
bin/qmc_create_walkers: src/MAIN/qmc_create_walkers bin/qmc_create_walkers: src/MAIN/qmc_create_walkers
cp src/MAIN/qmc_create_walkers bin/ cp src/MAIN/qmc_create_walkers bin/
bin/qmcchem: bin/qmcchem: ocaml/qmcchem
cp ocaml/qmcchem bin/ cp ocaml/qmcchem bin/
all: bin/qmc bin/qmcchem_info bin/qmc_create_walkers bin/qmcchem all: bin/qmc bin/qmcchem_info bin/qmc_create_walkers bin/qmcchem

View File

@ -7,7 +7,7 @@ CPU_TYPE="-mavx"
## FORTRAN compiler ## FORTRAN compiler
FC="gfortran -ffree-line-length-none" FC="gfortran -ffree-line-length-none"
FCFLAGS="-O2 -g ${CPU_TYPE}" FCFLAGS="-O2 -g ${CPU_TYPE}"
LIB="-lblas -llapack" LIB="-lblas -llapack -lpthread"
## IRPF90 ## IRPF90
IRPF90="${QMCCHEM_PATH}/bin/irpf90" IRPF90="${QMCCHEM_PATH}/bin/irpf90"

View File

@ -15,7 +15,7 @@ LIB="-mkl=sequential"
## IRPF90 ## IRPF90
IRPF90="${QMCCHEM_PATH}/bin/irpf90" IRPF90="${QMCCHEM_PATH}/bin/irpf90"
IRPF90_FLAGS="--align=${ALIGN} ${IRPF90_FLAGS}" IRPF90_FLAGS="--align=${ALIGN}"
export FC FCFLAGS LIB IRPF90 IRPF90_FLAGS export FC FCFLAGS LIB IRPF90 IRPF90_FLAGS

View File

@ -48,10 +48,10 @@ let run ?(daemon=true) ezfio_filename =
in in
(** Measures the time difference between [t0] and [Unix.time ()] *) (** Measures the time difference between [t0] and [Unix.gettimeofday ()] *)
let delta_t t0 = let delta_t t0 =
let t1 = let t1 =
Unix.time () Unix.gettimeofday ()
in in
t1 -. t0 t1 -. t0
in in
@ -149,7 +149,7 @@ let run ?(daemon=true) ezfio_filename =
delta_t t0 delta_t t0
in in
let message = let message =
Printf.sprintf "%20s : %8d : %10s : %f" Printf.sprintf "%20s : %8d : %10s : %e"
socket size text dt socket size text dt
in in
Zmq.Socket.send debug_socket message Zmq.Socket.send debug_socket message
@ -183,7 +183,7 @@ let run ?(daemon=true) ezfio_filename =
(** Array of walkers. The size is [walk_num_tot]. *) (** Array of walkers. The size is [walk_num_tot]. *)
let walkers_array = let walkers_array =
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
let j = let j =
3*elec_num + 3 3*elec_num + 3
@ -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.time ()) ref (Unix.gettimeofday ())
in in
@ -227,7 +227,7 @@ let run ?(daemon=true) ezfio_filename =
if (delta_t !last_save_walkers > 10. ) then if (delta_t !last_save_walkers > 10. ) then
begin begin
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in 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 =
@ -239,7 +239,7 @@ let run ?(daemon=true) ezfio_filename =
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);
send_log "status" walk_num_tot t0 "Saved walkers"; send_log "status" walk_num_tot t0 "Saved walkers";
last_save_walkers := Unix.time (); last_save_walkers := Unix.gettimeofday ();
end end
in in
@ -292,7 +292,7 @@ let run ?(daemon=true) ezfio_filename =
in in
match Hashtbl.find_opt workers_hash s with match Hashtbl.find_opt workers_hash s with
| Some _ -> failwith (s^" already registered") | Some _ -> failwith (s^" already registered")
| None -> Hashtbl.add workers_hash s (Unix.time ()) | None -> Hashtbl.add workers_hash s (Unix.gettimeofday ())
in in
@ -310,12 +310,12 @@ let run ?(daemon=true) ezfio_filename =
(** Sets the last access of the worker to [Unix.time ()] *) (** Sets the last access of the worker to [Unix.gettimeofday ()] *)
let touch_worker w pid = let touch_worker w pid =
let s = let s =
key w pid key w pid
in in
Hashtbl.replace workers_hash s (Unix.time ()) Hashtbl.replace workers_hash s (Unix.gettimeofday ())
in in
@ -386,7 +386,7 @@ let run ?(daemon=true) ezfio_filename =
*) *)
let compress_block_file filename = let compress_block_file filename =
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
close_out !block_channel; close_out !block_channel;
Unix.rename block_channel_filename_locked block_channel_filename_tmp; Unix.rename block_channel_filename_locked block_channel_filename_tmp;
@ -406,7 +406,7 @@ let run ?(daemon=true) ezfio_filename =
let start_status_thread = let start_status_thread =
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
Thread.create (fun () -> Thread.create (fun () ->
send_log "status" 0 t0 "Starting status thread"; send_log "status" 0 t0 "Starting status thread";
@ -422,7 +422,7 @@ let run ?(daemon=true) ezfio_filename =
in in
let start_time = let start_time =
Unix.time () Unix.gettimeofday ()
and stop_time = and stop_time =
ref (Input.Stop_time.(read () |> to_float) ) ref (Input.Stop_time.(read () |> to_float) )
in in
@ -435,7 +435,7 @@ let run ?(daemon=true) ezfio_filename =
do do
Unix.sleepf delay; Unix.sleepf delay;
let now = let now =
Unix.time () Unix.gettimeofday ()
in in
let status_string = let status_string =
Status.to_string !status Status.to_string !status
@ -490,7 +490,7 @@ let run ?(daemon=true) ezfio_filename =
let start_log_thread = let start_log_thread =
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
Thread.create (fun () -> Thread.create (fun () ->
send_log "status" 0 t0 "Starting log thread"; send_log "status" 0 t0 "Starting log thread";
@ -520,7 +520,7 @@ let run ?(daemon=true) ezfio_filename =
|> String.concat " " |> String.concat " "
in in
let now = let now =
Unix.time () Unix.gettimeofday ()
in in
send_log "log" 0 now message send_log "log" 0 now message
end end
@ -556,7 +556,7 @@ let run ?(daemon=true) ezfio_filename =
let start_main_thread = let start_main_thread =
let wall0 = let wall0 =
Unix.time () Unix.gettimeofday ()
in in
let f () = let f () =
@ -627,7 +627,7 @@ let run ?(daemon=true) ezfio_filename =
Zmq.Socket.recv_all ~block:false rep_socket Zmq.Socket.recv_all ~block:false rep_socket
in in
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
let msg = let msg =
List.map String.trim raw_msg List.map String.trim raw_msg
@ -712,7 +712,7 @@ let run ?(daemon=true) ezfio_filename =
Zmq.Socket.recv_all ~block:false pull_socket Zmq.Socket.recv_all ~block:false pull_socket
in in
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
let msg = let msg =
List.map String.trim raw_msg List.map String.trim raw_msg
@ -746,7 +746,7 @@ let run ?(daemon=true) ezfio_filename =
done; done;
let wall = let wall =
Printf.sprintf "%f %f # %s %s %s %d" Printf.sprintf "%f %f # %s %s %s %d"
(Unix.time () -. wall0) (Unix.gettimeofday () -. wall0)
1. (Property.to_string Property.Wall) 1. (Property.to_string Property.Wall)
hostname (string_of_int dataserver_pid) 1 hostname (string_of_int dataserver_pid) 1
|> Block.of_string |> Block.of_string
@ -838,7 +838,7 @@ let run ?(daemon=true) ezfio_filename =
(** {3 Main function} *) (** {3 Main function} *)
let t0 = let t0 =
Unix.time () Unix.gettimeofday ()
in in
(* Handle signals *) (* Handle signals *)

View File

@ -466,6 +466,7 @@ let run ezfio_filename dataserver =
int_of_string n_str int_of_string n_str
in in
let len = let len =
if !walk_num = 0 then n else
n / !walk_num n / !walk_num
in in
if (n < 5*len) then if (n < 5*len) then

View File

@ -39,7 +39,7 @@ let string_of_date t =
let string_of_now () = let string_of_now () =
Unix.time () Unix.gettimeofday ()
|> Unix.localtime |> Unix.localtime
|> string_of_date |> string_of_date