Commit 3fac252f authored by Mathieu Faverge's avatar Mathieu Faverge

Merge branch 'hotfix/sonarqube' into 'master'

Hotfix/sonarqube II

See merge request !98
parents 1549b342 bacc34d2
......@@ -29,7 +29,6 @@ void morse_pzgebrd_ge2gb(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *D,
if (A->m >= A->n){
for (k = 0; k < A->nt; k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
A1 = morse_desc_submatrix(A, k*A->mb, k*A->nb, A->m-k*A->mb, tempkn);
......@@ -47,7 +46,7 @@ void morse_pzgebrd_ge2gb(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *D,
sequence, request);
if (k+1 < A->nt){
tempkn = k+1 == A->nt-1 ? A->n-(k+1)*A->nb : A->nb;
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
A1 = morse_desc_submatrix(A, k*A->mb, (k+1)*A->nb, tempkm, A->n-(k+1)*A->nb);
A2 = morse_desc_submatrix(A, (k+1)*A->mb, (k+1)*A->nb, A->m-(k+1)*A->mb, A->n-(k+1)*A->nb);
......@@ -68,7 +67,6 @@ void morse_pzgebrd_ge2gb(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *D,
else{
for (k = 0; k < A->mt; k++) {
tempkm = k == A->mt-1 ? A->m-k*A->mb : A->mb;
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
A1 = morse_desc_submatrix(A, k*A->mb, k*A->nb, tempkm, A->n-k*A->nb);
A2 = morse_desc_submatrix(A, (k+1)*A->mb, k*A->nb, A->m-(k+1)*A->mb, A->n-k*A->nb);
......@@ -84,7 +82,7 @@ void morse_pzgebrd_ge2gb(MORSE_desc_t *A, MORSE_desc_t *T, MORSE_desc_t *D,
sequence, request);
if (k+1 < A->mt){
tempkm = k+1 == A->mt-1 ? A->m-(k+1)*A->mb : A->mb;
tempkn = k == A->nt-1 ? A->n-k*A->nb : A->nb;
A1 = morse_desc_submatrix(A, (k+1)*A->mb, k*A->nb, A->m-(k+1)*A->mb, tempkn);
A2 = morse_desc_submatrix(A, (k+1)*A->mb, (k+1)*A->nb, A->m-(k+1)*A->mb, A->n-(k+1)*A->nb);
......
......@@ -147,7 +147,6 @@ void morse_pzgelqf_param( const libhqr_tree_t *qrtree, MORSE_desc_t *A,
p = qrtree->currpiv(qrtree, k, n);
tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
temppn = p == A->nt-1 ? A->n-p*A->nb : A->nb;
if (qrtree->gettype(qrtree, k, n) == 0) {
/* TS kernel */
......
......@@ -172,7 +172,6 @@ void morse_pztradd(MORSE_enum uplo, MORSE_enum trans,
else {
for (m = 0; m < B->mt; m++) {
tempmm = m == B->mt-1 ? B->m-B->mb*m : B->nb;
ldam = BLKLDD(A, m);
ldbm = BLKLDD(B, m);
for (n = 0; n < B->nt; n++) {
......
......@@ -193,7 +193,6 @@ void morse_pztrsm(MORSE_enum side, MORSE_enum uplo, MORSE_enum trans, MORSE_enum
}
RUNTIME_data_flush( sequence, A(B->mt-1-k, B->mt-1-k) );
for (m = k+1; m < B->mt; m++) {
tempmm = m == B->mt-1 ? B->m-m*B->mb : B->mb;
ldbm = BLKLDD(B, B->mt-1-m);
for (n = 0; n < B->nt; n++) {
tempnn = n == B->nt-1 ? B->n-n*B->nb : B->nb;
......
......@@ -245,7 +245,6 @@ void morse_pzunmqr(MORSE_enum side, MORSE_enum trans,
tempkn = k == B->nt - 1 ? B->n - k * B->nb : B->nb;
tempkmin = k == minMT - 1 ? minM - k * A->nb : A->nb;
ldak = BLKLDD(A, k);
ldbk = BLKLDD(B, k);
for (n = B->nt-1; n > k; n--) {
tempnn = n == B->nt-1 ? B->n-n*B->nb : B->nb;
ldan = BLKLDD(A, n);
......
......@@ -330,7 +330,6 @@ void morse_pzunmqrrh( MORSE_enum side, MORSE_enum trans,
tempMm = M == A->mt-1 ? A->m-M*A->mb : A->mb;
tempkmin = chameleon_min(tempMm, tempkn);
ldaM = BLKLDD(A, M);
ldbM = BLKLDD(B, M);
for (n = chameleon_min(M+BS, A->mt)-1; n > M; n--) {
ldan = BLKLDD(A, n);
tempnn = n == B->nt-1 ? B->n-n*B->nb : B->nb;
......
......@@ -400,8 +400,8 @@ int MORSE_zgesvd_Tile_Async( MORSE_enum jobu, MORSE_enum jobvt,
{
MORSE_desc_t descA;
MORSE_desc_t descT;
MORSE_desc_t descU;
MORSE_desc_t descVT;
MORSE_desc_t descUl, descUt;
MORSE_desc_t descVTl, descVTt;
MORSE_desc_t descAB;
MORSE_desc_t D, *Dptr = NULL;
MORSE_desc_t *subA, *subT, *subUVT;
......@@ -555,65 +555,61 @@ int MORSE_zgesvd_Tile_Async( MORSE_enum jobu, MORSE_enum jobvt,
morse_desc_mat_free( &descAB );
/* Transform U and Vt into tile format */
if ( jobu != MorseNoVec ) {
//morse_zooplap2tile( descU, U, NB, NB, LDU, M, 0, 0, M, M, sequence, request, morse_desc_mat_free(&(descU)) );
}
if ( jobvt != MorseNoVec ) {
//morse_zooplap2tile( descVT, VT, NB, NB, LDVT, N, 0, 0, N, N, sequence, request, morse_desc_mat_free(&(descVT)) );
}
morse_sequence_wait( morse, sequence );
subA = NULL;
subT = NULL;
subUVT = NULL;
if ( jobu != MorseNoVec ) {
morse_zlap2tile( morse, &descUl, &descUt, MorseDescInout, MorseUpperLower,
U, NB, NB, LDU, M, M, M, sequence, request );
if ( M < N ){
subA = morse_desc_submatrix(&descA, descA.mb, 0, descA.m-descA.mb, descA.n-descA.nb);
subUVT = morse_desc_submatrix(&descU, descU.mb, 0, descU.m-descU.mb, descU.n);
subT = morse_desc_submatrix(&descT, descT.mb, 0, descT.m-descT.mb, descT.n-descT.nb);
subA = morse_desc_submatrix(&descA, descA.mb, 0, descA.m -descA.mb, descA.n-descA.nb);
subUVT = morse_desc_submatrix(&descUt, descUt.mb, 0, descUt.m-descUt.mb, descUt.n);
subT = morse_desc_submatrix(&descT, descT.mb, 0, descT.m -descT.mb, descT.n-descT.nb);
morse_pzunmqr( MorseLeft, MorseNoTrans,
subA, subUVT, subT, Dptr,
sequence, request );
free(subA); free(subUVT); free(subT);
}
else {
morse_pzunmqr( MorseLeft, MorseNoTrans,
&descA, &descU, &descT, Dptr,
&descA, &descUt, &descT, Dptr,
sequence, request );
}
morse_ztile2lap( morse, &descUl, &descUt,
MorseDescInout, MorseUpperLower, sequence, request );
}
if ( jobvt != MorseNoVec ) {
morse_zlap2tile( morse, &descVTl, &descVTt, MorseDescInout, MorseUpperLower,
VT, NB, NB, LDVT, N, N, N, sequence, request );
if ( M < N ){
morse_pzunmlq( MorseRight, MorseNoTrans,
&descA, &descVT, &descT, Dptr,
&descA, &descVTt, &descT, Dptr,
sequence, request );
}
else {
subA = morse_desc_submatrix(&descA, 0, descA.nb, descA.m-descA.mb, descA.n -descA.nb);
subUVT = morse_desc_submatrix(&descVT, 0, descVT.nb, descVT.m, descVT.n-descVT.nb);
subT = morse_desc_submatrix(&descT, 0, descT.nb, descT.m-descT.mb, descT.n -descT.nb);
subA = morse_desc_submatrix(&descA, 0, descA.nb, descA.m-descA.mb, descA.n -descA.nb );
subUVT = morse_desc_submatrix(&descVTt, 0, descVTt.nb, descVTt.m, descVTt.n-descVTt.nb);
subT = morse_desc_submatrix(&descT, 0, descT.nb, descT.m-descT.mb, descT.n -descT.nb );
morse_pzunmlq( MorseRight, MorseNoTrans,
subA, subUVT, subT, Dptr,
sequence, request );
free(subA); free(subUVT); free(subT);
}
}
/* Transform U and VT into lapack layout */
if ( jobu != MorseNoVec ) {
//morse_zooptile2lap( descU, U, NB, NB, LDU, M, sequence, request );
}
if ( jobvt != MorseNoVec ) {
//morse_zooptile2lap( descVT, VT, NB, NB, LDVT, N, sequence, request );
morse_ztile2lap( morse, &descVTl, &descVTt,
MorseDescInout, MorseUpperLower, sequence, request );
}
morse_sequence_wait( morse, sequence );
if (subA) {
free(subA); free(subUVT); free(subT);
}
/* Solve the bidiagonal SVD problem */
/* On exit, U and VT are updated with bidiagonal matrix singular vectors */
#if !defined(CHAMELEON_SIMULATION)
......@@ -626,12 +622,6 @@ int MORSE_zgesvd_Tile_Async( MORSE_enum jobu, MORSE_enum jobvt,
}
#endif /* !defined(CHAMELEON_SIMULATION) */
if (jobu != MorseNoVec) {
morse_desc_mat_free( &descU );
}
if (jobvt != MorseNoVec) {
morse_desc_mat_free( &descVT );
}
free(E);
if ( Dptr ) {
morse_desc_mat_free( Dptr );
......
......@@ -83,7 +83,7 @@ double MORSE_zlange(MORSE_enum norm, int M, int N,
{
int NB;
int status;
double value;
double value = -1.;
MORSE_context_t *morse;
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
......@@ -125,7 +125,7 @@ double MORSE_zlange(MORSE_enum norm, int M, int N,
}
/* Set NT */
NB = MORSE_NB;
NB = MORSE_NB;
morse_sequence_create( morse, &sequence );
......@@ -194,7 +194,7 @@ double MORSE_zlange_Tile(MORSE_enum norm, MORSE_desc_t *A )
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
int status;
double value;
double value = -1.;
morse = morse_context_self();
if (morse == NULL) {
......
......@@ -83,7 +83,7 @@ double MORSE_zlanhe(MORSE_enum norm, MORSE_enum uplo, int N,
{
int NB;
int status;
double value;
double value = -1.;
MORSE_context_t *morse;
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
......@@ -198,7 +198,7 @@ double MORSE_zlanhe_Tile( MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A )
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
int status;
double value;
double value = -1.;
morse = morse_context_self();
if (morse == NULL) {
......
......@@ -83,7 +83,7 @@ double MORSE_zlansy(MORSE_enum norm, MORSE_enum uplo, int N,
{
int NB;
int status;
double value;
double value = -1.;
MORSE_context_t *morse;
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
......@@ -198,7 +198,7 @@ double MORSE_zlansy_Tile( MORSE_enum norm, MORSE_enum uplo, MORSE_desc_t *A )
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
int status;
double value;
double value = -1.;
morse = morse_context_self();
if (morse == NULL) {
......
......@@ -95,7 +95,7 @@ double MORSE_zlantr(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag,
{
int NB;
int status;
double value;
double value = -1.;
MORSE_context_t *morse;
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
......@@ -220,7 +220,7 @@ double MORSE_zlantr_Tile(MORSE_enum norm, MORSE_enum uplo, MORSE_enum diag, MORS
MORSE_sequence_t *sequence = NULL;
MORSE_request_t request = MORSE_REQUEST_INITIALIZER;
int status;
double value;
double value = -1.;
morse = morse_context_self();
if (morse == NULL) {
......
......@@ -36,7 +36,8 @@ int main(int argc, char *argv[]) {
size_t NRHS; // number of RHS vectors
/* declarations to time the program and evaluate performances */
double fmuls, fadds, flops, gflops, cpu_time;
double fmuls, fadds, flops, gflops, cpu_time, eps, res;
int hres;
/* initialize some parameters with default values */
int iparam[IPARAM_SIZEOF];
......@@ -52,8 +53,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -137,26 +136,27 @@ int main(int argc, char *argv[]) {
/* compute A*X-B, store the result in B */
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans,
N, NRHS, N, 1.0, Acpy, N, X, N, -1.0, B, N);
double res = LAPACKE_dlange( LAPACK_COL_MAJOR, 'I', N, NRHS, B, N);
res = LAPACKE_dlange( LAPACK_COL_MAJOR, 'I', N, NRHS, B, N);
/* check residual and print a message */
double eps = LAPACKE_dlamch_work( 'e' );
eps = LAPACKE_dlamch_work( 'e' );
/*
* if hres = 0 then the test succeed
* else the test failed
*/
int hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* deallocate data */
free(A);
......
......@@ -38,7 +38,6 @@
* The precision is: double
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -66,8 +65,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -88,7 +85,7 @@ int main(int argc, char *argv[]) {
}
/*
* allocate memory for our data using a C macro (see step1.h)
* Allocate memory for our data using a C macro (see step1.h)
* - matrix A : size N x N
* - set of RHS vectors B : size N x NRHS
* - set of solutions vectors X : size N x NRHS
......@@ -154,17 +151,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* deallocate data */
free(A);
......
......@@ -29,8 +29,7 @@
* The goal is also to show examples of calling MORSE tile interface.
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -61,8 +60,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -76,7 +73,7 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* Initialize MORSE with main parameters */
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
......@@ -198,17 +195,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* get back results in LAPACK format */
MORSE_dTile_to_Lapack(descA, A, N);
......
......@@ -27,7 +27,6 @@
* During this step we do not use classical LAPACK matrices (1D array) anymore.
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
......@@ -62,8 +61,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -77,7 +74,7 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* Initialize MORSE with main parameters */
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
......@@ -181,17 +178,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* free the matrix of tiles */
deallocate_tile_matrix(matA, N, N, NB);
......
......@@ -31,8 +31,7 @@
* subsequent algorithms so that less synchronisations are done.
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -70,8 +69,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -85,7 +82,7 @@ int main(int argc, char *argv[]) {
/* print informations to user */
print_header( argv[0], iparam);
/* Initialize MORSE with main parameters */
/* Initialize MORSE with main parameters */
if ( MORSE_Init( NCPU, NGPU ) != MORSE_SUCCESS ) {
fprintf(stderr, "Error initializing MORSE library\n");
return EXIT_FAILURE;
......@@ -179,17 +176,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* deallocate A, B, X, Acpy and associated descriptors descA, ... */
MORSE_Desc_Destroy( &descA );
......
......@@ -31,8 +31,7 @@
* - number of right-hand sides
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -71,8 +70,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -183,17 +180,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* deallocate A, B, X, Acpy and associated descriptors descA, ... */
MORSE_Desc_Destroy( &descA );
......
......@@ -29,8 +29,7 @@
* --p= and --q=
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -72,8 +71,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -181,8 +178,9 @@ int main(int argc, char *argv[]) {
/* print informations to user */
gflops = flops / cpu_time;
if ( MORSE_My_Mpi_Rank() == 0 )
if ( MORSE_My_Mpi_Rank() == 0 ) {
printf( "%9.3f %9.2f\n", cpu_time, gflops);
}
fflush( stdout );
/************************************************************/
......@@ -206,18 +204,19 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
if ( MORSE_My_Mpi_Rank() == 0 ){
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
}
/* deallocate A, B, X, Acpy and associated descriptors descA, ... */
......
......@@ -33,8 +33,7 @@
* and therefore this approach is much more flexible.
*/
int main(int argc, char *argv[]) {
size_t N; // matrix order
size_t N; // matrix order
int NB; // number of rows and columns in tiles
int NRHS; // number of RHS vectors
int NCPU; // number of cores to use
......@@ -76,8 +75,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv
* It makes sense only if this program is linked with pthread and
......@@ -189,8 +186,9 @@ int main(int argc, char *argv[]) {
/* print informations to user */
gflops = flops / cpu_time;
if ( MORSE_My_Mpi_Rank() == 0 )
if ( MORSE_My_Mpi_Rank() == 0 ) {
printf( "%9.3f %9.2f\n", cpu_time, gflops);
}
fflush( stdout );
/************************************************************/
......@@ -214,18 +212,19 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
if ( MORSE_My_Mpi_Rank() == 0 ){
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
}
/* deallocate A, B, X, Acpy and associated descriptors descA, ... */
......
......@@ -56,8 +56,6 @@ int main(int argc, char *argv[]) {
fadds = (double)( FADDS_POTRF(N) + 2 * FADDS_TRSM(N,NRHS) );
fmuls = (double)( FMULS_POTRF(N) + 2 * FMULS_TRSM(N,NRHS) );
flops = 1e-9 * (fmuls + fadds);
gflops = 0.0;
cpu_time = 0.0;
/* initialize the number of thread if not given by the user in argv */
if ( iparam[IPARAM_THRDNBR] == -1 ) {
......@@ -166,17 +164,18 @@ int main(int argc, char *argv[]) {
* if hres = 0 then the test succeed
* else the test failed
*/
hres = 0;
hres = ( res / N / eps / (anorm * xnorm + bnorm ) > 100.0 );
hres = ( (res / N / eps / (anorm * xnorm + bnorm )) > 100.0 );
printf( " ||Ax-b|| ||A|| ||x|| ||b|| ||Ax-b||/N/eps/(||A||||x||+||b||) RETURN\n");
if (hres)
if (hres) {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e FAILURE \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
else
}
else {
printf( "%8.5e %8.5e %8.5e %8.5e %8.5e SUCCESS \n",
res, anorm, xnorm, bnorm,
res / N / eps / (anorm * xnorm + bnorm ));
}
/* free descriptors descA, descB, descX, descAC */
MORSE_Desc_Destroy( &descA );