[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instructions for Installing BLAS and LAPACK library on Octave 5.2.0

From: Ian McCallion
Subject: Re: Instructions for Installing BLAS and LAPACK library on Octave 5.2.0
Date: Tue, 29 Sep 2020 18:12:38 +0100

On Tue, 29 Sep 2020 at 17:54, Ian McCallion <> wrote:
> On Tuesday, 29 September 2020, Nicholas Jankowski <> wrote:
>>>> Downloading Octave 5.2.0-64 bit executable from the official GNU Octave 
>>>> website( for 
>>>> Win 10
>>>> Installing the same and checking with the default OPENBLAS library.
>>>> Assigning the value for the environment variable  OPENBLAS_NUM_THREADS = 
>>>> "the number of processors we need to utilize"
>>> The second step is not necessary. Otherwise yes.
>>> Ian
>>  Do you mean the installing or assigning step?
> My apologies. I was away from my desk any failed to give the question my full 
> attention.
> Install ( of course), but the default installation does result in 
> libopenblas.dll being copied to libblass.dll so that "checking with the 
> default OPENBLAS library" is not necessary.
>> In my default config zip install, OPENBLAS_NUM_THREADS was empty.  I set it 
>> to different values from 1-4 since I have a 4 core machine, and didn't 
>> notice any real difference running that test routine you posted.  i extended 
>> the 1e8 to 2e8 and 1e9 to get meaningful runtimes, but there seemed to be no 
>> difference changing the value of that option.  in all cases multiple cores 
>> were taxed on execution.  It's a managed machine so I don't have Process 
>> Explorer to actually verify the thread count, so maybe other things are 
>> happening that I'm not noticing.
> I have the same result. I have task manager and whatever the value of  
> OPENBLAS_NUM_THREADS the execution time is the same and the cpu utilisation 
> peaks at the same level so it would appear the environment variable is being 
> ignored. I will investigate further as my system uses this, succesfully I 
> believe!

Progress. It all comes flooding back to me now! You must set
OPENBLAS_NUM_THREADS before launching Octave, which is of course a
real pain and cannot surely be justified as you might actually want to
change the number of threads used. I Imagine the DLL is loaded at
Octave startup and the value of OPENBLAS_NUM_THREADS is read at that

If you don't set OPENBLAS_NUM_THREADS the default is to use enough
threads to consume most the CPU fully, and on my system I get

  >> tic; a=rand(10000); b=a*a;toc
  Elapsed time is 13.0891 seconds.

setting OPENBLAS_NUM_THREADS=1 and then calling Octave:
   >> tic; a=rand(10000); b=a*a;toc
   Elapsed time is 42.447 seconds.

One way to set OPENBLAS_NUM_THREADS which avoid leaving the Octave
environment is:

  >> setenv('OPENBLAS_NUM_THREADS','1')
  >> system C:/Octave/Octave-5.2.0/octave.vbs

This launches a second copy of Octave with the first as parent hence
inheriting the environment variables.

Cheers... Ian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]