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