From a15f3ae2b1a26d3e0dc5705bc7dc45253ed6e68e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 29 Dec 2015 00:48:17 +0100 Subject: [PATCH] Works with gfortran. Fixed ezfio.ml compiling problem. --- .gitignore | 13 + configure.sh | 20 +- install/build.ninja | 2 +- make.config.gfortran | 18 + make.config => make.config.ifort | 0 ocaml/.gitignore | 12 + ocaml/Property.ml | 629 ------------------------------- scripts/compile_ocaml.sh | 2 - scripts/compile_ocaml_dep.sh | 2 + src/.gitignore | 8 + src/ZMQ/utils.irp.f | 11 +- src/ZMQ/zmq_ezfio.irp.f | 154 ++++++-- src/types.F | 30 +- src/wf.irp.f | 2 +- 14 files changed, 219 insertions(+), 684 deletions(-) create mode 100644 .gitignore create mode 100644 make.config.gfortran rename make.config => make.config.ifort (100%) create mode 100644 ocaml/.gitignore delete mode 100644 ocaml/Property.ml create mode 100644 src/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8c3821e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +.ninja_deps +.ninja_log +EZFIO +install/Downloads +install/_build +lib +irpf90 +qmcchemrc +make.config +src/ZMQ/f77_zmq.h +ezfio_config/properties.config +bin/ + diff --git a/configure.sh b/configure.sh index e37b138..5da8621 100755 --- a/configure.sh +++ b/configure.sh @@ -18,7 +18,25 @@ then fi touch _build/ninja.ok fi -touch "${QMCCHEM_PATH}"/{src,ocaml}/ls_md5 +touch "${QMCCHEM_PATH}"/{src,ocaml}/.ls_md5 exec "${QMCCHEM_PATH}"/bin/ninja "$@" +if [[ ! -f make.config ]] +then + which ifort > /dev/null + if [[ $? ]] + then + cp make.config.ifort make.config + else + cp make.config.gfortran make.config + fi +fi + +echo "=====================================================================" +echo "Configuration OK." +echo "Now, source the qmcchemrc file:" +echo "" +echo "source qmcchemrc" +echo "" +echo "=====================================================================" diff --git a/install/build.ninja b/install/build.ninja index b2310a4..39d1054 100644 --- a/install/build.ninja +++ b/install/build.ninja @@ -20,7 +20,7 @@ rule download rule install command = ./scripts/install_${target}.sh > _build/${target}.log 2>&1 && touch _build/${target}.ok || cat _build/${target}.log - description = Installing ${descr} | tail -f install/_build/${target}.log + description = Installing ${descr} | tail -f install/_build/${target}.log # Builds diff --git a/make.config.gfortran b/make.config.gfortran new file mode 100644 index 0000000..0f44979 --- /dev/null +++ b/make.config.gfortran @@ -0,0 +1,18 @@ +# CPU type + +## ALIGNMENT + +CPU_TYPE="-mavx" + +## FORTRAN compiler +FC="gfortran -ffree-line-length-none" +NINJA="ninja" +FCFLAGS="-O2 -g ${CPU_TYPE}" +LIB="-lblas -llapack" + +## IRPF90 +IRPF90="${QMCCHEM_PATH}/bin/irpf90" +IRPF90_FLAGS="--align=16" + +export FC NINJA FCFLAGS LIB IRPF90 IRPF90_FLAGS + diff --git a/make.config b/make.config.ifort similarity index 100% rename from make.config rename to make.config.ifort diff --git a/ocaml/.gitignore b/ocaml/.gitignore new file mode 100644 index 0000000..d6883ef --- /dev/null +++ b/ocaml/.gitignore @@ -0,0 +1,12 @@ +*.cmi +*.cmx +*.o +ezfio.ml +Qptypes.ml +.ls_md5 +.ninja_deps +.ninja_log +generated.ninja +qmcchem +qptypes_generator + diff --git a/ocaml/Property.ml b/ocaml/Property.ml deleted file mode 100644 index f71daad..0000000 --- a/ocaml/Property.ml +++ /dev/null @@ -1,629 +0,0 @@ - -(* File generated by ${QMCCHEM_PATH}/src/create_properties.py. Do not - modify here - *) - -type t = -| Cpu -| Wall -| Accep -| D_var_jast_a_up_dn -| D_var_jast_a_up_up -| D_var_jast_b_up_dn -| D_var_jast_b_up_up -| D_var_jast_core_a1 -| D_var_jast_core_b1 -| D_var_jast_een_e_a -| D_var_jast_een_e_b -| D_var_jast_een_n -| D_var_jast_pen -| Density1d -| Dipole -| Drift_mod -| E_kin -| E_loc -| E_loc_one -| E_loc_per_electron -| E_loc_split_core -| E_loc_two -| E_nucl -| E_pot -| E_pot_one -| N_s_inverted -| N_s_updated -| N_s_updates -| Voronoi_charges -| Voronoi_charges_covariance -| Voronoi_dipoles -| Wf_extension -| D_var_jast_a_up_dn_qmcvar -| D_var_jast_a_up_up_qmcvar -| D_var_jast_b_up_dn_qmcvar -| D_var_jast_b_up_up_qmcvar -| D_var_jast_core_a1_qmcvar -| D_var_jast_core_b1_qmcvar -| D_var_jast_een_e_a_qmcvar -| D_var_jast_een_e_b_qmcvar -| D_var_jast_een_n_qmcvar -| D_var_jast_pen_qmcvar -| Density1d_qmcvar -| Dipole_qmcvar -| Drift_mod_qmcvar -| E_kin_qmcvar -| E_loc_qmcvar -| E_loc_one_qmcvar -| E_loc_per_electron_qmcvar -| E_loc_split_core_qmcvar -| E_loc_two_qmcvar -| E_nucl_qmcvar -| E_pot_qmcvar -| E_pot_one_qmcvar -| N_s_inverted_qmcvar -| N_s_updated_qmcvar -| N_s_updates_qmcvar -| Voronoi_charges_qmcvar -| Voronoi_charges_covariance_qmcvar -| Voronoi_dipoles_qmcvar -| Wf_extension_qmcvar -;; - -let calc = function -| Cpu -| Wall -| Accep -> true -| D_var_jast_a_up_dn -| D_var_jast_a_up_dn_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_a_up_dn ()) then - Ezfio.get_properties_d_var_jast_a_up_dn () - else - false - end - -| D_var_jast_a_up_up -| D_var_jast_a_up_up_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_a_up_up ()) then - Ezfio.get_properties_d_var_jast_a_up_up () - else - false - end - -| D_var_jast_b_up_dn -| D_var_jast_b_up_dn_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_b_up_dn ()) then - Ezfio.get_properties_d_var_jast_b_up_dn () - else - false - end - -| D_var_jast_b_up_up -| D_var_jast_b_up_up_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_b_up_up ()) then - Ezfio.get_properties_d_var_jast_b_up_up () - else - false - end - -| D_var_jast_core_a1 -| D_var_jast_core_a1_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_core_a1 ()) then - Ezfio.get_properties_d_var_jast_core_a1 () - else - false - end - -| D_var_jast_core_b1 -| D_var_jast_core_b1_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_core_b1 ()) then - Ezfio.get_properties_d_var_jast_core_b1 () - else - false - end - -| D_var_jast_een_e_a -| D_var_jast_een_e_a_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_een_e_a ()) then - Ezfio.get_properties_d_var_jast_een_e_a () - else - false - end - -| D_var_jast_een_e_b -| D_var_jast_een_e_b_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_een_e_b ()) then - Ezfio.get_properties_d_var_jast_een_e_b () - else - false - end - -| D_var_jast_een_n -| D_var_jast_een_n_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_een_n ()) then - Ezfio.get_properties_d_var_jast_een_n () - else - false - end - -| D_var_jast_pen -| D_var_jast_pen_qmcvar -> - begin - if (Ezfio.has_properties_d_var_jast_pen ()) then - Ezfio.get_properties_d_var_jast_pen () - else - false - end - -| Density1d -| Density1d_qmcvar -> - begin - if (Ezfio.has_properties_density1d ()) then - Ezfio.get_properties_density1d () - else - false - end - -| Dipole -| Dipole_qmcvar -> - begin - if (Ezfio.has_properties_dipole ()) then - Ezfio.get_properties_dipole () - else - false - end - -| Drift_mod -| Drift_mod_qmcvar -> - begin - if (Ezfio.has_properties_drift_mod ()) then - Ezfio.get_properties_drift_mod () - else - false - end - -| E_kin -| E_kin_qmcvar -> - begin - if (Ezfio.has_properties_e_kin ()) then - Ezfio.get_properties_e_kin () - else - false - end - -| E_loc -| E_loc_qmcvar -> - begin - if (Ezfio.has_properties_e_loc ()) then - Ezfio.get_properties_e_loc () - else - true - end - -| E_loc_one -| E_loc_one_qmcvar -> - begin - if (Ezfio.has_properties_e_loc_one ()) then - Ezfio.get_properties_e_loc_one () - else - false - end - -| E_loc_per_electron -| E_loc_per_electron_qmcvar -> - begin - if (Ezfio.has_properties_e_loc_per_electron ()) then - Ezfio.get_properties_e_loc_per_electron () - else - false - end - -| E_loc_split_core -| E_loc_split_core_qmcvar -> - begin - if (Ezfio.has_properties_e_loc_split_core ()) then - Ezfio.get_properties_e_loc_split_core () - else - false - end - -| E_loc_two -| E_loc_two_qmcvar -> - begin - if (Ezfio.has_properties_e_loc_two ()) then - Ezfio.get_properties_e_loc_two () - else - false - end - -| E_nucl -| E_nucl_qmcvar -> - begin - if (Ezfio.has_properties_e_nucl ()) then - Ezfio.get_properties_e_nucl () - else - false - end - -| E_pot -| E_pot_qmcvar -> - begin - if (Ezfio.has_properties_e_pot ()) then - Ezfio.get_properties_e_pot () - else - false - end - -| E_pot_one -| E_pot_one_qmcvar -> - begin - if (Ezfio.has_properties_e_pot_one ()) then - Ezfio.get_properties_e_pot_one () - else - false - end - -| N_s_inverted -| N_s_inverted_qmcvar -> - begin - if (Ezfio.has_properties_n_s_inverted ()) then - Ezfio.get_properties_n_s_inverted () - else - false - end - -| N_s_updated -| N_s_updated_qmcvar -> - begin - if (Ezfio.has_properties_n_s_updated ()) then - Ezfio.get_properties_n_s_updated () - else - false - end - -| N_s_updates -| N_s_updates_qmcvar -> - begin - if (Ezfio.has_properties_n_s_updates ()) then - Ezfio.get_properties_n_s_updates () - else - false - end - -| Voronoi_charges -| Voronoi_charges_qmcvar -> - begin - if (Ezfio.has_properties_voronoi_charges ()) then - Ezfio.get_properties_voronoi_charges () - else - false - end - -| Voronoi_charges_covariance -| Voronoi_charges_covariance_qmcvar -> - begin - if (Ezfio.has_properties_voronoi_charges_covariance ()) then - Ezfio.get_properties_voronoi_charges_covariance () - else - false - end - -| Voronoi_dipoles -| Voronoi_dipoles_qmcvar -> - begin - if (Ezfio.has_properties_voronoi_dipoles ()) then - Ezfio.get_properties_voronoi_dipoles () - else - false - end - -| Wf_extension -| Wf_extension_qmcvar -> - begin - if (Ezfio.has_properties_wf_extension ()) then - Ezfio.get_properties_wf_extension () - else - false - end - -;; - -let u _ = ();; - -let set_calc = function -| Cpu -| Wall -| Accep -> u -| D_var_jast_a_up_dn -| D_var_jast_a_up_dn_qmcvar -> - Ezfio.set_properties_d_var_jast_a_up_dn - -| D_var_jast_a_up_up -| D_var_jast_a_up_up_qmcvar -> - Ezfio.set_properties_d_var_jast_a_up_up - -| D_var_jast_b_up_dn -| D_var_jast_b_up_dn_qmcvar -> - Ezfio.set_properties_d_var_jast_b_up_dn - -| D_var_jast_b_up_up -| D_var_jast_b_up_up_qmcvar -> - Ezfio.set_properties_d_var_jast_b_up_up - -| D_var_jast_core_a1 -| D_var_jast_core_a1_qmcvar -> - Ezfio.set_properties_d_var_jast_core_a1 - -| D_var_jast_core_b1 -| D_var_jast_core_b1_qmcvar -> - Ezfio.set_properties_d_var_jast_core_b1 - -| D_var_jast_een_e_a -| D_var_jast_een_e_a_qmcvar -> - Ezfio.set_properties_d_var_jast_een_e_a - -| D_var_jast_een_e_b -| D_var_jast_een_e_b_qmcvar -> - Ezfio.set_properties_d_var_jast_een_e_b - -| D_var_jast_een_n -| D_var_jast_een_n_qmcvar -> - Ezfio.set_properties_d_var_jast_een_n - -| D_var_jast_pen -| D_var_jast_pen_qmcvar -> - Ezfio.set_properties_d_var_jast_pen - -| Density1d -| Density1d_qmcvar -> - Ezfio.set_properties_density1d - -| Dipole -| Dipole_qmcvar -> - Ezfio.set_properties_dipole - -| Drift_mod -| Drift_mod_qmcvar -> - Ezfio.set_properties_drift_mod - -| E_kin -| E_kin_qmcvar -> - Ezfio.set_properties_e_kin - -| E_loc -| E_loc_qmcvar -> - Ezfio.set_properties_e_loc - -| E_loc_one -| E_loc_one_qmcvar -> - Ezfio.set_properties_e_loc_one - -| E_loc_per_electron -| E_loc_per_electron_qmcvar -> - Ezfio.set_properties_e_loc_per_electron - -| E_loc_split_core -| E_loc_split_core_qmcvar -> - Ezfio.set_properties_e_loc_split_core - -| E_loc_two -| E_loc_two_qmcvar -> - Ezfio.set_properties_e_loc_two - -| E_nucl -| E_nucl_qmcvar -> - Ezfio.set_properties_e_nucl - -| E_pot -| E_pot_qmcvar -> - Ezfio.set_properties_e_pot - -| E_pot_one -| E_pot_one_qmcvar -> - Ezfio.set_properties_e_pot_one - -| N_s_inverted -| N_s_inverted_qmcvar -> - Ezfio.set_properties_n_s_inverted - -| N_s_updated -| N_s_updated_qmcvar -> - Ezfio.set_properties_n_s_updated - -| N_s_updates -| N_s_updates_qmcvar -> - Ezfio.set_properties_n_s_updates - -| Voronoi_charges -| Voronoi_charges_qmcvar -> - Ezfio.set_properties_voronoi_charges - -| Voronoi_charges_covariance -| Voronoi_charges_covariance_qmcvar -> - Ezfio.set_properties_voronoi_charges_covariance - -| Voronoi_dipoles -| Voronoi_dipoles_qmcvar -> - Ezfio.set_properties_voronoi_dipoles - -| Wf_extension -| Wf_extension_qmcvar -> - Ezfio.set_properties_wf_extension - -;; - -let of_string s = - match (String.lowercase s) with - | "cpu" -> Cpu - | "wall" -> Wall - | "accep" -> Accep - | "d_var_jast_a_up_dn" -> D_var_jast_a_up_dn - | "d_var_jast_a_up_up" -> D_var_jast_a_up_up - | "d_var_jast_b_up_dn" -> D_var_jast_b_up_dn - | "d_var_jast_b_up_up" -> D_var_jast_b_up_up - | "d_var_jast_core_a1" -> D_var_jast_core_a1 - | "d_var_jast_core_b1" -> D_var_jast_core_b1 - | "d_var_jast_een_e_a" -> D_var_jast_een_e_a - | "d_var_jast_een_e_b" -> D_var_jast_een_e_b - | "d_var_jast_een_n" -> D_var_jast_een_n - | "d_var_jast_pen" -> D_var_jast_pen - | "density1d" -> Density1d - | "dipole" -> Dipole - | "drift_mod" -> Drift_mod - | "e_kin" -> E_kin - | "e_loc" -> E_loc - | "e_loc_one" -> E_loc_one - | "e_loc_per_electron" -> E_loc_per_electron - | "e_loc_split_core" -> E_loc_split_core - | "e_loc_two" -> E_loc_two - | "e_nucl" -> E_nucl - | "e_pot" -> E_pot - | "e_pot_one" -> E_pot_one - | "n_s_inverted" -> N_s_inverted - | "n_s_updated" -> N_s_updated - | "n_s_updates" -> N_s_updates - | "voronoi_charges" -> Voronoi_charges - | "voronoi_charges_covariance" -> Voronoi_charges_covariance - | "voronoi_dipoles" -> Voronoi_dipoles - | "wf_extension" -> Wf_extension - | "d_var_jast_a_up_dn_qmcvar" -> D_var_jast_a_up_dn_qmcvar - | "d_var_jast_a_up_up_qmcvar" -> D_var_jast_a_up_up_qmcvar - | "d_var_jast_b_up_dn_qmcvar" -> D_var_jast_b_up_dn_qmcvar - | "d_var_jast_b_up_up_qmcvar" -> D_var_jast_b_up_up_qmcvar - | "d_var_jast_core_a1_qmcvar" -> D_var_jast_core_a1_qmcvar - | "d_var_jast_core_b1_qmcvar" -> D_var_jast_core_b1_qmcvar - | "d_var_jast_een_e_a_qmcvar" -> D_var_jast_een_e_a_qmcvar - | "d_var_jast_een_e_b_qmcvar" -> D_var_jast_een_e_b_qmcvar - | "d_var_jast_een_n_qmcvar" -> D_var_jast_een_n_qmcvar - | "d_var_jast_pen_qmcvar" -> D_var_jast_pen_qmcvar - | "density1d_qmcvar" -> Density1d_qmcvar - | "dipole_qmcvar" -> Dipole_qmcvar - | "drift_mod_qmcvar" -> Drift_mod_qmcvar - | "e_kin_qmcvar" -> E_kin_qmcvar - | "e_loc_qmcvar" -> E_loc_qmcvar - | "e_loc_one_qmcvar" -> E_loc_one_qmcvar - | "e_loc_per_electron_qmcvar" -> E_loc_per_electron_qmcvar - | "e_loc_split_core_qmcvar" -> E_loc_split_core_qmcvar - | "e_loc_two_qmcvar" -> E_loc_two_qmcvar - | "e_nucl_qmcvar" -> E_nucl_qmcvar - | "e_pot_qmcvar" -> E_pot_qmcvar - | "e_pot_one_qmcvar" -> E_pot_one_qmcvar - | "n_s_inverted_qmcvar" -> N_s_inverted_qmcvar - | "n_s_updated_qmcvar" -> N_s_updated_qmcvar - | "n_s_updates_qmcvar" -> N_s_updates_qmcvar - | "voronoi_charges_qmcvar" -> Voronoi_charges_qmcvar - | "voronoi_charges_covariance_qmcvar" -> Voronoi_charges_covariance_qmcvar - | "voronoi_dipoles_qmcvar" -> Voronoi_dipoles_qmcvar - | "wf_extension_qmcvar" -> Wf_extension_qmcvar - | p -> failwith ("unknown property "^p) ;; - - -let to_string = function -| Cpu -> "Cpu" -| Wall -> "Wall" -| Accep -> "Accep" -| D_var_jast_a_up_dn -> "D_var_jast_a_up_dn" -| D_var_jast_a_up_up -> "D_var_jast_a_up_up" -| D_var_jast_b_up_dn -> "D_var_jast_b_up_dn" -| D_var_jast_b_up_up -> "D_var_jast_b_up_up" -| D_var_jast_core_a1 -> "D_var_jast_core_a1" -| D_var_jast_core_b1 -> "D_var_jast_core_b1" -| D_var_jast_een_e_a -> "D_var_jast_een_e_a" -| D_var_jast_een_e_b -> "D_var_jast_een_e_b" -| D_var_jast_een_n -> "D_var_jast_een_n" -| D_var_jast_pen -> "D_var_jast_pen" -| Density1d -> "Density1d" -| Dipole -> "Dipole" -| Drift_mod -> "Drift_mod" -| E_kin -> "E_kin" -| E_loc -> "E_loc" -| E_loc_one -> "E_loc_one" -| E_loc_per_electron -> "E_loc_per_electron" -| E_loc_split_core -> "E_loc_split_core" -| E_loc_two -> "E_loc_two" -| E_nucl -> "E_nucl" -| E_pot -> "E_pot" -| E_pot_one -> "E_pot_one" -| N_s_inverted -> "N_s_inverted" -| N_s_updated -> "N_s_updated" -| N_s_updates -> "N_s_updates" -| Voronoi_charges -> "Voronoi_charges" -| Voronoi_charges_covariance -> "Voronoi_charges_covariance" -| Voronoi_dipoles -> "Voronoi_dipoles" -| Wf_extension -> "Wf_extension" -| D_var_jast_a_up_dn_qmcvar -> "D_var_jast_a_up_dn_qmcvar" -| D_var_jast_a_up_up_qmcvar -> "D_var_jast_a_up_up_qmcvar" -| D_var_jast_b_up_dn_qmcvar -> "D_var_jast_b_up_dn_qmcvar" -| D_var_jast_b_up_up_qmcvar -> "D_var_jast_b_up_up_qmcvar" -| D_var_jast_core_a1_qmcvar -> "D_var_jast_core_a1_qmcvar" -| D_var_jast_core_b1_qmcvar -> "D_var_jast_core_b1_qmcvar" -| D_var_jast_een_e_a_qmcvar -> "D_var_jast_een_e_a_qmcvar" -| D_var_jast_een_e_b_qmcvar -> "D_var_jast_een_e_b_qmcvar" -| D_var_jast_een_n_qmcvar -> "D_var_jast_een_n_qmcvar" -| D_var_jast_pen_qmcvar -> "D_var_jast_pen_qmcvar" -| Density1d_qmcvar -> "Density1d_qmcvar" -| Dipole_qmcvar -> "Dipole_qmcvar" -| Drift_mod_qmcvar -> "Drift_mod_qmcvar" -| E_kin_qmcvar -> "E_kin_qmcvar" -| E_loc_qmcvar -> "E_loc_qmcvar" -| E_loc_one_qmcvar -> "E_loc_one_qmcvar" -| E_loc_per_electron_qmcvar -> "E_loc_per_electron_qmcvar" -| E_loc_split_core_qmcvar -> "E_loc_split_core_qmcvar" -| E_loc_two_qmcvar -> "E_loc_two_qmcvar" -| E_nucl_qmcvar -> "E_nucl_qmcvar" -| E_pot_qmcvar -> "E_pot_qmcvar" -| E_pot_one_qmcvar -> "E_pot_one_qmcvar" -| N_s_inverted_qmcvar -> "N_s_inverted_qmcvar" -| N_s_updated_qmcvar -> "N_s_updated_qmcvar" -| N_s_updates_qmcvar -> "N_s_updates_qmcvar" -| Voronoi_charges_qmcvar -> "Voronoi_charges_qmcvar" -| Voronoi_charges_covariance_qmcvar -> "Voronoi_charges_covariance_qmcvar" -| Voronoi_dipoles_qmcvar -> "Voronoi_dipoles_qmcvar" -| Wf_extension_qmcvar -> "Wf_extension_qmcvar" -;; - - -let is_scalar = function -| Cpu -> true -| Wall -> true -| Accep -> true -| D_var_jast_a_up_dn | D_var_jast_a_up_dn_qmcvar -> false -| D_var_jast_a_up_up | D_var_jast_a_up_up_qmcvar -> false -| D_var_jast_b_up_dn | D_var_jast_b_up_dn_qmcvar -> false -| D_var_jast_b_up_up | D_var_jast_b_up_up_qmcvar -> false -| D_var_jast_core_a1 | D_var_jast_core_a1_qmcvar -> false -| D_var_jast_core_b1 | D_var_jast_core_b1_qmcvar -> false -| D_var_jast_een_e_a | D_var_jast_een_e_a_qmcvar -> false -| D_var_jast_een_e_b | D_var_jast_een_e_b_qmcvar -> false -| D_var_jast_een_n | D_var_jast_een_n_qmcvar -> false -| D_var_jast_pen | D_var_jast_pen_qmcvar -> false -| Density1d | Density1d_qmcvar -> false -| Dipole | Dipole_qmcvar -> false -| Drift_mod | Drift_mod_qmcvar -> false -| E_kin | E_kin_qmcvar -> true -| E_loc | E_loc_qmcvar -> true -| E_loc_one | E_loc_one_qmcvar -> true -| E_loc_per_electron | E_loc_per_electron_qmcvar -> false -| E_loc_split_core | E_loc_split_core_qmcvar -> false -| E_loc_two | E_loc_two_qmcvar -> true -| E_nucl | E_nucl_qmcvar -> true -| E_pot | E_pot_qmcvar -> true -| E_pot_one | E_pot_one_qmcvar -> true -| N_s_inverted | N_s_inverted_qmcvar -> true -| N_s_updated | N_s_updated_qmcvar -> true -| N_s_updates | N_s_updates_qmcvar -> true -| Voronoi_charges | Voronoi_charges_qmcvar -> false -| Voronoi_charges_covariance | Voronoi_charges_covariance_qmcvar -> false -| Voronoi_dipoles | Voronoi_dipoles_qmcvar -> false -| Wf_extension | Wf_extension_qmcvar -> true -;; - - -let all = [ Cpu ; Wall ; Accep ; - D_var_jast_a_up_dn ; D_var_jast_a_up_up ; D_var_jast_b_up_dn ; D_var_jast_b_up_up ; D_var_jast_core_a1 ; D_var_jast_core_b1 ; D_var_jast_een_e_a ; D_var_jast_een_e_b ; D_var_jast_een_n ; D_var_jast_pen ; Density1d ; Dipole ; Drift_mod ; E_kin ; E_loc ; E_loc_one ; E_loc_per_electron ; E_loc_split_core ; E_loc_two ; E_nucl ; E_pot ; E_pot_one ; N_s_inverted ; N_s_updated ; N_s_updates ; Voronoi_charges ; Voronoi_charges_covariance ; Voronoi_dipoles ; Wf_extension ; ];; diff --git a/scripts/compile_ocaml.sh b/scripts/compile_ocaml.sh index f7db780..a28ce68 100755 --- a/scripts/compile_ocaml.sh +++ b/scripts/compile_ocaml.sh @@ -8,6 +8,4 @@ fi cd ${QMCCHEM_PATH}/ocaml || exit -1 -cp ${QMCCHEM_PATH}/EZFIO/Ocaml/ezfio.ml . || exit -1 - exec ninja -f generated.ninja ${@} diff --git a/scripts/compile_ocaml_dep.sh b/scripts/compile_ocaml_dep.sh index 5df2b1e..cafbefc 100755 --- a/scripts/compile_ocaml_dep.sh +++ b/scripts/compile_ocaml_dep.sh @@ -8,6 +8,8 @@ fi cd ${QMCCHEM_PATH}/ocaml || exit -1 +cp ${QMCCHEM_PATH}/EZFIO/Ocaml/ezfio.ml . || exit -1 + LSMD5_FILE=${QMCCHEM_PATH}/ocaml/.ls_md5 FILES="*.ml *.mli" MD5=$(ls -ltr --full-time ${FILES} 2>/dev/null | md5sum | cut -d ' ' -f 1) diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..c778c32 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,8 @@ +IRPF90_temp/ +IRPF90_man/ +irpf90.make +irpf90_entities +tags +.ls_md5 +Makefile +properties.pyc diff --git a/src/ZMQ/utils.irp.f b/src/ZMQ/utils.irp.f index 63e4c2f..7eb9ffa 100644 --- a/src/ZMQ/utils.irp.f +++ b/src/ZMQ/utils.irp.f @@ -19,7 +19,9 @@ subroutine get_elec_coord_full(elec_coord_full_out,lda) integer(ZMQ_PTR) :: msg character*(32) :: buffer integer :: sze + integer :: block_time_int + block_time_int = int(block_time) msg = f77_zmq_msg_new() sze = 0 do k=1,walk_num @@ -27,17 +29,18 @@ subroutine get_elec_coord_full(elec_coord_full_out,lda) do i=1,elec_num+1 rc = f77_zmq_msg_init(msg) rc = -1 - do l=1,2*block_time + do l=1,2*block_time_int rc = f77_zmq_msg_recv(msg,zmq_to_dataserver_socket,ZMQ_NOBLOCK) if (rc > 0) then exit endif - if (l==2*block_time) then - call abrt(irp_here, 'Unable to get walkers') - endif call sleep(1) enddo + if (l>=2*block_time_int) then + call abrt(irp_here, 'Unable to get walkers') + endif sze += rc + buffer = '' rc = f77_zmq_msg_copy_from_data(msg, buffer) rc = f77_zmq_msg_close(msg) buffer = trim(adjustl(buffer)) diff --git a/src/ZMQ/zmq_ezfio.irp.f b/src/ZMQ/zmq_ezfio.irp.f index e239ea8..91599b2 100644 --- a/src/ZMQ/zmq_ezfio.irp.f +++ b/src/ZMQ/zmq_ezfio.irp.f @@ -50,7 +50,7 @@ subroutine zmq_ezfio_get_logical(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char integer :: rc @@ -61,11 +61,27 @@ subroutine zmq_ezfio_get_logical(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_logical2(buffer,buffer_size,w,d) + deallocate(buffer) +end + +subroutine zmq_ezfio_get_logical2(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a logical variable in EZFIO using ZMQ + END_DOC + + integer, intent(in) :: d + logical, intent(out) :: w(d) + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) read( buffer(1:rc), *) w(1:d) - deallocate(buffer) end @@ -82,7 +98,7 @@ subroutine zmq_ezfio_get_double_precision(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char integer :: rc @@ -93,14 +109,28 @@ subroutine zmq_ezfio_get_double_precision(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) - - rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) - read( buffer(1:rc), *) w(1:d) - + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_double_precision2(buffer,buffer_size,w,d) deallocate(buffer) end +subroutine zmq_ezfio_get_double_precision2(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a double precision variable in EZFIO using ZMQ + END_DOC + + integer, intent(in) :: d + double precision, intent(out) :: w(d) + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc + + rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) + read( buffer(1:rc), *) w(1:d) +end subroutine zmq_ezfio_get_integer(cmd_in,w,d) implicit none @@ -114,7 +144,7 @@ subroutine zmq_ezfio_get_integer(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char integer :: rc @@ -125,14 +155,28 @@ subroutine zmq_ezfio_get_integer(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) - - rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) - read( buffer(1:rc), *) w(1:d) - + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_integer2(buffer,buffer_size,w,d) deallocate(buffer) end +subroutine zmq_ezfio_get_integer2(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a integer variable in EZFIO using ZMQ + END_DOC + + integer, intent(in) :: d + integer, intent(out) :: w(d) + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc + + rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) + read( buffer(1:rc), *) w(1:d) +end subroutine zmq_ezfio_get_integer8(cmd_in,w,d) implicit none @@ -146,7 +190,7 @@ subroutine zmq_ezfio_get_integer8(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char integer :: rc @@ -157,12 +201,27 @@ subroutine zmq_ezfio_get_integer8(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_integer82(buffer,buffer_size,w,d) + deallocate(buffer) +end + +subroutine zmq_ezfio_get_integer82(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a integer variable in EZFIO using ZMQ + END_DOC + integer, intent(in) :: d + integer*8, intent(out) :: w(d) + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc + rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) read( buffer(1:rc), *) w(1:d) - - deallocate(buffer) end @@ -180,7 +239,7 @@ subroutine zmq_ezfio_get_real(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char @@ -190,14 +249,30 @@ subroutine zmq_ezfio_get_real(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) - - rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) - read( buffer(1:rc), *) w(1:d) - + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_real2(buffer,buffer_size,w,d) deallocate(buffer) end +subroutine zmq_ezfio_get_real2(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a real variable in EZFIO using ZMQ + END_DOC + + integer, intent(in) :: d + real, intent(out) :: w(d) + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc + + rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) + read( buffer(1:rc), *) w(1:d) +end + + subroutine zmq_ezfio_get_character(cmd_in,w,d) implicit none @@ -213,7 +288,7 @@ subroutine zmq_ezfio_get_character(cmd_in,w,d) character*(*) :: cmd_in character*(128) :: cmd - character(len=:), allocatable :: buffer + character(len=1), allocatable :: buffer(:) integer :: buffer_size character*(20) :: buffer_size_char @@ -223,12 +298,29 @@ subroutine zmq_ezfio_get_character(cmd_in,w,d) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer_size_char, len(buffer_size_char), ZMQ_SNDMORE) read(buffer_size_char(1:rc),*) buffer_size - allocate (character(len=buffer_size) :: buffer) - - rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) - read( buffer(1:rc), '(A)') w - + allocate (buffer(buffer_size+1)) + buffer = ' ' + call zmq_ezfio_get_character2(buffer,buffer_size,w,d) deallocate(buffer) end +subroutine zmq_ezfio_get_character2(buffer,buffer_size,w,d) + implicit none + use f77_zmq + BEGIN_DOC +! Fetch a character variable in EZFIO using ZMQ + END_DOC + + integer, intent(in) :: d + character*(*), intent(out) :: w + integer, intent(in) :: buffer_size + character(len=buffer_size), intent(inout) :: buffer + integer :: rc + + rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, buffer_size, 0) + w = buffer(1:buffer_size) +end + + + diff --git a/src/types.F b/src/types.F index cc4ba67..936f4b2 100644 --- a/src/types.F +++ b/src/types.F @@ -16,19 +16,19 @@ integer, parameter :: t_Stopping = 3 character*(32) :: types(15) = & - (/ '', & - '', & - 'Brownian', & - 'Langevin', & - '', & - '', & - 'VMC ', & - 'DMC ', & - ' ', & - '', & - 'Simple ', & - 'None ', & - ' ', & - 'Core ', & - ' '/) + (/ ' ', & + ' ', & + 'Brownian ', & + 'Langevin ', & + ' ', & + ' ', & + 'VMC ', & + 'DMC ', & + ' ', & + ' ', & + 'Simple ', & + 'None ', & + ' ', & + 'Core ', & + ' '/) diff --git a/src/wf.irp.f b/src/wf.irp.f index b973e9a..cee557b 100644 --- a/src/wf.irp.f +++ b/src/wf.irp.f @@ -217,7 +217,7 @@ BEGIN_PROVIDER [ double precision, ci_threshold ] END_DOC ci_threshold = 0.d0 call get_simulation_ci_threshold(ci_threshold) - call rinfo(irp_here,'ci_threshold',ci_threshold) + call dinfo(irp_here,'ci_threshold',ci_threshold) END_PROVIDER