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
00026
00027
00028 typedef struct {
00029 int_t **Lrowind_bc_ptr;
00030 doublecomplex **Lnzval_bc_ptr;
00031 int_t **Ufstnz_br_ptr;
00032 doublecomplex **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 doublecomplex *Lval_buf_2[2];
00039 int_t *Usub_buf;
00040 doublecomplex *Uval_buf;
00041 doublecomplex *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 int_t *mod_bit;
00067
00068
00069 int_t *ilsum;
00070
00071 int_t ldalsum;
00072 int_t SolveMsgSent;
00073 int_t SolveMsgVol;
00074 } LocalLU_t;
00075
00076 typedef struct {
00077 int_t *etree;
00078 Glu_persist_t *Glu_persist;
00079 LocalLU_t *Llu;
00080 } LUstruct_t;
00081
00082
00083 typedef struct {
00084 int_t lbnum;
00085 int_t indpos;
00086 } Ucb_indptr_t;
00087
00088
00089 typedef struct {
00090 int_t *extern_start;
00091 int_t *ind_tosend;
00092 int_t *ind_torecv;
00093 int_t *ptr_ind_tosend;
00094
00095 int_t *ptr_ind_torecv;
00096
00097 int *SendCounts;
00098
00099 int *RecvCounts;
00100
00101 doublecomplex *val_tosend;
00102 doublecomplex *val_torecv;
00103 int_t TotalIndSend;
00104
00105 int_t TotalValSend;
00106
00107 } pzgsmv_comm_t;
00108
00109
00110 typedef struct {
00111 int *B_to_X_SendCnt;
00112 int *X_to_B_SendCnt;
00113 int *ptr_to_ibuf, *ptr_to_dbuf;
00114 } pxgstrs_comm_t;
00115
00116
00117 typedef struct {
00118 int_t *row_to_proc;
00119 int_t *inv_perm_c;
00120 int_t num_diag_procs, *diag_procs, *diag_len;
00121 pzgsmv_comm_t *gsmv_comm;
00122 pxgstrs_comm_t *gstrs_comm;
00123 int_t *A_colind_gsmv;
00124
00125
00126
00127 } SOLVEstruct_t;
00128
00129
00130
00131
00132
00133
00134 #ifdef __cplusplus
00135 extern "C" {
00136 #endif
00137
00138
00139
00140 extern void
00141 zCreate_CompCol_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, doublecomplex *,
00142 int_t *, int_t *, Stype_t, Dtype_t, Mtype_t);
00143 extern void
00144 zCreate_CompRowLoc_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, int_t,
00145 int_t, doublecomplex *, int_t *, int_t *,
00146 Stype_t, Dtype_t, Mtype_t);
00147 extern void
00148 zCompRow_to_CompCol_dist(int_t, int_t, int_t, doublecomplex *, int_t *, int_t *,
00149 doublecomplex **, int_t **, int_t **);
00150 extern int
00151 pzCompRow_loc_to_CompCol_global(int_t, SuperMatrix *, gridinfo_t *,
00152 SuperMatrix *);
00153 extern void
00154 zCopy_CompCol_Matrix_dist(SuperMatrix *, SuperMatrix *);
00155 extern void
00156 zCreate_Dense_Matrix_dist(SuperMatrix *, int_t, int_t, doublecomplex *, int_t,
00157 Stype_t, Dtype_t, Mtype_t);
00158 extern void
00159 zCreate_SuperNode_Matrix_dist(SuperMatrix *, int_t, int_t, int_t, doublecomplex *,
00160 int_t *, int_t *, int_t *, int_t *, int_t *,
00161 Stype_t, Dtype_t, Mtype_t);
00162 extern void
00163 zCopy_Dense_Matrix_dist(int_t, int_t, doublecomplex *, int_t,
00164 doublecomplex *, int_t);
00165
00166 extern void zallocateA_dist (int_t, int_t, doublecomplex **, int_t **, int_t **);
00167 extern void zGenXtrue_dist (int_t, int_t, doublecomplex *, int_t);
00168 extern void zFillRHS_dist (char *, int_t, doublecomplex *, int_t,
00169 SuperMatrix *, doublecomplex *, int_t);
00170 extern int zcreate_matrix(SuperMatrix *, int, doublecomplex **, int *,
00171 doublecomplex **, int *, FILE *, gridinfo_t *);
00172
00173
00174 extern void zgsequ_dist (SuperMatrix *, double *, double *, double *,
00175 double *, double *, int_t *);
00176 extern double zlangs_dist (char *, SuperMatrix *);
00177 extern void zlaqgs_dist (SuperMatrix *, double *, double *, double,
00178 double, double, char *);
00179 extern void pzgsequ (SuperMatrix *, double *, double *, double *,
00180 double *, double *, int_t *, gridinfo_t *);
00181 extern double pzlangs (char *, SuperMatrix *, gridinfo_t *);
00182 extern void pzlaqgs (SuperMatrix *, double *, double *, double,
00183 double, double, char *);
00184 extern int pzPermute_Dense_Matrix(int_t, int_t, int_t [], int_t[],
00185 doublecomplex [], int, doublecomplex [], int, int,
00186 gridinfo_t *);
00187
00188 extern int sp_ztrsv_dist (char *, char *, char *, SuperMatrix *,
00189 SuperMatrix *, doublecomplex *, int *);
00190 extern int sp_zgemv_dist (char *, doublecomplex, SuperMatrix *, doublecomplex *,
00191 int, doublecomplex, doublecomplex *, int);
00192 extern int sp_zgemm_dist (char *, char *, int, int, int, doublecomplex,
00193 SuperMatrix *, doublecomplex *, int, doublecomplex,
00194 doublecomplex *, int);
00195
00196 extern int_t zdistribute(fact_t, int_t, SuperMatrix *, Glu_freeable_t *,
00197 LUstruct_t *, gridinfo_t *);
00198 extern void pzgssvx_ABglobal(superlu_options_t *, SuperMatrix *,
00199 ScalePermstruct_t *, doublecomplex *,
00200 int, int, gridinfo_t *, LUstruct_t *, double *,
00201 SuperLUStat_t *, int *);
00202 extern int_t pzdistribute(fact_t, int_t, SuperMatrix *,
00203 ScalePermstruct_t *, Glu_freeable_t *,
00204 LUstruct_t *, gridinfo_t *);
00205 extern void pzgssvx(superlu_options_t *, SuperMatrix *,
00206 ScalePermstruct_t *, doublecomplex *,
00207 int, int, gridinfo_t *, LUstruct_t *,
00208 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00209 extern int zSolveInit(superlu_options_t *, SuperMatrix *, int_t [], int_t [],
00210 int_t, LUstruct_t *, gridinfo_t *, SOLVEstruct_t *);
00211 extern int_t pxgstrs_init(int_t, int_t, int_t, int_t,
00212 int_t [], int_t [], gridinfo_t *grid,
00213 Glu_persist_t *, SOLVEstruct_t *);
00214 extern void pxgstrs_finalize(pxgstrs_comm_t *);
00215 extern void zSolveFinalize(superlu_options_t *, SOLVEstruct_t *);
00216 extern void zldperm(int_t, int_t, int_t, int_t [], int_t [],
00217 doublecomplex [], int_t *, double [], double []);
00218 extern int_t pzgstrf(superlu_options_t *, int, int, double,
00219 LUstruct_t*, gridinfo_t*, SuperLUStat_t*, int*);
00220 extern void pzgstrs_Bglobal(int_t, LUstruct_t *, gridinfo_t *,
00221 doublecomplex *, int_t, int, SuperLUStat_t *, int *);
00222 extern void pzgstrs(int_t, LUstruct_t *, ScalePermstruct_t *, gridinfo_t *,
00223 doublecomplex *, int_t, int_t, int_t, int, SOLVEstruct_t *,
00224 SuperLUStat_t *, int *);
00225 extern void zlsum_fmod(doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *,
00226 int, int, int_t , int_t *, int_t, int_t, int_t,
00227 int_t *, gridinfo_t *, LocalLU_t *,
00228 MPI_Request [], SuperLUStat_t *);
00229 extern void zlsum_bmod(doublecomplex *, doublecomplex *, doublecomplex *,
00230 int, int_t, int_t *, int_t *, Ucb_indptr_t **,
00231 int_t **, int_t *, gridinfo_t *, LocalLU_t *,
00232 MPI_Request [], SuperLUStat_t *);
00233 extern void pzgsrfs(int_t, SuperMatrix *, double, LUstruct_t *,
00234 ScalePermstruct_t *, gridinfo_t *,
00235 doublecomplex [], int_t, doublecomplex [], int_t, int,
00236 SOLVEstruct_t *, double *, SuperLUStat_t *, int *);
00237 extern void pzgsrfs_ABXglobal(int_t, SuperMatrix *, double, LUstruct_t *,
00238 gridinfo_t *, doublecomplex *, int_t, doublecomplex *, int_t,
00239 int, double *, SuperLUStat_t *, int *);
00240 extern int pzgsmv_AXglobal_setup(SuperMatrix *, Glu_persist_t *,
00241 gridinfo_t *, int_t *, int_t *[],
00242 doublecomplex *[], int_t *[], int_t []);
00243 extern int pzgsmv_AXglobal(int_t, int_t [], doublecomplex [], int_t [],
00244 doublecomplex [], doublecomplex []);
00245 extern int pzgsmv_AXglobal_abs(int_t, int_t [], doublecomplex [], int_t [],
00246 doublecomplex [], double []);
00247 extern void pzgsmv_init(SuperMatrix *, int_t *, gridinfo_t *,
00248 pzgsmv_comm_t *);
00249 extern void pzgsmv(int_t, SuperMatrix *, gridinfo_t *, pzgsmv_comm_t *,
00250 doublecomplex x[], doublecomplex ax[]);
00251 extern void pzgsmv_finalize(pzgsmv_comm_t *);
00252
00253
00254 extern doublecomplex *doublecomplexMalloc_dist(int_t);
00255 extern doublecomplex *doublecomplexCalloc_dist(int_t);
00256 extern double *doubleMalloc_dist(int_t);
00257 extern double *doubleCalloc_dist(int_t);
00258 extern void *duser_malloc_dist (int_t, int_t);
00259 extern void duser_free_dist (int_t, int_t);
00260 extern int_t zQuerySpace_dist(int_t, LUstruct_t *, gridinfo_t *, mem_usage_t *);
00261 extern void Destroy_LU(int_t, gridinfo_t *, LUstruct_t *);
00262 extern void LUstructInit(const int_t, const int_t, LUstruct_t *);
00263 extern void LUstructFree(LUstruct_t *);
00264
00265
00266 extern void zfill_dist (doublecomplex *, int_t, doublecomplex);
00267 extern void zinf_norm_error_dist (int_t, int_t, doublecomplex*, int_t,
00268 doublecomplex*, int_t, gridinfo_t*);
00269 extern void pzinf_norm_error(int, int_t, int_t, doublecomplex [], int_t,
00270 doublecomplex [], int_t , gridinfo_t *);
00271 extern void zreadhb_dist (int, FILE *, int_t *, int_t *, int_t *,
00272 doublecomplex **, int_t **, int_t **);
00273
00274
00275 extern int_t zdist_psymbtonum
00276 (fact_t, int_t, SuperMatrix *,
00277 ScalePermstruct_t *, Pslu_freeable_t *,
00278 LUstruct_t *, gridinfo_t *);
00279
00280
00281 extern void zPrintLblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00282 LocalLU_t *);
00283 extern void zPrintUblocks(int_t, int_t, gridinfo_t *, Glu_persist_t *,
00284 LocalLU_t *);
00285 extern void zPrint_CompCol_Matrix_dist(SuperMatrix *);
00286 extern void zPrint_Dense_Matrix_dist(SuperMatrix *);
00287 extern int zPrint_CompRowLoc_Matrix_dist(SuperMatrix *);
00288 extern void PrintDoublecomplex(char *, int_t, doublecomplex *);
00289 extern int file_PrintDoublecomplex(FILE *fp, char *, int_t, doublecomplex *);
00290
00291
00292
00293 #ifdef USE_VENDOR_BLAS
00294 extern int zgemm_(char*, char*, int*, int*, int*, doublecomplex*,
00295 doublecomplex*, int*, doublecomplex*, int*, doublecomplex*,
00296 doublecomplex*, int*, int, int);
00297 extern int ztrsv_(char*, char*, char*, int*, doublecomplex*, int*,
00298 doublecomplex*, int*, int, int, int);
00299 #else
00300 extern int zgemm_(char*, char*, int*, int*, int*, doublecomplex*,
00301 doublecomplex*, int*, doublecomplex*, int*, doublecomplex*,
00302 doublecomplex*, int*);
00303 extern int ztrsv_(char*, char*, char*, int*, doublecomplex*, int*,
00304 doublecomplex*, int*);
00305 #endif
00306
00307 extern int zger_(int*, int*, doublecomplex*, doublecomplex*, int*,
00308 doublecomplex*, int*, doublecomplex*, int*);
00309
00310
00311 #ifdef __cplusplus
00312 }
00313 #endif
00314
00315 #endif
00316