10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-06-30 00:44:37 +02:00

Merge branch 'dev-lct' of https://github.com/QuantumPackage/qp2 into dev-lct

This commit is contained in:
Emmanuel Giner LCT 2019-08-30 16:31:17 +02:00
commit 879a83f1f7
21 changed files with 189 additions and 100 deletions

View File

@ -2,20 +2,23 @@ GitHub Branches
=============== ===============
master: master:
The current up-to-date working branch, that users download It should The current up-to-date working branch, that users download. It should
only contain the latest release and bug fixes. only contain the latest stable release and bug fixes.
develop-lcpq: dev:
Toulouse development branch
develop-lct:
Paris development branch
develop:
It is a fork of the *master* branch with new developments that will be It is a fork of the *master* branch with new developments that will be
merged in the *master* branch for the next release. Other development merged in the *master* branch for the next release. Other development
branches should be merged on this one. branches should be merged on this one.
bugfix:
A fork of the *master* on which the bug fixes are made.
dev-lcpq:
Toulouse development branch
dev-lct:
Paris development branch
gh-pages: gh-pages:
This is an independent branch, containing only the web site of QP2. This is an independent branch, containing only the web site of QP2.

View File

@ -328,7 +328,7 @@ OCaml
echo ${QP_ROOT}/bin echo ${QP_ROOT}/bin
${QP_ROOT}/external/opam_installer.sh --no-backup --fresh ${QP_ROOT}/external/opam_installer.sh --no-backup --fresh
You the :command:`opam` command can be installed in the :file:`${QP_ROOT}/bin` The :command:`opam` command can be installed in the :file:`${QP_ROOT}/bin`
directory. To do this, take the output of ``echo ${QP_ROOT}/bin`` and directory. To do this, take the output of ``echo ${QP_ROOT}/bin`` and
use it as an answer to where :command:`opam` should be installed. use it as an answer to where :command:`opam` should be installed.
@ -337,7 +337,14 @@ OCaml
.. code:: bash .. code:: bash
opam init --disable-sandboxing --comp=4.07.0 opam init --comp=4.07.1
eval `${QP_ROOT}/bin/opam env`
If the installation fails because of bwrap, you can initialize opam using:
.. code:: bash
opam init --disable-sandboxing --comp=4.07.1
eval `${QP_ROOT}/bin/opam env` eval `${QP_ROOT}/bin/opam env`
* Install the required external OCaml libraries * Install the required external OCaml libraries

View File

@ -5,7 +5,7 @@
[*Quantum package 2.0: an open-source determinant-driven suite of programs*](https://pubs.acs.org/doi/10.1021/acs.jctc.9b00176)\ [*Quantum package 2.0: an open-source determinant-driven suite of programs*](https://pubs.acs.org/doi/10.1021/acs.jctc.9b00176)\
Y. Garniron, K. Gasperich, T. Applencourt, A. Benali, A. Ferté, J. Paquier, B. Pradines, R. Assaraf, P. Reinhardt, J. Toulouse, P. Barbaresco, N. Renon, G. David, J. P. Malrieu, M. Véril, M. Caffarel, P. F. Loos, E. Giner and A. Scemama\ Y. Garniron, K. Gasperich, T. Applencourt, A. Benali, A. Ferté, J. Paquier, B. Pradines, R. Assaraf, P. Reinhardt, J. Toulouse, P. Barbaresco, N. Renon, G. David, J. P. Malrieu, M. Véril, M. Caffarel, P. F. Loos, E. Giner and A. Scemama\
J. Chem. Theory Comput., 15:6, 3591--3609, (2019)\ [J. Chem. Theory Comput. 2019, 15, 6, 3591-3609](https://doi.org/10.1021/acs.jctc.9b00176)\
https://arxiv.org/abs/1902.08154 https://arxiv.org/abs/1902.08154
``` ```

View File

@ -834,3 +834,4 @@ qp_name potential_sr_c_alpha_ao_pbe --rename=potential_c_alpha_ao_sr_pbe
qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe qp_name potential_sr_c_beta_ao_pbe --rename=potential_c_beta_ao_sr_pbe
qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe qp_name potential_sr_xc_alpha_ao_pbe --rename=potential_xc_alpha_ao_sr_pbe
qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe qp_name potential_sr_xc_beta_ao_pbe --rename=potential_xc_beta_ao_sr_pbe
qp_name disk_access_nuclear_repulsion --rename=io_nuclear_repulsion

View File

@ -35,7 +35,7 @@ OPENMP : 1 ; Append OpenMP flags
# -ffast-math and the Fortran-specific # -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays. # -fno-protect-parens and -fstack-arrays.
[OPT] [OPT]
FCFLAGS : -Ofast -march=native FCFLAGS : -Ofast -msse4.2
# Profiling flags # Profiling flags
################# #################

39
configure vendored
View File

@ -292,6 +292,9 @@ EOF
# Special commands for Travis CI # Special commands for Travis CI
chmod +x "${QP_ROOT}"/external/opam_installer.sh chmod +x "${QP_ROOT}"/external/opam_installer.sh
rm --force ${QP_ROOT}/bin/opam rm --force ${QP_ROOT}/bin/opam
if [[ -n ${NO_CACHE} ]] ; then
rm -rf ${HOME}/.opam
fi
export OPAMROOT=${HOME}/.opam export OPAMROOT=${HOME}/.opam
cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup
${QP_ROOT}/bin ${QP_ROOT}/bin
@ -301,25 +304,33 @@ ${QP_ROOT}/bin
EOF EOF
rm ${QP_ROOT}/external/opam_installer.sh rm ${QP_ROOT}/external/opam_installer.sh
source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true # source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
#
# opam switch create ocaml-base-compiler.4.07.1
opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing
${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing eval $(opam env)
eval $(${QP_ROOT}/bin/opam env)
opam install -y ${OCAML_PACKAGES} || exit 1 opam install -y ${OCAML_PACKAGES} || exit 1
else else
# Conventional commands # Conventional commands
execute << EOF execute << EOF
chmod +x "\${QP_ROOT}"/external/opam_installer.sh chmod +x "${QP_ROOT}"/external/opam_installer.sh
"\${QP_ROOT}"/external/opam_installer.sh --no-backup "${QP_ROOT}"/external/opam_installer.sh --no-backup
rm --force \${QP_ROOT}/bin/opam EOF
export OPAMROOT=\${OPAMROOT:-\${QP_ROOT}/external/opam} execute << EOF
echo \${QP_ROOT}/bin \ rm --force ${QP_ROOT}/bin/opam
| sh \${QP_ROOT}/external/opam_installer.sh export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam}
rm \${QP_ROOT}/external/opam_installer.sh echo ${QP_ROOT}/bin \
source \${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true | sh ${QP_ROOT}/external/opam_installer.sh
\${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing EOF
eval \$(\${QP_ROOT}/bin/opam env) rm ${QP_ROOT}/external/opam_installer.sh
# source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true
# opam switch create ocaml-base-compiler.4.07.1 || exit 1
opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing
eval $(opam env)
execute << EOF
opam install -y \${OCAML_PACKAGES} || exit 1 opam install -y \${OCAML_PACKAGES} || exit 1
EOF EOF
fi fi

View File

@ -1,22 +1,36 @@
%%% ARXIV TO BE UPDATED %%% %%% ARXIV TO BE UPDATED %%%
@article{Dash2019May, @article{Giner2019Jul,
author = {Dash, Monika and Feldt, Jonas and Moroni, Saverio and Scemama, Anthony and Filippi, Claudia}, author = {Giner, Emmanuel and Scemama, Anthony and Toulouse, Julien and Loos, Pierre-Fran{\c{c}}ois},
title = {{Excited states with selected CI-QMC: chemically accurate excitation energies and geometries}}, title = {{Chemically Accurate Excitation Energies With Small Basis Sets}},
journal = {arXiv}, journal = {arXiv},
year = {2019}, year = {2019},
month = {May}, month = {Jul},
eprint = {1905.06737}, eprint = {1907.01245},
url = {https://arxiv.org/abs/1905.06737} url = {https://arxiv.org/abs/1907.01245}
} }
@article{Burton2019May,
author = {Burton, Hugh G. A. and Thom, Alex J. W.}, @article{Burton_2019,
title = {{A General Approach for Multireference Ground and Excited States using Non-Orthogonal Configuration Interaction}}, doi = {10.1021/acs.jctc.9b00441},
journal = {arXiv}, url = {https://doi.org/10.1021%2Facs.jctc.9b00441},
year = {2019}, year = 2019,
month = {May}, month = {aug},
eprint = {1905.02626}, publisher = {American Chemical Society ({ACS})},
url = {https://arxiv.org/abs/1905.02626} author = {Hugh G. A. Burton and Alex J.W. Thom},
title = {A General Approach for Multireference Ground and Excited States using Non-Orthogonal Configuration Interaction},
journal = {Journal of Chemical Theory and Computation}
}
@article{Dash_2019,
doi = {10.1021/acs.jctc.9b00476},
url = {https://doi.org/10.1021%2Facs.jctc.9b00476},
year = 2019,
month = {aug},
publisher = {American Chemical Society ({ACS})},
author = {Monika Dash and Jonas Feldt and Saverio Moroni and Anthony Scemama and Claudia Filippi},
title = {Excited States with Selected Configuration Interaction-Quantum Monte Carlo: Chemically Accurate Excitation Energies and Geometries},
journal = {Journal of Chemical Theory and Computation}
} }
@ -36,6 +50,20 @@
journal = {The Journal of Chemical Physics} journal = {The Journal of Chemical Physics}
} }
@article{Caffarel_2019,
doi = {10.1063/1.5114703},
url = {https://doi.org/10.1063%2F1.5114703},
year = 2019,
month = {aug},
publisher = {{AIP} Publishing},
volume = {151},
number = {6},
pages = {064101},
author = {Michel Caffarel},
title = {Evaluating two-electron-repulsion integrals over arbitrary orbitals using zero variance Monte Carlo: Application to full configuration interaction calculations with Slater-type orbitals},
journal = {The Journal of Chemical Physics}
}
@article{Loos_2019, @article{Loos_2019,
doi = {10.1021/acs.jpclett.9b01176}, doi = {10.1021/acs.jpclett.9b01176},
url = {https://doi.org/10.1021%2Facs.jpclett.9b01176}, url = {https://doi.org/10.1021%2Facs.jpclett.9b01176},

View File

@ -3,7 +3,8 @@ open Sexplib.Std
type t = int64 array [@@deriving sexp] type t = int64 array [@@deriving sexp]
let to_int64_array (x:t) = (x:int64 array) external to_int64_array : t -> int64 array = "%identity"
external of_int64_array_no_check : int64 array -> t = "%identity"
let to_alpha_beta x = let to_alpha_beta x =
@ -61,7 +62,6 @@ let of_int64_array ~n_int ~alpha ~beta x =
end; end;
x x
let of_int64_array_no_check x = x
let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) = let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) =
let ba, bb = let ba, bb =

View File

@ -196,8 +196,9 @@ end = struct
let write_psi_coef ~n_det ~n_states c = let write_psi_coef ~n_det ~n_states c =
let n_det = Det_number.to_int n_det let n_det = Det_number.to_int n_det
and c = Array.to_list c and c =
|> List.map Det_coef.to_float Array.map Det_coef.to_float c
|> Array.to_list
and n_states = and n_states =
States_number.to_int n_states States_number.to_int n_states
in in
@ -239,12 +240,11 @@ end = struct
assert (n_int = dim.(0)); assert (n_int = dim.(0));
assert (dim.(1) = 2); assert (dim.(1) = 2);
assert (dim.(2) = (Det_number.to_int (read_n_det ()))); assert (dim.(2) = (Det_number.to_int (read_n_det ())));
List.init dim.(2) (fun i -> Array.init dim.(2) (fun i ->
Array.sub data (2*n_int*i) (2*n_int) ) Array.sub data (2*n_int*i) (2*n_int) )
|> List.map (Determinant.of_int64_array |> Array.map (Determinant.of_int64_array
~n_int:(N_int_number.of_int n_int) ~n_int:(N_int_number.of_int n_int)
~alpha:n_alpha ~beta:n_beta ) ~alpha:n_alpha ~beta:n_beta )
|> Array.of_list
;; ;;
let write_psi_det ~n_int ~n_det d = let write_psi_det ~n_int ~n_det d =
@ -363,7 +363,7 @@ Determinants ::
" "
(b.expected_s2 |> Positive_float.to_string) (b.expected_s2 |> Positive_float.to_string)
(b.n_det |> Det_number.to_string) (b.n_det |> Det_number.to_string)
(b.state_average_weight |> Array.to_list |> List.map Positive_float.to_string |> String.concat "\t") (b.state_average_weight |> Array.map Positive_float.to_string |> Array.to_list |> String.concat "\t")
det_text det_text
|> Rst_string.of_string |> Rst_string.of_string
;; ;;
@ -387,10 +387,10 @@ psi_det = %s
(b.n_states |> States_number.to_string) (b.n_states |> States_number.to_string)
(b.expected_s2 |> Positive_float.to_string) (b.expected_s2 |> Positive_float.to_string)
(b.state_average_weight |> Array.to_list |> List.map Positive_float.to_string |> String.concat ",") (b.state_average_weight |> Array.to_list |> List.map Positive_float.to_string |> String.concat ",")
(b.psi_coef |> Array.to_list |> List.map Det_coef.to_string (b.psi_coef |> Array.map Det_coef.to_string |> Array.to_list
|> String.concat ", ") |> String.concat ", ")
(b.psi_det |> Array.to_list |> List.map (Determinant.to_string (b.psi_det |> Array.map (Determinant.to_string ~mo_num) |> Array.to_list
~mo_num) |> String.concat "\n\n") |> String.concat "\n\n")
;; ;;
let of_rst r = let of_rst r =

View File

@ -6,9 +6,8 @@ All the one-electron integrals in the |AO| basis are here.
The most important providers for usual quantum-chemistry calculation are: The most important providers for usual quantum-chemistry calculation are:
* `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) * `ao_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis
* `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) * `ao_integrals_n_e` which are the nuclear-elctron operator integrals on the |AO| basis
* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) * `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis
Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`.

View File

@ -148,7 +148,7 @@ subroutine run_pt2_slave_small(thread,iproc,energy)
integer, external :: disconnect_from_taskserver integer, external :: disconnect_from_taskserver
do i=1,300 do i=1,300
if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) /= -2) exit if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) /= -2) exit
call sleep(1) call usleep(500)
print *, 'Retry disconnect...' print *, 'Retry disconnect...'
end do end do

View File

@ -73,7 +73,7 @@ subroutine run_selection_slave(thread,iproc,energy)
if(done .or. ctask == size(task_id)) then if(done .or. ctask == size(task_id)) then
do i=1, ctask do i=1, ctask
if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then
call sleep(1) call usleep(100)
if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then
ctask = 0 ctask = 0
done = .true. done = .true.
@ -84,6 +84,7 @@ subroutine run_selection_slave(thread,iproc,energy)
if(ctask > 0) then if(ctask > 0) then
call sort_selection_buffer(buf) call sort_selection_buffer(buf)
! call merge_selection_buffers(buf,buf2) ! call merge_selection_buffers(buf,buf2)
print *, task_id(1), pt2(1), buf%cur, ctask
call push_selection_results(zmq_socket_push, pt2, variance, norm, buf, task_id(1), ctask) call push_selection_results(zmq_socket_push, pt2, variance, norm, buf, task_id(1), ctask)
! buf%mini = buf2%mini ! buf%mini = buf2%mini
pt2(:) = 0d0 pt2(:) = 0d0
@ -131,23 +132,24 @@ subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_
print *, 'f77_zmq_send( zmq_socket_push, b%cur, 4, ZMQ_SNDMORE)' print *, 'f77_zmq_send( zmq_socket_push, b%cur, 4, ZMQ_SNDMORE)'
endif endif
rc = f77_zmq_send( zmq_socket_push, pt2, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, pt2, 8*N_states, ZMQ_SNDMORE)'
endif
rc = f77_zmq_send( zmq_socket_push, variance, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, variance, 8*N_states, ZMQ_SNDMORE)'
endif
rc = f77_zmq_send( zmq_socket_push, norm, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, norm, 8*N_states, ZMQ_SNDMORE)'
endif
if (b%cur > 0) then if (b%cur > 0) then
rc = f77_zmq_send( zmq_socket_push, pt2, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, pt2, 8*N_states, ZMQ_SNDMORE)'
endif
rc = f77_zmq_send( zmq_socket_push, variance, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, variance, 8*N_states, ZMQ_SNDMORE)'
endif
rc = f77_zmq_send( zmq_socket_push, norm, 8*N_states, ZMQ_SNDMORE)
if(rc /= 8*N_states) then
print *, 'f77_zmq_send( zmq_socket_push, norm, 8*N_states, ZMQ_SNDMORE)'
endif
rc = f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE) rc = f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE)
if(rc /= 8*b%cur) then if(rc /= 8*b%cur) then
print *, 'f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE)' print *, 'f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE)'
@ -202,22 +204,26 @@ subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det
print *, 'f77_zmq_recv( zmq_socket_pull, N, 4, 0)' print *, 'f77_zmq_recv( zmq_socket_pull, N, 4, 0)'
endif endif
pt2(:) = 0.d0
variance(:) = 0.d0
norm(:) = 0.d0
rc = f77_zmq_recv( zmq_socket_pull, pt2, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, pt2, N_states*8, 0)'
endif
rc = f77_zmq_recv( zmq_socket_pull, variance, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, variance, N_states*8, 0)'
endif
rc = f77_zmq_recv( zmq_socket_pull, norm, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, norm, N_states*8, 0)'
endif
if (N>0) then if (N>0) then
rc = f77_zmq_recv( zmq_socket_pull, pt2, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, pt2, N_states*8, 0)'
endif
rc = f77_zmq_recv( zmq_socket_pull, variance, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, variance, N_states*8, 0)'
endif
rc = f77_zmq_recv( zmq_socket_pull, norm, N_states*8, 0)
if(rc /= 8*N_states) then
print *, 'f77_zmq_recv( zmq_socket_pull, norm, N_states*8, 0)'
endif
rc = f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0) rc = f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0)
if(rc /= 8*N) then if(rc /= 8*N) then
print *, 'f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0)' print *, 'f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0)'
@ -227,10 +233,6 @@ subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det
if(rc /= bit_kind*N_int*2*N) then if(rc /= bit_kind*N_int*2*N) then
print *, 'f77_zmq_recv( zmq_socket_pull, det(1,1,1), bit_kind*N_int*2*N, 0)' print *, 'f77_zmq_recv( zmq_socket_pull, det(1,1,1), bit_kind*N_int*2*N, 0)'
endif endif
else
pt2(:) = 0.d0
variance(:) = 0.d0
norm(:) = 0.d0
endif endif
rc = f77_zmq_recv( zmq_socket_pull, ntask, 4, 0) rc = f77_zmq_recv( zmq_socket_pull, ntask, 4, 0)

View File

@ -63,7 +63,7 @@ subroutine run_slave_main
if (mpi_master) then if (mpi_master) then
call wait_for_states(states,zmq_state,size(states)) call wait_for_states(states,zmq_state,size(states))
if (zmq_state(1:64) == old_state(1:64)) then if (zmq_state(1:64) == old_state(1:64)) then
call sleep(1) call usleep(200)
cycle cycle
else else
old_state(1:64) = zmq_state(1:64) old_state(1:64) = zmq_state(1:64)

View File

@ -39,6 +39,8 @@ BEGIN_PROVIDER [ character*(128), ezfio_filename ]
write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj' write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj'
call system(command) call system(command)
PROVIDE file_lock
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ character*(128), ezfio_work_dir ] BEGIN_PROVIDER [ character*(128), ezfio_work_dir ]

View File

@ -43,8 +43,13 @@ subroutine run
E_CI_before(:) = psi_energy(:) + nuclear_repulsion E_CI_before(:) = psi_energy(:) + nuclear_repulsion
relative_error=PT2_relative_error relative_error=PT2_relative_error
call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & if (do_pt2) then
norm,0) ! Stochastic PT2 call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, &
norm,0) ! Stochastic PT2
else
call ZMQ_selection(0, pt2, variance, norm)
endif
do k=1,N_states do k=1,N_states
rpt2(k) = pt2(k)/(1.d0 + norm(k)) rpt2(k) = pt2(k)/(1.d0 + norm(k))
enddo enddo

View File

@ -21,7 +21,7 @@ type: double precision
size: (nuclei.nucl_num,3) size: (nuclei.nucl_num,3)
interface: ezfio interface: ezfio
[disk_access_nuclear_repulsion] [io_nuclear_repulsion]
doc: Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] doc: Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ]
type: Disk_access type: Disk_access
interface: ezfio,provider,ocaml interface: ezfio,provider,ocaml

View File

@ -143,7 +143,7 @@ BEGIN_PROVIDER [ double precision, nuclear_repulsion ]
END_DOC END_DOC
PROVIDE mpi_master nucl_coord nucl_charge nucl_num PROVIDE mpi_master nucl_coord nucl_charge nucl_num
if (disk_access_nuclear_repulsion.EQ.'Read') then if (io_nuclear_repulsion == 'Read') then
logical :: has logical :: has
if (mpi_master) then if (mpi_master) then
@ -194,7 +194,7 @@ BEGIN_PROVIDER [ double precision, nuclear_repulsion ]
call write_time(6) call write_time(6)
call write_double(6,nuclear_repulsion,'Nuclear repulsion energy') call write_double(6,nuclear_repulsion,'Nuclear repulsion energy')
if (disk_access_nuclear_repulsion.EQ.'Write') then if (io_nuclear_repulsion == 'Write') then
if (mpi_master) then if (mpi_master) then
call ezfio_set_nuclei_nuclear_repulsion(nuclear_repulsion) call ezfio_set_nuclei_nuclear_repulsion(nuclear_repulsion)
endif endif

6
src/utils/c_funcs.c Normal file
View File

@ -0,0 +1,6 @@
#include <unistd.h>
void usleep_c(int s)
{
usleep((useconds_t) s);
}

21
src/utils/c_functions.f90 Normal file
View File

@ -0,0 +1,21 @@
module c_functions
use iso_c_binding
interface
subroutine usleep_c(us) bind (C,name="usleep_c")
use iso_c_binding
integer(c_int), value :: us
end subroutine usleep_c
end interface
end module
subroutine usleep(us)
use c_functions
use iso_c_binding
implicit none
integer, intent(in) :: us
integer(c_int) :: u
u = us
call usleep_c(u)
end

View File

@ -15,6 +15,7 @@ BEGIN_PROVIDER [ integer, qp_max_mem ]
END_PROVIDER END_PROVIDER
subroutine resident_memory(value) subroutine resident_memory(value)
use c_functions
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Returns the current used memory in gigabytes used by the current process. ! Returns the current used memory in gigabytes used by the current process.
@ -25,6 +26,8 @@ subroutine resident_memory(value)
double precision, intent(out) :: value double precision, intent(out) :: value
call omp_set_lock(file_lock) call omp_set_lock(file_lock)
call usleep(10)
value = 0.d0 value = 0.d0
iunit = getUnitAndOpen('/proc/self/status','r') iunit = getUnitAndOpen('/proc/self/status','r')
do do

View File

@ -275,7 +275,6 @@ IRP_ENDIF
rc = f77_zmq_bind(new_zmq_pull_socket, zmq_socket_pull_tcp_address) rc = f77_zmq_bind(new_zmq_pull_socket, zmq_socket_pull_tcp_address)
if (rc /= 0) then if (rc /= 0) then
icount = icount-1 icount = icount-1
! call sleep(3)
zmq_socket_pull_tcp_address = 'tcp://*:'//zmq_port(2+icount*100)//' ' zmq_socket_pull_tcp_address = 'tcp://*:'//zmq_port(2+icount*100)//' '
zmq_socket_push_tcp_address = trim(qp_run_address)//':'//zmq_port(2+icount*100)//' ' zmq_socket_push_tcp_address = trim(qp_run_address)//':'//zmq_port(2+icount*100)//' '
else else
@ -752,7 +751,8 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
add_task_to_taskserver = 0 add_task_to_taskserver = 0
allocate(character(len=len(task)+10+len(zmq_state)) :: message) sze = len(trim(task)) + len(trim(zmq_state))+11
allocate(character(len=sze) :: message)
message='add_task '//trim(zmq_state)//' '//trim(task) message='add_task '//trim(zmq_state)//' '//trim(task)
sze = len(message) sze = len(message)
rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0) rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0)
@ -768,6 +768,7 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
add_task_to_taskserver = -1 add_task_to_taskserver = -1
return return
endif endif
deallocate(message)
end end