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