SuperLU 3.0

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
Jaka Zevnik
Posts: 5
Joined: Fri Jul 02, 2004 4:26 am
Location: University of Ljubljana, FGG - IKPIR
Contact:

SuperLU 3.0

Post by Jaka Zevnik »

There seems to be a bug in the new version of SuperLU (see also http://opensees.berkeley.edu/community/ ... .php?t=387). It looks like someone has dropped a line in dgstrf.c, leaving variable iperm_r undefined under certain conditions.

The relevant code of SuperLU 3.0 is:

Code: Select all

if ( usepr ) {
    /* Compute the inverse of perm_r */
    iperm_r = (int *) intMalloc(m);
    for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k;
    iperm_r_allocated = 1;
}
The code should be (see the old version of the dgstrf.c file):

Code: Select all

if ( usepr ) {
    /* Compute the inverse of perm_r */
    iperm_r = (int *) intMalloc(m);
    for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k;
    iperm_r_allocated = 1;
} else 
    iperm_r = 0;
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

true but they put it in the decleration of i_perm_r

int *iperm_r;

was changed in the latest code to:

int *iperm_r = NULL;

will see if the change you suggest does work .. after all the problem occurs on the windows version which is compiled using the bug-free vc++ compiler.
Jaka Zevnik
Posts: 5
Joined: Fri Jul 02, 2004 4:26 am
Location: University of Ljubljana, FGG - IKPIR
Contact:

Post by Jaka Zevnik »

Actually the original code compiles just fine in VS.net and the problem does not occur in the release version of the program. I encountered it while running a time history analysis in a debug mode. In this case, time history analysis fails during the first step (a call to one of the functions using iperm_r, which definitely isn't defined at that time).
Post Reply