next up previous contents index
Next: RMS Fit and Alignment Up: Interactive Molecular Dynamics Previous: Interactive Molecular Dynamics   Contents   Index


How the Connection Works

IMD works by establishing a TCP connection between VMD and NAMD. NAMD, or whichever molecular dynamics program is being used, acts as the server. In order to prepare NAMD to accept VMD's connection request, NAMD must be instructed at the time the program starts to listen for incoming connections on a particular port. Once NAMD has started up, it will wait for the user to connect through VMD through that port. VMD and NAMD perform a handshake sequence to determine things such as the relative endianness of the machines, then the simulation commences.

Before connecting to the remote simulation, the VMD user must first load a molecule corresponding to the system being simulated. This can be done within the Load Files form by selecting "IMD" as the molecule type, then choosing a psf and pdb file for loading. It is not necessary that the coordinates in the pdb file bear any relation to the simulation coordinates, since they will immediately be replaced when VMD starts receiving coordinates from NAMD. However, the psf file should be the same file used in the NAMD configuration file. The pdb and psf files can also be loaded at the command line in the VMD console, using the command "mol load imd <psffile> pdb <pdbfile>". Note that a molecule must be loaded in one of these two ways for a connection to be established.

Once the molecule is loaded and NAMD has been started and is listening for a connection, the user is ready to connect to the simulation and start receiving coordinates. To establish a connection, type the following at the command line: "imd connect <host> <port>". <host> is the name of the machine on which NAMD started; if NAMD is running on several distributed nodes, VMD must connect to the root node on which NAMD initially started out.

VMD can connect to only one molecular dynamics simulation at a time. To pause, detach, or kill a running simulation, see the Sim Form section 4.2.15.


next up previous contents index
Next: RMS Fit and Alignment Up: Interactive Molecular Dynamics Previous: Interactive Molecular Dynamics   Contents   Index
vmd@ks.uiuc.edu