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