Plug your Scilab model

Suggest edits
Documentation > Plug

ScilabTask 🔗

Scilab is an open source software initially designed for numerical computation (see the official website). It provides its own high-level scripting language and can be used as a computing kernel only. Note that it includes most of proprietary Matlab's functionalities and that a set of conversion tools exists (doc).

Preliminary remarks 🔗

The ScilabTask uses the Singularity container system. You should install Singularity on your system otherwise you won't be able to use it.

The ScilabTask supports files and directories, in and out. Get some help on how to handle it by reading this page.

Arguments of the ScilabTask 🔗

It takes the following arguments :
  • script String or file, mandatory. The Scilab script to be executed.
  • install Sequence of strings, optional (default = empty). The commands to be executed prior to the script execution (to install libraries on the system).
  • version String, optional. The version of Scilab to run.
  • prepare Sequence of strings, optional (default = empty). System commands to be executed just before to the execution of Scilab on the execution node.

Simple ScilabTask 🔗

Here is a dummy workflow multiplying a vector dArray by i using a ScilabTask:

// Declare variables
val i = Val[Int]
val dArray = Val[Array[Double]]

// Task
val m = ScilabTask("dArray = dArray * i") set (
    inputs += i mapped "i",
    inputs += dArray mapped "dArray",
    outputs += i,
    outputs += dArray mapped "dArray",

    // Default values
    i := 9,
    dArray := Array(9.0, 8.0)
)

// Workflow
m hook DisplayHook()

A ScilabTask running a script 🔗

Here is a dummy workflow running the "rand.sce" script:

val size = Val[Int]
val a = Val[Array[Array[Double]]]

val model =
  ScilabTask(workDirectory / "rand.sce") set (
    inputs += (size.mapped),
    outputs += (a.mapped("A"), size)
  )

DirectSampling(
  evaluation = model,
  sampling = size in (0 to 10 by 2)
) hook (workDirectory / "results2")