Gromacs  2019-beta2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
gmx::SimulationContext Class Referencefinal

#include <gromacs/mdrun/simulationcontext.h>

Description

Simulation environment and configuration.

SimulationContext allows a simulation module () to retrieve runtime parameters and resources from client code. The client retains ownership of the context and its resources, with exceptions as noted.

The public interface of SimulationContext is not yet well-specified. Client code can create an instance with gmx::createSimulationContext()

Todo:
This class should also handle aspects of simulation environment such as working directory and environment variables.

This is a minimal placeholder for a more complete implementation. Interfaces for different API levels are not yet final, but also depend on additional development of t_commrec and other resources.

Todo:
Impose sensible access restrictions. Either the SimulationContext should be passed to the Mdrunner as logically constant or a separate handle class can provide access to resources that have been allocated by (negotiated with) the client for the current simulation (or simulation segment). Non-const accessors to shared resources need to be associated with update signals that the simulation components (modules and runner) can subscribe to.

Also reference https://redmine.gromacs.org/issues/2587

Public Member Functions

 SimulationContext ()=delete
 Object must be initialized with non-default constructor.
 
 SimulationContext (t_commrec *communicationRecord)
 Initializate with borrowed values. More...
 

Public Attributes

t_commrec * communicationRecord_
 Non-owning communicator handle. More...
 

Constructor & Destructor Documentation

gmx::SimulationContext::SimulationContext ( t_commrec *  communicationRecord)
explicit

Initializate with borrowed values.

Parameters
communicationRecordnon-owning communication record handle.

Client code is responsible for cleaning up communicationRecord after SimulationContext is destroyed.

SimulationContext should be the owner of these objects and these implementation details are subject to change as ownership semantics are clarified in future development.

Member Data Documentation

t_commrec* gmx::SimulationContext::communicationRecord_

Non-owning communicator handle.

Communication record is allocated, initialized, and finalized by client code without clearly transferring ownership.

Todo:
Context should own communicator.

The documentation for this class was generated from the following files: