Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First impressions of Vivarium #1

Open
khinsen opened this issue Nov 8, 2022 · 4 comments
Open

First impressions of Vivarium #1

khinsen opened this issue Nov 8, 2022 · 4 comments

Comments

@khinsen
Copy link

khinsen commented Nov 8, 2022

I did a quick exploration of the Vivarium Web site, which was pointed out to me by Matthew Akamatsu at a workshop on synthesis of scientific knowledge (in which @eagmon also participates). Here's some feedback, hoping that it will help with improving the presentation of Vivarium to potential users (and maybe collaborators).

Background: I am a biophysicist with a background in biomolecular simulation (a more detailed level of description than what Vivarium seems to aim at) and mesoscale material simulation (colloids etc.). My question is "could Vivarium help me interface/interact with other simulation techniques?"

The main difficulty I have with finding answers to my questions is that the description of Vivarium is heavily focused in technicalities but neglects scientific questions. I understand that Vivarium core is a framework for developing interoperable simulation engines, plus a collection of concrete simulation engines. What I haven't been able to figure out is: what are the constraints that Vivarium imposes on simulation engines, in terms of features and implementation, and what precisely does Vivarium offer in terms of interoperability services? Put differently: what do I gain and what do I lose if I adopt Vivarium rather than hooking up simulation engines with purpose-written code (e.g. Python scripts)? That's something I want to know long before getting interested in questions such as how to set PYTHONPATH, which is the first topic under "Getting Started".

The only specific simulation engine I looked at is "Cytosim", which is closest to my prior experience (Langevin and Brownian dynamics). Similar criticism applies here: what I want to know first is how systems are represented in Cytosim, and according to which models their evolution is simulated. Instead, I get told that the code is written in C++. I had to read up to the pointer to a paper in the "New Journal of Physics", and follow that pointer, to see the information that I want first. The abstract of that paper should be the opening paragraph of the description of Cytosim!

@eagmon
Copy link
Member

eagmon commented Nov 8, 2022

Thank you @khinsen for the feedback! I plan to improve the presentation of Vivarium to the public, and will keep your feedback in mind as we move ahead in the coming months.
To give you more immediate answers -- Vivarium is indeed focused more on interoperability than on any particular scientific question, and this is by design. I think of Vivarium as scaffolding for combining different simulation approaches and running them as an integrated system. It is useful to separate the particular scientific questions from the composition framework, as this allows us to develop more general and reusable infrastructure.
A Vivarium "process interface" lets you to define typed ports for your given simulation modules, which can then be plugged together with other simulation modules, and these are simulated together as an integrative system. Vivarium assists with the composition and execution. In time, I hope to develop methods for more automatic composition. Compositional/integrative simulation is actually fairly sophisticated and would be difficult to accomplish in an reproducible and extensible way using python scripts -- many people have done it with python scripts using "glue code" but often these hybrid simulations are really hard to build upon in a flexible way.
Another thing -- Cytosim is developed by a separate group. We built a Vivarium interface for this simulator, which allows us to use it as a module and connect it with other independently-developed simulators. This is part of the vision of Vivarium -- it doesn't force you to adopt a particular simulation methodology or simulation tool, rather it is a framework for combining existing tools.

@khinsen
Copy link
Author

khinsen commented Nov 8, 2022

Thanks @eagmon for these comments! The role of Vivarium as a framework is pretty clear, as is the motivation for its creation. Integrative simulation is indeed a non-trivial problem! What I find missing is a summary of the types of simulation that can participate, and in the nature of the interfaces that are made possible.

Example: does Vivarium support continuous-time simulations, discrete-event simulations, or both? If both, how are they combined?

Another example: simulations typically proceed by maintaining the current state of a system, which is evolved over time according to specific rules/algorithms. Is interaction between simulations defined in terms of their states at equal times? Or is it possible to use some time-accumulated data from one simulation as input to another time, bridging time scales?

@eagmon
Copy link
Member

eagmon commented Nov 13, 2022

Hi @khinsen -- The vivarium engine is a discrete-event simulation engine, but its component processes can be any type of simulation method. The way this is done is described in the paper, and also in the tutorial on our documentation page.

Short answer to your second example -- Vivarium maintains the total state as a type of tree graph that component simulators connect to. They read the state at the start of a time step, and pass an update back at the end. They can do this at any time step they declare, including adaptive time steps. Simulators can be operating at different time scales.

@khinsen
Copy link
Author

khinsen commented Nov 21, 2022

Thanks @eagmon! That's exactly the kind of information I was looking for when I checked out the Vivarium Web site. In other words, that's what I think should be said close to a new visitor's entry point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants