From 3967b197fa0ab8cbce39584b4e70ac6d0bd78e35 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 3 Jul 2019 08:29:59 +0200 Subject: [PATCH 01/21] Biblio --- docs/source/research.bib | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/research.bib b/docs/source/research.bib index 67a40766..124e1539 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -1,4 +1,14 @@ %%% ARXIV TO BE UPDATED %%% +@article{Giner2019Jul, + author = {Giner, Emmanuel and Scemama, Anthony and Toulouse, Julien and Loos, Pierre-Fran{\ifmmode\mbox{\c{c}}\else\c{c}\fi}ois}, + title = {{Chemically Accurate Excitation Energies With Small Basis Sets}}, + journal = {arXiv}, + year = {2019}, + month = {Jul}, + eprint = {1907.01245}, + url = {https://arxiv.org/abs/1907.01245} +} + @article{Dash2019May, author = {Dash, Monika and Feldt, Jonas and Moroni, Saverio and Scemama, Anthony and Filippi, Claudia}, title = {{Excited states with selected CI-QMC: chemically accurate excitation energies and geometries}}, From 3763767f778aa7abef876e34959a234adf178532 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 9 Jul 2019 13:40:06 +0200 Subject: [PATCH 02/21] Fix bug with deterministic PT2 --- src/cipsi/run_pt2_slave.irp.f | 2 +- src/cipsi/run_selection_slave.irp.f | 72 +++++++++++++++-------------- src/cipsi/slave_cipsi.irp.f | 2 +- src/ezfio_files/ezfio.irp.f | 2 + src/fci/pt2.irp.f | 9 +++- src/utils/c_functions.f90 | 19 ++++++++ src/utils/memory.irp.f | 3 ++ src/zmq/utils.irp.f | 1 - 8 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 src/utils/c_functions.f90 diff --git a/src/cipsi/run_pt2_slave.irp.f b/src/cipsi/run_pt2_slave.irp.f index 21def8f2..cb1bc83f 100644 --- a/src/cipsi/run_pt2_slave.irp.f +++ b/src/cipsi/run_pt2_slave.irp.f @@ -148,7 +148,7 @@ subroutine run_pt2_slave_small(thread,iproc,energy) integer, external :: disconnect_from_taskserver do i=1,300 if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) /= -2) exit - call sleep(1) + call usleep(500) print *, 'Retry disconnect...' end do diff --git a/src/cipsi/run_selection_slave.irp.f b/src/cipsi/run_selection_slave.irp.f index c1542445..ac889794 100644 --- a/src/cipsi/run_selection_slave.irp.f +++ b/src/cipsi/run_selection_slave.irp.f @@ -74,7 +74,7 @@ subroutine run_selection_slave(thread,iproc,energy) if(done .or. ctask == size(task_id)) then do i=1, ctask 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 ctask = 0 done = .true. @@ -85,6 +85,7 @@ subroutine run_selection_slave(thread,iproc,energy) if(ctask > 0) then call sort_selection_buffer(buf) ! 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) ! buf%mini = buf2%mini pt2(:) = 0d0 @@ -132,23 +133,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)' 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 - 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) if(rc /= 8*b%cur) then print *, 'f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE)' @@ -203,22 +205,26 @@ subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det print *, 'f77_zmq_recv( zmq_socket_pull, N, 4, 0)' 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 - 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) if(rc /= 8*N) then print *, 'f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0)' @@ -228,10 +234,6 @@ subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det 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)' endif - else - pt2(:) = 0.d0 - variance(:) = 0.d0 - norm(:) = 0.d0 endif rc = f77_zmq_recv( zmq_socket_pull, ntask, 4, 0) diff --git a/src/cipsi/slave_cipsi.irp.f b/src/cipsi/slave_cipsi.irp.f index c9710c18..3e33dfa8 100644 --- a/src/cipsi/slave_cipsi.irp.f +++ b/src/cipsi/slave_cipsi.irp.f @@ -63,7 +63,7 @@ subroutine run_slave_main if (mpi_master) then call wait_for_states(states,zmq_state,size(states)) if (zmq_state(1:64) == old_state(1:64)) then - call sleep(1) + call usleep(200) cycle else old_state(1:64) = zmq_state(1:64) diff --git a/src/ezfio_files/ezfio.irp.f b/src/ezfio_files/ezfio.irp.f index 70277992..e7a7a159 100644 --- a/src/ezfio_files/ezfio.irp.f +++ b/src/ezfio_files/ezfio.irp.f @@ -39,6 +39,8 @@ BEGIN_PROVIDER [ character*(128), ezfio_filename ] write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj' call system(command) + PROVIDE file_lock + END_PROVIDER BEGIN_PROVIDER [ character*(128), ezfio_work_dir ] diff --git a/src/fci/pt2.irp.f b/src/fci/pt2.irp.f index 6135864f..c916e0ef 100644 --- a/src/fci/pt2.irp.f +++ b/src/fci/pt2.irp.f @@ -43,8 +43,13 @@ subroutine run E_CI_before(:) = psi_energy(:) + nuclear_repulsion relative_error=PT2_relative_error - call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & - norm,0) ! Stochastic PT2 + if (do_pt2) then + 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 rpt2(k) = pt2(k)/(1.d0 + norm(k)) enddo diff --git a/src/utils/c_functions.f90 b/src/utils/c_functions.f90 new file mode 100644 index 00000000..32bd5005 --- /dev/null +++ b/src/utils/c_functions.f90 @@ -0,0 +1,19 @@ +module c_functions + use iso_c_binding + + interface + subroutine usleep_c(us) bind (C,name="usleep") + 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 + call usleep_c(int(us,c_int)) +end diff --git a/src/utils/memory.irp.f b/src/utils/memory.irp.f index f9e4bb69..3e077f97 100644 --- a/src/utils/memory.irp.f +++ b/src/utils/memory.irp.f @@ -15,6 +15,7 @@ BEGIN_PROVIDER [ integer, qp_max_mem ] END_PROVIDER subroutine resident_memory(value) + use c_functions implicit none BEGIN_DOC ! 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 call omp_set_lock(file_lock) + call usleep(10) + value = 0.d0 iunit = getUnitAndOpen('/proc/self/status','r') do diff --git a/src/zmq/utils.irp.f b/src/zmq/utils.irp.f index 1205e09e..e936f268 100644 --- a/src/zmq/utils.irp.f +++ b/src/zmq/utils.irp.f @@ -275,7 +275,6 @@ IRP_ENDIF rc = f77_zmq_bind(new_zmq_pull_socket, zmq_socket_pull_tcp_address) if (rc /= 0) then icount = icount-1 -! call sleep(3) 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)//' ' else From e0b06889c81eb3806b459ab24a541f103d21a2e1 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 9 Jul 2019 17:15:30 +0200 Subject: [PATCH 03/21] Cleaning --- src/zmq/utils.irp.f | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zmq/utils.irp.f b/src/zmq/utils.irp.f index 70f0830b..b376c185 100644 --- a/src/zmq/utils.irp.f +++ b/src/zmq/utils.irp.f @@ -752,7 +752,8 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) 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) sze = len(message) rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0) @@ -768,6 +769,7 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) add_task_to_taskserver = -1 return endif + deallocate(message) end From 1120d572fa82034cedbf193c0b7d0cc8c3fc954a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 9 Jul 2019 17:18:05 +0200 Subject: [PATCH 04/21] Cleaning allocation of string --- src/utils/c_functions.f90 | 4 +++- src/zmq/utils.irp.f | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/c_functions.f90 b/src/utils/c_functions.f90 index 32bd5005..52c01d12 100644 --- a/src/utils/c_functions.f90 +++ b/src/utils/c_functions.f90 @@ -15,5 +15,7 @@ subroutine usleep(us) use iso_c_binding implicit none integer, intent(in) :: us - call usleep_c(int(us,c_int)) + integer(c_int) :: u + u = us + call usleep_c(u) end diff --git a/src/zmq/utils.irp.f b/src/zmq/utils.irp.f index e936f268..e76238ed 100644 --- a/src/zmq/utils.irp.f +++ b/src/zmq/utils.irp.f @@ -300,7 +300,6 @@ function new_zmq_push_socket(thread) END_DOC integer, intent(in) :: thread integer :: rc - character*(8), external :: zmq_port integer(ZMQ_PTR) :: new_zmq_push_socket call omp_set_lock(zmq_lock) @@ -424,7 +423,6 @@ subroutine end_zmq_pair_socket(zmq_socket_pair) END_DOC integer(ZMQ_PTR), intent(in) :: zmq_socket_pair integer :: rc - character*(8), external :: zmq_port call omp_set_lock(zmq_lock) rc = f77_zmq_close(zmq_socket_pair) @@ -444,7 +442,6 @@ subroutine end_zmq_pull_socket(zmq_socket_pull) END_DOC integer(ZMQ_PTR), intent(in) :: zmq_socket_pull integer :: rc - character*(8), external :: zmq_port ! rc = f77_zmq_setsockopt(zmq_socket_pull,ZMQ_LINGER,0,4) ! if (rc /= 0) then @@ -471,7 +468,6 @@ subroutine end_zmq_push_socket(zmq_socket_push,thread) integer, intent(in) :: thread integer(ZMQ_PTR), intent(in) :: zmq_socket_push integer :: rc - character*(8), external :: zmq_port rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,300000,4) if (rc /= 0) then @@ -751,10 +747,12 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) character*(*), intent(in) :: task integer :: rc, sze - character(len=:), allocatable :: message + character(len=:), allocatable :: message add_task_to_taskserver = 0 + sze = len(trim(task)) + len(trim(zmq_state))+11 + allocate(character(len=sze) :: message) message='add_task '//trim(zmq_state)//' '//trim(task) sze = len(message) rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0) @@ -770,6 +768,7 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) add_task_to_taskserver = -1 return endif + deallocate(message) end @@ -1031,7 +1030,6 @@ subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) ! Terminate the socket from the application to qp_run END_DOC integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket - character*(8), external :: zmq_port integer :: rc rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,300000,4) From edd2276b75fb24a54e36ff86bce8f72a0ba98597 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 9 Jul 2019 17:33:44 +0200 Subject: [PATCH 05/21] Fixed usleep --- src/utils/c_funcs.c | 6 ++++++ src/utils/c_functions.f90 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/utils/c_funcs.c diff --git a/src/utils/c_funcs.c b/src/utils/c_funcs.c new file mode 100644 index 00000000..5b7035fb --- /dev/null +++ b/src/utils/c_funcs.c @@ -0,0 +1,6 @@ +#include + +void usleep_c(int s) +{ + usleep((useconds_t) s); +} diff --git a/src/utils/c_functions.f90 b/src/utils/c_functions.f90 index 52c01d12..425aafd6 100644 --- a/src/utils/c_functions.f90 +++ b/src/utils/c_functions.f90 @@ -2,7 +2,7 @@ module c_functions use iso_c_binding interface - subroutine usleep_c(us) bind (C,name="usleep") + subroutine usleep_c(us) bind (C,name="usleep_c") use iso_c_binding integer(c_int), value :: us end subroutine usleep_c From bf96d8c0c898cdffab2423eb39e470924659d960 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 23 Jul 2019 14:54:03 +0200 Subject: [PATCH 06/21] Renamed disk_access_nuclear_repulsion --- REPLACE | 1 + src/ao_one_e_ints/README.rst | 7 +++---- src/nuclei/EZFIO.cfg | 2 +- src/nuclei/nuclei.irp.f | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/REPLACE b/REPLACE index 10a53958..d0b6adce 100755 --- a/REPLACE +++ b/REPLACE @@ -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_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 disk_access_nuclear_repulsion --rename=io_nuclear_repulsion diff --git a/src/ao_one_e_ints/README.rst b/src/ao_one_e_ints/README.rst index bc8832c3..a87bdb17 100644 --- a/src/ao_one_e_ints/README.rst +++ b/src/ao_one_e_ints/README.rst @@ -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: -* `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) -* `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) -* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) +* `ao_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis +* `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 -Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`. diff --git a/src/nuclei/EZFIO.cfg b/src/nuclei/EZFIO.cfg index 7bcbf013..ebdcfead 100644 --- a/src/nuclei/EZFIO.cfg +++ b/src/nuclei/EZFIO.cfg @@ -21,7 +21,7 @@ type: double precision size: (nuclei.nucl_num,3) interface: ezfio -[disk_access_nuclear_repulsion] +[io_nuclear_repulsion] doc: Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] type: Disk_access interface: ezfio,provider,ocaml diff --git a/src/nuclei/nuclei.irp.f b/src/nuclei/nuclei.irp.f index c797ff30..88ee24e8 100644 --- a/src/nuclei/nuclei.irp.f +++ b/src/nuclei/nuclei.irp.f @@ -143,7 +143,7 @@ BEGIN_PROVIDER [ double precision, nuclear_repulsion ] END_DOC 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 if (mpi_master) then @@ -194,7 +194,7 @@ BEGIN_PROVIDER [ double precision, nuclear_repulsion ] call write_time(6) 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 call ezfio_set_nuclei_nuclear_repulsion(nuclear_repulsion) endif From a8dbea61d3d542089fb61c7392b5060508735d33 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 08:11:17 +0200 Subject: [PATCH 07/21] Fixed opam installation --- INSTALL.rst | 11 +++++++++-- configure | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/INSTALL.rst b/INSTALL.rst index c91b184f..10f583db 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -328,7 +328,7 @@ OCaml echo ${QP_ROOT}/bin ${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 use it as an answer to where :command:`opam` should be installed. @@ -337,7 +337,14 @@ OCaml .. 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, the you can initialize opam using: + + .. code:: bash + + opam init --disable-sandboxing --comp=4.07.1 eval `${QP_ROOT}/bin/opam env` * Install the required external OCaml libraries diff --git a/configure b/configure index c343c243..c3ff8942 100755 --- a/configure +++ b/configure @@ -297,12 +297,13 @@ EOF ${QP_ROOT}/bin + EOF rm ${QP_ROOT}/external/opam_installer.sh source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true - ${QP_ROOT}/bin/opam init --verbose --yes + ${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing eval $(${QP_ROOT}/bin/opam env) opam install -y ${OCAML_PACKAGES} || exit 1 @@ -310,13 +311,14 @@ EOF # Conventional commands execute << EOF chmod +x "\${QP_ROOT}"/external/opam_installer.sh + "\${QP_ROOT}"/external/opam_installer.sh --no-backup rm --force \${QP_ROOT}/bin/opam export OPAMROOT=\${OPAMROOT:-\${QP_ROOT}/external/opam} echo \${QP_ROOT}/bin \ | sh \${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 - \${QP_ROOT}/bin/opam init --verbose --yes + \${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing eval \$(\${QP_ROOT}/bin/opam env) opam install -y \${OCAML_PACKAGES} || exit 1 EOF From 4e58fe7576b320c6c282762f3df538397f413aeb Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 08:12:22 +0200 Subject: [PATCH 08/21] Typo --- INSTALL.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.rst b/INSTALL.rst index 10f583db..a9cee40b 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -340,7 +340,7 @@ OCaml opam init --comp=4.07.1 eval `${QP_ROOT}/bin/opam env` - If the installation fails because of bwrap, the you can initialize opam using: + If the installation fails because of bwrap, you can initialize opam using: .. code:: bash From c405dc99d3cdd1c9ffa6afc6bb8f91758a1321e5 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 09:06:11 +0200 Subject: [PATCH 09/21] Fixing travis --- configure | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c3ff8942..634b5888 100755 --- a/configure +++ b/configure @@ -303,22 +303,30 @@ EOF rm ${QP_ROOT}/external/opam_installer.sh source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true - ${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing + execute << EOF + ${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing eval $(${QP_ROOT}/bin/opam env) opam install -y ${OCAML_PACKAGES} || exit 1 +EOF else # Conventional commands execute << EOF chmod +x "\${QP_ROOT}"/external/opam_installer.sh "\${QP_ROOT}"/external/opam_installer.sh --no-backup +EOF + execute << EOF rm --force \${QP_ROOT}/bin/opam export OPAMROOT=\${OPAMROOT:-\${QP_ROOT}/external/opam} echo \${QP_ROOT}/bin \ | sh \${QP_ROOT}/external/opam_installer.sh +EOF + execute << EOF rm \${QP_ROOT}/external/opam_installer.sh source \${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true - \${QP_ROOT}/bin/opam init --verbose --yes --comp=4.07.1 --disable-sandboxing + \${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing +EOF + execute << EOF eval \$(\${QP_ROOT}/bin/opam env) opam install -y \${OCAML_PACKAGES} || exit 1 EOF From be6c9b533ead2710e12e69107a3edb705d2e6180 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 09:36:51 +0200 Subject: [PATCH 10/21] Fixing travis --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 634b5888..228b4f3f 100755 --- a/configure +++ b/configure @@ -304,6 +304,7 @@ EOF source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true execute << EOF + opam switch 4.07.1 || exit 1 ${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing eval $(${QP_ROOT}/bin/opam env) @@ -324,6 +325,7 @@ EOF execute << EOF rm \${QP_ROOT}/external/opam_installer.sh source \${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true + opam switch 4.07.1 || exit 1 \${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing EOF execute << EOF From 00074558463e79e00bf130f4ae437d8a161d094c Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 10:27:39 +0200 Subject: [PATCH 11/21] Fixing travis --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 228b4f3f..e605c088 100755 --- a/configure +++ b/configure @@ -304,7 +304,7 @@ EOF source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true execute << EOF - opam switch 4.07.1 || exit 1 + opam switch create ocaml-base-compiler.4.07.1 || exit 1 ${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing eval $(${QP_ROOT}/bin/opam env) @@ -325,7 +325,7 @@ EOF execute << EOF rm \${QP_ROOT}/external/opam_installer.sh source \${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true - opam switch 4.07.1 || exit 1 + opam switch create ocaml-base-compiler.4.07.1 || exit 1 \${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing EOF execute << EOF From 2f89be4ee9ec6c29d167b4b1021d33d90c5160c2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 12:33:08 +0200 Subject: [PATCH 12/21] Fixing travis --- configure | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/configure b/configure index e605c088..98641633 100755 --- a/configure +++ b/configure @@ -303,13 +303,12 @@ EOF rm ${QP_ROOT}/external/opam_installer.sh source ${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true - execute << EOF - opam switch create ocaml-base-compiler.4.07.1 || exit 1 - ${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing + opam switch create ocaml-base-compiler.4.07.1 + opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing - eval $(${QP_ROOT}/bin/opam env) + eval $(opam env) opam install -y ${OCAML_PACKAGES} || exit 1 -EOF + else # Conventional commands execute << EOF @@ -322,14 +321,13 @@ EOF echo \${QP_ROOT}/bin \ | sh \${QP_ROOT}/external/opam_installer.sh EOF - execute << EOF - 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 - \${QP_ROOT}/bin/opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing + 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) EOF execute << EOF - eval \$(\${QP_ROOT}/bin/opam env) opam install -y \${OCAML_PACKAGES} || exit 1 EOF fi From 861aed9dd4c0a9c8fe2183a9892f68ec2f64b03c Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 12:40:05 +0200 Subject: [PATCH 13/21] Update GITHUB.md --- GITHUB.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/GITHUB.md b/GITHUB.md index 02836a37..cee4cc8c 100644 --- a/GITHUB.md +++ b/GITHUB.md @@ -2,20 +2,23 @@ GitHub Branches =============== master: - The current up-to-date working branch, that users download It should - only contain the latest release and bug fixes. + The current up-to-date working branch, that users download. It should + only contain the latest stable release and bug fixes. -develop-lcpq: - Toulouse development branch - -develop-lct: - Paris development branch - -develop: +dev: 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 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: This is an independent branch, containing only the web site of QP2. From 2e86462070aff808cb15b50f6613a84f99cf7c55 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 24 Jul 2019 12:56:45 +0200 Subject: [PATCH 14/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7fab0c9..3349f561 100644 --- a/README.md +++ b/README.md @@ -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)\ 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 ``` From faaba29eb7a7c72b1eddd61a60107d8f457736e9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 26 Jul 2019 12:39:58 +0200 Subject: [PATCH 15/21] Fix rm opam_installer.sh (#53) * Changed native into SSE4.2 in gfortran.cfg * Fixed rm opam_installer --- config/gfortran.cfg | 2 +- configure | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/gfortran.cfg b/config/gfortran.cfg index 94a12ccf..f561fcb7 100644 --- a/config/gfortran.cfg +++ b/config/gfortran.cfg @@ -35,7 +35,7 @@ OPENMP : 1 ; Append OpenMP flags # -ffast-math and the Fortran-specific # -fno-protect-parens and -fstack-arrays. [OPT] -FCFLAGS : -Ofast -march=native +FCFLAGS : -Ofast -msse4.2 # Profiling flags ################# diff --git a/configure b/configure index 98641633..2599fbbc 100755 --- a/configure +++ b/configure @@ -321,8 +321,8 @@ EOF echo \${QP_ROOT}/bin \ | sh \${QP_ROOT}/external/opam_installer.sh EOF - rm \${QP_ROOT}/external/opam_installer.sh - source \${OPAMROOT}/opam-init/init.sh > /dev/null 2> /dev/null || true + 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) From b65400c5442794f2b9deaaeb23cb5fa5122e9a26 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 19 Aug 2019 13:14:01 +0200 Subject: [PATCH 16/21] Update biblio (#55) --- docs/source/research.bib | 50 +++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/docs/source/research.bib b/docs/source/research.bib index 124e1539..9e200698 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -9,29 +9,47 @@ url = {https://arxiv.org/abs/1907.01245} } -@article{Dash2019May, - author = {Dash, Monika and Feldt, Jonas and Moroni, Saverio and Scemama, Anthony and Filippi, Claudia}, - title = {{Excited states with selected CI-QMC: chemically accurate excitation energies and geometries}}, - journal = {arXiv}, - year = {2019}, - month = {May}, - eprint = {1905.06737}, - url = {https://arxiv.org/abs/1905.06737} + +@article{Burton_2019, + doi = {10.1021/acs.jctc.9b00441}, + url = {https://doi.org/10.1021%2Facs.jctc.9b00441}, + year = 2019, + month = {aug}, + publisher = {American Chemical Society ({ACS})}, + 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{Burton2019May, - author = {Burton, Hugh G. A. and Thom, Alex J. W.}, - title = {{A General Approach for Multireference Ground and Excited States using Non-Orthogonal Configuration Interaction}}, - journal = {arXiv}, - year = {2019}, - month = {May}, - eprint = {1905.02626}, - url = {https://arxiv.org/abs/1905.02626} + +@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} } %%%% PUBLISHED PAPERS +@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, doi = {10.1021/acs.jpclett.9b01176}, url = {https://doi.org/10.1021%2Facs.jpclett.9b01176}, From cd2b606daa5928131b784f14d72e127eb52a33a2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 19 Aug 2019 18:57:43 +0200 Subject: [PATCH 17/21] Biblio (#57) * Update biblio * Update paper --- docs/source/research.bib | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/research.bib b/docs/source/research.bib index 9e200698..e6c75b9e 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -36,6 +36,19 @@ %%%% PUBLISHED PAPERS +@article{Ferte_2019, + doi = {10.1063/1.5082638}, + url = {https://doi.org/10.1063%2F1.5082638}, + year = 2019, + month = {feb}, + publisher = {{AIP} Publishing}, + volume = {150}, + number = {8}, + pages = {084103}, + author = {Anthony Fert{\'{e}} and Emmanuel Giner and Julien Toulouse}, + title = {Range-separated multideterminant density-functional theory with a short-range correlation functional of the on-top pair density}, +} + @article{Caffarel_2019, doi = {10.1063/1.5114703}, url = {https://doi.org/10.1063%2F1.5114703}, From fcade8c8f7a67f7ccd877a189cf36cf559e7540e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 19 Aug 2019 20:11:39 +0200 Subject: [PATCH 18/21] Fixed installation issues with OPAM * Changed native into SSE4.2 in gfortran.cfg * Fixed rm opam_installer * Fixing opam installation * Introduce NO_CACHE in configure for daily test --- configure | 26 +++++++++++++++----------- docs/source/research.bib | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 2599fbbc..23f4aa02 100755 --- a/configure +++ b/configure @@ -292,6 +292,9 @@ EOF # Special commands for Travis CI chmod +x "${QP_ROOT}"/external/opam_installer.sh rm --force ${QP_ROOT}/bin/opam + if [[ -n ${NO_CACHE} ]] ; then + rm -rf ${HOME}/.opam + fi export OPAMROOT=${HOME}/.opam cat << EOF | bash ${QP_ROOT}/external/opam_installer.sh --no-backup ${QP_ROOT}/bin @@ -301,9 +304,9 @@ ${QP_ROOT}/bin EOF 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 +# 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 eval $(opam env) @@ -312,18 +315,19 @@ EOF else # Conventional commands execute << EOF - chmod +x "\${QP_ROOT}"/external/opam_installer.sh - "\${QP_ROOT}"/external/opam_installer.sh --no-backup + chmod +x "${QP_ROOT}"/external/opam_installer.sh + "${QP_ROOT}"/external/opam_installer.sh --no-backup EOF execute << EOF - rm --force \${QP_ROOT}/bin/opam - export OPAMROOT=\${OPAMROOT:-\${QP_ROOT}/external/opam} - echo \${QP_ROOT}/bin \ - | sh \${QP_ROOT}/external/opam_installer.sh + rm --force ${QP_ROOT}/bin/opam + export OPAMROOT=${OPAMROOT:-${QP_ROOT}/external/opam} + echo ${QP_ROOT}/bin \ + | sh ${QP_ROOT}/external/opam_installer.sh EOF 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 +# 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) EOF diff --git a/docs/source/research.bib b/docs/source/research.bib index e6c75b9e..f0c0648c 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -1,6 +1,6 @@ %%% ARXIV TO BE UPDATED %%% @article{Giner2019Jul, - author = {Giner, Emmanuel and Scemama, Anthony and Toulouse, Julien and Loos, Pierre-Fran{\ifmmode\mbox{\c{c}}\else\c{c}\fi}ois}, + author = {Giner, Emmanuel and Scemama, Anthony and Toulouse, Julien and Loos, Pierre-Fran{\c{c}}ois}, title = {{Chemically Accurate Excitation Energies With Small Basis Sets}}, journal = {arXiv}, year = {2019}, From f4f75509dbb842b8c612641350afa6c13ba227f5 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 19 Aug 2019 20:16:33 +0200 Subject: [PATCH 19/21] Biblio (#58) * Update biblio * Update paper * Journal missing in research.bib --- docs/source/research.bib | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/research.bib b/docs/source/research.bib index f0c0648c..a2abea47 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -47,6 +47,7 @@ pages = {084103}, author = {Anthony Fert{\'{e}} and Emmanuel Giner and Julien Toulouse}, title = {Range-separated multideterminant density-functional theory with a short-range correlation functional of the on-top pair density}, + journal = {The Journal of Chemical Physics} } @article{Caffarel_2019, From 8b14e190a9c9b9ea5218222334bcdc00a89db224 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Mon, 19 Aug 2019 17:13:41 -0500 Subject: [PATCH 20/21] Fix spurious EOF --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 23f4aa02..6d875fae 100755 --- a/configure +++ b/configure @@ -330,7 +330,6 @@ EOF opam init --verbose --yes --compiler=4.07.1 --disable-sandboxing eval $(opam env) -EOF execute << EOF opam install -y \${OCAML_PACKAGES} || exit 1 EOF From 6148624fe799e304cecc9ca2805359314bede136 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 21 Aug 2019 16:29:23 +0200 Subject: [PATCH 21/21] Optimized qp_edit -n (#60) --- ocaml/Determinant.ml | 4 ++-- ocaml/Input_determinants_by_hand.ml | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ocaml/Determinant.ml b/ocaml/Determinant.ml index c27aefc4..6f248470 100644 --- a/ocaml/Determinant.ml +++ b/ocaml/Determinant.ml @@ -3,7 +3,8 @@ open Sexplib.Std 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 = @@ -61,7 +62,6 @@ let of_int64_array ~n_int ~alpha ~beta x = end; x -let of_int64_array_no_check x = x let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) = let ba, bb = diff --git a/ocaml/Input_determinants_by_hand.ml b/ocaml/Input_determinants_by_hand.ml index e4c6ff2a..a676cf76 100644 --- a/ocaml/Input_determinants_by_hand.ml +++ b/ocaml/Input_determinants_by_hand.ml @@ -196,8 +196,9 @@ end = struct let write_psi_coef ~n_det ~n_states c = let n_det = Det_number.to_int n_det - and c = Array.to_list c - |> List.map Det_coef.to_float + and c = + Array.map Det_coef.to_float c + |> Array.to_list and n_states = States_number.to_int n_states in @@ -239,12 +240,11 @@ end = struct assert (n_int = dim.(0)); assert (dim.(1) = 2); 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) ) - |> List.map (Determinant.of_int64_array + |> Array.map (Determinant.of_int64_array ~n_int:(N_int_number.of_int n_int) ~alpha:n_alpha ~beta:n_beta ) - |> Array.of_list ;; let write_psi_det ~n_int ~n_det d = @@ -363,7 +363,7 @@ Determinants :: " (b.expected_s2 |> Positive_float.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 |> Rst_string.of_string ;; @@ -387,10 +387,10 @@ psi_det = %s (b.n_states |> States_number.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.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 ", ") - (b.psi_det |> Array.to_list |> List.map (Determinant.to_string - ~mo_num) |> String.concat "\n\n") + (b.psi_det |> Array.map (Determinant.to_string ~mo_num) |> Array.to_list + |> String.concat "\n\n") ;; let of_rst r =