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 & Restrictions

Octave is available to all OSC users without restriction.

The following versions of Octave are available on OSC clusters:

Version Oakley Ruby Owens
3.6.1 X    
3.6.4 X*    
4.0.0   X*  
4.0.3     X*

Usage

Set-up

To initialize either cluster for the use of 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.

#PBS -N AppNameJob
#PBS -l nodes=1:ppn=12
#PBS -l walltime=01:00:00
#PBS -l software=appname

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

octave < mycode.o > data.out

cp data.out $PBS_O_WORKDIR

Working with Packages

Here is Octave 4.0.1 documentation on working with packages:

https://www.gnu.org/software/octave/doc/v4.0.1/Installing-and-Removing-Packages.html

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

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

Service: