Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

imd.C File Reference

#include "imd.h"
#include "vmdsock.h"
#include <string.h>
#include <errno.h>
#include <stdlib.h>

Go to the source code of this file.

Compounds

struct  IMDheader
 IMD communication protocol message header structure. More...

struct  netint
 structure used to perform byte swapping operations. More...


Defines

#define HEADERSIZE   8
#define IMDVERSION   2

Functions

void swap4_aligned (void *v, long ndata)
int32 imd_htonl (int32 h)
int32 imd_ntohl (int32 n)
void fill_header (IMDheader *header, IMDType type, int32 length)
void swap_header (IMDheader *header)
int32 imd_readn (void *s, char *ptr, int32 n)
int32 imd_writen (void *s, const char *ptr, int32 n)
int imd_disconnect (void *s)
int imd_pause (void *s)
int imd_kill (void *s)
int imd_go (void *s)
int imd_handshake (void *s)
int imd_trate (void *s, int32 rate)
int imd_send_mdcomm (void *s, int32 n, const int32 *indices, const float *forces)
int imd_send_energies (void *s, const IMDEnergies *energies)
int imd_send_fcoords (void *s, int32 n, const float *coords)
IMDType imd_recv_header_nolengthswap (void *s, int32 *length)
IMDType imd_recv_header (void *s, int32 *length)
int imd_recv_handshake (void *s)
int imd_recv_mdcomm (void *s, int32 n, int32 *indices, float *forces)
int imd_recv_energies (void *s, IMDEnergies *energies)
int imd_recv_fcoords (void *s, int32 n, float *coords)


Define Documentation

#define HEADERSIZE   8
 

Definition at line 37 of file imd.C.

Referenced by imd_disconnect, imd_go, imd_handshake, imd_kill, imd_pause, imd_recv_header, imd_recv_header_nolengthswap, imd_send_energies, imd_send_fcoords, imd_send_mdcomm, and imd_trate.

#define IMDVERSION   2
 

Definition at line 38 of file imd.C.

Referenced by imd_handshake, and imd_recv_handshake.


Function Documentation

void fill_header IMDheader   header,
IMDType    type,
int32    length
[static]
 

Definition at line 79 of file imd.C.

References imd_htonl, IMDType, IMDheader::length, length, and IMDheader::type.

int imd_disconnect void *   
 

leave sim running but close IMD

Definition at line 127 of file imd.C.

References fill_header, HEADERSIZE, IMD_DISCONNECT, and imd_writen.

int imd_go void *    s [static]
 

Definition at line 145 of file imd.C.

References fill_header, HEADERSIZE, IMD_GO, and imd_writen.

Referenced by imd_recv_handshake.

int imd_handshake void *   
 

check endianness, version compat

Definition at line 152 of file imd.C.

References fill_header, HEADERSIZE, IMD_HANDSHAKE, imd_writen, IMDVERSION, and IMDheader::length.

int32 imd_htonl int32    h [static]
 

Definition at line 53 of file imd.C.

References n.

Referenced by fill_header.

int imd_kill void *   
 

kill simulation, shutdown IMD

Definition at line 139 of file imd.C.

References fill_header, HEADERSIZE, IMD_KILL, and imd_writen.

int32 imd_ntohl int32    n [static]
 

Definition at line 70 of file imd.C.

References netint::high, netint::highest, netint::low, netint::lowest, and n.

Referenced by swap_header.

int imd_pause void *   
 

pause simulation

Definition at line 133 of file imd.C.

References fill_header, HEADERSIZE, IMD_PAUSE, and imd_writen.

int32 imd_readn void *    s,
char *    ptr,
int32    n
[static]
 

Definition at line 89 of file imd.C.

References n, and vmdsock_read.

int imd_recv_energies void *   ,
IMDEnergies  
 

Receive energies

Definition at line 251 of file imd.C.

References imd_readn.

int imd_recv_fcoords void *   ,
int32   ,
float *   
 

Receive atom coordinates and forces, units are Kcal/mol/angstrom

Definition at line 256 of file imd.C.

References imd_readn, and n.

int imd_recv_handshake void *   
 

recv_handshake returns 0 if server and client have the same relative endianism; returns 1 if they have opposite endianism, and -1 if there was an error in the handshake process.

Definition at line 219 of file imd.C.

References imd_go, IMD_HANDSHAKE, imd_recv_header_nolengthswap, IMDType, IMDVERSION, swap4_aligned, and vmdsock_selread.

IMDType imd_recv_header void *   ,
int32  
 

Receive header and data

Definition at line 210 of file imd.C.

References HEADERSIZE, IMD_IOERROR, imd_readn, IMDType, IMDheader::length, length, swap_header, and IMDheader::type.

IMDType imd_recv_header_nolengthswap void *    s,
int32   length
 

Definition at line 201 of file imd.C.

References HEADERSIZE, IMD_IOERROR, imd_readn, IMDType, IMDheader::length, length, swap_header, and IMDheader::type.

Referenced by imd_recv_handshake.

int imd_recv_mdcomm void *   ,
int32   ,
int32  ,
float *   
 

Receive MDComm-style forces, units are Kcal/mol/angstrom

Definition at line 245 of file imd.C.

References imd_readn, and n.

int imd_send_energies void *   ,
const IMDEnergies  
 

Send energies

Definition at line 178 of file imd.C.

References fill_header, HEADERSIZE, IMD_ENERGIES, imd_writen, and size.

int imd_send_fcoords void *   ,
int32   ,
const float *   
 

Send atom forces and coordinates, units are Kcal/mol/angstrom

Definition at line 189 of file imd.C.

References fill_header, HEADERSIZE, IMD_FCOORDS, imd_writen, n, and size.

int imd_send_mdcomm void *   ,
int32   ,
const int32  ,
const float *   
 

Send MDComm compatible forces, units are Kcal/mol/angstrom

Definition at line 166 of file imd.C.

References fill_header, HEADERSIZE, IMD_MDCOMM, imd_writen, n, and size.

int imd_trate void *   ,
int32   
 

set IMD update transmission rate

Definition at line 159 of file imd.C.

References fill_header, HEADERSIZE, IMD_TRATE, and imd_writen.

int32 imd_writen void *    s,
const char *    ptr,
int32    n
[static]
 

Definition at line 108 of file imd.C.

References n, and vmdsock_write.

void swap4_aligned void *    v,
long    ndata
 

Definition at line 42 of file imd.C.

References data.

void swap_header IMDheader   header [static]
 

Definition at line 84 of file imd.C.

References imd_ntohl, IMDheader::length, and IMDheader::type.


Generated on Mon Dec 9 02:45:23 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002