mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
i-Pi: Added initialization step
This commit is contained in:
parent
ffaae80b08
commit
8587bbbc7d
1 changed files with 13 additions and 0 deletions
|
|
@ -90,6 +90,8 @@ CONTAINS
|
|||
CHARACTER(len=default_path_length) :: c_hostname, drv_hostname
|
||||
INTEGER :: drv_port, handle, i_drv_unix, &
|
||||
output_unit, socket, comm_socket
|
||||
CHARACTER(len=msglength) :: msgbuffer
|
||||
CHARACTER(len=msglength), PARAMETER :: initmsg = "INIT"
|
||||
LOGICAL :: drv_unix, ionode
|
||||
|
||||
CALL timeset(routineN, handle)
|
||||
|
|
@ -123,6 +125,17 @@ CONTAINS
|
|||
CALL ipi_env_set(ipi_env=ipi_env, sockfd=comm_socket)
|
||||
END IF
|
||||
|
||||
! Check if the client needs initialization
|
||||
! We only send a meaningless message since we have no general way of
|
||||
! knowing what the client is expecting
|
||||
CALL ask_status(comm_socket, msgbuffer)
|
||||
IF (TRIM(msgbuffer) == "NEEDINIT") THEN
|
||||
CALL writebuffer(comm_socket, initmsg, msglength)
|
||||
CALL writebuffer(comm_socket, 1) ! Bead index - just send 1
|
||||
CALL writebuffer(comm_socket, 12) ! Bits in the following message
|
||||
CALL writebuffer(comm_socket, "Initializing", 12)
|
||||
END IF
|
||||
|
||||
#endif
|
||||
|
||||
CALL timestop(handle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue