diff --git a/bin/mu_opt.py b/bin/mu_opt.py index c219ca5..802ae7a 100755 --- a/bin/mu_opt.py +++ b/bin/mu_opt.py @@ -183,10 +183,10 @@ def main(): if sum(x) == 0.: jast_a_up_dn = ezfio.jastrow_jast_a_up_dn x += jast_a_up_dn -# opt = sp.optimize.minimize(f,x,method="Powell", -# options= {'disp':True, 'ftol':thresh,'xtol':0.02}) - opt = sp.optimize.minimize(f,x,method="Nelder-Mead", + opt = sp.optimize.minimize(f,x,method="Powell", options= {'disp':True, 'ftol':thresh,'xtol':0.02}) +# opt = sp.optimize.minimize(f,x,method="Nelder-Mead", +# options= {'disp':True, 'ftol':thresh,'xtol':0.02}) print("x = "+str(opt)) sys.stdout.flush() set_params_b(opt['x'][0]) diff --git a/ocaml/Qmcchem_result.ml b/ocaml/Qmcchem_result.ml index 68106d8..724ee40 100644 --- a/ocaml/Qmcchem_result.ml +++ b/ocaml/Qmcchem_result.ml @@ -131,7 +131,7 @@ let display_histogram ~range property = -(** Display a summary of all the cmoputed quantities *) +(** Display a summary of all the computed quantities *) let display_summary ~range = let properties = @@ -152,12 +152,16 @@ let display_summary ~range = Random_variable.of_raw_data ~range Property.Wall |> Random_variable.max_value_per_compute_node |> Random_variable.sum + and total_weight = + Random_variable.of_raw_data ~range Property.E_loc + |> Random_variable.total_weight in let speedup = cpu /. wall in - Printf.printf "%20s : %10.2f x\n" "Speedup" speedup + Printf.printf "%20s : %10.2f x\n" "Speedup" speedup ; + Printf.printf "%20s : %20.10e\n" "Total weight" total_weight diff --git a/ocaml/Random_variable.ml b/ocaml/Random_variable.ml index f408564..1387a0d 100644 --- a/ocaml/Random_variable.ml +++ b/ocaml/Random_variable.ml @@ -189,6 +189,13 @@ let sum { property ; data } = in accu +. num ) 0. data +(** Compute sum of the weights *) +let total_weight { property ; data } = + List.fold_left (fun accu x -> + let num = (Weight.to_float x.Block.weight) + in accu +. num + ) 0. data + (** Calculation of the average and error bar *) @@ -414,7 +421,7 @@ let create_hash ~create_key ?(update_block_id=(fun x->x)) compute_node = block.compute_node; } | None -> Some - { property = block.property ; + { property = block.property ; weight = block.weight; value = block.value ; block_id = update_block_id block.block_id;