10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 09:55:59 +02:00

Working on MPI

This commit is contained in:
Anthony Scemama 2017-07-17 23:33:42 +02:00
parent ce35cfe2bb
commit 7bb54e2a43
5 changed files with 15 additions and 31 deletions

View File

@ -13,7 +13,8 @@ addons:
packages: packages:
- gfortran - gfortran
- gcc - gcc
- liblapack-dev # - liblapack-dev
- libatlas-dev
- graphviz - graphviz
# - zlib1g-dev # - zlib1g-dev
# - libgmp3-dev # - libgmp3-dev

View File

@ -10,6 +10,7 @@ type t =
|Na|Mg |Al|Si|P |S |Cl|Ar |Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr |K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe |Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
|Pt
with sexp with sexp
let of_string x = let of_string x =

View File

@ -54,9 +54,7 @@ subroutine run_wf
if (is_mpi_master) then if (is_mpi_master) then
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
endif endif
IRP_IF MIP call mpi_bcast_psi()
call MPI_BCAST(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
IRP_ENDIF
!$OMP PARALLEL PRIVATE(i) !$OMP PARALLEL PRIVATE(i)
i = omp_get_thread_num() i = omp_get_thread_num()
@ -70,7 +68,10 @@ subroutine run_wf
! -------- ! --------
print *, 'Davidson' print *, 'Davidson'
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) if (is_mpi_master) then
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
endif
call mpi_bcast_psi()
call omp_set_nested(.True.) call omp_set_nested(.True.)
call davidson_slave_tcp(0) call davidson_slave_tcp(0)
call omp_set_nested(.False.) call omp_set_nested(.False.)
@ -82,7 +83,10 @@ subroutine run_wf
! --- ! ---
print *, 'PT2' print *, 'PT2'
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) if (is_mpi_master) then
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
endif
call mpi_bcast_psi()
logical :: lstop logical :: lstop
lstop = .False. lstop = .False.

View File

@ -1 +1 @@
Bitmask

View File

@ -2,7 +2,7 @@ subroutine mpi_bcast_psi()
use f77_zmq use f77_zmq
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Put the wave function on the qp_run scheduler ! Broadcast the wave function coming from the qp_run scheduler
END_DOC END_DOC
integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket
integer, intent(in) :: worker_id integer, intent(in) :: worker_id
@ -18,29 +18,7 @@ subroutine mpi_bcast_psi()
call MPI_BCast(psi_det, N_det, MPI_INTEGER8, 0, MPI_COMM_WORLD, ierr) call MPI_BCast(psi_det, N_det, MPI_INTEGER8, 0, MPI_COMM_WORLD, ierr)
call MPI_BCast(psi_coef, psi_det_size, MPI_DOUBLE_PRECISION* N_states, 0, MPI_COMM_WORLD, ierr) call MPI_BCast(psi_coef, psi_det_size, MPI_DOUBLE_PRECISION* N_states, 0, MPI_COMM_WORLD, ierr)
IRP_ENDIF
rc8 = f77_zmq_recv8(zmq_to_qp_run_socket,psi_coef,int(psi_det_size*N_states*8_8,8),0)
if (rc8 /= psi_det_size*N_states*8_8) then
print *, '77_zmq_recv8(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
stop 'error'
endif
TOUCH psi_det psi_coef
rc = f77_zmq_recv(zmq_to_qp_run_socket,energy,size_energy*8,0)
if (rc /= size_energy*8) then
print *, '77_zmq_recv(zmq_to_qp_run_socket,energy,size_energy*8,0)'
stop 'error'
endif
if (N_det_generators_read > 0) then
N_det_generators = N_det_generators_read
TOUCH N_det_generators
endif
if (N_det_selectors_read > 0) then
N_det_selectors = N_det_selectors_read
TOUCH N_det_selectors
endif
end end