## Introduction

**OPENBLAS** is an optimized implementation of the Basic Linear Algebra Subprograms (BLAS). The BLAS are organized into Level 1 (vector-vector), Level 2 (matrix-vector) and Level 3 (matrix-matrix) operations. The BLAS carry out many useful linear algebra tasks, include vector norms, matrix-vector and matrix-matrix multiplication.

The OPENBLAS library can be called by C, C++ or Fortran programs. For C and C++ calling programs, there are two options:

- the "F2C interface" requires the user to declare each OPENBLAS function as an
**external**, to append an underscore to the function name, and to call every argument by reference, like so:

dgemm_ ( &transa_char, &transb_char, &m, &n, &k, &alpha, a, &lda, b, &ldb, &beta, c, &ldc );

- the "C interface" requires the user to prepend the string
**cblas_**to the name of every function, inserts an additional initial argument that specifies whether matrix storage is row major or column major, and allows scalar input arguments to be passed by value:

cblas_dgemm ( CblasColMajor, transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc );

The project web site is: https://github.com/xianyi/

Reference for the original FORTRAN77 BLAS:

- Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh,

Algorithm 539: Basic Linear Algebra Subprograms for Fortran Usage,

ACM Transactions on Mathematical Software,

Volume 5, Number 3, September 1979, pages 308-323. - Jack Dongarra, Jeremey Du Croz, Sven Hammarling, Richard Hanson,

An extended set of FORTRAN Basic Linear Algebra Subprograms,

ACM Transactions on Mathematical Software,

Volume 14, Number 1, March 1988, pages 1-17. - Jack Dongarra, Jeremey Du Croz, Iain Duff, Sven Hammarling,

A set of Level 3 Basic Linear Algebra Subprograms,

ACM Transactions on Mathematical Software,

Volume 16, Number 1, March 1990, pages 1-17.

## Availability

Version 0.2.19 of OPENBLAS is available on the ARC cluster Cascades. Version 0.2.14 is available on BlueRidge, DragonsTooth, HokieOne, HokieSpeed, and NewRiver. To check the latest information on available versions of OPENBLAS on any ARC cluster, type "module spider openblas".

## Usage

OPENBLAS requires that several modules be loaded before it can be run. One version of the appropriate commands is:

module purge module load gcc/5.2.0 module load openblas/0.2.14

## Examples

Here is an example batch script which uses a C program with OPENBLAS:

#! /bin/bash #PBS -l walltime=00:05:00 #PBS -l nodes=1:ppn=1 #PBS -W group_list=newriver #PBS -q open_q #PBS -j oe cd $PBS_O_WORKDIR module purge module load gcc/5.2.0 module load openblas/0.2.14 gcc -c -I$OPENBLAS_DIR/include openblas_test_c.c gcc -o openblas_test openblas_test_c.o -L$OPENBLAS_LIB -lopenblas ./openblas_test_c

A complete set of files to carry out a similar example calculation are available in a tar file