GlobalMasterIMD.C File Reference

#include "InfoStream.h"
#include "vmdsock.h"
#include "Node.h"
#include "IMDOutput.h"
#include "imd.h"
#include "SimParameters.h"
#include "UniqueSortedArray.h"
#include "GlobalMaster.h"
#include "GlobalMasterIMD.h"
#include "Vector.h"
#include <errno.h>
#include "Debug.h"

Go to the source code of this file.

Classes

struct  vmdforce

Defines

#define MIN_DEBUG_LEVEL   1

Functions

static int find_free_port (void *sock, int defport)
static int my_imd_connect (void *s)

Variables

static UniqueSortedArray<
vmdforce
vmdforces


Define Documentation

#define MIN_DEBUG_LEVEL   1

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 21 of file GlobalMasterIMD.C.


Function Documentation

static int find_free_port ( void *  sock,
int  defport 
) [static]

Definition at line 46 of file GlobalMasterIMD.C.

References vmdsock_bind().

Referenced by GlobalMasterIMD::GlobalMasterIMD().

00046                                                    {
00047   if (vmdsock_bind(sock, defport)==0) return defport; // success
00048   for (int port=1025; port < 4096; port++) 
00049     if (vmdsock_bind(sock, port)==0) return port;
00050   return -1;
00051 }

static int my_imd_connect ( void *  s  )  [static]

Definition at line 92 of file GlobalMasterIMD.C.

References endi(), IMD_GO, imd_handshake(), imd_recv_header(), iout, iWARN(), and vmdsock_selread().

Referenced by GlobalMasterIMD::calculate().

00092                                    {
00093   if (imd_handshake(s)) {
00094     iout << iWARN << "IMD handshake failed\n" << endi;
00095     return 0;
00096   }
00097 
00098   // Wait a second, then see if VMD has responded.
00099   int32 length;
00100   if (vmdsock_selread(s,1) != 1 || imd_recv_header(s, &length) != IMD_GO) {
00101     iout << iWARN << "Incompatible Interactive MD, use VMD v1.4b2 or higher\n"
00102          << endi;
00103     return 0;
00104   }
00105   return 1;
00106 }


Variable Documentation

UniqueSortedArray<vmdforce> vmdforces [static]

Definition at line 41 of file GlobalMasterIMD.C.

Referenced by GlobalMasterIMD::calculate(), and GlobalMasterIMD::get_vmd_forces().


Generated on Tue Sep 26 01:17:16 2017 for NAMD by  doxygen 1.4.7