10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-11-07 06:33:38 +01:00

Merge branch 'master' of github.com:scemama/qmcchem

This commit is contained in:
Anthony Scemama 2018-03-14 16:52:38 +01:00
commit 06e68216fb
4 changed files with 58 additions and 91 deletions

View File

@ -83,7 +83,7 @@ let hostname = lazy (
try try
Unix.gethostname () Unix.gethostname ()
with with
| _ -> "localhost" | _ -> "127.0.0.1"
) )

View File

@ -100,7 +100,7 @@ let run ?(daemon=true) ezfio_filename =
ZMQ.Socket.bind socket address; ZMQ.Socket.bind socket address;
accu accu
with with
| _ -> false; | _ -> false
in in
ZMQ.Socket.close socket; ZMQ.Socket.close socket;
result result

View File

@ -12,13 +12,16 @@ let full_run ?(start_dataserver=true) ezfio_filename =
(* Create the node file *) (* Create the node file *)
(*
let () =
let server_file = let server_file =
Filename.concat ezfio_filename "nodefile" Filename.concat ezfio_filename "nodefile"
in in
Out_channel.with_file server_file ~f:(fun out_channel -> Out_channel.with_file server_file ~f:(fun out_channel ->
Launcher.create_nodefile () Launcher.create_nodefile ()
|> Out_channel.output_string out_channel |> Out_channel.output_string out_channel
) ; )
*)
(* Get the configuration of executables *) (* Get the configuration of executables *)
@ -32,7 +35,7 @@ let full_run ?(start_dataserver=true) ezfio_filename =
if (start_dataserver) then if (start_dataserver) then
begin begin
(* Reset socket address in EZFIO *) (* Reset socket address in EZFIO *)
Ezfio.set_simulation_http_server "tcp://localhost:65534"; Ezfio.set_simulation_http_server "tcp://127.0.0.1:65534";
(* Start the data server *) (* Start the data server *)
@ -64,7 +67,7 @@ let full_run ?(start_dataserver=true) ezfio_filename =
ZMQ.Socket.send socket (Message.(to_string Test)); ZMQ.Socket.send socket (Message.(to_string Test));
ZMQ.Socket.recv socket ZMQ.Socket.recv socket
) with ) with
| Unix.Unix_error _ -> | Unix.Unix_error (_,_,_) ->
begin begin
ZMQ.Socket.set_linger_period socket 1 ; ZMQ.Socket.set_linger_period socket 1 ;
ZMQ.Socket.close socket; ZMQ.Socket.close socket;

View File

