Dynamo standalone
The Dynamo standalone is the version of Dynamo that runs without any Matlab installation. A standalone package carries its own "Matlab" version in the form of MCR libraries.
Contents
Activating the standalone
To use Dynamo is standalone modus in a shell, you need to activate first that shell, typically with:
source <DYNAMO_ROOT>/dynamo_activate_linux_shippedMCR.sh
Using the standalone
Our advice to work with the Dynamo standalone is to use at least two linux shells. You would use one shell (let's call it console shell) to run an interactive Dynamo console, where you can create projects, view tomograms or analyse results. In a second linux shell (let's call it computing shell), you can launch the projects edited on the first shell.
Dynamo must be active in both shells!
On the Console shell
A console shell can be launched through typing dynamo or dynamo x.
- Using the Wizard GUI
- Make certain that when you create a project, you use the standalone option in the Computing environment GUI. Each "core" will be handled by a different openMP process. You can also run alignment projects in the GPU, in which case you also have to mark the set of GPU identifiers.
- Using the command line
- In case that you are designing your project from the command line, the parameter that controls the environment is called destination. To use the standalone, it should be tuned to system_omp for multicore projects, or to system_gpu for GPU projects.
In both cases you can check and unfold the project in the GUI handled by the Dynamo console to produce an execution script. A project called myProject will generate an standalone script called myProject.exe. Instead of running the project in the Console shell, the Console will be blocked until the project is finished (and wont show any results on screen).
On the computation shell
To execute a project myProject in a shell, you don't need to open any Dynamo console first. Just type:
myProject.exe
or
./myProject.exe
depending on your system configuration. You might also need to adjust permissions through:
chmod u=rxw ./myProject.exe
Note, anyway, that you can run in the Linux shell any project that has been unfolded as standalone: you can thus create your projects in a Matlab shell, check and unfold them under Matlab, an then run them inside a Linux shell using the generated execution script.
For independent commands
You can use the standalone version to execute independent Dynamo commands from the linux shell (avoiding the Dynamo console). Use the sign " to encase the literal expression that you would write on a Matlab shell. Importantly do NOT use the short version of the commands, i.e., do not use dwrite instead of dynamo_write. For example, writing in your (Dynamo-activated) shell:
dynamo "x=rand(64,64,64);dynamo_write(x,'test.em');"
will create a cube containing random uniform noise in the temporary workspace and then write it into a file test.em. Note that the workspace is local to each call to Dynamo through the dynamo command, so that you can NOT divide the order in two:
dynamo "x=rand(64,64,64);"
dynamo "dynamo_write(x,'test.em');"
would throw an error on the second line.
In general, calling the command dynamo will require an initiation time of several seconds, so it is convenient to pile as many operations as possible inside a single call. Loops are allowed:
dynamo "for i=1:10;x=rand(64,64,64);dynamo_write(x,sprintf('test%d.em',i));end"
As an alternative, you can write Dynamo instructions in a text file and pass the name of the file to the dynamo command. For intance, if you have a text file called commnads.sh with this content:
x=rand(64,64,64); dynamo_write(x,'test.em');
you can execute the script by writing:
dynamo commands.sh
Note that this imposes a maximum of 1024 characters for the full script.
With this technique, it is possible to fully design and run a project from the command line , or to integrate Dynamo operations in third party pipelines.
Advantages over the Matlab version
Besides the obvious advantage of not requiring the purchase of any Matlab license, there are some minor functionalities in Dynamo that would require an extra Toolbox on top of the basic Matlab license, as Statistics or Curve fitting. These functionalities are never used in the basic pipeline of Dynamo, but are part of the extended tools offered by Dynamo through its command line. When you use the standalone, all mathematical toolboxes are automatically available.
Additionally, the standalone version is automatically delivered with the newest Matlab version. If you are running Dynamo on Matlab versions previous to release R2014b, you can experiment visualization problems in some programs.
Functionality restrictions
There is one single functionality not available in the standalone version: although multicore projects can be run normally, the averaging step of each iteration will run on single core. For most projects, this limitation has no practical effect, as the numerical bottleneck is the alignment step.
Testing your standalone
Open a system shell. Let's call it dynamo console shell
Activate Dynamo on this shell:
source <Dynamo Root>/dynamo_activate_linux_with_shippedMRC.sh
or equivalently for your system (Mac or Windows).
Start the Dynamoconsole on it by typing
dynamo
on it. Now this shell will work as a console when you can type Dynamo commands
Under the Dynamo >> prompt, we will create a tutorial project;
dtutorial mytest -p ptest
Open a different system shell. Let's call it project execution shell.
On this shell, activate Dynamo.
source <Dynamo Root>/dynamo_activate_linux_with_shippedMRC.sh
Execute the project in the project execution shell
./ptest.exe
Please note that this project has been unfolded during creation. For your own projects, you'll need to unfold them manually through the dcp GUI or with the command
dvunfold ptest
invoked inside the Dynamo console