Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if Octave has full access to the 64 bit memory range

Tags:

64-bit

octave

How can I know if Octave has full access to the 64 bit memory range?

Can I create a matrix which uses up more than 4GB of memory?

like image 792
Ben Avatar asked Feb 19 '09 15:02

Ben


3 Answers

I realize the question is old but it's still quite relevant. On a Mac yes, I used homebrew and include an example of a matrix over 4GB below. Currently this procedure works:

Install homebrew and then run the following in a terminal window.

brew install hg
brew install --use-gcc --HEAD graphicsmagick
brew install gfortran
brew install --use-gcc gnuplot
brew install octave

Then add this to ~/.octaverc:

setenv GNUTERM 'x11'
graphics_toolkit("gnuplot")

Enjoy your 64-bit octave compile!

octave:1> a = zeros(500*2^10+1,2^10);
octave:2> whos
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  ===== 
        a      512001x1024              4194312192  double
        ans         1x50                       498  cell

Total is 524289074 elements using 4194312690 bytes
like image 158
thirdhaf Avatar answered Nov 02 '22 16:11

thirdhaf


I installed a 64-bit version of Octave (octave-devel) using MacPorts. Installation instructions are available at http://shifteleven.com/articles/2011/11/06/installing-octave-on-osx-with-macports.

However, it appears that the octave-devel package still uses Octave's 32-bit default indexing so I can't load arrays of 'int8' greater than 2GB. (ref: http://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html).

This may be caused by the octave-devel package not compiling 64-bit versions of the linear algebra packages that Octave depends on.

% Load a 3GB int8 vector (32-bit limits to 2GB)
octave:1> a = zeros(1024^3*3, 1, ‘int8′);
error: memory exhausted or requested size too large for range of Octave’s index type — trying to return to prompt

64bit everywhere's answer does not show a valid test because the default Octave's 32-bit indexing allows the creation of 'double' arrays up to 16GB.

like image 2
somealias Avatar answered Nov 02 '22 16:11

somealias


I don't know if that helps you but according to this: http://wiki.octave.org/wiki.pl?EnableLargeArrays, support over 2 GB of memory for array is experimental.

like image 1
Czubek Avatar answered Nov 02 '22 16:11

Czubek