UMBC logo
UMBC High Performance Computing Facility
How to run Scilab on tara

Introduction

On this page we'll see how to use Scilab on the tara cluster. Before proceeding, make sure you've read the how to run tutorial first. Scilab is an open source mathematics package, similar to in functionality to MATLAB.

Example batch script

We'll write a simple Scilab script that says "hello", and does some simple linear algebra operations.
hostname = unix_g("hostname");
printf('Hello world from %s\n', hostname);

A = [1 3 5; 2 5 1; 2 3 8]
inv(A)
det(A)

Download: ../code/scilab_hello/hello.m
We can launch it with a standard SLURM script
#!/bin/bash
#SBATCH --job-name=hello_scilab
#SBATCH --output=slurm.out
#SBATCH --error=slurm.err
#SBATCH --partition=develop

scilab -nogui -nb < hello.m

Download: ../code/scilab_hello/run.slurm
Now we launch the job
[araim1@tara-fe1 scilab_hello]$ sbatch run.slurm
sbatch: Submitted batch job 2618
[araim1@tara-fe1 scilab_hello]$ ls
hello.m  run.slurm  slurm.err  slurm.out
[araim1@tara-fe1 scilab_hello]$ cat slurm.out
 
 
Hello world from n1
 
 
 A  =
 
    1.    3.    5.  
    2.    5.    1.  
    2.    3.    8.  
 
 ans  =
 
  - 1.48    0.36    0.88  
    0.56    0.08  - 0.36  
    0.16  - 0.12    0.04  
 
 ans  =
 
  - 25.  
 
[araim1@tara-fe1 scilab_hello]$ 
Also note that hello.m can be run directly on the front end node, which is okay here because it's a small job
[araim1@tara-fe1 scilab_hello]$ scilab -nogui -nb < hello.m 
 
 
Hello world from tara-fe1.rs.umbc.edu
 
 
 A  =
 
    1.    3.    5.  
    2.    5.    1.  
    2.    3.    8.  
 
 ans  =
 
  - 1.48    0.36    0.88  
    0.56    0.08  - 0.36  
    0.16  - 0.12    0.04  
 
 ans  =
 
  - 25.  
 
[araim1@tara-fe1 scilab_scilab]$ 

Running Scilab interactively

Scilab can also be used interatively on the front end node, as in the following example
[araim1@tara-fe1 scilab_hello]$ scilab -nogui -nb
 
-->hostname = unix_g("hostname");
 
-->printf('Hello world from %s\n', hostname);
Hello world from tara-fe1.rs.umbc.edu
 
-->A = [1 3 5; 2 5 1; 2 3 8]
 A  =
 
    1.    3.    5.  
    2.    5.    1.  
    2.    3.    8.  
 
-->inv(A)
 ans  =
 
  - 1.48    0.36    0.88  
    0.56    0.08  - 0.36  
    0.16  - 0.12    0.04  
 
-->det(A)
 ans  =
 
  - 25.  
 
-->quit 
[araim1@tara-fe1 scilab_hello]$ 
As always, this should only be used for smaller computations. Intensive programs should be submitted to the compute nodes.

Above we've shown Scilab in command line mode. You can launch the GUI version by the following

[araim1@tara-fe1 scilab_hello]$ scilab