The OpenMOLE Language

Suggest edits


1 - OpenMOLE scripts
2 - Basic Scala constructs
3 - Going further

The OpenMOLE language is an extension of the Scala language designed for model exploration and distributed computing. It supports all the Scala constructs, and additional operators and classes specifically designed to compose workflows. OpenMOLE workflows expose explicit parallel aspect of the workload that can be delegated to distributed computing environments in a transparent manner. The philosophy of OpenMOLE is test small (on your computer) and scale for free (on remote distributed computing environments).
A good way to get a first glimpse of what OpenMOLE can do is to read this research paper.

OpenMOLE scripts 🔗

The OpenMOLE scripts are stored in the GUI in .oms files. One workflow can be split into several files.
To be able to use the content of a .oms file (let's call it file2.oms) in another one (say file1.oms), located in the same directory, file2.oms needs to be imported in file1.oms. The following line needs to be written at the beginning of file1.oms:
import _file_.file2._
To refer to a file located in a parent directory, use the parent keyword:
import _parent_._file_.file2._

Basic Scala constructs 🔗

You need only a very basic understanding of the Scala language in order to be able to design OpenMOLE workflows.

Declare variables 🔗

val a = 1 // declares a variable a of type Int
val b = "Text" // declares a variable a of type String
val c = if(condition) 5 else 10 // declare a variable c of type Int, the value of c depends on the condition

Construct objects 🔗

OpenMOLE takes advantage of the object oriented aspect of Scala. A set of objects are available to build and assemble together to specify your workflow. Usually, an object is instantiated using the new keyword: val f = new File("/tmp/file.txt")
However, in OpenMOLE we have chosen to use factories instead of directly constructing objects, that's why most of OpenMOLE scripts don't contain the new keyword at all. For instance: val l = File("/tmp/file.txt"). Under the hood, it calls a method that is in charge of building the file.

Named parameters 🔗

Function calls generally require the parameters to be provided in a predefined order. In Scala you can get rid of this ordering constraint by using named parameters. OpenMOLE scripts will often make use of this pattern: val t = SomeClass(value1, value2, otherParam = otherValue). Here it means that value1 and value2 are the values for the first two (unnamed) parameters, and that the parameter named otherParam is set to the value otherValue. Unspecified parameters are set to their default value.

Going further 🔗

What you have read so far should be sufficient in order to get started with OpenMOLE. To begin with the OpenMOLE syntax you should have a look at the Getting started. You may also want to look at the Task documentation, and more generally the Documentation.
Scala is a very nice language, with an extensive and very well designed standard library. To get more insights on this language, check these links: