49 #include "auxcompute_z.h" 50 #include "auxdescutil.h" 59 #define CBLAS_SADDR(_val) (_val) 68 #define PROGRESS(str) \ 70 int myrank = MORSE_My_Mpi_Rank();\ 72 tm_info = localtime(&timer); \ 73 strftime(datebuf, 26, "%Y-%m-%d %H:%M:%S",tm_info); \ 74 fprintf(stdout, "%d:%s\t%d\t%s\t%s\n", myrank, datebuf, __LINE__, __func__, str);\ 92 double timediff(
struct timeval begin,
struct timeval end){
93 double elapsed = (end.tv_sec - begin.tv_sec) +
94 ((end.tv_usec - begin.tv_usec)/1000000.0);
100 void check_same(MORSE_desc_t *descL, MORSE_desc_t *descR,
char diag,
char lower_triangle){
101 double *MATL = descL->mat;
102 double *MATR = descR->mat;
103 if(descL->mb != descR->mb){
104 printf(
"mb: %d %d\n", descL->mb, descR->mb);
106 assert(descL->mb == descR->mb);
107 if(descL->nb != descR->nb){
108 printf(
"nb: %d %d\n", descL->nb, descR->nb);
110 assert(descL->nb == descR->nb);
111 if(descL->mt != descR->mt){
112 printf(
"mt: %d %d\n", descL->mt, descR->mt);
114 assert(descL->mt == descR->mt);
115 if(descL->nt != descR->nt){
116 printf(
"nt: %d %d\n", descL->nt, descR->nt);
118 assert(descL->nt == descR->nt);
119 int64_t i, j, imt, jnt;
120 for(imt=0;imt<descL->mt;imt++){
121 for(jnt=0;jnt<descL->nt;jnt++){
122 if(
diag ==
'D' && imt != jnt){
125 if(lower_triangle ==
'L' && imt < jnt){
128 double *L = &MATL[tsa(descL, imt, jnt)];
129 double *R = &MATR[tsa(descR, imt, jnt)];
130 for(i=0;i<descL->nb;i++){
131 for(j=0;j<descL->nb;j++){
132 double valL = L[j*tld(descL)+i];
133 double valR = R[j*tld(descR)+i];
134 double diff = fabs(valL - valR);
135 double thresh = 1e-14;
137 printf(
"Tile:%d,%d. Elm:%d,%d val:%.2e %.2e\n", imt, jnt, i, j, valL, valR);
156 if(MORSE_My_Mpi_Rank() != 0)
160 double alpha = 1.0, beta = 1.0;
168 MORSE_user_tag_size(31,26);
235 PROGRESS(
"desc..UV's are allocated");
237 int mt = descAUV->mt;
238 int nt = descAUV->nt;
253 PROGRESS(
"desc..rk's are allocated");
256 double _acc = pow(10, -1.0*iparam[
IPARAM_ACC]);
263 int initial_maxrank, final_maxrank;
264 double initial_avgrank, final_avgrank;
269 hicma_problem.
noise = 0.0;
274 double theta[3] = {1, 0.1, 0.5};
276 hicma_problem.
theta = theta;
277 hicma_problem.
noise = 0.0;
284 hicma_problem.
beta = 0.1;
288 hicma_problem.
nu = 0.5;
290 hicma_problem.
noise = 1.e-4;
291 hicma_problem.
noise = 5.e-4;
294 PROGRESS(
"generating coordinates started");
295 HICMA_zgenerate_problem(probtype, sym, ddecay, M, MB, mt, nt, &hicma_problem);
296 PROGRESS(
"generating coordinates ended");
300 int compress_diag = 1;
304 HICMA_zgytlr_Tile(MorseUpperLower, descAUV, descAD, descArk, 0, maxrank, _acc, compress_diag, descA);
305 HICMA_zgytlr_Tile(MorseUpperLower, descBUV, descBD, descBrk, 0, maxrank, _acc, compress_diag, descB);
306 HICMA_zgytlr_Tile(MorseUpperLower, descCUV, descCD, descCrk, 0, maxrank, _acc, compress_diag, descC);
313 PROGRESS(
"pasting original dense descC into C2 started");
316 PROGRESS(
"pasting original dense descC into C2 finished");
324 descCUV, descCrk, _k, maxrank, _acc
335 HICMA_zuncompress(MorseUpperLower, descCUV, descC, descCrk);
341 alpha,
A, LDA,
B, LDB, beta,
C, C2, LDC,
345 free(
A); free(
B); free(
C); free(C2);
int RunTest(int *iparam, double *dparam, morse_time_t *t_, char *rankfile)
double timediff(struct timeval begin, struct timeval end)
#define PASTE_CODE_ALLOCATE_MATRIX_TILE(_desc_, _cond_, _type_, _type2_, _lda_, _m_, _n_)
#define PASTE_TILE_TO_LAPACK(_desc_, _name_, _cond_, _type_, _lda_, _n_)
#define HICMA_STARSH_PROB_GEOSTAT
#define PASTE_CODE_FREE_MATRIX(_desc_)
int HICMA_zgemm_Tile(MORSE_enum transA, MORSE_enum transB, double alpha, MORSE_desc_t *AUV, MORSE_desc_t *Ark, MORSE_desc_t *BUV, MORSE_desc_t *Brk, double beta, MORSE_desc_t *CUV, MORSE_desc_t *Crk, int rk, int maxrk, double acc)
int store_only_diagonal_tiles
#define HICMA_STARSH_PROB_RND
double hicma_z_check_gemm(MORSE_enum transA, MORSE_enum transB, int M, int N, int K, double alpha, double *A, int LDA, double *B, int LDB, double beta, double *Cmorse, double *Cref, int LDC, double *Cinitnorm, double *Cmorsenorm, double *Clapacknorm)
STARSH_blrf * starsh_format
int HICMA_set_use_fast_hcore_zgemm()
int HICMA_zgytlr_Tile(MORSE_enum uplo, MORSE_desc_t *AUV, MORSE_desc_t *AD, MORSE_desc_t *Ark, unsigned long long int seed, int maxrank, double tol, int compress_diag, MORSE_desc_t *Dense)
#define HICMA_STARSH_PROB_SS
int global_always_fixed_rank
#define PASTE_CODE_IPARAM_LOCALS(iparam)
void check_same(MORSE_desc_t *descL, MORSE_desc_t *descR, char diag, char lower_triangle)