@ -1467,30 +1467,6 @@ END_PROVIDER
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, single_det_value ]
&BEGIN_PROVIDER [ double precision, single_det_grad, (elec_num_8,3) ]
&BEGIN_PROVIDER [ double precision, single_det_lapl, (elec_num) ]
BEGIN_DOC
! Value of a single determinant wave function from the 1st determinant
END_DOC
det_i = 1
det_j = 1
integer :: i
single_det_value = det_alpha_value_curr * det_beta_value_curr
do i=1,elec_alpha_num
single_det_grad(i,1) = det_alpha_grad_lapl_curr(1,i) * det_beta_value_curr
single_det_grad(i,2) = det_alpha_grad_lapl_curr(2,i) * det_beta_value_curr
single_det_grad(i,3) = det_alpha_grad_lapl_curr(3,i) * det_beta_value_curr
single_det_lapl(i) = det_alpha_grad_lapl_curr(4,i) * det_beta_value_curr
enddo
do i=elec_alpha_num+1,elec_num
single_det_grad(i,1) = det_alpha_value_curr * det_beta_grad_lapl_curr(1,i)
single_det_grad(i,2) = det_alpha_value_curr * det_beta_grad_lapl_curr(2,i)
single_det_grad(i,3) = det_alpha_value_curr * det_beta_grad_lapl_curr(3,i)
single_det_lapl(i) = det_alpha_value_curr * det_beta_grad_lapl_curr(4,i)
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, psidet_value ] BEGIN_PROVIDER [ double precision, psidet_value ]
&BEGIN_PROVIDER [ double precision, psidet_inv ] &BEGIN_PROVIDER [ double precision, psidet_inv ]
@ -1609,62 +1585,26 @@ END_PROVIDER
! Gradients ! Gradients
! --------- ! ---------
call dgemv('N',elec_alpha_num*4,det_alpha_num,1.d0, &
det_alpha_grad_lapl, &
size(det_alpha_grad_lapl,1)*size(det_alpha_grad_lapl,2), &
CDb, 1, 0.d0, psidet_grad_lapl, 1)
if (elec_beta_num /= 0) then
call dgemv('N',elec_beta_num*4,det_beta_num,1.d0, &
det_beta_grad_lapl(1,elec_alpha_num+1,1), &
size(det_beta_grad_lapl,1)*size(det_beta_grad_lapl,2), &
DaC, 1, 0.d0, psidet_grad_lapl(1,elec_alpha_num+1), 1)
endif
if (do_pseudo) then if (do_pseudo) then
do j=1,elec_num call dgemv('N',elec_alpha_num,det_alpha_num,psidet_inv, &
psidet_grad_lapl(1:4,j) = 0.d0 det_alpha_pseudo, size(det_alpha_pseudo,1), &
pseudo_non_local(j) = 0.d0 CDb, 1, 0.d0, pseudo_non_local, 1)
enddo if (elec_beta_num /= 0) then
call dgemv('N',elec_beta_num,det_beta_num,psidet_inv, &
do i=1,det_alpha_num det_beta_pseudo, size(det_beta_pseudo,1), &
do j=1,elec_alpha_num DaC, 1, 0.d0, pseudo_non_local(elec_alpha_num+1), 1)
!DIR$ VECTOR ALIGNED endif
do k=1,4
psidet_grad_lapl(k,j) = psidet_grad_lapl(k,j) + det_alpha_grad_lapl(k,j,i)*CDb(i)
enddo
pseudo_non_local(j) = pseudo_non_local(j) + det_alpha_pseudo(j,i)*CDb(i)
enddo
enddo
do i=1,det_beta_num
do j=elec_alpha_num+1,elec_num
!DIR$ VECTOR ALIGNED
do k=1,4
psidet_grad_lapl(k,j) = psidet_grad_lapl(k,j) + det_beta_grad_lapl(k,j,i)*DaC(i)
enddo
pseudo_non_local(j) = pseudo_non_local(j) + det_beta_pseudo(j,i)*DaC(i)
enddo
enddo
!DIR$ VECTOR ALIGNED
do j=1,elec_num
pseudo_non_local(j) = pseudo_non_local(j) * psidet_inv
enddo
else
!DIR$ VECTOR ALIGNED
do j=1,elec_num
psidet_grad_lapl(1:4,j) = 0.d0
enddo
do i=1,det_alpha_num
do j=1,elec_alpha_num
!DIR$ VECTOR ALIGNED
do k=1,4
psidet_grad_lapl(k,j) = psidet_grad_lapl(k,j) + det_alpha_grad_lapl(k,j,i)*CDb(i)
enddo
enddo
enddo
do i=1,det_beta_num
do j=elec_alpha_num+1,elec_num
!DIR$ VECTOR ALIGNED
do k=1,4
psidet_grad_lapl(k,j) = psidet_grad_lapl(k,j) + det_beta_grad_lapl(k,j,i)*DaC(i)
enddo
enddo
enddo
endif endif
END_PROVIDER END_PROVIDER
@ -1748,7 +1688,7 @@ BEGIN_PROVIDER [ double precision, det_alpha_grad_lapl_curr, (4,elec_alpha_num)
! imo = mo_list_alpha_curr(j) ! imo = mo_list_alpha_curr(j)
! do i=1,elec_alpha_num ! do i=1,elec_alpha_num
! do k=1,4 ! do k=1,4
! det_alpha_grad_lapl_curr(k,i) = det_alpha_grad_lapl_curr(k,i) + mo_grad_lapl(k,i,imo)*slater_matrix_alpha_inv_det(i,j) ! det_alpha_grad_lapl_curr(k,i) = det_alpha_grad_lapl_curr(k,i) + mo_grad_lapl_alpha(k,i,imo)*slater_matrix_alpha_inv_det(i,j)
! enddo ! enddo
! enddo ! enddo
! enddo ! enddo
@ -1905,3 +1845,27 @@ BEGIN_PROVIDER [ double precision, det_beta_grad_lapl_curr, (4,elec_alpha_num+1
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, single_det_value ]
&BEGIN_PROVIDER [ double precision, single_det_grad, (elec_num_8,3) ]
&BEGIN_PROVIDER [ double precision, single_det_lapl, (elec_num) ]
BEGIN_DOC
! Value of a single determinant wave function from the 1st determinant
END_DOC
det_i = 1
det_j = 1
integer :: i
single_det_value = det_alpha_value_curr * det_beta_value_curr
do i=1,elec_alpha_num
single_det_grad(i,1) = det_alpha_grad_lapl_curr(1,i) * det_beta_value_curr
single_det_grad(i,2) = det_alpha_grad_lapl_curr(2,i) * det_beta_value_curr
single_det_grad(i,3) = det_alpha_grad_lapl_curr(3,i) * det_beta_value_curr
single_det_lapl(i) = det_alpha_grad_lapl_curr(4,i) * det_beta_value_curr
enddo
do i=elec_alpha_num+1,elec_num
single_det_grad(i,1) = det_alpha_value_curr * det_beta_grad_lapl_curr(1,i)
single_det_grad(i,2) = det_alpha_value_curr * det_beta_grad_lapl_curr(2,i)
single_det_grad(i,3) = det_alpha_value_curr * det_beta_grad_lapl_curr(3,i)
single_det_lapl(i) = det_alpha_value_curr * det_beta_grad_lapl_curr(4,i)
enddo
END_PROVIDER