mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2025-01-03 01:55:39 +01:00
Smaller time step errors
- Implemented SRMC and DMC - Using (E_new+E_old)/2 in DMC weight reduces time step errors - Branching weight is present in E_loc accumulation - Introduces Error in Message.ml
This commit is contained in:
parent
55d3c7b68a
commit
c56c3ea851
@ -65,7 +65,7 @@ simulation
|
|||||||
ci_threshold double precision
|
ci_threshold double precision
|
||||||
md5_key character*(32)
|
md5_key character*(32)
|
||||||
E_ref double precision
|
E_ref double precision
|
||||||
dmc_projection_time real
|
srmc_projection_time real
|
||||||
|
|
||||||
jastrow
|
jastrow
|
||||||
jast_type character*(32)
|
jast_type character*(32)
|
||||||
|
@ -8,16 +8,16 @@ let simulation_do_nucl_fitcusp = lazy(
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
let electrons_elec_walk_num = lazy ( 30 )
|
let electrons_elec_walk_num = lazy ( 30 )
|
||||||
let electrons_elec_walk_num_tot = lazy ( 10000 )
|
let electrons_elec_walk_num_tot = lazy ( 10000 )
|
||||||
let jastrow_jast_type = lazy ( "None" )
|
let jastrow_jast_type = lazy ( "None" )
|
||||||
let simulation_block_time = lazy ( 30 )
|
let simulation_block_time = lazy ( 30 )
|
||||||
let simulation_ci_threshold = lazy ( 1.e-8 )
|
let simulation_ci_threshold = lazy ( 1.e-8 )
|
||||||
let simulation_method = lazy ( "VMC" )
|
let simulation_method = lazy ( "VMC" )
|
||||||
let simulation_sampling = lazy ( "Langevin" )
|
let simulation_sampling = lazy ( "Langevin" )
|
||||||
let simulation_stop_time = lazy ( 3600 )
|
let simulation_stop_time = lazy ( 3600 )
|
||||||
let simulation_time_step = lazy ( 0.15 )
|
let simulation_time_step = lazy ( 0.15 )
|
||||||
let simulation_dmc_projection_time = lazy ( 1. )
|
let simulation_srmc_projection_time = lazy ( 1. )
|
||||||
|
|
||||||
let reset_defaults () =
|
let reset_defaults () =
|
||||||
List.iter ~f:(fun x -> Sys.remove ( (Lazy.force Qputils.ezfio_filename) ^ x))
|
List.iter ~f:(fun x -> Sys.remove ( (Lazy.force Qputils.ezfio_filename) ^ x))
|
||||||
|
@ -399,7 +399,7 @@ end
|
|||||||
|
|
||||||
module Method : sig
|
module Method : sig
|
||||||
|
|
||||||
type t = VMC | DMC
|
type t = VMC | DMC | SRMC
|
||||||
val doc : string
|
val doc : string
|
||||||
val read : unit -> t
|
val read : unit -> t
|
||||||
val write : t -> unit
|
val write : t -> unit
|
||||||
@ -408,19 +408,21 @@ module Method : sig
|
|||||||
|
|
||||||
end = struct
|
end = struct
|
||||||
|
|
||||||
type t = VMC | DMC
|
type t = VMC | DMC | SRMC
|
||||||
|
|
||||||
let doc = "QMC Method : [ VMC | DMC ]"
|
let doc = "QMC Method : [ VMC | DMC | SRMC ]"
|
||||||
|
|
||||||
let of_string = function
|
let of_string = function
|
||||||
| "VMC" | "vmc" -> VMC
|
| "VMC" | "vmc" -> VMC
|
||||||
| "DMC" | "dmc" -> DMC
|
| "DMC" | "dmc" -> DMC
|
||||||
| x -> failwith ("Method should be [ VMC | DMC ], not "^x^".")
|
| "SRMC" | "srmc" -> SRMC
|
||||||
|
| x -> failwith ("Method should be [ VMC | DMC | SRMC ], not "^x^".")
|
||||||
|
|
||||||
|
|
||||||
let to_string = function
|
let to_string = function
|
||||||
| VMC -> "VMC"
|
| VMC -> "VMC"
|
||||||
| DMC -> "DMC"
|
| DMC -> "DMC"
|
||||||
|
| SRMC -> "SRMC"
|
||||||
|
|
||||||
|
|
||||||
let read () =
|
let read () =
|
||||||
@ -611,7 +613,7 @@ contribution to the norm less than t (au)"
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module DMC_projection_time : sig
|
module SRMC_projection_time : sig
|
||||||
|
|
||||||
type t = float
|
type t = float
|
||||||
val doc : string
|
val doc : string
|
||||||
@ -625,13 +627,13 @@ module DMC_projection_time : sig
|
|||||||
end = struct
|
end = struct
|
||||||
|
|
||||||
type t = float
|
type t = float
|
||||||
let doc = "DMC projection time (au)"
|
let doc = "SRMC projection time (au)"
|
||||||
|
|
||||||
let of_float x =
|
let of_float x =
|
||||||
if (x >= 100.) then
|
if (x >= 100.) then
|
||||||
failwith "DMC Projection time should be < 100.";
|
failwith "SRMC Projection time should be < 100.";
|
||||||
if (x <= 0.) then
|
if (x <= 0.) then
|
||||||
failwith "DMC Projection time should be positive.";
|
failwith "SRMC Projection time should be positive.";
|
||||||
x
|
x
|
||||||
|
|
||||||
|
|
||||||
@ -641,10 +643,10 @@ end = struct
|
|||||||
let _ =
|
let _ =
|
||||||
Lazy.force Qputils.ezfio_filename
|
Lazy.force Qputils.ezfio_filename
|
||||||
in
|
in
|
||||||
if (not (Ezfio.has_simulation_dmc_projection_time())) then
|
if (not (Ezfio.has_simulation_srmc_projection_time())) then
|
||||||
Lazy.force Default.simulation_dmc_projection_time
|
Lazy.force Default.simulation_srmc_projection_time
|
||||||
|> Ezfio.set_simulation_dmc_projection_time ;
|
|> Ezfio.set_simulation_srmc_projection_time ;
|
||||||
Ezfio.get_simulation_dmc_projection_time ()
|
Ezfio.get_simulation_srmc_projection_time ()
|
||||||
|> of_float
|
|> of_float
|
||||||
|
|
||||||
|
|
||||||
@ -653,7 +655,7 @@ end = struct
|
|||||||
Lazy.force Qputils.ezfio_filename
|
Lazy.force Qputils.ezfio_filename
|
||||||
in
|
in
|
||||||
to_float t
|
to_float t
|
||||||
|> Ezfio.set_simulation_dmc_projection_time
|
|> Ezfio.set_simulation_srmc_projection_time
|
||||||
|
|
||||||
|
|
||||||
let of_string x =
|
let of_string x =
|
||||||
@ -862,27 +864,31 @@ let validate () =
|
|||||||
(* Check sampling and time steps *)
|
(* Check sampling and time steps *)
|
||||||
let () =
|
let () =
|
||||||
match (sampling, meth, Pseudo.to_bool do_pseudo) with
|
match (sampling, meth, Pseudo.to_bool do_pseudo) with
|
||||||
| (Sampling.Brownian, Method.DMC, true) ->
|
| (Sampling.Brownian, Method.DMC, true)
|
||||||
|
| (Sampling.Brownian, Method.SRMC, true) ->
|
||||||
if ( (Time_step.to_float ts) >= 0.5 ) then
|
if ( (Time_step.to_float ts) >= 0.5 ) then
|
||||||
warn "Time step seems large for DMC.";
|
warn ( "Time step seems large for "^(Method.to_string meth) )
|
||||||
|
| (Sampling.Brownian, Method.SRMC, false)
|
||||||
| (Sampling.Brownian, Method.DMC, false) ->
|
| (Sampling.Brownian, Method.DMC, false) ->
|
||||||
if ( (Time_step.to_float ts) >= 0.01 ) then
|
if ( (Time_step.to_float ts) >= 0.01 ) then
|
||||||
warn "Time step seems large for DMC.";
|
warn ( "Time step seems large for "^(Method.to_string meth) )
|
||||||
| (Sampling.Brownian, Method.VMC, _) ->
|
| (Sampling.Brownian, Method.VMC, _) ->
|
||||||
if ( (Time_step.to_float ts) >= 10. ) then
|
if ( (Time_step.to_float ts) >= 10. ) then
|
||||||
warn "Time step seems large for VMC.";
|
warn "Time step seems large for VMC."
|
||||||
| (Sampling.Langevin, Method.VMC, _) ->
|
| (Sampling.Langevin, Method.VMC, _) ->
|
||||||
if ( (Time_step.to_float ts) <= 0.01 ) then
|
if ( (Time_step.to_float ts) <= 0.01 ) then
|
||||||
warn "Time step seems small for Langevin sampling."
|
warn "Time step seems small for Langevin sampling."
|
||||||
|
| (Sampling.Langevin, Method.SRMC, _)
|
||||||
| (Sampling.Langevin, Method.DMC, _) ->
|
| (Sampling.Langevin, Method.DMC, _) ->
|
||||||
failwith "Lanvegin sampling is incompatible with DMC"
|
failwith "Lanvegin sampling is incompatible with DMC/SRMC"
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
(* Check E_ref is not zero *)
|
(* Check E_ref is not zero *)
|
||||||
let () =
|
let () =
|
||||||
match (meth, Ref_energy.(read () |> to_float) ) with
|
match (meth, Ref_energy.(read () |> to_float) ) with
|
||||||
| (Method.DMC,0.) -> failwith "E_ref should not be zero in DMC"
|
| (Method.SRMC,0.)
|
||||||
|
| (Method.DMC,0.) -> failwith ("E_ref should not be zero in "^(Method.to_string meth) )
|
||||||
| _ -> ()
|
| _ -> ()
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -895,7 +901,8 @@ let validate () =
|
|||||||
(* Check if E_loc if computed *)
|
(* Check if E_loc if computed *)
|
||||||
let () =
|
let () =
|
||||||
match (meth, Property.(calc E_loc)) with
|
match (meth, Property.(calc E_loc)) with
|
||||||
| (Method.DMC, false) -> failwith "E_loc should be sampled in DMC"
|
| (Method.SRMC, false)
|
||||||
|
| (Method.DMC, false) -> failwith ( "E_loc should be sampled in "^(Method.to_string meth) )
|
||||||
| (Method.VMC, false) -> warn "Sampling of E_loc is not activated in input"
|
| (Method.VMC, false) -> warn "Sampling of E_loc is not activated in input"
|
||||||
| _ -> ()
|
| _ -> ()
|
||||||
in
|
in
|
||||||
|
191
ocaml/Message.ml
191
ocaml/Message.ml
@ -9,105 +9,107 @@ type t =
|
|||||||
| Test
|
| Test
|
||||||
| GetWalkers of Strictly_positive_int.t
|
| GetWalkers of Strictly_positive_int.t
|
||||||
| Ezfio of string
|
| Ezfio of string
|
||||||
|
| Error of string
|
||||||
|
|
||||||
|
|
||||||
let create = function
|
let create m =
|
||||||
| [ "cpu" ; c ; pid ; b ; "1" ; v ] ->
|
try
|
||||||
let open Block in
|
match m with
|
||||||
Property
|
| [ "cpu" ; c ; pid ; b ; "1" ; v ] ->
|
||||||
{ property = Property.Cpu;
|
|
||||||
value = Sample.of_float (Float.of_string v) ;
|
|
||||||
weight = Weight.of_float 1.;
|
|
||||||
compute_node = Compute_node.of_string c;
|
|
||||||
pid = Pid.of_string pid;
|
|
||||||
block_id = Block_id.of_int (Int.of_string b);
|
|
||||||
}
|
|
||||||
| [ "accep" ; c ; pid ; b ; "1" ; v ] ->
|
|
||||||
let open Block in
|
|
||||||
Property
|
|
||||||
{ property = Property.Accep;
|
|
||||||
value = Sample.of_float (Float.of_string v) ;
|
|
||||||
weight = Weight.of_float 1.;
|
|
||||||
compute_node = Compute_node.of_string c;
|
|
||||||
pid = Pid.of_string pid;
|
|
||||||
block_id = Block_id.of_int (Int.of_string b);
|
|
||||||
}
|
|
||||||
| [ prop ; c ; pid ; b ; w ; v ] ->
|
|
||||||
let open Block in
|
|
||||||
Property
|
|
||||||
{ property = Property.of_string prop;
|
|
||||||
value = Sample.of_float (Float.of_string v);
|
|
||||||
weight = Weight.of_float (Float.of_string w);
|
|
||||||
compute_node = Compute_node.of_string c;
|
|
||||||
pid = Pid.of_string pid;
|
|
||||||
block_id = Block_id.of_int (Int.of_string b);
|
|
||||||
}
|
|
||||||
| "elec_coord" :: c :: pid :: _ :: n ::walkers ->
|
|
||||||
begin
|
|
||||||
let walk_num =
|
|
||||||
Lazy.force Qputils.walk_num
|
|
||||||
and elec_num =
|
|
||||||
Lazy.force Qputils.elec_num
|
|
||||||
and n =
|
|
||||||
Int.of_string n
|
|
||||||
in
|
|
||||||
assert (n = List.length walkers);
|
|
||||||
assert (n = walk_num*(elec_num+1)*3);
|
|
||||||
let rec build_walker accu = function
|
|
||||||
| (0,tail) ->
|
|
||||||
let result =
|
|
||||||
List.rev accu
|
|
||||||
|> List.map ~f:Float.of_string
|
|
||||||
|> Array.of_list
|
|
||||||
in
|
|
||||||
(result, tail)
|
|
||||||
| (n,head::tail) ->
|
|
||||||
build_walker (head::accu) (n-1, tail)
|
|
||||||
| _ -> failwith "Bad walkers"
|
|
||||||
in
|
|
||||||
let rec build accu = function
|
|
||||||
| [] -> Array.of_list accu
|
|
||||||
| w ->
|
|
||||||
let (result, tail) =
|
|
||||||
build_walker [] (3*elec_num+3, w)
|
|
||||||
in
|
|
||||||
build (result::accu) tail
|
|
||||||
in
|
|
||||||
Walkers (Compute_node.of_string c, Pid.of_string pid, build [] walkers)
|
|
||||||
end
|
|
||||||
| [ "get_walkers" ; n ] -> GetWalkers (n |> Int.of_string |> Strictly_positive_int.of_int)
|
|
||||||
| [ "register" ; c ; pid ] -> Register (Compute_node.of_string c, Pid.of_string pid)
|
|
||||||
| [ "unregister" ; c ; pid ] -> Unregister (Compute_node.of_string c, Pid.of_string pid)
|
|
||||||
| [ "Test" ] -> Test
|
|
||||||
| [ "Ezfio" ; ezfio_msg ] -> Ezfio ezfio_msg
|
|
||||||
| prop :: c :: pid :: b :: d :: w :: l ->
|
|
||||||
let property =
|
|
||||||
Property.of_string prop
|
|
||||||
in
|
|
||||||
begin
|
|
||||||
assert (not (Property.is_scalar property));
|
|
||||||
let a =
|
|
||||||
Array.of_list l
|
|
||||||
|> Array.map ~f:Float.of_string
|
|
||||||
and dim =
|
|
||||||
Int.of_string d
|
|
||||||
in
|
|
||||||
assert (Array.length a = dim);
|
|
||||||
let open Block in
|
let open Block in
|
||||||
Property
|
Property
|
||||||
{ property = property ;
|
{ property = Property.Cpu;
|
||||||
value = Sample.of_float_array ~dim a;
|
value = Sample.of_float (Float.of_string v) ;
|
||||||
weight = Weight.of_float (Float.of_string w);
|
weight = Weight.of_float 1.;
|
||||||
compute_node = Compute_node.of_string c;
|
compute_node = Compute_node.of_string c;
|
||||||
pid = Pid.of_string pid;
|
pid = Pid.of_string pid;
|
||||||
block_id = Block_id.of_int (Int.of_string b);
|
block_id = Block_id.of_int (Int.of_string b);
|
||||||
}
|
}
|
||||||
end
|
| [ "accep" ; c ; pid ; b ; "1" ; v ] ->
|
||||||
| l ->
|
let open Block in
|
||||||
|
Property
|
||||||
|
{ property = Property.Accep;
|
||||||
|
value = Sample.of_float (Float.of_string v) ;
|
||||||
|
weight = Weight.of_float 1.;
|
||||||
|
compute_node = Compute_node.of_string c;
|
||||||
|
pid = Pid.of_string pid;
|
||||||
|
block_id = Block_id.of_int (Int.of_string b);
|
||||||
|
}
|
||||||
|
| [ prop ; c ; pid ; b ; w ; v ] ->
|
||||||
|
let open Block in
|
||||||
|
Property
|
||||||
|
{ property = Property.of_string prop;
|
||||||
|
value = Sample.of_float (Float.of_string v);
|
||||||
|
weight = Weight.of_float (Float.of_string w);
|
||||||
|
compute_node = Compute_node.of_string c;
|
||||||
|
pid = Pid.of_string pid;
|
||||||
|
block_id = Block_id.of_int (Int.of_string b);
|
||||||
|
}
|
||||||
|
| "elec_coord" :: c :: pid :: _ :: n ::walkers ->
|
||||||
begin
|
begin
|
||||||
List.iter ~f:(Printf.printf ":%s:") l;
|
let walk_num =
|
||||||
failwith "Message not understood"
|
Lazy.force Qputils.walk_num
|
||||||
|
and elec_num =
|
||||||
|
Lazy.force Qputils.elec_num
|
||||||
|
and n =
|
||||||
|
Int.of_string n
|
||||||
|
in
|
||||||
|
assert (n = List.length walkers);
|
||||||
|
assert (n = walk_num*(elec_num+1)*3);
|
||||||
|
let rec build_walker accu = function
|
||||||
|
| (0,tail) ->
|
||||||
|
let result =
|
||||||
|
List.rev accu
|
||||||
|
|> List.map ~f:Float.of_string
|
||||||
|
|> Array.of_list
|
||||||
|
in
|
||||||
|
(result, tail)
|
||||||
|
| (n,head::tail) ->
|
||||||
|
build_walker (head::accu) (n-1, tail)
|
||||||
|
| _ -> failwith "Bad walkers"
|
||||||
|
in
|
||||||
|
let rec build accu = function
|
||||||
|
| [] -> Array.of_list accu
|
||||||
|
| w ->
|
||||||
|
let (result, tail) =
|
||||||
|
build_walker [] (3*elec_num+3, w)
|
||||||
|
in
|
||||||
|
build (result::accu) tail
|
||||||
|
in
|
||||||
|
Walkers (Compute_node.of_string c, Pid.of_string pid, build [] walkers)
|
||||||
end
|
end
|
||||||
|
| [ "get_walkers" ; n ] -> GetWalkers (n |> Int.of_string |> Strictly_positive_int.of_int)
|
||||||
|
| [ "register" ; c ; pid ] -> Register (Compute_node.of_string c, Pid.of_string pid)
|
||||||
|
| [ "unregister" ; c ; pid ] -> Unregister (Compute_node.of_string c, Pid.of_string pid)
|
||||||
|
| [ "Test" ] -> Test
|
||||||
|
| [ "Ezfio" ; ezfio_msg ] -> Ezfio ezfio_msg
|
||||||
|
| prop :: c :: pid :: b :: d :: w :: l ->
|
||||||
|
let property =
|
||||||
|
Property.of_string prop
|
||||||
|
in
|
||||||
|
begin
|
||||||
|
assert (not (Property.is_scalar property));
|
||||||
|
let a =
|
||||||
|
Array.of_list l
|
||||||
|
|> Array.map ~f:Float.of_string
|
||||||
|
and dim =
|
||||||
|
Int.of_string d
|
||||||
|
in
|
||||||
|
assert (Array.length a = dim);
|
||||||
|
let open Block in
|
||||||
|
Property
|
||||||
|
{ property = property ;
|
||||||
|
value = Sample.of_float_array ~dim a;
|
||||||
|
weight = Weight.of_float (Float.of_string w);
|
||||||
|
compute_node = Compute_node.of_string c;
|
||||||
|
pid = Pid.of_string pid;
|
||||||
|
block_id = Block_id.of_int (Int.of_string b);
|
||||||
|
}
|
||||||
|
end
|
||||||
|
| l -> Error (String.concat ~sep:":" l)
|
||||||
|
with
|
||||||
|
| Assert_failure (l,_,_) -> Error l
|
||||||
|
| _ -> Error "Unknown error"
|
||||||
|
|
||||||
|
|
||||||
let to_string = function
|
let to_string = function
|
||||||
@ -122,5 +124,6 @@ let to_string = function
|
|||||||
(Compute_node.to_string h) (Pid.to_string p)
|
(Compute_node.to_string h) (Pid.to_string p)
|
||||||
| Test -> "Test"
|
| Test -> "Test"
|
||||||
| Ezfio msg -> "Ezfio "^msg
|
| Ezfio msg -> "Ezfio "^msg
|
||||||
|
| Error msg -> "Error "^msg
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ let bind_socket ~socket_type ~socket ~address =
|
|||||||
|
|
||||||
let run ?(daemon=true) ezfio_filename =
|
let run ?(daemon=true) ezfio_filename =
|
||||||
|
|
||||||
Ezfio.set_file ezfio_filename ;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
|
|
||||||
(** Measures the time difference between [t0] and [Time.now ()] *)
|
(** Measures the time difference between [t0] and [Time.now ()] *)
|
||||||
let delta_t t0 =
|
let delta_t t0 =
|
||||||
@ -126,9 +126,9 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
Printf.sprintf "tcp://*:%d" (port+4)
|
Printf.sprintf "tcp://*:%d" (port+4)
|
||||||
in
|
in
|
||||||
bind_socket "XPUB" debug_socket address;
|
bind_socket "XPUB" debug_socket address;
|
||||||
|
ZMQ.Socket.set_linger_period debug_socket 100 ;
|
||||||
|
|
||||||
let close_debug_socket () =
|
let close_debug_socket () =
|
||||||
ZMQ.Socket.set_linger_period debug_socket 1000 ;
|
|
||||||
ZMQ.Socket.close debug_socket
|
ZMQ.Socket.close debug_socket
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
;
|
;
|
||||||
done;
|
done;
|
||||||
ZMQ.Socket.send socket (Status.to_string !status);
|
ZMQ.Socket.send socket (Status.to_string !status);
|
||||||
ZMQ.Socket.set_linger_period socket 1000 ;
|
ZMQ.Socket.set_linger_period socket 1_000 ;
|
||||||
ZMQ.Socket.close socket
|
ZMQ.Socket.close socket
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
@ -564,9 +564,10 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
Printf.sprintf "tcp://*:%d" port
|
Printf.sprintf "tcp://*:%d" port
|
||||||
in
|
in
|
||||||
bind_socket "REP" rep_socket address;
|
bind_socket "REP" rep_socket address;
|
||||||
ZMQ.Socket.set_receive_high_water_mark rep_socket 100000;
|
ZMQ.Socket.set_receive_high_water_mark rep_socket 100_000;
|
||||||
ZMQ.Socket.set_send_high_water_mark rep_socket 100000;
|
ZMQ.Socket.set_send_high_water_mark rep_socket 100_000;
|
||||||
ZMQ.Socket.set_immediate rep_socket true;
|
ZMQ.Socket.set_immediate rep_socket true;
|
||||||
|
ZMQ.Socket.set_linger_period rep_socket 600_000 ;
|
||||||
|
|
||||||
(** EZFIO Cache *)
|
(** EZFIO Cache *)
|
||||||
let ezfio_cache =
|
let ezfio_cache =
|
||||||
@ -630,6 +631,7 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
List.fold ~init:0 ~f:(fun accu x -> accu + (String.length x)) raw_msg
|
List.fold ~init:0 ~f:(fun accu x -> accu + (String.length x)) raw_msg
|
||||||
in
|
in
|
||||||
let handle = function
|
let handle = function
|
||||||
|
| Message.Error _ -> ()
|
||||||
| Message.Ezfio ezfio_msg ->
|
| Message.Ezfio ezfio_msg ->
|
||||||
let result =
|
let result =
|
||||||
handle_ezfio ezfio_msg
|
handle_ezfio ezfio_msg
|
||||||
@ -718,6 +720,7 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
in
|
in
|
||||||
|
|
||||||
let handle = function
|
let handle = function
|
||||||
|
| Message.Error _ -> ()
|
||||||
| Message.Walkers (h,pid,w) ->
|
| Message.Walkers (h,pid,w) ->
|
||||||
begin
|
begin
|
||||||
if (status = Status.Running) then
|
if (status = Status.Running) then
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
open Core.Std
|
open Core.Std
|
||||||
|
|
||||||
|
|
||||||
let run ~t filename=
|
let run ~t ezfio_filename=
|
||||||
|
|
||||||
Ezfio.set_file filename;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
|
|
||||||
if (not (Ezfio.has_simulation_http_server ())) then
|
if (not (Ezfio.has_simulation_http_server ())) then
|
||||||
failwith "QMC=Chem is not running"
|
failwith "QMC=Chem is not running"
|
||||||
@ -13,7 +13,7 @@ let run ~t filename=
|
|||||||
ZMQ.Context.create ()
|
ZMQ.Context.create ()
|
||||||
in
|
in
|
||||||
|
|
||||||
Printf.printf "Debugging %s\n%!" filename;
|
Printf.printf "Debugging %s\n%!" ezfio_filename;
|
||||||
let socket =
|
let socket =
|
||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.sub
|
ZMQ.Socket.create zmq_context ZMQ.Socket.sub
|
||||||
in
|
in
|
||||||
@ -70,7 +70,7 @@ let spec =
|
|||||||
empty
|
empty
|
||||||
+> flag "t" no_arg
|
+> flag "t" no_arg
|
||||||
~doc:"Measure the throughput"
|
~doc:"Measure the throughput"
|
||||||
+> anon ("filename" %: string)
|
+> anon ("ezfio_file" %: string)
|
||||||
|
|
||||||
|
|
||||||
let command =
|
let command =
|
||||||
@ -78,7 +78,7 @@ let command =
|
|||||||
~summary: "Debug ZeroMQ communications"
|
~summary: "Debug ZeroMQ communications"
|
||||||
~readme:(fun () -> "Gets debug information from the ZMQ debug sockets.")
|
~readme:(fun () -> "Gets debug information from the ZMQ debug sockets.")
|
||||||
spec
|
spec
|
||||||
(fun t filename () -> run t filename)
|
(fun t ezfio_file () -> run t ezfio_file)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ type field =
|
|||||||
| Ref_energy
|
| Ref_energy
|
||||||
| CI_threshold
|
| CI_threshold
|
||||||
| Time_step
|
| Time_step
|
||||||
| DMC_projection_time
|
| SRMC_projection_time
|
||||||
| Jastrow_type
|
| Jastrow_type
|
||||||
| Properties
|
| Properties
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ let get field =
|
|||||||
option_to_string CI_threshold.read CI_threshold.to_string CI_threshold.doc
|
option_to_string CI_threshold.read CI_threshold.to_string CI_threshold.doc
|
||||||
| Time_step ->
|
| Time_step ->
|
||||||
option_to_string Time_step.read Time_step.to_string Time_step.doc
|
option_to_string Time_step.read Time_step.to_string Time_step.doc
|
||||||
| DMC_projection_time ->
|
| SRMC_projection_time ->
|
||||||
option_to_string DMC_projection_time.read DMC_projection_time.to_string DMC_projection_time.doc
|
option_to_string SRMC_projection_time.read SRMC_projection_time.to_string SRMC_projection_time.doc
|
||||||
| Jastrow_type ->
|
| Jastrow_type ->
|
||||||
option_to_string Jastrow_type.read Jastrow_type.to_string Jastrow_type.doc
|
option_to_string Jastrow_type.read Jastrow_type.to_string Jastrow_type.doc
|
||||||
| Properties ->
|
| Properties ->
|
||||||
@ -116,10 +116,7 @@ let run ~c ?f ?t ?l ?m ?e ?s ?ts ?w ?wt ?n ?j ?p ?input ezfio_filename =
|
|||||||
in
|
in
|
||||||
|
|
||||||
(* Open EZFIO *)
|
(* Open EZFIO *)
|
||||||
if (not (Sys.file_exists_exn ezfio_filename)) then
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
failwith (ezfio_filename^" does not exist");
|
|
||||||
|
|
||||||
Ezfio.set_file ezfio_filename;
|
|
||||||
|
|
||||||
let handle_option (type_conv, write) x =
|
let handle_option (type_conv, write) x =
|
||||||
let () =
|
let () =
|
||||||
@ -144,7 +141,7 @@ let run ~c ?f ?t ?l ?m ?e ?s ?ts ?w ?wt ?n ?j ?p ?input ezfio_filename =
|
|||||||
handle_option Input.Walk_num.(of_int , write) w;
|
handle_option Input.Walk_num.(of_int , write) w;
|
||||||
handle_option Input.Walk_num_tot.(of_int , write) wt;
|
handle_option Input.Walk_num_tot.(of_int , write) wt;
|
||||||
handle_option Input.CI_threshold.(of_float , write) n;
|
handle_option Input.CI_threshold.(of_float , write) n;
|
||||||
handle_option Input.DMC_projection_time.(of_float , write) p;
|
handle_option Input.SRMC_projection_time.(of_float , write) p;
|
||||||
|
|
||||||
|
|
||||||
let fields =
|
let fields =
|
||||||
@ -154,7 +151,7 @@ let run ~c ?f ?t ?l ?m ?e ?s ?ts ?w ?wt ?n ?j ?p ?input ezfio_filename =
|
|||||||
Method ;
|
Method ;
|
||||||
Sampling ;
|
Sampling ;
|
||||||
Time_step ;
|
Time_step ;
|
||||||
DMC_projection_time ;
|
SRMC_projection_time ;
|
||||||
Ref_energy ;
|
Ref_energy ;
|
||||||
Walk_num ;
|
Walk_num ;
|
||||||
Walk_num_tot ;
|
Walk_num_tot ;
|
||||||
@ -216,19 +213,19 @@ let run ~c ?f ?t ?l ?m ?e ?s ?ts ?w ?wt ?n ?j ?p ?input ezfio_filename =
|
|||||||
try
|
try
|
||||||
begin
|
begin
|
||||||
match f with
|
match f with
|
||||||
| Stop_time -> Stop_time.(of_string s |> write)
|
| Stop_time -> Stop_time.(of_string s |> write)
|
||||||
| Fitcusp -> Fitcusp.(of_string s |> write)
|
| Fitcusp -> Fitcusp.(of_string s |> write)
|
||||||
| Block_time -> Block_time.(of_string s |> write)
|
| Block_time -> Block_time.(of_string s |> write)
|
||||||
| Method -> Method.(of_string s |> write)
|
| Method -> Method.(of_string s |> write)
|
||||||
| Ref_energy -> Ref_energy.(of_string s |> write)
|
| Ref_energy -> Ref_energy.(of_string s |> write)
|
||||||
| Sampling -> Sampling.(of_string s |> write)
|
| Sampling -> Sampling.(of_string s |> write)
|
||||||
| Time_step -> Time_step.(of_string s |> write)
|
| Time_step -> Time_step.(of_string s |> write)
|
||||||
| DMC_projection_time -> DMC_projection_time.(of_string s |> write)
|
| SRMC_projection_time -> SRMC_projection_time.(of_string s |> write)
|
||||||
| Walk_num -> Walk_num.(of_string s |> write)
|
| Walk_num -> Walk_num.(of_string s |> write)
|
||||||
| Walk_num_tot -> Walk_num_tot.(of_string s |> write)
|
| Walk_num_tot -> Walk_num_tot.(of_string s |> write)
|
||||||
| CI_threshold -> CI_threshold.(of_string s |> write)
|
| CI_threshold -> CI_threshold.(of_string s |> write)
|
||||||
| Jastrow_type -> Jastrow_type.(of_string s |> write)
|
| Jastrow_type -> Jastrow_type.(of_string s |> write)
|
||||||
| Properties -> Properties.(of_string s |> write)
|
| Properties -> Properties.(of_string s |> write)
|
||||||
end
|
end
|
||||||
with
|
with
|
||||||
| Failure msg -> Printf.eprintf "%s\n" msg
|
| Failure msg -> Printf.eprintf "%s\n" msg
|
||||||
@ -297,7 +294,7 @@ let spec =
|
|||||||
+> flag "j" (optional string)
|
+> flag "j" (optional string)
|
||||||
~doc:("jastrow_type "^Input.Jastrow_type.doc)
|
~doc:("jastrow_type "^Input.Jastrow_type.doc)
|
||||||
+> flag "p" (optional float)
|
+> flag "p" (optional float)
|
||||||
~doc:("projection_time "^Input.DMC_projection_time.doc)
|
~doc:("projection_time "^Input.SRMC_projection_time.doc)
|
||||||
+> anon ("ezfio_file" %: string)
|
+> anon ("ezfio_file" %: string)
|
||||||
+> anon (maybe ("input" %: string))
|
+> anon (maybe ("input" %: string))
|
||||||
;;
|
;;
|
||||||
|
@ -226,16 +226,17 @@ let run ezfio_filename dataserver =
|
|||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.req
|
ZMQ.Socket.create zmq_context ZMQ.Socket.req
|
||||||
in
|
in
|
||||||
ZMQ.Socket.connect req_socket dataserver;
|
ZMQ.Socket.connect req_socket dataserver;
|
||||||
ZMQ.Socket.set_receive_timeout req_socket 180_000;
|
ZMQ.Socket.set_receive_timeout req_socket 600_000;
|
||||||
|
|
||||||
let dealer_socket =
|
let dealer_socket =
|
||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
||||||
in
|
in
|
||||||
|
|
||||||
bind_socket "PROXY" dealer_socket "inproc://dealer";
|
bind_socket "PROXY" dealer_socket "inproc://dealer";
|
||||||
ZMQ.Socket.set_receive_high_water_mark dealer_socket 100000;
|
ZMQ.Socket.set_receive_high_water_mark dealer_socket 100_000;
|
||||||
ZMQ.Socket.set_send_high_water_mark dealer_socket 100000;
|
ZMQ.Socket.set_send_high_water_mark dealer_socket 100_000;
|
||||||
ZMQ.Socket.set_immediate dealer_socket true;
|
ZMQ.Socket.set_immediate dealer_socket true;
|
||||||
|
ZMQ.Socket.set_linger_period dealer_socket 600_000;
|
||||||
|
|
||||||
let fetch_walkers () =
|
let fetch_walkers () =
|
||||||
ZMQ.Socket.send_all req_socket ["get_walkers" ; Int.to_string !walk_num ];
|
ZMQ.Socket.send_all req_socket ["get_walkers" ; Int.to_string !walk_num ];
|
||||||
@ -293,7 +294,7 @@ let run ezfio_filename dataserver =
|
|||||||
let result =
|
let result =
|
||||||
handle_ezfio ezfio_msg
|
handle_ezfio ezfio_msg
|
||||||
in
|
in
|
||||||
ZMQ.Socket.send_all dealer_socket (header @ result) ;
|
ZMQ.Socket.send_all dealer_socket (header @ result)
|
||||||
| Message.GetWalkers n_walks ->
|
| Message.GetWalkers n_walks ->
|
||||||
begin
|
begin
|
||||||
if (!walk_num = 0) then
|
if (!walk_num = 0) then
|
||||||
@ -305,7 +306,8 @@ let run ezfio_filename dataserver =
|
|||||||
walkers := fetch_walkers ();
|
walkers := fetch_walkers ();
|
||||||
end
|
end
|
||||||
| Message.Test ->
|
| Message.Test ->
|
||||||
ZMQ.Socket.send_all dealer_socket (header @ [ "OK" ]);
|
ZMQ.Socket.send_all dealer_socket (header @ [ "OK" ])
|
||||||
|
| Message.Error _ -> ()
|
||||||
| Message.Register _
|
| Message.Register _
|
||||||
| Message.Unregister _
|
| Message.Unregister _
|
||||||
| Message.Walkers _
|
| Message.Walkers _
|
||||||
@ -315,8 +317,8 @@ let run ezfio_filename dataserver =
|
|||||||
end;
|
end;
|
||||||
done;
|
done;
|
||||||
ZMQ.Socket.set_linger_period dealer_socket 1000 ;
|
ZMQ.Socket.set_linger_period dealer_socket 1000 ;
|
||||||
ZMQ.Socket.close dealer_socket;
|
|
||||||
ZMQ.Socket.set_linger_period req_socket 1000 ;
|
ZMQ.Socket.set_linger_period req_socket 1000 ;
|
||||||
|
ZMQ.Socket.close dealer_socket;
|
||||||
ZMQ.Socket.close req_socket;
|
ZMQ.Socket.close req_socket;
|
||||||
in
|
in
|
||||||
Thread.create f
|
Thread.create f
|
||||||
@ -330,6 +332,7 @@ let run ezfio_filename dataserver =
|
|||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
||||||
in
|
in
|
||||||
ZMQ.Socket.connect dealer_socket dataserver;
|
ZMQ.Socket.connect dealer_socket dataserver;
|
||||||
|
ZMQ.Socket.set_linger_period dealer_socket 600_000;
|
||||||
|
|
||||||
let proxy_socket =
|
let proxy_socket =
|
||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
ZMQ.Socket.create zmq_context ZMQ.Socket.dealer
|
||||||
@ -345,6 +348,7 @@ let run ezfio_filename dataserver =
|
|||||||
ZMQ.Socket.set_receive_high_water_mark router_socket 100000;
|
ZMQ.Socket.set_receive_high_water_mark router_socket 100000;
|
||||||
ZMQ.Socket.set_send_high_water_mark router_socket 100000;
|
ZMQ.Socket.set_send_high_water_mark router_socket 100000;
|
||||||
ZMQ.Socket.set_immediate router_socket true;
|
ZMQ.Socket.set_immediate router_socket true;
|
||||||
|
ZMQ.Socket.set_linger_period router_socket 600_000;
|
||||||
|
|
||||||
(* Pull socket for computed data *)
|
(* Pull socket for computed data *)
|
||||||
let push_socket =
|
let push_socket =
|
||||||
@ -353,6 +357,7 @@ let run ezfio_filename dataserver =
|
|||||||
Printf.sprintf "tcp://%s:%d" dataserver_address (port+2-10)
|
Printf.sprintf "tcp://%s:%d" dataserver_address (port+2-10)
|
||||||
in
|
in
|
||||||
ZMQ.Socket.connect push_socket address;
|
ZMQ.Socket.connect push_socket address;
|
||||||
|
ZMQ.Socket.set_linger_period push_socket 600_000;
|
||||||
|
|
||||||
let pull_socket =
|
let pull_socket =
|
||||||
ZMQ.Socket.create zmq_context ZMQ.Socket.pull
|
ZMQ.Socket.create zmq_context ZMQ.Socket.pull
|
||||||
@ -380,13 +385,14 @@ let run ezfio_filename dataserver =
|
|||||||
| Message.GetWalkers _
|
| Message.GetWalkers _
|
||||||
| Message.Ezfio _
|
| Message.Ezfio _
|
||||||
| Message.Test ->
|
| Message.Test ->
|
||||||
ZMQ.Socket.send_all proxy_socket raw_msg;
|
ZMQ.Socket.send_all proxy_socket raw_msg
|
||||||
| Message.Register _
|
| Message.Register _
|
||||||
| Message.Unregister _ ->
|
| Message.Unregister _ ->
|
||||||
ZMQ.Socket.send_all dealer_socket raw_msg;
|
ZMQ.Socket.send_all dealer_socket raw_msg
|
||||||
| Message.Walkers (_, _, _)
|
| Message.Walkers (_, _, _)
|
||||||
| Message.Property _ ->
|
| Message.Property _ ->
|
||||||
failwith "Bad message"
|
failwith "Bad message"
|
||||||
|
| Message.Error _ -> ()
|
||||||
in handle msg
|
in handle msg
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ open Core.Std
|
|||||||
|
|
||||||
|
|
||||||
let run ezfio_filename =
|
let run ezfio_filename =
|
||||||
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
let qmcchem_info =
|
let qmcchem_info =
|
||||||
Lazy.force Qmcchem_config.qmcchem_info
|
Lazy.force Qmcchem_config.qmcchem_info
|
||||||
in
|
in
|
||||||
|
@ -2,7 +2,7 @@ open Core.Std
|
|||||||
|
|
||||||
let run ?c ?d ~l ezfio_filename =
|
let run ?c ?d ~l ezfio_filename =
|
||||||
|
|
||||||
Ezfio.set_file ezfio_filename;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
|
|
||||||
let input_directory =
|
let input_directory =
|
||||||
Lazy.force Md5.input_directory
|
Lazy.force Md5.input_directory
|
||||||
|
@ -164,7 +164,7 @@ let display_summary () =
|
|||||||
|
|
||||||
let run ?a ?c ?e ?h ?t ?p ezfio_file =
|
let run ?a ?c ?e ?h ?t ?p ezfio_file =
|
||||||
|
|
||||||
Ezfio.set_file ezfio_file;
|
Qputils.set_ezfio_filename ezfio_file;
|
||||||
let f (x,func) =
|
let f (x,func) =
|
||||||
match x with
|
match x with
|
||||||
| Some property -> func property
|
| Some property -> func property
|
||||||
|
@ -143,10 +143,7 @@ let ssh_run host dataserver ezfio_filename =
|
|||||||
|
|
||||||
let run a d ?q ?s ezfio_filename =
|
let run a d ?q ?s ezfio_filename =
|
||||||
|
|
||||||
Ezfio.set_file ezfio_filename;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
let ezfio_filename =
|
|
||||||
Lazy.force Qputils.ezfio_filename
|
|
||||||
in
|
|
||||||
|
|
||||||
(* Signal handler to Kill properly all the processes *)
|
(* Signal handler to Kill properly all the processes *)
|
||||||
let handler s =
|
let handler s =
|
||||||
|
@ -2,7 +2,7 @@ open Core.Std
|
|||||||
|
|
||||||
|
|
||||||
let run ezfio_filename =
|
let run ezfio_filename =
|
||||||
Ezfio.set_file ezfio_filename ;
|
Qputils.set_ezfio_filename ezfio_filename;
|
||||||
Status.write Status.Stopping
|
Status.write Status.Stopping
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,34 +9,40 @@ let split s =
|
|||||||
|> Str.split split_re
|
|> Str.split split_re
|
||||||
|
|
||||||
|
|
||||||
|
let set_ezfio_filename ezfio_filename =
|
||||||
|
let () =
|
||||||
|
if (not (Sys.file_exists_exn ezfio_filename)) then
|
||||||
|
failwith (ezfio_filename^" does not exist")
|
||||||
|
in
|
||||||
|
let () =
|
||||||
|
match (Sys.is_directory ezfio_filename) with
|
||||||
|
| `Yes -> Ezfio.set_file ezfio_filename ;
|
||||||
|
| _ -> failwith ("Error : "^ezfio_filename^" is not a directory")
|
||||||
|
in
|
||||||
|
let dir, result =
|
||||||
|
Filename.realpath ezfio_filename
|
||||||
|
|> Filename.split
|
||||||
|
in
|
||||||
|
Unix.chdir dir ;
|
||||||
|
Ezfio.set_file result
|
||||||
|
|
||||||
|
|
||||||
let ezfio_filename = lazy (
|
let ezfio_filename = lazy (
|
||||||
let f =
|
let f =
|
||||||
!Ezfio.ezfio_filename
|
!Ezfio.ezfio_filename
|
||||||
in
|
in
|
||||||
let full_path =
|
let full_path =
|
||||||
begin
|
match f with
|
||||||
if f = "EZFIO_File" then
|
| "EZFIO_File" ->
|
||||||
begin
|
begin
|
||||||
if (Array.length Sys.argv = 1) then
|
if (Array.length Sys.argv = 1) then
|
||||||
failwith "Error : EZFIO directory not specified on the command line\n";
|
failwith "Error : EZFIO directory not specified on the command line\n";
|
||||||
let ezfio_filename = Sys.argv.(1)
|
Sys.argv.(1)
|
||||||
in
|
|
||||||
let () =
|
|
||||||
match (Sys.is_directory ezfio_filename) with
|
|
||||||
| `Yes -> Ezfio.set_file ezfio_filename ;
|
|
||||||
| _ -> failwith ("Error : "^ezfio_filename^" not found")
|
|
||||||
in ezfio_filename
|
|
||||||
end
|
end
|
||||||
else
|
| f -> f
|
||||||
f
|
|
||||||
end
|
|
||||||
in
|
in
|
||||||
let dir, result =
|
set_ezfio_filename full_path;
|
||||||
Filename.realpath full_path
|
!Ezfio.ezfio_filename
|
||||||
|> Filename.split
|
|
||||||
in
|
|
||||||
Unix.chdir dir;
|
|
||||||
result
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -235,13 +235,12 @@ BEGIN_PROVIDER [ double precision, E_loc ]
|
|||||||
E_loc += E_kin_elec(i) + E_pot_elec(i)
|
E_loc += E_kin_elec(i) + E_pot_elec(i)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! Avoid divergence of E_loc
|
! ! Avoid divergence of E_loc
|
||||||
if (qmc_method == t_DMC) then
|
! if (qmc_method == t_DMC) then
|
||||||
double precision :: delta_e
|
! double precision :: delta_e
|
||||||
delta_e = E_loc-E_ref
|
! delta_e = E_loc-E_ref
|
||||||
E_loc = E_ref + erf(1.d0/(time_step*delta_e*time_step*delta_e)) * delta_e
|
! E_loc = E_ref + erf(1.d0/(time_step*delta_e*time_step*delta_e)) * delta_e
|
||||||
endif
|
! endif
|
||||||
|
|
||||||
|
|
||||||
E_loc_min = min(E_loc,E_loc_min)
|
E_loc_min = min(E_loc,E_loc_min)
|
||||||
E_loc_max = max(E_loc,E_loc_max)
|
E_loc_max = max(E_loc,E_loc_max)
|
||||||
|
@ -47,15 +47,15 @@ BEGIN_PROVIDER [ double precision, wf_extension ]
|
|||||||
SOFT_TOUCH wf_extension_min wf_extension_max
|
SOFT_TOUCH wf_extension_min wf_extension_max
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, dmc_pop_weight ]
|
BEGIN_PROVIDER [ double precision, srmc_pop_weight ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Weight of the DMC population
|
! Weight of the SRMC population
|
||||||
END_DOC
|
END_DOC
|
||||||
dmc_pop_weight = pop_weight_mult
|
srmc_pop_weight = pop_weight_mult
|
||||||
dmc_pop_weight_min = min(dmc_pop_weight,dmc_pop_weight_min)
|
srmc_pop_weight_min = min(srmc_pop_weight,srmc_pop_weight_min)
|
||||||
dmc_pop_weight_max = max(dmc_pop_weight,dmc_pop_weight_max)
|
srmc_pop_weight_max = max(srmc_pop_weight,srmc_pop_weight_max)
|
||||||
SOFT_TOUCH dmc_pop_weight_min dmc_pop_weight_max
|
SOFT_TOUCH srmc_pop_weight_min srmc_pop_weight_max
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -24,6 +24,12 @@ t = """
|
|||||||
$X_block_walk = $X_dmc_block_walk
|
$X_block_walk = $X_dmc_block_walk
|
||||||
$X_2_block_walk = $X_2_dmc_block_walk
|
$X_2_block_walk = $X_2_dmc_block_walk
|
||||||
endif
|
endif
|
||||||
|
else if (qmc_method == t_SRMC) then
|
||||||
|
PROVIDE E_loc_srmc_block_walk
|
||||||
|
if (calc_$X) then
|
||||||
|
$X_block_walk = $X_srmc_block_walk
|
||||||
|
$X_2_block_walk = $X_2_srmc_block_walk
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
@ -42,15 +42,23 @@ END_SHELL
|
|||||||
! Properties averaged over the block using the DMC method
|
! Properties averaged over the block using the DMC method
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
real, allocatable :: elec_coord_tmp(:,:,:)
|
real, allocatable :: elec_coord_tmp(:,:,:)
|
||||||
integer :: mod_align
|
integer :: mod_align
|
||||||
double precision :: psi_value_save(walk_num)
|
double precision :: E_loc_save(walk_num_dmc_max)
|
||||||
double precision :: psi_value_save_tmp(walk_num)
|
double precision :: E_loc_save_tmp(walk_num_dmc_max)
|
||||||
integer :: trapped_walk_tmp(walk_num)
|
double precision :: psi_value_save(walk_num_dmc_max)
|
||||||
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: psi_value_save
|
double precision :: psi_value_save_tmp(walk_num_dmc_max)
|
||||||
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: psi_value_save_tmp
|
double precision :: dmc_weight(walk_num_dmc_max)
|
||||||
allocate ( elec_coord_tmp(mod_align(elec_num+1),3,walk_num) )
|
integer :: trapped_walk_tmp(walk_num_dmc_max)
|
||||||
psi_value_save = 0.d0
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: E_loc_save
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: E_loc_save_tmp
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: dmc_weight
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: psi_value_save
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: psi_value_save_tmp
|
||||||
|
allocate ( elec_coord_tmp(mod_align(elec_num+1),3,walk_num_dmc_max) )
|
||||||
|
psi_value_save = 0.d0
|
||||||
|
psi_value_save_tmp = 0.d0
|
||||||
|
dmc_weight = 1.d0
|
||||||
|
|
||||||
! Initialization
|
! Initialization
|
||||||
if (vmc_algo /= t_Brownian) then
|
if (vmc_algo /= t_Brownian) then
|
||||||
@ -71,8 +79,6 @@ t = """
|
|||||||
$X_2_dmc_block_walk = 0.d0
|
$X_2_dmc_block_walk = 0.d0
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
$X_2_dmc_block_walk_kahan = 0.d0
|
$X_2_dmc_block_walk_kahan = 0.d0
|
||||||
$X_min = huge(1.)
|
|
||||||
$X_max =-huge(1.)
|
|
||||||
endif
|
endif
|
||||||
"""
|
"""
|
||||||
for p in properties:
|
for p in properties:
|
||||||
@ -88,35 +94,79 @@ END_SHELL
|
|||||||
|
|
||||||
block_weight = 0.d0
|
block_weight = 0.d0
|
||||||
|
|
||||||
|
real, external :: accep_rate
|
||||||
|
double precision :: delta, thr, E0
|
||||||
|
|
||||||
|
thr = 2.d0/time_step_sq
|
||||||
|
E0 = E_ref
|
||||||
|
|
||||||
|
|
||||||
do while (loop)
|
do while (loop)
|
||||||
|
|
||||||
! Every walker makes a step
|
! Every walker makes a step
|
||||||
do i_walk=1,walk_num
|
do i_walk=1,walk_num_dmc
|
||||||
integer :: i,j,l
|
integer :: i,j,l
|
||||||
do l=1,3
|
do l=1,3
|
||||||
do i=1,elec_num+1
|
do i=1,elec_num+1
|
||||||
elec_coord(i,l) = elec_coord_full(i,l,i_walk)
|
elec_coord(i,l) = elec_coord_full_dmc(i,l,i_walk)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
TOUCH elec_coord
|
TOUCH elec_coord
|
||||||
|
|
||||||
|
double precision :: p,q
|
||||||
|
real :: delta_x
|
||||||
|
logical :: accepted
|
||||||
|
call brownian_step(p,q,accepted,delta_x)
|
||||||
|
if (accepted) then
|
||||||
|
trapped_walk(i_walk) = 0
|
||||||
|
else
|
||||||
|
trapped_walk(i_walk) += 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ( (trapped_walk(i_walk) < trapped_walk_max).and. &
|
||||||
|
(psi_value * psi_value_save(i_walk) >= 0.d0) ) then
|
||||||
|
delta = ((E_loc+E_loc_save(i_walk))*0.5d0 - E0) * p
|
||||||
|
if ( delta > thr ) then
|
||||||
|
dmc_weight(i_walk) = dexp(-dtime_step*thr)
|
||||||
|
else if ( delta < -thr ) then
|
||||||
|
dmc_weight(i_walk) = dexp(dtime_step*thr)
|
||||||
|
else
|
||||||
|
dmc_weight(i_walk) = dexp(-dtime_step*delta)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
dmc_weight(i_walk) = 0.d0
|
||||||
|
trapped_walk(i_walk) = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
elec_coord(elec_num+1,1) += p*time_step
|
||||||
|
elec_coord(elec_num+1,2) = E_loc
|
||||||
|
elec_coord(elec_num+1,3) = dmc_weight(i_walk)
|
||||||
|
do l=1,3
|
||||||
|
do i=1,elec_num+1
|
||||||
|
elec_coord_full_dmc(i,l,i_walk) = elec_coord(i,l)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
psi_value_save(i_walk) = psi_value
|
||||||
|
E_loc_save(i_walk) = E_loc
|
||||||
|
|
||||||
BEGIN_SHELL [ /usr/bin/python ]
|
BEGIN_SHELL [ /usr/bin/python ]
|
||||||
from properties import *
|
from properties import *
|
||||||
t = """
|
t = """
|
||||||
if (calc_$X) then
|
if (calc_$X) then
|
||||||
! Kahan's summation algorithm to compute these sums reducing the rounding error:
|
! Kahan's summation algorithm to compute these sums reducing the rounding error:
|
||||||
! $X_dmc_block_walk += $X * pop_weight_mult
|
! $X_dmc_block_walk += $X * dmc_weight(i_walk)
|
||||||
! $X_2_dmc_block_walk += $X_2 * pop_weight_mult
|
! $X_2_dmc_block_walk += $X_2 * dmc_weight(i_walk)
|
||||||
! see http://en.wikipedia.org/wiki/Kahan_summation_algorithm
|
! see http://en.wikipedia.org/wiki/Kahan_summation_algorithm
|
||||||
|
|
||||||
$X_dmc_block_walk_kahan($D2 3) = $X * pop_weight_mult - $X_dmc_block_walk_kahan($D2 1)
|
$X_dmc_block_walk_kahan($D2 3) = $X * dmc_weight(i_walk) - $X_dmc_block_walk_kahan($D2 1)
|
||||||
$X_dmc_block_walk_kahan($D2 2) = $X_dmc_block_walk $D1 + $X_dmc_block_walk_kahan($D2 3)
|
$X_dmc_block_walk_kahan($D2 2) = $X_dmc_block_walk $D1 + $X_dmc_block_walk_kahan($D2 3)
|
||||||
$X_dmc_block_walk_kahan($D2 1) = ($X_dmc_block_walk_kahan($D2 2) - $X_dmc_block_walk $D1 ) &
|
$X_dmc_block_walk_kahan($D2 1) = ($X_dmc_block_walk_kahan($D2 2) - $X_dmc_block_walk $D1 ) &
|
||||||
- $X_dmc_block_walk_kahan($D2 3)
|
- $X_dmc_block_walk_kahan($D2 3)
|
||||||
$X_dmc_block_walk $D1 = $X_dmc_block_walk_kahan($D2 2)
|
$X_dmc_block_walk $D1 = $X_dmc_block_walk_kahan($D2 2)
|
||||||
|
|
||||||
|
|
||||||
$X_2_dmc_block_walk_kahan($D2 3) = $X_2 * pop_weight_mult - $X_2_dmc_block_walk_kahan($D2 1)
|
$X_2_dmc_block_walk_kahan($D2 3) = $X_2 * dmc_weight(i_walk) - $X_2_dmc_block_walk_kahan($D2 1)
|
||||||
$X_2_dmc_block_walk_kahan($D2 2) = $X_2_dmc_block_walk $D1 + $X_2_dmc_block_walk_kahan($D2 3)
|
$X_2_dmc_block_walk_kahan($D2 2) = $X_2_dmc_block_walk $D1 + $X_2_dmc_block_walk_kahan($D2 3)
|
||||||
$X_2_dmc_block_walk_kahan($D2 1) = ($X_2_dmc_block_walk_kahan($D2 2) - $X_2_dmc_block_walk $D1 ) &
|
$X_2_dmc_block_walk_kahan($D2 1) = ($X_2_dmc_block_walk_kahan($D2 2) - $X_2_dmc_block_walk $D1 ) &
|
||||||
- $X_2_dmc_block_walk_kahan($D2 3)
|
- $X_2_dmc_block_walk_kahan($D2 3)
|
||||||
@ -135,92 +185,59 @@ for p in properties:
|
|||||||
END_SHELL
|
END_SHELL
|
||||||
|
|
||||||
|
|
||||||
double precision :: p,q
|
block_weight += dmc_weight(i_walk)
|
||||||
real :: delta_x
|
|
||||||
logical :: accepted
|
|
||||||
call brownian_step(p,q,accepted,delta_x)
|
|
||||||
if (accepted) then
|
|
||||||
trapped_walk(i_walk) = 0
|
|
||||||
else
|
|
||||||
trapped_walk(i_walk) += 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
if ( (trapped_walk(i_walk) < trapped_walk_max).and. &
|
|
||||||
(psi_value * psi_value_save(i_walk) >= 0.d0) ) then
|
|
||||||
dmc_weight(i_walk) = dexp(dtime_step*(E_ref - E_loc))
|
|
||||||
else
|
|
||||||
dmc_weight(i_walk) = 0.d0
|
|
||||||
trapped_walk(i_walk) = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
elec_coord(elec_num+1,1) += p*time_step
|
|
||||||
elec_coord(elec_num+1,2) = E_loc
|
|
||||||
elec_coord(elec_num+1,3) = dmc_weight(i_walk)
|
|
||||||
do l=1,3
|
|
||||||
do i=1,elec_num+1
|
|
||||||
elec_coord_full(i,l,i_walk) = elec_coord(i,l)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
|
|
||||||
psi_value_save(i_walk) = psi_value
|
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! Move to the next projection step
|
! Population control
|
||||||
if (dmc_projection > 0) then
|
|
||||||
dmc_projection_step = mod(dmc_projection_step,dmc_projection)+1
|
|
||||||
else
|
|
||||||
dmc_projection_step = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
! Eventually, recompute the weight of the population
|
|
||||||
if (dmc_projection_step == 1) then
|
|
||||||
pop_weight_mult = 1.d0
|
|
||||||
do k=1,dmc_projection
|
|
||||||
pop_weight_mult *= pop_weight(k)
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
|
|
||||||
! Remove contribution of the old value of the weight at the new
|
|
||||||
! projection step
|
|
||||||
pop_weight_mult *= 1.d0/pop_weight(dmc_projection_step)
|
|
||||||
|
|
||||||
! Compute the new weight of the population
|
|
||||||
double precision :: sum_weight
|
double precision :: sum_weight
|
||||||
sum_weight = 0.d0
|
sum_weight = 0.d0
|
||||||
do k=1,walk_num
|
do k=1,walk_num_dmc
|
||||||
sum_weight += dmc_weight(k)
|
sum_weight += dmc_weight(k)
|
||||||
enddo
|
enddo
|
||||||
pop_weight(dmc_projection_step) = sum_weight/dble(walk_num)
|
E0 = E_ref - log(real(walk_num_dmc)/real(walk_num)) * 0.1d0/dtime_step
|
||||||
|
|
||||||
! Update the running population weight
|
! Branching
|
||||||
pop_weight_mult *= pop_weight(dmc_projection_step)
|
integer :: ipos(walk_num_dmc_max), walk_num_dmc_new
|
||||||
|
double precision, external :: qmc_ranf
|
||||||
|
double precision :: r
|
||||||
|
|
||||||
block_weight += pop_weight_mult * dble(walk_num)
|
do k=1,walk_num_dmc
|
||||||
|
|
||||||
! Reconfiguration
|
|
||||||
integer :: ipos(walk_num)
|
|
||||||
|
|
||||||
call reconfigure(ipos,dmc_weight)
|
|
||||||
|
|
||||||
do k=1,walk_num
|
|
||||||
do l=1,3
|
do l=1,3
|
||||||
do i=1,elec_num+1
|
do i=1,elec_num+1
|
||||||
elec_coord_tmp(i,l,k) = elec_coord_full(i,l,k)
|
elec_coord_tmp(i,l,k) = elec_coord_full_dmc(i,l,k)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
psi_value_save_tmp(k) = psi_value_save(k)
|
psi_value_save_tmp(k) = psi_value_save(k)
|
||||||
|
E_loc_save_tmp(k) = E_loc_save(k)
|
||||||
trapped_walk_tmp(k) = trapped_walk(k)
|
trapped_walk_tmp(k) = trapped_walk(k)
|
||||||
|
ipos(k) = k
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do k=1,walk_num_dmc
|
||||||
|
r = qmc_ranf()
|
||||||
|
if (dmc_weight(k) > 1.d0) then
|
||||||
|
if ( 1.d0+r < dmc_weight(k) ) then
|
||||||
|
walk_num_dmc = walk_num_dmc+1
|
||||||
|
ipos(walk_num_dmc) = k
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if ( r > dmc_weight(k) ) then
|
||||||
|
ipos(k) = ipos(walk_num_dmc)
|
||||||
|
walk_num_dmc = walk_num_dmc-1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
integer :: ipm
|
integer :: ipm
|
||||||
do k=1,walk_num
|
do k=1,walk_num_dmc
|
||||||
ipm = ipos(k)
|
ipm = ipos(k)
|
||||||
do l=1,3
|
do l=1,3
|
||||||
do i=1,elec_num+1
|
do i=1,elec_num+1
|
||||||
elec_coord_full(i,l,k) = elec_coord_tmp(i,l,ipm)
|
elec_coord_full_dmc(i,l,k) = elec_coord_tmp(i,l,ipm)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
E_loc_save(k) = E_loc_save_tmp(ipm)
|
||||||
psi_value_save(k) = psi_value_save_tmp(ipm)
|
psi_value_save(k) = psi_value_save_tmp(ipm)
|
||||||
trapped_walk(k) = trapped_walk_tmp(ipm)
|
trapped_walk(k) = trapped_walk_tmp(ipm)
|
||||||
enddo
|
enddo
|
||||||
@ -237,7 +254,7 @@ END_SHELL
|
|||||||
cpu2 = cpu1
|
cpu2 = cpu1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SOFT_TOUCH elec_coord_full psi_value psi_grad_psi_inv_x psi_grad_psi_inv_y psi_grad_psi_inv_z elec_coord pop_weight_mult
|
SOFT_TOUCH elec_coord_full_dmc psi_value psi_grad_psi_inv_x psi_grad_psi_inv_y psi_grad_psi_inv_z elec_coord
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -259,6 +276,22 @@ END_SHELL
|
|||||||
|
|
||||||
deallocate ( elec_coord_tmp )
|
deallocate ( elec_coord_tmp )
|
||||||
|
|
||||||
|
do k=1,min(walk_num,walk_num_dmc)
|
||||||
|
do l=1,3
|
||||||
|
do i=1,elec_num+1
|
||||||
|
elec_coord_full(i,l,k) = elec_coord_full_dmc(i,l,k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
do k=walk_num_dmc+1,walk_num
|
||||||
|
do l=1,3
|
||||||
|
do i=1,elec_num+1
|
||||||
|
elec_coord_full(i,l,k) = elec_coord_full_dmc(i,l,mod(k,walk_num_dmc)+1)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
SOFT_TOUCH elec_coord_full
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
@ -271,36 +304,7 @@ BEGIN_PROVIDER [ double precision, E_ref ]
|
|||||||
call get_simulation_E_ref(E_ref)
|
call get_simulation_E_ref(E_ref)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, pop_weight_mult ]
|
BEGIN_PROVIDER [ integer, trapped_walk, (walk_num_dmc_max) ]
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Population weight of DMC
|
|
||||||
END_DOC
|
|
||||||
pop_weight_mult = pop_weight(dmc_projection)
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, dmc_projection ]
|
|
||||||
&BEGIN_PROVIDER [ integer, dmc_projection_step ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Number of projection steps for SRMC
|
|
||||||
END_DOC
|
|
||||||
real :: dmc_projection_time
|
|
||||||
dmc_projection_time = 1.
|
|
||||||
call get_simulation_dmc_projection_time(dmc_projection_time)
|
|
||||||
dmc_projection = int( dmc_projection_time/time_step)
|
|
||||||
dmc_projection_step = 0
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, pop_weight, (0:dmc_projection+1) ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Population weight of DMC
|
|
||||||
END_DOC
|
|
||||||
pop_weight = 1.d0
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, trapped_walk, (walk_num_8) ]
|
|
||||||
&BEGIN_PROVIDER [ integer, trapped_walk_max ]
|
&BEGIN_PROVIDER [ integer, trapped_walk_max ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
@ -311,13 +315,36 @@ END_PROVIDER
|
|||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, dmc_weight, (walk_num_8) ]
|
BEGIN_PROVIDER [ integer, walk_num_dmc ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Weight of the walkers in the DMC algorithm: exp(-time_step*(E_loc-E_ref))
|
! Current number of walkers in DMC
|
||||||
END_DOC
|
END_DOC
|
||||||
!DIR$ VECTOR ALIGNED
|
walk_num_dmc = walk_num
|
||||||
dmc_weight = 1.d0
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, walk_num_dmc_max ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Max number of walkers in DMC
|
||||||
|
END_DOC
|
||||||
|
walk_num_dmc_max = 3 * walk_num
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ real, elec_coord_full_dmc, (elec_num+1,3,walk_num_dmc_max)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! DMC population
|
||||||
|
END_DOC
|
||||||
|
integer :: i,k,l
|
||||||
|
do k=1,walk_num
|
||||||
|
do l=1,3
|
||||||
|
do i=1,elec_num+1
|
||||||
|
elec_coord_full_dmc(i,l,k) = elec_coord_full(i,l,k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -69,11 +69,11 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_to_dataserver_socket ]
|
|||||||
endif
|
endif
|
||||||
integer :: i
|
integer :: i
|
||||||
i=4
|
i=4
|
||||||
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_SNDTIMEO, 120000, i)
|
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_SNDTIMEO, 600000, i)
|
||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to set send timout in zmq_to_dataserver_socket')
|
call abrt(irp_here, 'Unable to set send timout in zmq_to_dataserver_socket')
|
||||||
endif
|
endif
|
||||||
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_RCVTIMEO, 120000, i)
|
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_RCVTIMEO, 600000, i)
|
||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to set recv timout in zmq_to_dataserver_socket')
|
call abrt(irp_here, 'Unable to set recv timout in zmq_to_dataserver_socket')
|
||||||
endif
|
endif
|
||||||
@ -108,6 +108,7 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_socket_push ]
|
|||||||
character*(8), external :: zmq_port
|
character*(8), external :: zmq_port
|
||||||
zmq_socket_push = f77_zmq_socket(zmq_context, ZMQ_PUSH)
|
zmq_socket_push = f77_zmq_socket(zmq_context, ZMQ_PUSH)
|
||||||
address = trim(dataserver_address)//':'//zmq_port(2)
|
address = trim(dataserver_address)//':'//zmq_port(2)
|
||||||
|
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,600000,4)
|
||||||
rc = f77_zmq_connect(zmq_socket_push, trim(address))
|
rc = f77_zmq_connect(zmq_socket_push, trim(address))
|
||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to connect zmq_socket_push')
|
call abrt(irp_here, 'Unable to connect zmq_socket_push')
|
||||||
|
@ -36,7 +36,7 @@ data = [ \
|
|||||||
("simulation_equilibration" , "logical" , "" ),
|
("simulation_equilibration" , "logical" , "" ),
|
||||||
("simulation_block_time" , "integer" , "" ),
|
("simulation_block_time" , "integer" , "" ),
|
||||||
("simulation_time_step" , "real" , "" ),
|
("simulation_time_step" , "real" , "" ),
|
||||||
("simulation_dmc_projection_time" , "real" , "" ),
|
("simulation_srmc_projection_time" , "real" , "" ),
|
||||||
("simulation_method" , "character*(32)", "" ),
|
("simulation_method" , "character*(32)", "" ),
|
||||||
("simulation_save_data" , "logical" , "" ),
|
("simulation_save_data" , "logical" , "" ),
|
||||||
("simulation_print_level" , "integer" , "" ),
|
("simulation_print_level" , "integer" , "" ),
|
||||||
|
@ -148,7 +148,7 @@ BEGIN_PROVIDER [ integer, qmc_method ]
|
|||||||
implicit none
|
implicit none
|
||||||
include 'types.F'
|
include 'types.F'
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! qmc_method : Calculation method. Can be t_VMC, t_DMC
|
! qmc_method : Calculation method. Can be t_VMC, t_DMC, t_SRMC
|
||||||
END_DOC
|
END_DOC
|
||||||
character*(32) :: method
|
character*(32) :: method
|
||||||
method = types(t_VMC)
|
method = types(t_VMC)
|
||||||
@ -158,8 +158,10 @@ BEGIN_PROVIDER [ integer, qmc_method ]
|
|||||||
qmc_method = t_VMC
|
qmc_method = t_VMC
|
||||||
else if (method == types(t_DMC)) then
|
else if (method == types(t_DMC)) then
|
||||||
qmc_method = t_DMC
|
qmc_method = t_DMC
|
||||||
|
else if (method == types(t_SRMC)) then
|
||||||
|
qmc_method = t_SRMC
|
||||||
else
|
else
|
||||||
call abrt(irp_here, 'Method should be ( VMC | DMC )')
|
call abrt(irp_here, 'Method should be ( VMC | DMC | SRMC )')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call cinfo(irp_here,'qmc_method',trim(method))
|
call cinfo(irp_here,'qmc_method',trim(method))
|
||||||
@ -276,12 +278,15 @@ BEGIN_PROVIDER [ integer, vmc_algo ]
|
|||||||
else if (Sampling == types(t_Langevin)) then
|
else if (Sampling == types(t_Langevin)) then
|
||||||
vmc_algo = t_Langevin
|
vmc_algo = t_Langevin
|
||||||
if (qmc_method == t_DMC) then
|
if (qmc_method == t_DMC) then
|
||||||
vmc_algo = t_Brownian
|
stop 'Langevin incompatible with DMC'
|
||||||
|
endif
|
||||||
|
if (qmc_method == t_SRMC) then
|
||||||
|
stop 'Langevin incompatible with SRMC'
|
||||||
endif
|
endif
|
||||||
else if (Sampling == types(t_MTM)) then
|
else if (Sampling == types(t_MTM)) then
|
||||||
vmc_algo = t_MTM
|
vmc_algo = t_MTM
|
||||||
else
|
else
|
||||||
call abrt(irp_here,'Sampling should be (Brownian|Langevin|MTM|Read)')
|
call abrt(irp_here,'Sampling should be (Brownian|Langevin)')
|
||||||
endif
|
endif
|
||||||
call cinfo(irp_here,'Sampling',Sampling)
|
call cinfo(irp_here,'Sampling',Sampling)
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
integer, parameter :: t_VMC = 7
|
integer, parameter :: t_VMC = 7
|
||||||
integer, parameter :: t_DMC = 8
|
integer, parameter :: t_DMC = 8
|
||||||
|
integer, parameter :: t_SRMC = 9
|
||||||
|
|
||||||
integer, parameter :: t_Simple = 11
|
integer, parameter :: t_Simple = 11
|
||||||
integer, parameter :: t_None = 12
|
integer, parameter :: t_None = 12
|
||||||
@ -24,7 +25,7 @@
|
|||||||
' ', &
|
' ', &
|
||||||
'VMC ', &
|
'VMC ', &
|
||||||
'DMC ', &
|
'DMC ', &
|
||||||
' ', &
|
'SRMC ', &
|
||||||
' ', &
|
' ', &
|
||||||
'Simple ', &
|
'Simple ', &
|
||||||
'None ', &
|
'None ', &
|
||||||
|
Loading…
Reference in New Issue
Block a user