Simflowny is a cloud-based open environment for scientific dynamical models, composed by a semantic Domain Specific Language and a friendly Integrated Development Environment, which automatically generates parallel code for simulation frameworks.
Currently supported scientific model paradigms are:
- Partial Differential Equations, such as Navier-Stokes and Maxwell Equations, and the Brusselator. This family is conformed by two branches:
- Balance Law PDE, the PDEs are written as an evolution system of first order in time and space, which allow us to use schemes based on Finite Volume Methods to deal with shocks and discontinuities. This model also allows parabolic terms like the ones appearing, for instance, in the Navier-Stokes Equations.
- Generic PDE, allowing almost arbitrary forms of evolution equations, including derivatives of any order. The only restriction is that the system must be still first order in time. Typical examples of systems naturally in this form would be the Maxwell Equations.
- Spatial Agent-Based Models, such as Ising and Collective Motion (flocking) models
- Graph-based Models, such as the Voter model and the Elementary Cellular Automaton
For further information see https://bitbucket.org/iac3/simflowny/wiki/Home.
Simflowny is bundleized in two separate images:
App: contains the application and simulation frameworks ready to be used.
Datastore: contains the sample database provided by Simflowny, and is the place in which the code generated by the user is going to be stored.
This allows users to update the application without losing their information.
Note: On Linux all commands must be executed with
sudo or from a root terminal.
Getting the app from scratch
- Obtain the datastore container from the Docker hub:
docker pull iac3/simflowny:datastore
- Obtain the app container from the Docker hub:
docker pull iac3/simflowny:app
Running the app for the first time
- Create the data volume container:
docker create -v /generatedCode --name storage iac3/simflowny:datastore
- Launch Simflowny:
docker run -i -t -p 9080:8080 --volumes-from storage iac3/simflowny:app
This will launch the Simflowny container bound to the datastore container. Internally Simflowny runs on the 8080 port of the container and the above command maps this port to the port 9080 of the host. You may want to change such mapping if you are already using the port 9080 on your machine.
Once launched, the terminal will show messages while the application is loading. After a few seconds, the application is ready and Simflowny can be open in a browser. Notice that from this point you can no longer use this terminal to execute docker commands and you may need to open a new Docker terminal.
To open the app in a non Windows platform, open a web browser and go to:
On Windows, the IP for the app should be retrieved by using the command:
Then, use the following http address:
Stopping the app
- Find the container name with:
- Stop the container:
docker stop <container_name>
- Only on Windows, if you do not intend to use Docker for other containers, you probably want to stop the virtual machine. To do so execute:
to find the name of the virtual machine linked to Docker, typically
default, and then run:
docker-machine stop <vmName>
- Then you may close the Docker terminal.
Running the app again
- List the Docker containers by:
docker ps -a
- Locate the container corresponding to the IMAGE
iac3/simflowny:appand notice its name.
- Start the app by using the following command:
docker start <containerName>
Getting started with Simflowny
To start using Simflowny, visit https://bitbucket.org/iac3/simflowny/wiki/Home and check the tutorials and user guides.
Running generated code
Following Simflowny tutorials and user guides, the user can generate simulation code. There are two options for compiling and running code from Docker:
- Compiling and running inside Docker.
1.1 Find the running container name by typing
docker psin a terminal. A list of the active containers is shown.
1.2 Run a terminal in the container executing
docker exec -i -t <container_name> /bin/bash
1.3 Once inside the container, the generated code is located in
generatedCodefolder, ordered by name, author and version. Browse to the proper folder and compile using the instructions from the user guide.
1.4 When finished, you may exit the container and return to the docker console by executing
- Exporting the code to another machine. In this case, the user needs to install the simulation framework and its requirements. The instructions are described in https://bitbucket.org/iac3/simflowny/wiki/Compilation.
Copying data to the host
In case you want to transfer files (such as the code or the results of the simulation) from the container to the host system, please follow these steps:
Decide where you want to keep the files in your host system. For instance in Windows you may decide to save them into:
In Linux the path could be:
In the Windows case you need to translate the path to Linux syntax by replacing
/c/and changing all backslashes
/. In our example the result would be:
On the Docker terminal run the following comand
docker run --rm -v <hostpath>:/host:rw --volumes-from storage iac3/simflowny:app cp -r /generatedCode /host
<hostpath>is the path defined in step 2 (Windows) or in step 1 (Linux). Notice that this command will copy the files from
/generatedCodein the container to the selected path in the host. Of course, one can transfer any other folder other than
Installing Simflowny on Docker from image files
In case you want to test a non stable version, you may need to install the app from image files instead of installing it from the Docker hub. To do so run:
docker load < simflowny_app.tar
docker load < simflowny_datastore.tar
Docker performance on Windows
In case you experience performance problems, you may modify the settings of de Docker virtual machine:
- Stop the the Docker virtual machine by running:
docker-machine stop <VMName>
- Close the Docker terminal
- Open Oracle VM VirtualBox, select the machine corresponding to the name found before, go to system settings and modify the following:
3.1. Increase base memory
3.2. Go to processor tab and increase the use of processors
3.3. In the acceleration tab select legacy paravirtualization interface
- Save the changes.
- Open the Docker terminal. This starts the virtual machine automatically.
Opening a shell in the running app
- Get the name of the container running the app
- Execute a shell in the running app
docker exec -i -t <container_name> /bin/bash
- To check if there are unused containers run:
docker ps -a
- To remove non needed containers
docker rm <containerName>