Getting started with OpenMOLE


Romain Reuillon, Mathieu Leclaire
Institut des Systémes Complexes, Paris Île de France

Java7 installation

Linux

Get it from prebuilt OpenJDK packages // details

Windows & Mac

OpenMOLE installation

Getting started

Create a new Groovy Task

Name it javaTask and click on create

Set the pi.jar path in the library tab

Input the command line with a string seed

Create the seed Prototype (Int): click on > prototype from the Groovy Task panel

Create the pi Prototype (Double): click on > prototype from the Groovy Task panel

Set seed as input and pi as output of the Task from the Inputs / Outputs tab

Set a value for seed

The icon turn from white to green (the value is valid)

Close all the open panels

Add the Task on the Scene (right click on the scene)

Create a Display Hook (for displaying the output)

Call it disp, add the pi Prototype (with the + button) and click on create

Add the previously created Hook to the Task by
  • clicking on the right circle of the Task and
  • selecting the disp Hook in the Capsule panel

A blue circle appears on the right circle (meaning that at least one Hook is set)

Build the Mole

Click on start

Create now a new Exploration Task

Name it explore and click on create

Click on sampling.
A new Sampling Compositon shows up and name it replication

Right click on the Sampling scene and add a new Domain.

Click on the domain box that appears: a panel for the domain configuration shows up

Select the Uniform distribution domain, set the type to Int and close this panel.

In the same way, create a Take Domain and set its size to 100

Create a connection from the Uniform box to the Take box (Shift + drag from one box to another)

1) Create a connection from the Domain box the Final stone (Shift + drag)

2) Click on the ? and select the Prototype seed to make it vary on this range

At runtime, 1000 Prototypes seed are generated according to a Uniform distribution

Select the replication Sampling on the explore Task

Add the explore Task on the Scene and set it as Starting Capsule (right click on it)

Draw a Transition between the explore Task to the input slot of the java Task (Shift + drag)

Build and start the Mole again.
The javaTask is now executed 100 times.

Create a Multi-thread environment to share the JavaTask execution on several threads

Click on the environment link on the JavaTask (grey cross) and set the threads environment.

The grey cross turns to the green label of the multi-thread environment.

Build and run the Mole again.
A a new environment panel appears...

Create a new Task (of type Average) to compute a mean value of pi.

Set the computation on an Array of pi values (automatically generated) and store it into a new double Prototype avg

Name the Task meani> and close it

Add the mean Task on the Scene

Connect the javaTask with the meanTask: the workflow is in error ...

[WARNING] Wrong type received at Slot hash of mean, data pi: Array[Double] is expected but pi: double is provided

[WARNING] Wrong type received at Slot hash of mean, data pi: Array[Double] is expected but pi: double is provided

Solution: the data have to be aggregated before the mean Task ...

Right click on the transition between the javaTask and the mean Task and turns it out to Aggregation

The workflow is no longer in error: thanks to the Aggregation transition, an Array of pi values is produced to the mean Task as expected

1) Add a new display hook on the mean Task (disAvg) to see the computed pi mean value

2) Remove the display hook on the java Task to avoid the display of intermediate pi computation values

Build again and rerun the workflow: we obtain a mean value for pi

Create a new Confidence Interval Task ci and a new double Prototype ci to store the confidence interval (on the pi Array).

1) Add the ci Task on the scene (right click on the scene)

2) Connect it to the mean Task (Click and drag)

3) Provide pi[1] as output of the mean Task

Create a Display Hook for ci and use it on the ci Task

Run the workflow, the confidence interval is around :

- 0.003 for 100 replications

- 0.001 for 1000 replications

- 3e10-4 for 10000 replications

In a more complex workflow, we can iterate as long as a given value of the confidence interval (0.0003 for instance) is not reached