00001
00002
00013 #ifndef __SUPERLU_dDEFS
00014 #define __SUPERLU_dDEFS
00015
00016
00017
00018
00019
00020
00021
00022 #include "superlu_defs.h"
00023
00024
00025 typedef struct {
00026 int_t lbnum;
00027 int_t indpos;
00028 } Ucb_indptr_t;
00029
00030
00031
00032
00033
00034 #define MAX_LOOKAHEADS 50
00035 typedef struct {
00036 int_t **Lrowind_bc_ptr;
00037 double **Lnzval_bc_ptr;
00038 int_t **Ufstnz_br_ptr;
00039 double **Unzval_br_ptr;
00040 #if 0
00041 int_t *Lsub_buf;
00042 double *Lval_buf;
00043 #endif
00044 int_t *Lsub_buf_2[MAX_LOOKAHEADS];
00045 double *Lval_buf_2[MAX_LOOKAHEADS];
00046 int_t *Usub_buf_2[MAX_LOOKAHEADS];
00047 double *Uval_buf_2[MAX_LOOKAHEADS];
00048 int_t *Usub_buf;
00049 double *Uval_buf;
00050 double *ujrow;
00051 int_t bufmax[NBUFFERS];
00052
00053
00054
00055
00056
00057
00058
00059
00060 int_t *ToRecv;
00061 int_t *ToSendD;
00062 int_t **ToSendR;
00063
00064
00065 int_t *fmod;
00066 int_t **fsendx_plist;
00067 int_t *frecv;
00068 int_t nfrecvx;
00069 int_t nfsendx;
00070 int_t *bmod;
00071 int_t **bsendx_plist;
00072 int_t *brecv;
00073 int_t nbrecvx;
00074 int_t nbsendx;
00075 int_t *mod_bit;
00076
00077
00078 int_t *ilsum;
00079
00080 int_t ldalsum;
00081 int_t SolveMsgSent;
00082 int_t SolveMsgVol;
00083
00084
00085
00086
00087
00088
00089 int_t UT_SOLVE;
00090 int_t L_SOLVE;
00091 int_t FRECV;
00092 int_t ut_ldalsum;
00093 int_t *ut_ilsum;
00094 int_t *utmod;
00095 int_t **ut_sendx_plist;
00096 int_t *utrecv;
00097 int_t n_utsendx;
00098 int_t n_utrecvx;
00099 int_t n_utrecvmod;
00100 int_t nroot;
00101 int_t *ut_modbit;
00102 int_t *Urbs;
00103 Ucb_indptr_t **Ucb_indptr;
00104 int_t **Ucb_valptr;
00105
00106
00107 int_t n;
00108 int_t nleaf;
00109 int_t nfrecvmod;
00110 } LocalLU_t;
00111
00112
00113 typedef struct {
00114 int_t *etree;
00115 Glu_persist_t *Glu_persist;
00116 LocalLU_t *Llu;
00117 } LUstruct_t;
00118
00119
00120
00121 typedef struct {
00122 int_t *extern_start;
00123 int_t *ind_tosend;
00124 int_t *ind_torecv;
00125 int_t *ptr_ind_tosend;
00126
00127 int_t *ptr_ind_torecv;
00128
00129 int *SendCounts;
00130
00131 int *RecvCounts;
00132
00133 double *val_tosend;
00134 double *val_torecv;
00135 int_t TotalIndSend;
00136
00137 int_t TotalValSend;
00138
00139 } pdgsmv_comm_t;
00140
00141
00142 typedef struct {
00143 int *B_to_X_SendCnt;
00144 int *X_to_B_SendCnt;
00145 int *ptr_to_ibuf, *ptr_to_dbuf;
00146
00147
00148 int *X_to_B_iSendCnt;
00149 int *X_to_B_vSendCnt;
00150 int *disp_ibuf;
00151 int_t *send_ibuf;
00152 void *send_dbuf;
00153
00154 int_t x2b, b2x;
00155 int_t *send_ibuf2;
00156 int_t *recv_ibuf2;
00157 void *send_dbuf2;
00158 void *recv_dbuf2;
00159 } pxgstrs_comm_t;
00160
00161
00162 typedef struct {
00163 int_t *row_to_proc;
00164 int_t *inv_perm_c;
00165 int_t num_diag_procs, *diag_procs, *diag_len;
00166 pdgsmv_comm_t *gsmv_comm;
00167 pxgstrs_comm_t *gstrs_comm;
00168 int_t *A_colind_gsmv;
00169
00170
00171
00172 int_t *xrow_to_proc;
00173 } SOLVEstruct_t;
00174
00175
00176
00177
00178
00179
00180 #ifdef __cplusplus
00181 extern "C" {
00182 #endif
00183
00184
00185
00186 extern void
00187 dCreate_CompCol_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, double *,
00188 int_t *, int_t *, Stype_t, Dtype_t, Mtype_t);
00189 extern void
00190 dCreate_CompRowLoc_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, int_t,
00191 int_t, double *, int_t *, int_t *,
00192 Stype_t, Dtype_t, Mtype_t);
00193 extern void
00194 dCompRow_to_CompCol_dist(int_t, int_t, int_t, double *, int_t *, int_t *,
00195 double **, int_t **, int_t **);
00196 extern int
00197 pdCompRow_loc_to_CompCol_global(int_t, SuperMatrix *, gridinfo_t *,
00198 SuperMatrix *);
00199 extern void
00200 dCopy_CompCol_Matrix_dist(SuperMatrix *, SuperMatrix *);
00201 extern void
00202 dCreate_Dense_Matrix_dist(SuperMatrix *, int_t, int_t, double *, int_t,
00203 Stype_t, Dtype_t, Mtype_t);
00204 extern void
00205 dCreate_SuperNode_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, double *,
00206 int_t *, int_t *, int_t *, int_t *, int_t *,
00207 Stype_t, Dtype_t, Mtype_t);
00208 extern void
00209 dCopy_Dense_Matrix_dist(int_t, int_t, double *, int_t,
00210 double *, int_t);
00211
00212 extern void dallocateA_dist (int_t, int_t, double **, int_t **, int_t **);
00213 extern void dGenXtrue_dist (int_t, int_t, double *, int_t);
00214 extern void dFillRHS_dist (char *, int_t, double *, int_t,
00215 SuperMatrix *, double *, int_t);
00216 extern int dcreate_matrix(SuperMatrix *, int, double **, int *,
00217 double **, int *, FILE *, gridinfo_t *);
00218
00219
00220 extern void dgsequ_dist (SuperMatrix *, double *, double *, double *,
00221 double *, double *, int_t *);
00222 extern double dlangs_dist (char *, SuperMatrix *);
00223 extern void dlaqgs_dist (SuperMatrix *, double *, double *, double,
00224 double, double, char *);
00225 extern void pdgsequ (SuperMatrix *, double *, double *, double *,
00226 double *, double *, int_t *, gridinfo_t *);
00227 extern double pdlangs (char *, SuperMatrix *, gridinfo_t *);
00228 extern void pdlaqgs (SuperMatrix *, double *, double *, double,
00229 double, double, char *);
00230 extern int pdPermute_Dense_Matrix(int_t, int_t, int_t [], int_t[],
00231 double [], int, double [], int, int,
00232 gridinfo_t *);
00233
00234 extern int sp_dtrsv_dist (char *, char *, char *, SuperMatrix *,
00235 SuperMatrix *, double *, int *);
00236 extern int sp_dgemv_dist (char *, double, SuperMatrix *, double *,
00237 int, double, double *, int);
00238 extern int sp_dgemm_dist (char *, char *, int, int, int, double,
00239 SuperMatrix *, double *, int, double,
00240 double *, int);
00241
00242 extern float ddistribute(fact_t, int_t, SuperMatrix *, Glu_freeable_t *,
00243 LUstruct_t *, gridinfo_t *);
00244 extern void pdgssvx_ABglobal(superlu_options_t *, SuperMatrix *,
00245 ScalePermstruct_t *, double *,
00246 int, int, gridinfo_t *, LUstruct_t *, double *,
00247 SuperLUStat_t *, int *);
00248 extern float pddistribute(fact_t, int_t, SuperMatrix *,
00249 ScalePermstruct_t *, Glu_freeable_t *,
00250 LUstruct_t *, gridinfo_t *);
00251 extern void pdgssvx(superlu_options_t *, SuperMatrix *,
00252 ScalePermstruct_t *, double *,
00253 int, int, gridinfo_t *, LUstruct_t *,
00254 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00255 extern int dSolveInit(superlu_options_t *, SuperMatrix *, int_t [], int_t [],
00256 int_t, LUstruct_t *, gridinfo_t *, SOLVEstruct_t *);
00257 extern int_t pxgstrs_init(int_t, int_t, int_t, int_t,
00258 int_t [], int_t [], gridinfo_t *grid,
00259 Glu_persist_t *, SOLVEstruct_t *);
00260 extern void pxgstrs_finalize(pxgstrs_comm_t *);
00261 extern void dSolveFinalize(superlu_options_t *, SOLVEstruct_t *);
00262 extern void dldperm(int_t, int_t, int_t, int_t [], int_t [],
00263 double [], int_t *, double [], double []);
00264 extern int_t pdgstrf(superlu_options_t *, int, int, double,
00265 LUstruct_t*, gridinfo_t*, SuperLUStat_t*, int*);
00266 extern void pdgstrs_Bglobal(int_t, LUstruct_t *, gridinfo_t *,
00267 double *, int_t, int, SuperLUStat_t *, int *);
00268 extern void pdgstrs(int_t, LUstruct_t *, ScalePermstruct_t *, gridinfo_t *,
00269 double *, int_t, int_t, int_t, int, SOLVEstruct_t *,
00270 SuperLUStat_t *, int *);
00271 extern void dlsum_fmod(double *, double *, double *, double *,
00272 int, int, int_t , int_t *, int_t, int_t, int_t,
00273 int_t *, gridinfo_t *, LocalLU_t *,
00274 MPI_Request [], SuperLUStat_t *);
00275 extern void dlsum_bmod(double *, double *, double *,
00276 int, int_t, int_t *, int_t *, Ucb_indptr_t **,
00277 int_t **, int_t *, gridinfo_t *, LocalLU_t *,
00278 MPI_Request [], SuperLUStat_t *);
00279 extern void pdgsrfs(int_t, SuperMatrix *, double, LUstruct_t *,
00280 ScalePermstruct_t *, gridinfo_t *,
00281 double [], int_t, double [], int_t, int,
00282 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00283 extern void pdgsrfs_ABXglobal(int_t, SuperMatrix *, double, LUstruct_t *,
00284 gridinfo_t *, double *, int_t, double *, int_t,
00285 int, double *, SuperLUStat_t *, int *);
00286 extern int pdgsmv_AXglobal_setup(SuperMatrix *, Glu_persist_t *,
00287 gridinfo_t *, int_t *, int_t *[],
00288 double *[], int_t *[], int_t []);
00289 extern int pdgsmv_AXglobal(int_t, int_t [], double [], int_t [],
00290 double [], double []);
00291 extern int pdgsmv_AXglobal_abs(int_t, int_t [], double [], int_t [],
00292 double [], double []);
00293 extern void pdgsmv_init(SuperMatrix *, int_t *, gridinfo_t *,
00294 pdgsmv_comm_t *);
00295 extern void pdgsmv(int_t, SuperMatrix *, gridinfo_t *, pdgsmv_comm_t *,
00296 double x[], double ax[]);
00297 extern void pdgsmv_finalize(pdgsmv_comm_t *);
00298
00299
00300 extern double *doubleMalloc_dist(int_t);
00301 extern double *doubleCalloc_dist(int_t);
00302 extern void *duser_malloc_dist (int_t, int_t);
00303 extern void duser_free_dist (int_t, int_t);
00304 extern int_t dQuerySpace_dist(int_t, LUstruct_t *, gridinfo_t *, mem_usage_t *);
00305 extern void Destroy_LU(int_t, gridinfo_t *, LUstruct_t *);
00306 extern void LUstructInit(const int_t, const int_t, LUstruct_t *);
00307 extern void LUstructFree(LUstruct_t *);
00308
00309
00310 extern void dfill_dist (double *, int_t, double);
00311 extern void dinf_norm_error_dist (int_t, int_t, double*, int_t,
00312 double*, int_t, gridinfo_t*);
00313 extern void pdinf_norm_error(int, int_t, int_t, double [], int_t,
00314 double [], int_t , gridinfo_t *);
00315 extern void dreadhb_dist (int, FILE *, int_t *, int_t *, int_t *,
00316 double **, int_t **, int_t **);
00317
00318
00319 extern float ddist_psymbtonum(fact_t, int_t, SuperMatrix *,
00320 ScalePermstruct_t *, Pslu_freeable_t *,
00321 LUstruct_t *, gridinfo_t *);
00322
00323
00324 extern void dPrintLblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00325 LocalLU_t *);
00326 extern void dPrintUblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00327 LocalLU_t *);
00328 extern void dPrint_CompCol_Matrix_dist(SuperMatrix *);
00329 extern void dPrint_Dense_Matrix_dist(SuperMatrix *);
00330 extern int dPrint_CompRowLoc_Matrix_dist(SuperMatrix *);
00331 extern int file_PrintDouble5(FILE *, char *, int_t, double *);
00332
00333
00334
00335 #ifdef USE_VENDOR_BLAS
00336 extern int dgemm_(char*, char*, int*, int*, int*, double*,
00337 double*, int*, double*, int*, double*,
00338 double*, int*, int, int);
00339 extern int dtrsv_(char*, char*, char*, int*, double*, int*,
00340 double*, int*, int, int, int);
00341 #else
00342 extern int dgemm_(char*, char*, int*, int*, int*, double*,
00343 double*, int*, double*, int*, double*,
00344 double*, int*);
00345 extern int dtrsv_(char*, char*, char*, int*, double*, int*,
00346 double*, int*);
00347 #endif
00348
00349 extern int dger_(int*, int*, double*, double*, int*,
00350 double*, int*, double*, int*);
00351
00352
00353 #ifdef __cplusplus
00354 }
00355 #endif
00356
00357 #endif
00358