bugGNU Octave - Bugs: bug #36783, Large sparse matrix fails in thee...

 
 

bug #36783: Large sparse matrix fails in thee 64-bit build

Submitter:  Hsaing-Fu Yu (Rofu) <rofu>
Submitted:  Wed 04 Jul 2012 04:33:58 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Rofu Open/Closed:  * Closed
Release:  * 3.6.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 04 Jul 2012 05:06:27 PM UTC, comment #4: 

Thanks for the report and quick fix, both of you.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Wed 04 Jul 2012 05:02:20 PM UTC, comment #3: 
John W. Eaton <jwe>
Group administrator
Wed 04 Jul 2012 04:50:44 PM UTC, comment #2: 

Yes, I was using mex interface.

Here is the sample "test.c" I used in a 64-bit with enough memory.

#include "mex.h"

void mexFunction( int nlhs, mxArray *plhs[],
        int nrhs, const mxArray *prhs[] )
{
    mxCreateSparse(65535, 65535, 2749999776, mxREAL);
    return;
}


When I executed test.mex, i got the
  error: test: failed to allocate 525161728 bytes of memory

It seems that it's a overflow problem. After I modified mex.cpp and re-compiled octave again,  it works.

Hsaing-Fu Yu (Rofu) <rofu>
Wed 04 Jul 2012 04:41:59 PM UTC, comment #1: 

You seem to be using the mex interface, so can you please describe a bit more what fails and how?

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Wed 04 Jul 2012 04:33:58 PM UTC, original submission:  

Followed the instruction in
http://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html,
allocating a sparse matrix with more than 2G nnz elements fails.

After traced the code, I found a bug on the line 1517 in mex.cc.
Types for m, n, nzmax_arg should be "mwSize" rather than "int."

Here is the diff result:

1517c1517
<   mxArray_sparse (mxClassID id_arg, int m, int n, int nzmax_arg,
---
>   mxArray_sparse (mxClassID id_arg, mwSize m, mwSize n, mwSize nzmax_arg,


Hsaing-Fu Yu (Rofu) <rofu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by rofu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-04 jordigh StatusNone Fixed
        Open/ClosedOpen Closed
    2012-07-04 jordigh StatusFixed None
        Open/ClosedClosed Open
    2012-07-04 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code