Gromacs: gmx::ImdSession::Impl Class Reference

Implementation type for the IMD session.


Make this class (or one extracted from it) model IForceProvider.

Use RAII for files and allocations

  Impl (const MDLogger &mdlog)   Constructor.  
void  prepareMasterSocket ()   Prepare the socket on the MASTER.  
void  disconnectClient ()   Disconnect the client.   void  issueFatalError (const char *msg)   Prints an error message and disconnects the client. More…  
bool  tryConnect ()   Check whether we got an incoming connection.   void  blockConnect ()   Wrap imd_tryconnect in order to make it blocking. More…  
void  prepareVmdForces ()   Make sure that our array holding the forces received via IMD is large enough.  
void  readVmdForces ()   Reads forces received via IMD.  
void  prepareMDForces ()   Prepares the MD force arrays.   void  copyToMDForces ()   Copy IMD forces to MD forces. More…  
bool  bForcesChanged () const   Return true if any of the forces or indices changed.  
void  keepOldValues ()   Update the old_f_ind and old_forces arrays to contain the current values.   void  outputForces (double time)   Write the applied pull forces to logfile. More…  
void  syncNodes (const t_commrec *cr, double t)   Synchronize the nodes.  
void  readCommand ()   Reads header from the client and decides what to do.   void  openOutputFile (const char *fn, int nat_total, const gmx_output_env_t *oenv, StartingBehavior startingBehavior)   Open IMD output file and write header information. More…  
void  prepareMoleculesInImdGroup (const gmx_mtop_t *top_global)   Creates the molecule start-end position array of molecules in the IMD group.  
void  removeMolecularShifts (const matrix box)   Removes shifts of molecules diffused outside of the box.  
void  prepareForPositionAssembly (const t_commrec *cr, const rvec x[])   Initialize arrays used to assemble the positions from the other nodes.  
bool  run (int64_t step, bool bNS, const matrix box, const rvec x[], double t)   Interact with any connected VMD session.  

bool  sessionPossible = false   True if tpr and mdrun input combine to permit IMD sessions.  
FILE *  outf = nullptr   Output file for IMD data, mainly forces.  
int  nat = 0   Number of atoms that can be pulled via IMD.  
int  nat_loc = 0   Part of the atoms that are local.  
int *  ind = nullptr   Global indices of the IMD atoms.  
int *  ind_loc = nullptr   Local indices of the IMD atoms.  
int  nalloc_loc = 0   Allocation size for ind_loc.  
rvec *  xa = nullptr   Positions for all IMD atoms assembled on the master node.  
ivec *  xa_shifts = nullptr   Shifts for all IMD atoms, to make molecule(s) whole.  
ivec *  xa_eshifts = nullptr   Extra shifts since last DD step.  
rvec *  xa_old = nullptr   Old positions for all IMD atoms on master.  
int *  xa_ind = nullptr   Position of each local atom in the collective array.  
int  nstimd = 1   Global IMD frequency, known to all ranks.  
int  nstimd_new = 1   New frequency from IMD client, master only.  
int  defaultNstImd = -1   Default IMD frequency when disconnected.  
int  port = 0   Port to use for network socket.  
IMDSocketsocket = nullptr   The IMD socket on the master node.  
IMDSocketclientsocket = nullptr   The IMD socket on the client.  
int  length = 0   Length we got with last header.  
bool  bWConnect = false   Shall we block and wait for connection?  
bool  bTerminated = false   Set if MD is terminated.  
bool  bTerminatable = false   Set if MD can be terminated.  
bool  bConnected = false   Set if connection is present.  
bool  bNewForces = false   Set if we received new forces.  
bool  bForceActivated = false   Set if pulling from VMD is allowed.  
IMDEnergyBlockenergies = nullptr   Pointer to energies we send back.  
int32_t  vmd_nforces = 0   Number of VMD forces.  
int32_t *  vmd_f_ind = nullptr   VMD forces indices.  
float *  vmd_forces = nullptr   The VMD forces flat in memory.  
int  nforces = 0   Number of actual MD forces; this gets communicated to the clients.  
int *  f_ind = nullptr   Force indices.  
rvec *  f = nullptr   The IMD pulling forces.  
char *  forcesendbuf = nullptr   Buffer for force sending.  
char *  coordsendbuf = nullptr   Buffer for coordinate sending.  
char *  energysendbuf = nullptr   Send buffer for energies.  
rvec *  sendxbuf = nullptr   Buffer to make molecules whole before sending.  
t_block  mols   Molecules block in IMD group.  
int  old_nforces = 0   Old value for nforces.  
int *  old_f_ind = nullptr   Old values for force indices.  
rvec *  old_forces = nullptr   Old values for IMD pulling forces.  
const MDLoggermdlog   Logger.  
const t_commrec *  cr = nullptr   Commmunication object.  
gmx_wallcycle *  wcycle = nullptr   Wallcycle counting manager.  
gmx_enerdata_tenerd = nullptr   Energy output handler.  

Read more here: Source link