00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __SUPERLU_zDEFS
00013 #define __SUPERLU_zDEFS
00014
00015
00016
00017
00018
00019
00020
00021 #include "superlu_defs.h"
00022 #include "dcomplex.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 doublecomplex **Lnzval_bc_ptr;
00037 int_t **Ufstnz_br_ptr;
00038 doublecomplex **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 doublecomplex *Lval_buf_2[2];
00045 int_t *Usub_buf;
00046 doublecomplex *Uval_buf;
00047 doublecomplex *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 doublecomplex *val_tosend;
00131 doublecomplex *val_torecv;
00132 int_t TotalIndSend;
00133
00134 int_t TotalValSend;
00135
00136 } pzgsmv_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 pzgsmv_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 zCreate_CompCol_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, doublecomplex *,
00185 int_t *, int_t *, Stype_t, Dtype_t, Mtype_t);
00186 extern void
00187 zCreate_CompRowLoc_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, int_t,
00188 int_t, doublecomplex *, int_t *, int_t *,
00189 Stype_t, Dtype_t, Mtype_t);
00190 extern void
00191 zCompRow_to_CompCol_dist(int_t, int_t, int_t, doublecomplex *, int_t *, int_t *,
00192 doublecomplex **, int_t **, int_t **);
00193 extern int
00194 pzCompRow_loc_to_CompCol_global(int_t, SuperMatrix *, gridinfo_t *,
00195 SuperMatrix *);
00196 extern void
00197 zCopy_CompCol_Matrix_dist(SuperMatrix *, SuperMatrix *);
00198 extern void
00199 zCreate_Dense_Matrix_dist(SuperMatrix *, int_t, int_t, doublecomplex *, int_t,
00200 Stype_t, Dtype_t, Mtype_t);
00201 extern void
00202 zCreate_SuperNode_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, doublecomplex *,
00203 int_t *, int_t *, int_t *, int_t *, int_t *,
00204 Stype_t, Dtype_t, Mtype_t);
00205 extern void
00206 zCopy_Dense_Matrix_dist(int_t, int_t, doublecomplex *, int_t,
00207 doublecomplex *, int_t);
00208
00209 extern void zallocateA_dist (int_t, int_t, doublecomplex **, int_t **, int_t **);
00210 extern void zGenXtrue_dist (int_t, int_t, doublecomplex *, int_t);
00211 extern void zFillRHS_dist (char *, int_t, doublecomplex *, int_t,
00212 SuperMatrix *, doublecomplex *, int_t);
00213 extern int zcreate_matrix(SuperMatrix *, int, doublecomplex **, int *,
00214 doublecomplex **, int *, FILE *, gridinfo_t *);
00215
00216
00217 extern void zgsequ_dist (SuperMatrix *, double *, double *, double *,
00218 double *, double *, int_t *);
00219 extern double zlangs_dist (char *, SuperMatrix *);
00220 extern void zlaqgs_dist (SuperMatrix *, double *, double *, double,
00221 double, double, char *);
00222 extern void pzgsequ (SuperMatrix *, double *, double *, double *,
00223 double *, double *, int_t *, gridinfo_t *);
00224 extern double pzlangs (char *, SuperMatrix *, gridinfo_t *);
00225 extern void pzlaqgs (SuperMatrix *, double *, double *, double,
00226 double, double, char *);
00227 extern int pzPermute_Dense_Matrix(int_t, int_t, int_t [], int_t[],
00228 doublecomplex [], int, doublecomplex [], int, int,
00229 gridinfo_t *);
00230
00231 extern int sp_ztrsv_dist (char *, char *, char *, SuperMatrix *,
00232 SuperMatrix *, doublecomplex *, int *);
00233 extern int sp_zgemv_dist (char *, doublecomplex, SuperMatrix *, doublecomplex *,
00234 int, doublecomplex, doublecomplex *, int);
00235 extern int sp_zgemm_dist (char *, char *, int, int, int, doublecomplex,
00236 SuperMatrix *, doublecomplex *, int, doublecomplex,
00237 doublecomplex *, int);
00238
00239 extern float zdistribute(fact_t, int_t, SuperMatrix *, Glu_freeable_t *,
00240 LUstruct_t *, gridinfo_t *);
00241 extern void pzgssvx_ABglobal(superlu_options_t *, SuperMatrix *,
00242 ScalePermstruct_t *, doublecomplex *,
00243 int, int, gridinfo_t *, LUstruct_t *, double *,
00244 SuperLUStat_t *, int *);
00245 extern float pzdistribute(fact_t, int_t, SuperMatrix *,
00246 ScalePermstruct_t *, Glu_freeable_t *,
00247 LUstruct_t *, gridinfo_t *);
00248 extern void pzgssvx(superlu_options_t *, SuperMatrix *,
00249 ScalePermstruct_t *, doublecomplex *,
00250 int, int, gridinfo_t *, LUstruct_t *,
00251 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00252 extern int zSolveInit(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 zSolveFinalize(superlu_options_t *, SOLVEstruct_t *);
00259 extern void zldperm(int_t, int_t, int_t, int_t [], int_t [],
00260 doublecomplex [], int_t *, double [], double []);
00261 extern int_t pzgstrf(superlu_options_t *, int, int, double,
00262 LUstruct_t*, gridinfo_t*, SuperLUStat_t*, int*);
00263 extern void pzgstrs_Bglobal(int_t, LUstruct_t *, gridinfo_t *,
00264 doublecomplex *, int_t, int, SuperLUStat_t *, int *);
00265 extern void pzgstrs(int_t, LUstruct_t *, ScalePermstruct_t *, gridinfo_t *,
00266 doublecomplex *, int_t, int_t, int_t, int, SOLVEstruct_t *,
00267 SuperLUStat_t *, int *);
00268 extern void zlsum_fmod(doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *,
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 zlsum_bmod(doublecomplex *, doublecomplex *, doublecomplex *,
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 pzgsrfs(int_t, SuperMatrix *, double, LUstruct_t *,
00277 ScalePermstruct_t *, gridinfo_t *,
00278 doublecomplex [], int_t, doublecomplex [], int_t, int,
00279 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00280 extern void pzgsrfs_ABXglobal(int_t, SuperMatrix *, double, LUstruct_t *,
00281 gridinfo_t *, doublecomplex *, int_t, doublecomplex *, int_t,
00282 int, double *, SuperLUStat_t *, int *);
00283 extern int pzgsmv_AXglobal_setup(SuperMatrix *, Glu_persist_t *,
00284 gridinfo_t *, int_t *, int_t *[],
00285 doublecomplex *[], int_t *[], int_t []);
00286 extern int pzgsmv_AXglobal(int_t, int_t [], doublecomplex [], int_t [],
00287 doublecomplex [], doublecomplex []);
00288 extern int pzgsmv_AXglobal_abs(int_t, int_t [], doublecomplex [], int_t [],
00289 doublecomplex [], double []);
00290 extern void pzgsmv_init(SuperMatrix *, int_t *, gridinfo_t *,
00291 pzgsmv_comm_t *);
00292 extern void pzgsmv(int_t, SuperMatrix *, gridinfo_t *, pzgsmv_comm_t *,
00293 doublecomplex x[], doublecomplex ax[]);
00294 extern void pzgsmv_finalize(pzgsmv_comm_t *);
00295
00296
00297 extern doublecomplex *doublecomplexMalloc_dist(int_t);
00298 extern doublecomplex *doublecomplexCalloc_dist(int_t);
00299 extern double *doubleMalloc_dist(int_t);
00300 extern double *doubleCalloc_dist(int_t);
00301 extern void *duser_malloc_dist (int_t, int_t);
00302 extern void duser_free_dist (int_t, int_t);
00303 extern int_t zQuerySpace_dist(int_t, LUstruct_t *, gridinfo_t *, mem_usage_t *);
00304 extern void Destroy_LU(int_t, gridinfo_t *, LUstruct_t *);
00305 extern void LUstructInit(const int_t, const int_t, LUstruct_t *);
00306 extern void LUstructFree(LUstruct_t *);
00307
00308
00309 extern void zfill_dist (doublecomplex *, int_t, doublecomplex);
00310 extern void zinf_norm_error_dist (int_t, int_t, doublecomplex*, int_t,
00311 doublecomplex*, int_t, gridinfo_t*);
00312 extern void pzinf_norm_error(int, int_t, int_t, doublecomplex [], int_t,
00313 doublecomplex [], int_t , gridinfo_t *);
00314 extern void zreadhb_dist (int, FILE *, int_t *, int_t *, int_t *,
00315 doublecomplex **, int_t **, int_t **);
00316
00317
00318 extern float zdist_psymbtonum(fact_t, int_t, SuperMatrix *,
00319 ScalePermstruct_t *, Pslu_freeable_t *,
00320 LUstruct_t *, gridinfo_t *);
00321
00322
00323 extern void zPrintLblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00324 LocalLU_t *);
00325 extern void zPrintUblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00326 LocalLU_t *);
00327 extern void zPrint_CompCol_Matrix_dist(SuperMatrix *);
00328 extern void zPrint_Dense_Matrix_dist(SuperMatrix *);
00329 extern int zPrint_CompRowLoc_Matrix_dist(SuperMatrix *);
00330 extern void PrintDoublecomplex(char *, int_t, doublecomplex *);
00331 extern int file_PrintDoublecomplex(FILE *fp, char *, int_t, doublecomplex *);
00332
00333
00334
00335 #ifdef USE_VENDOR_BLAS
00336 extern int zgemm_(char*, char*, int*, int*, int*, doublecomplex*,
00337 doublecomplex*, int*, doublecomplex*, int*, doublecomplex*,
00338 doublecomplex*, int*, int, int);
00339 extern int ztrsv_(char*, char*, char*, int*, doublecomplex*, int*,
00340 doublecomplex*, int*, int, int, int);
00341 #else
00342 extern int zgemm_(char*, char*, int*, int*, int*, doublecomplex*,
00343 doublecomplex*, int*, doublecomplex*, int*, doublecomplex*,
00344 doublecomplex*, int*);
00345 extern int ztrsv_(char*, char*, char*, int*, doublecomplex*, int*,
00346 doublecomplex*, int*);
00347 #endif
00348
00349 extern int zger_(int*, int*, doublecomplex*, doublecomplex*, int*,
00350 doublecomplex*, int*, doublecomplex*, int*);
00351
00352
00353 #ifdef __cplusplus
00354 }
00355 #endif
00356
00357 #endif
00358