Octave

Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command-line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language.

Octave has extensive tools for solving common numerical linear algebra problems, finding the roots of nonlinear equations, integrating ordinary functions, manipulating polynomials, and integrating ordinary differential and differential-algebraic equations. It is easily extensible and customizable via user-defined functions written in Octave's own language, or using dynamically loaded modules written in C++, C, Fortran, or other languages.

Availability and Restrictions

Versions

The following versions of Octave are available on Owens Clusters:

Version Owens
4.0.3 X*
* Current default version

You can use module spider octave to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

Access

Octave is available to all OSC users. If you have any questions, please contact OSC Help.

Publisher/Vendor/Repository and License Type

https://www.gnu.org/software/octave/, Open source

Usage

Set-up

To initialize Octave, run the following command:

module load octave

Using Octave

To run Octave, simply run the following command:

octave

Batch Usage

The following example batch script will an octave code file mycode.o via the batch processing system. The script requests one full node of cores on Oakley and 1 hour of walltime.

#!/bin/bash
#SBATCH --job-name=AppNameJob
#SBATCH --nodes=1 --ntasks-per-node=12
#SBATCH --time=01:00:00
#SBATCH --licenses=appname
#SBATCH --account <project-account>

module load octave
cp mycode.o $TMPDIR
cd $TMPDIR

octave < mycode.o > data.out

cp data.out $SLURM_SUBMIT_DIR

Working with Packages

See the Octave 4.0.1 documentation on working with packages.

To install a package, launch an Octave session and type the pkg list command to see if there are any packages within your user scope.  There is an issue where global packages may not be seen by particular Octave versions.  To see the location of the global packages file use the command pkg global_list.

If you are having trouble installing your own packages, you can use the system-wide packages. Due to issues with system-wide installation, you will need to copy the system-wide package installation file to your local package installation file with cp $OCTAVE_PACKAGES $HOME/.octave_packages.

Then via pkg list you should see packages that you can load.  This is clearly not portable and needs to be reperformed within a job script if you are using packages across multiple clusters.

Further Reading

See Also

Supercomputer: 
Service: