Commit adb41a00 authored by Mathieu Faverge's avatar Mathieu Faverge

Merge branch 'sonarqube' into 'master'

Sonarqube

See merge request solverstack/chameleon!79
parents 2e8a8bb2 98ba8385
Subproject commit b102625ef8626da53d4461e84050dc4cb5e62afb
Subproject commit a5142c9b74e6bfa007142aff48c3c70f99805995
......@@ -111,7 +111,7 @@ int MORSE_zgeadd( MORSE_enum trans, int M, int N,
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_zgeadd", "illegal value of trans");
return -1;
}
......@@ -324,7 +324,7 @@ int MORSE_zgeadd_Tile_Async( MORSE_enum trans,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_zgeadd_Tile_Async", "illegal value of trans");
return morse_request_fail(sequence, request, -1);
}
......
......@@ -152,11 +152,11 @@ int MORSE_zgemm( MORSE_enum transA, MORSE_enum transB, int M, int N, int K,
}
/* Check input arguments */
if ((transA != MorseNoTrans) && (transA != MorseTrans) && (transA != MorseConjTrans)) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_zgemm", "illegal value of transA");
return -1;
}
if ((transB != MorseNoTrans) && (transB != MorseTrans) && (transB != MorseConjTrans)) {
if ((transB < MorseNoTrans) || (transB > MorseConjTrans)) {
morse_error("MORSE_zgemm", "illegal value of transB");
return -2;
}
......@@ -401,11 +401,11 @@ int MORSE_zgemm_Tile_Async( MORSE_enum transA, MORSE_enum transB,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((transA != MorseNoTrans) && (transA != MorseTrans) && (transA != MorseConjTrans)) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_zgemm_Tile_Async", "illegal value of transA");
return morse_request_fail(sequence, request, -1);
}
if ((transB != MorseNoTrans) && (transB != MorseTrans) && (transB != MorseConjTrans)) {
if ((transB < MorseNoTrans) || (transB > MorseConjTrans)) {
morse_error("MORSE_zgemm_Tile_Async", "illegal value of transB");
return morse_request_fail(sequence, request, -2);
}
......
......@@ -121,7 +121,7 @@ int MORSE_ztradd( MORSE_enum uplo, MORSE_enum trans, int M, int N,
morse_error("MORSE_ztradd", "illegal value of uplo");
return -1;
}
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_ztradd", "illegal value of trans");
return -2;
}
......@@ -340,7 +340,7 @@ int MORSE_ztradd_Tile_Async( MORSE_enum uplo, MORSE_enum trans,
return morse_request_fail(sequence, request, MORSE_ERR_ILLEGAL_VALUE);
}
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
morse_error("MORSE_ztradd_Tile_Async", "illegal value of trans");
return morse_request_fail(sequence, request, -1);
}
......
......@@ -371,7 +371,7 @@ int MORSE_ztrmm_Tile_Async( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrmm_Tile", "illegal value of uplo");
return morse_request_fail(sequence, request, -2);
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_ztrmm_Tile", "illegal value of transA");
return morse_request_fail(sequence, request, -3);
}
......
......@@ -136,7 +136,7 @@ int MORSE_ztrsm( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrsm", "illegal value of uplo");
return -2;
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans ) {
if (((transA < MorseNoTrans) || (transA > MorseConjTrans)) ) {
morse_error("MORSE_ztrsm", "illegal value of transA");
return -3;
}
......@@ -369,7 +369,7 @@ int MORSE_ztrsm_Tile_Async( MORSE_enum side, MORSE_enum uplo,
morse_error("MORSE_ztrsm_Tile", "illegal value of uplo");
return morse_request_fail(sequence, request, -2);
}
if (transA != MorseConjTrans && transA != MorseNoTrans && transA != MorseTrans) {
if ((transA < MorseNoTrans) || (transA > MorseConjTrans)) {
morse_error("MORSE_ztrsm_Tile", "illegal value of transA");
return morse_request_fail(sequence, request, -3);
}
......
......@@ -93,9 +93,7 @@ int CORE_zgeadd(MORSE_enum trans, int M, int N,
{
int i, j;
if ((trans != MorseNoTrans) &&
(trans != MorseTrans) &&
(trans != MorseConjTrans))
if ((trans < MorseNoTrans) || (trans > MorseConjTrans))
{
coreblas_error(1, "illegal value of trans");
return -1;
......
......@@ -99,7 +99,7 @@ int CORE_zlatro(MORSE_enum uplo, MORSE_enum trans,
coreblas_error(1, "Illegal value of uplo");
return -1;
}
if ((trans != MorseConjTrans) && (trans != MorseNoTrans) && (trans != MorseTrans) ) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
coreblas_error(2, "Illegal value of trans");
return -2;
}
......
......@@ -146,7 +146,7 @@ int CORE_zpemv(MORSE_enum trans, int storev,
/* Check input arguments */
if ((trans != MorseNoTrans) && (trans != MorseTrans) && (trans != MorseConjTrans)) {
if ((trans < MorseNoTrans) || (trans > MorseConjTrans)) {
coreblas_error(1, "Illegal value of trans");
return -1;
}
......
......@@ -118,9 +118,7 @@ int CORE_ztradd(MORSE_enum uplo, MORSE_enum trans, int M, int N,
return -1;
}
if ((trans != MorseNoTrans) &&
(trans != MorseTrans) &&
(trans != MorseConjTrans))
if ((trans < MorseNoTrans) || (trans > MorseConjTrans))
{
coreblas_error(2, "illegal value of trans");
return -2;
......
......@@ -16,7 +16,7 @@
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
......
......@@ -16,7 +16,7 @@
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
......
......@@ -83,7 +83,10 @@ int testing_zgeadd(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Binit)||(!Bfinal)){
if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -258,7 +258,11 @@ int testing_zgels(int argc, char **argv)
MORSE_desc_t *T;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -95,7 +95,11 @@ int testing_zgels_hqr(int argc, char **argv)
MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -89,7 +89,11 @@ int testing_zgels_systolic(int argc, char **argv)
MORSE_desc_t *TT = NULL;
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
if ( (!A1) || (!A2) || (!B1) || (!B2) || (!Q) )
{
free(A1); free(A2);
free(B1); free(B2);
free(Q);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -88,7 +88,10 @@ int testing_zgemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) )
{
free(A); free(B);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -87,6 +87,8 @@ int testing_zgeqrf_qdwh(int argc, char **argv)
/* Check if unable to allocate memory */
if ( (!A) || (!A1) || (!A2) || (!Q1) || (!Q2) ){
free(A); free(A1); free(A2);
free(Q1); free(Q2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -196,7 +196,10 @@ int testing_zgesv_incpiv(int argc, char **argv)
int *IPIV;
/* Check if unable to allocate memory */
if ( (!A1) || (!A2)|| (!B1) || (!B2) ) {
if ( (!A1) || (!A2)|| (!B1) || (!B2) )
{
free(A1); free(A2);
free(B1); free(B2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -100,6 +100,8 @@ int testing_zgesvd(int argc, char **argv)
/* Check if unable to allocate memory */
if ( (!A1) || (!S1) || (!S2) || (!work) ) {
free(A1); free(work);
free(S1); free(S2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -72,7 +72,11 @@ int testing_zheevd(int argc, char **argv)
MORSE_desc_t *T;
/* Check if unable to allocate memory */
if ( (!A2) || (!W1) || (!W2) ){
if ( (!A2) || (!W1) || (!W2) || !(work) )
{
free(A2);
free(W1); free(W2);
free(work);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -81,7 +81,10 @@ int testing_zhemm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -82,7 +82,9 @@ int testing_zher2k(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -77,7 +77,9 @@ int testing_zherk(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
if ( (!A) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -134,9 +134,12 @@ int testing_zpemv(int argc, char **argv)
LAPACKE_zlarnv_work(1, ISEED, 1, &beta0 );
/* Check if unable to allocate memory */
if ( (!A) || (!X) || (!Y0) || (!work) ) {
if ( (!A) || (!A0) || (!X) || (!Y) || (!Y0) || (!work) ) {
free(A); free(A0);
free(X); free(Y); free(Y0);
free(work);
printf("Out of Memory \n ");
exit(0);
return -2;
}
/* Initialize Data */
......
......@@ -189,13 +189,16 @@ int testing_zposv(int argc, char **argv)
int info_solution, info_factorization;
int trans1, trans2;
MORSE_Complex64_t *A1 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *A2 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B1 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B2 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *A1 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *A2 = (MORSE_Complex64_t *)malloc(LDA*N*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B1 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
MORSE_Complex64_t *B2 = (MORSE_Complex64_t *)malloc(LDB*NRHS*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)){
if ( (!A1) || (!A2)|| (!B1) || (!B2) )
{
free(A1); free(A2);
free(B1); free(B2);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -199,7 +199,10 @@ int testing_zpotri(int argc, char **argv)
MORSE_Complex64_t *WORK = (MORSE_Complex64_t *)malloc(2*LDA*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)){
if ( (!A1) || (!A2) || (!WORK) )
{
free(A1); free(A2);
free(WORK);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -81,7 +81,10 @@ int testing_zsymm(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -82,7 +82,10 @@ int testing_zsyr2k(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
if ( (!A) || (!B) || (!C) || (!Cinit) || (!Cfinal) )
{
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -77,7 +77,9 @@ int testing_zsyrk(int argc, char **argv)
MORSE_Complex64_t *Cfinal = (MORSE_Complex64_t *)malloc(LDCxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
if ( (!A) || (!C) || (!Cinit) || (!Cfinal) ){
free(A); free(C);
free(Cinit); free(Cfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -77,7 +77,10 @@ int testing_ztrmm(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -77,7 +77,10 @@ int testing_ztrsm(int argc, char **argv)
MORSE_Complex64_t *Bfinal = (MORSE_Complex64_t *)malloc(LDBxN*sizeof(MORSE_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
if ( (!A) || (!B) || (!Binit) || (!Bfinal) )
{
free(A); free(B);
free(Binit); free(Bfinal);
printf("Out of Memory \n ");
return -2;
}
......
......@@ -674,17 +674,21 @@ main(int argc, char *argv[]) {
MORSE_Set(MORSE_HOUSEHOLDER_SIZE, iparam[IPARAM_RHBLK]);
}
if (iparam[IPARAM_PROFILE] == 1)
if (iparam[IPARAM_PROFILE] == 1) {
MORSE_Enable(MORSE_PROFILING_MODE);
}
if (iparam[IPARAM_PROGRESS] == 1)
if (iparam[IPARAM_PROGRESS] == 1) {
MORSE_Enable(MORSE_PROGRESS);
}
if (iparam[IPARAM_PRINT_WARNINGS] == 0)
if (iparam[IPARAM_PRINT_WARNINGS] == 0) {
MORSE_Disable(MORSE_WARNINGS);
}
if (iparam[IPARAM_GEMM3M] == 1)
if (iparam[IPARAM_GEMM3M] == 1) {
MORSE_Enable(MORSE_GEMM3M);
}
#if defined(CHAMELEON_USE_MPI)
nbnode = MORSE_Comm_size();
......@@ -702,8 +706,9 @@ main(int argc, char *argv[]) {
/* Layout conversion */
MORSE_Set(MORSE_TRANSLATION_MODE, iparam[IPARAM_INPLACE]);
if ( MORSE_My_Mpi_Rank() == 0 )
if ( MORSE_My_Mpi_Rank() == 0 ) {
print_header( argv[0], iparam);
}
if (step < 1) step = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment