Comments (2)
I think the steps we have will ultimately be preferable, but with some name changes and with more conventional application of the Builder pattern. When a Session is being prepared, the Context can provide a GraphBuilder object (currently an empty graph is provided) to each of the operation Directors (currently described as "element builders"). When the client code (via the Context enter()
call) calls the construct()
method (currently confusingly called build()
) on each director, the director interacts with the graph builder. When the GraphBuilder's build()
method is then called, we have a natural place for the current launch()
call as an API hook available to the graph nodes. The remaining run()
method (maybe more appropriately evaluate()
or even visit()
) is the interface for the graph execution Visitor pattern.
Our protocol allows Directors to subscribe to each other according to Element dependencies. This allows the interactions and data flow between graph nodes to be decoupled from the Context implementation (when possible). We will probably want a good way for the Context to intervene, though, or to mediate these bindings, so we should keep some abstraction in mind. This is informed by discussion in #62 .
During the graph building phase, as each Director is initialized, it is passed by the Context to the add_subscriber() method of its dependencies. The Context should provide a map of the input ports of the subscriber and the output ports of the provider as specified for the work, but the basic point is that the subscribing directors are stashed for use during the construct() call. During construct(), each director provides its subscribers with a way to access a bind()
method for the objects being added to the graph, after passing its own new object to the bind()
methods of its dependencies. The object binding is a chance to register factory functions if the binding needs to be completed with new objects during launch()
.
We currently use bind()
for the elements providing the restraint calculation interface. For other more generic input / output relationships, we are stashing functors in the workflow Resources object provided to the plugins. The Resources object currently gets created during the construct()
(currently build()
). The upstream object calls the stashed functor to trigger a data event on the associated graph edge.
Some more experimentation with edge types and work elements should help to clarify how the above should be refined.
from gmxapi.
Tasks in support of this issue include #47 and #78
from gmxapi.
Related Issues (20)
- Inconsistent type for WorkElement.namespace and WorkElement.operation
- docker images for 0.0.7 HOT 2
- Avoid race conditions from unsynchronized ensembles HOT 3
- Invalid attempt to use Context.rank in Context.work setter.
- Logic error when checking for operation implementations
- Specifications for referencing external data sources in serialized work
- Enable readthedocs build for 0.1.0.1
- Enable readthedocs build for >= 0.2a
- Provide long description for gmxapi package
- reposority reorganization makes gmxapi 0.0.7 install docs confusing
- commandline_operation should be able to read from STDIN HOT 10
- Validity checks for WorkSpec updates are not applied consistently.
- Accesing commandline output. HOT 5
- TypeError when importing gmxapi 0.0.8 HOT 9
- How to implement trjcat? HOT 3
- Neural Net potential and py interface HOT 1
- Using interactive gmx commands such as trjconv within gmxapi HOT 1
- How to replace coordinates in the simulation input HOT 1
- How to control the operation of MD by output conformation HOT 1
- `gmxapi.commandline_operation` seems to have memory leaks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmxapi.