|
|
@ -94,13 +94,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
|
|
#define HANDLE_SIZE 8
|
|
|
|
#define HANDLE_SIZE 8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
|
|
SuperMatrix *A;
|
|
|
|
|
|
|
|
dLUstruct_t *LUstruct;
|
|
|
|
|
|
|
|
gridinfo_t *grid;
|
|
|
|
|
|
|
|
dScalePermstruct_t *ScalePermstruct;
|
|
|
|
|
|
|
|
} factors_t;
|
|
|
|
|
|
|
|
#else
|
|
|
|
typedef struct {
|
|
|
|
typedef struct {
|
|
|
|
SuperMatrix *A;
|
|
|
|
SuperMatrix *A;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
gridinfo_t *grid;
|
|
|
|
gridinfo_t *grid;
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
} factors_t;
|
|
|
|
} factors_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
@ -127,14 +135,20 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
|
|
|
SuperMatrix *A;
|
|
|
|
SuperMatrix *A;
|
|
|
|
NRformat_loc *Astore;
|
|
|
|
NRformat_loc *Astore;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
dScalePermstruct_t *ScalePermstruct;
|
|
|
|
|
|
|
|
dLUstruct_t *LUstruct;
|
|
|
|
|
|
|
|
dSOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#else
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
gridinfo_t *grid;
|
|
|
|
gridinfo_t *grid;
|
|
|
|
int i, panel_size, permc_spec, relax, info;
|
|
|
|
int i, panel_size, permc_spec, relax, info;
|
|
|
|
trans_t trans;
|
|
|
|
trans_t trans;
|
|
|
|
double drop_tol = 0.0, b[1], berr[1];
|
|
|
|
double drop_tol = 0.0, b[1], berr[1];
|
|
|
|
#if defined(SLUD_VERSION_5)
|
|
|
|
#if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
superlu_options_t options;
|
|
|
|
superlu_options_t options;
|
|
|
@ -160,10 +174,18 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
|
|
|
SLU_NR_loc, SLU_D, SLU_GE);
|
|
|
|
SLU_NR_loc, SLU_D, SLU_GE);
|
|
|
|
|
|
|
|
|
|
|
|
/* Initialize ScalePermstruct and LUstruct. */
|
|
|
|
/* Initialize ScalePermstruct and LUstruct. */
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
ScalePermstruct = (dScalePermstruct_t *) SUPERLU_MALLOC(sizeof(dScalePermstruct_t));
|
|
|
|
|
|
|
|
LUstruct = (dLUstruct_t *) SUPERLU_MALLOC(sizeof(dLUstruct_t));
|
|
|
|
|
|
|
|
dScalePermstructInit(n,n, ScalePermstruct);
|
|
|
|
|
|
|
|
#else
|
|
|
|
ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t));
|
|
|
|
ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t));
|
|
|
|
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
|
|
|
|
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
|
|
|
|
ScalePermstructInit(n,n, ScalePermstruct);
|
|
|
|
ScalePermstructInit(n,n, ScalePermstruct);
|
|
|
|
#if defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
dLUstructInit(n, LUstruct);
|
|
|
|
|
|
|
|
#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5)
|
|
|
|
LUstructInit(n, LUstruct);
|
|
|
|
LUstructInit(n, LUstruct);
|
|
|
|
#elif defined(SLUD_VERSION_3)
|
|
|
|
#elif defined(SLUD_VERSION_3)
|
|
|
|
LUstructInit(n,n, LUstruct);
|
|
|
|
LUstructInit(n,n, LUstruct);
|
|
|
@ -223,15 +245,21 @@ int mld_dsludist_solve(int itrans, int n, int nrhs,
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#ifdef Have_SLUDist_
|
|
|
|
#ifdef Have_SLUDist_
|
|
|
|
SuperMatrix *A;
|
|
|
|
SuperMatrix *A;
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
dScalePermstruct_t *ScalePermstruct;
|
|
|
|
|
|
|
|
dLUstruct_t *LUstruct;
|
|
|
|
|
|
|
|
dSOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#else
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
gridinfo_t *grid;
|
|
|
|
gridinfo_t *grid;
|
|
|
|
int i, panel_size, permc_spec, relax, info;
|
|
|
|
int i, panel_size, permc_spec, relax, info;
|
|
|
|
trans_t trans;
|
|
|
|
trans_t trans;
|
|
|
|
double drop_tol = 0.0;
|
|
|
|
double drop_tol = 0.0;
|
|
|
|
double *berr;
|
|
|
|
double *berr;
|
|
|
|
#if defined(SLUD_VERSION_5)
|
|
|
|
#if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
superlu_options_t options;
|
|
|
|
superlu_options_t options;
|
|
|
@ -303,15 +331,21 @@ int mld_dsludist_free(void *f_factors)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#ifdef Have_SLUDist_
|
|
|
|
#ifdef Have_SLUDist_
|
|
|
|
SuperMatrix *A;
|
|
|
|
SuperMatrix *A;
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
dScalePermstruct_t *ScalePermstruct;
|
|
|
|
|
|
|
|
dLUstruct_t *LUstruct;
|
|
|
|
|
|
|
|
dSOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#else
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
ScalePermstruct_t *ScalePermstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
LUstruct_t *LUstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
SOLVEstruct_t SOLVEstruct;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
gridinfo_t *grid;
|
|
|
|
gridinfo_t *grid;
|
|
|
|
int i, panel_size, permc_spec, relax;
|
|
|
|
int i, panel_size, permc_spec, relax;
|
|
|
|
trans_t trans;
|
|
|
|
trans_t trans;
|
|
|
|
double drop_tol = 0.0;
|
|
|
|
double drop_tol = 0.0;
|
|
|
|
double *berr;
|
|
|
|
double *berr;
|
|
|
|
#if defined(SLUD_VERSION_5)
|
|
|
|
#if defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
superlu_dist_options_t options;
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
|
|
|
superlu_options_t options;
|
|
|
|
superlu_options_t options;
|
|
|
@ -334,8 +368,13 @@ int mld_dsludist_free(void *f_factors)
|
|
|
|
// we either have a leak or a segfault here.
|
|
|
|
// we either have a leak or a segfault here.
|
|
|
|
// To be investigated further.
|
|
|
|
// To be investigated further.
|
|
|
|
//Destroy_CompRowLoc_Matrix_dist(A);
|
|
|
|
//Destroy_CompRowLoc_Matrix_dist(A);
|
|
|
|
|
|
|
|
#if defined(SLUD_VERSION_6)
|
|
|
|
|
|
|
|
dScalePermstructFree(ScalePermstruct);
|
|
|
|
|
|
|
|
dLUstructFree(LUstruct);
|
|
|
|
|
|
|
|
#else
|
|
|
|
ScalePermstructFree(ScalePermstruct);
|
|
|
|
ScalePermstructFree(ScalePermstruct);
|
|
|
|
LUstructFree(LUstruct);
|
|
|
|
LUstructFree(LUstruct);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
superlu_gridexit(grid);
|
|
|
|
superlu_gridexit(grid);
|
|
|
|
|
|
|
|
|
|
|
|
free(grid);
|
|
|
|
free(grid);
|
|
|
|