diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b4b35d4c37fbe91717448d7b397df9b75295e7d..5bb96a0bd8f8666f85e8abf9e93eae47e74887a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,76 +8,117 @@ stages: before_script: - git submodule update --init --recursive - - source .gitlab-ci-env.sh + - source .gitlab-ci-env.sh $SIMU - mkdir -p build -build_starpu_cuda_mpi: +.build_script_template: &build_script stage: build - artifacts: - name: build_starpu_cuda_mpi - expire_in: 48 hours - paths: - - build - - chameleon-build-starpu.log script: + - echo BUILD_OPTIONS $BUILD_OPTIONS + - echo VERSION $VERSION - (cd build && cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. - -DCHAMELEON_USE_CUDA=ON - -DCHAMELEON_USE_MPI=ON && + $BUILD_OPTIONS && ctest --no-compress-output -V -j 5 -D ExperimentalBuild -D ExperimentalSubmit - | tee ../chameleon-build-starpu.log) + | tee ../chameleon_${VERSION}.log) - (cd build && - make install | tee -a ../chameleon-build-starpu.log && + make install | tee -a ../chameleon_${VERSION}.log && rm install/ -r) -test_starpu_cuda_mpi: +.test_script_template: &test_script stage: test - dependencies: - - build_starpu_cuda_mpi - artifacts: - name: test_starpu_cuda_mpi - expire_in: 48 hours - paths: - - build - - chameleon-build-starpu.log - - chameleon_starpu_mpi.lcov script: + - echo TESTS_RESTRICTION $TESTS_RESTRICTION + - echo VERSION $VERSION - (cd build && - ctest --no-compress-output -V - -R "test_shm_s|mpi_s" + eval "ctest --no-compress-output -V + $TESTS_RESTRICTION -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit - | tee -a ../chameleon-build-starpu.log) - - lcov --directory build --capture --output-file chameleon_starpu_mpi.lcov + | tee -a ../chameleon_${VERSION}.log") + - lcov --directory build --capture --output-file ../chameleon_${VERSION}.lcov + +build_starpu: + <<: *build_script + artifacts: + name: build_starpu + expire_in: 48 hours + paths: + - build + - chameleon_starpu.log + variables: + BUILD_OPTIONS: "-DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON" + VERSION: starpu build_starpu_simgrid: - stage: build + <<: *build_script artifacts: name: build_starpu_simgrid expire_in: 48 hours paths: - build - - chameleon-build-starpu-simgrid.log - script: - - source .gitlab-ci-env.sh simu - - (cd build && - cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. - -DCHAMELEON_SIMULATION=ON - -DCHAMELEON_USE_CUDA=ON - -DCHAMELEON_USE_MPI=OFF && - ctest --no-compress-output -V -j 5 - -D ExperimentalBuild - -D ExperimentalSubmit - | tee ../chameleon-build-starpu-simgrid.log) - - (cd build && - make install | tee -a ../chameleon-build-starpu-simgrid.log && - rm install/ -r) + - chameleon_starpu_simgrid.log + variables: + SIMU: simu + BUILD_OPTIONS: "-DCHAMELEON_SIMULATION=ON -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=OFF" + VERSION: starpu_simgrid -test_starpu_simgrid: - stage: test +build_quark: + <<: *build_script + artifacts: + name: build_quark + expire_in: 48 hours + paths: + - build + - chameleon_quark.log + variables: + BUILD_OPTIONS: "-DCHAMELEON_SCHED_QUARK=ON" + VERSION: quark + +test_starpu_branches: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\"" + VERSION: starpu + dependencies: + - build_starpu + artifacts: + name: test_starpu + expire_in: 48 hours + paths: + - build + - chameleon_starpu.log + - chameleon_starpu.lcov + only: + - branches + except: + - master + +test_starpu_master: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R test_" + VERSION: starpu + dependencies: + - build_starpu + artifacts: + name: test_starpu + expire_in: 48 hours + paths: + - build + - chameleon_starpu.log + - chameleon_starpu.lcov + only: + - master@solverstack/chameleon + +test_starpu_simgrid_branches: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\"" + VERSION: starpu_simgrid dependencies: - build_starpu_simgrid artifacts: @@ -85,81 +126,88 @@ test_starpu_simgrid: expire_in: 48 hours paths: - build - - chameleon-build-starpu-simgrid.log + - chameleon_starpu_simgrid.log - chameleon_starpu_simgrid.lcov - script: - - source .gitlab-ci-env.sh simu - - (cd build && - ctest --no-compress-output -V - -D ExperimentalTest - -D ExperimentalCoverage - -D ExperimentalSubmit - | tee -a ../chameleon-build-starpu-simgrid.log) - - lcov --directory build --capture --output-file chameleon_starpu_simgrid.lcov + only: + - branches + except: + - master -build_quark: - stage: build +test_starpu_simgrid_master: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R test_" + VERSION: starpu_simgrid + dependencies: + - build_starpu_simgrid artifacts: - name: build_quark + name: test_starpu_simgrid expire_in: 48 hours paths: - build - - chameleon-build-quark.log - script: - - (cd build && - cmake -C ../cmake_modules/gitlab-ci-initial-cache.cmake .. - -DCHAMELEON_SCHED_QUARK=ON && - ctest --no-compress-output -V -j 5 - -D ExperimentalBuild - -D ExperimentalSubmit - | tee ../chameleon-build-quark.log) - - (cd build && - make install | tee -a ../chameleon-build-quark.log && - rm install/ -r) + - chameleon_starpu_simgrid.log + - chameleon_starpu_simgrid.lcov + only: + - master@solverstack/chameleon -test_quark: - stage: test +test_quark_branches: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R \"test_shm_s|test_mpi_s\"" + VERSION: quark dependencies: - build_quark artifacts: - name: build_quark + name: test_quark expire_in: 48 hours paths: - build - - chameleon-build-quark.log + - chameleon_quark.log - chameleon_quark.lcov - script: - - (cd build && - ctest --no-compress-output -V - -R "test_shm_s" - -D ExperimentalTest - -D ExperimentalCoverage - -D ExperimentalSubmit - | tee -a ../chameleon-build-quark.log) - - lcov --directory build --capture --output-file chameleon_quark.lcov + only: + - branches + except: + - master + +test_quark_master: + <<: *test_script + variables: + TESTS_RESTRICTION: "-R test_" + VERSION: quark + dependencies: + - build_quark + artifacts: + name: test_quark + expire_in: 48 hours + paths: + - build + - chameleon_quark.log + - chameleon_quark.lcov + only: + - master@solverstack/chameleon sonar: stage: analysis dependencies: - - test_starpu_cuda_mpi - - test_starpu_simgrid - - test_quark + - test_starpu_master + - test_starpu_simgrid_master + - test_quark_master artifacts: name: chameleon_analysis expire_in: 1 week paths: - - chameleon-build.log - - chameleon-coverage.xml - - chameleon-cppcheck.xml - - chameleon-rats.xml + - chameleon_build.log + - chameleon_coverage.xml + - chameleon_cppcheck.xml + - chameleon_rats.xml - sonar.log script: - - cat *.log > chameleon-build.log - - lcov -a $PWD/chameleon_starpu_mpi.lcov + - cat *.log > chameleon_build.log + - lcov -a $PWD/chameleon_starpu.lcov -a $PWD/chameleon_starpu_simgrid.lcov -a $PWD/chameleon_quark.lcov -o $PWD/chameleon.lcov - - lcov_cobertura.py chameleon.lcov --output chameleon-coverage.xml + - lcov_cobertura.py chameleon.lcov --output chameleon_coverage.xml - ./tools/analysis.sh only: - master@solverstack/chameleon diff --git a/compute/zgesvd.c b/compute/zgesvd.c index 1c135ae469223b05acbb13c313cde6e1f5d44cc1..d4a249b8a080aa15d5a832ecfb74fecdb867e60f 100644 --- a/compute/zgesvd.c +++ b/compute/zgesvd.c @@ -622,12 +622,14 @@ int MORSE_zgesvd_Tile_Async( MORSE_enum jobu, MORSE_enum jobvt, } #endif /* !defined(CHAMELEON_SIMULATION) */ - if (jobu != MorseNoVec) + if (jobu != MorseNoVec) { morse_desc_mat_free( &descU ); - if (jobvt != MorseNoVec) + } + if (jobvt != MorseNoVec) { morse_desc_mat_free( &descVT ); + } free(E); - if (Dptr != NULL) { + if ( Dptr ) { morse_desc_mat_free( Dptr ); } (void)D; diff --git a/coreblas/compute/core_ztsmlq_hetra1.c b/coreblas/compute/core_ztsmlq_hetra1.c index e7edbe4befedd2f3eaf65592af49e836ae676e6d..e7903c4e05b4c4be3b756aacc90d00a712e30f59 100644 --- a/coreblas/compute/core_ztsmlq_hetra1.c +++ b/coreblas/compute/core_ztsmlq_hetra1.c @@ -143,8 +143,9 @@ int CORE_ztsmlq_hetra1( MORSE_enum side, MORSE_enum trans, /* in-place transposition of A1 */ for (j = 0; j < n1; j++){ +#if defined(PRECISION_z) || defined(PRECISION_c) A1[j + j*lda1] = conj(A1[j + j*lda1]); - +#endif for (i = j+1; i < m1; i++){ *WORK = *(A1 + i + j*lda1); *(A1 + i + j*lda1) = conj(*(A1 + j + i*lda1)); @@ -159,8 +160,9 @@ int CORE_ztsmlq_hetra1( MORSE_enum side, MORSE_enum trans, /* in-place transposition of A1 */ for (j = 0; j < n1; j++){ +#if defined(PRECISION_z) || defined(PRECISION_c) A1[j + j*lda1] = conj(A1[j + j*lda1]); - +#endif for (i = j+1; i < m1; i++){ *WORK = *(A1 + i + j*lda1); *(A1 + i + j*lda1) = conj(*(A1 + j + i*lda1)); diff --git a/coreblas/compute/core_ztsmqr_hetra1.c b/coreblas/compute/core_ztsmqr_hetra1.c index e0675ddfff5193364dc3d803a68c2858302126c0..f66c27f1101b9ab192d1a550a101f75f7148a530 100644 --- a/coreblas/compute/core_ztsmqr_hetra1.c +++ b/coreblas/compute/core_ztsmqr_hetra1.c @@ -145,8 +145,9 @@ int CORE_ztsmqr_hetra1( MORSE_enum side, MORSE_enum trans, /* in-place transposition of A1 */ for (j = 0; j < n1; j++){ +#if defined(PRECISION_z) || defined(PRECISION_c) A1[j + j*lda1] = conj(A1[j + j*lda1]); - +#endif for (i = j+1; i < m1; i++){ *WORK = *(A1 + i + j*lda1); *(A1 + i + j*lda1) = conj(*(A1 + j + i*lda1)); @@ -158,8 +159,9 @@ int CORE_ztsmqr_hetra1( MORSE_enum side, MORSE_enum trans, /* in-place transposition of A1 */ for (j = 0; j < n1; j++){ +#if defined(PRECISION_z) || defined(PRECISION_c) A1[j + j*lda1] = conj(A1[j + j*lda1]); - +#endif for (i = j+1; i < m1; i++){ *WORK = *(A1 + i + j*lda1); *(A1 + i + j*lda1) = conj(*(A1 + j + i*lda1)); diff --git a/example/lapack_to_morse/step0.c b/example/lapack_to_morse/step0.c index f5cbfc34408ab63bea44b72711df6f35fc7be6f2..6879a1ef1e3ab1f0fde0ddb067255e842bb91128 100644 --- a/example/lapack_to_morse/step0.c +++ b/example/lapack_to_morse/step0.c @@ -71,9 +71,10 @@ int main(int argc, char *argv[]) { * - set of RHS vectors B : size N x NRHS * - set of solutions vectors X : size N x NRHS */ - PASTE_CODE_ALLOCATE_MATRIX( A, double, N, N ); - PASTE_CODE_ALLOCATE_MATRIX( B, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( X, double, N, NRHS ); + double *A = malloc( N * N * sizeof(double) ); + double *Acpy = malloc( N * N * sizeof(double) ); + double *B = malloc( N * NRHS * sizeof(double) ); + double *X = malloc( N * NRHS * sizeof(double) ); /* generate A matrix with random values such that it is spd */ CORE_dplgsy( (double)N, N, N, A, N, N, N, N, 51 ); @@ -82,8 +83,7 @@ int main(int argc, char *argv[]) { CORE_dplrnt( N, NRHS, B, N, N, N, NRHS, 5673 ); /* copy A before facto. in order to check the result */ - PASTE_CODE_ALLOCATE_MATRIX( Acpy, double, N, N ); - memcpy(Acpy, A, N*N*sizeof(double)); + memcpy(Acpy, A, N * N * sizeof(double)); /* copy B in X before solving */ memcpy(X, B, N*NRHS*sizeof(double)); diff --git a/example/lapack_to_morse/step0.h b/example/lapack_to_morse/step0.h index 7ca73889108f9b0f770f223b5b55a318a011418e..0f3f87672b85532ae2a6c03f9d23d5b8a6cea518 100644 --- a/example/lapack_to_morse/step0.h +++ b/example/lapack_to_morse/step0.h @@ -120,15 +120,4 @@ static void print_header(char *prog_name, int * iparam) { return; } -/** - * Macro to allocate a matrix as a 1D array - */ -#define PASTE_CODE_ALLOCATE_MATRIX(_name_, _type_, _m_, _n_) \ - _type_ *_name_ = NULL; \ - _name_ = (_type_*)malloc( (_m_) * (_n_) * sizeof(_type_) ); \ - if ( ! _name_ ) { \ - fprintf(stderr, "Out of Memory for %s\n", #_name_); \ - return -1; \ - } - #endif /* STEP0_H */ diff --git a/example/lapack_to_morse/step1.c b/example/lapack_to_morse/step1.c index 930055a7617180052fff10e9c08a301f10f21238..6099a6f9a673f2df637a93b3f28d02f9cd16c1cb 100644 --- a/example/lapack_to_morse/step1.c +++ b/example/lapack_to_morse/step1.c @@ -93,10 +93,10 @@ int main(int argc, char *argv[]) { * - set of RHS vectors B : size N x NRHS * - set of solutions vectors X : size N x NRHS */ - PASTE_CODE_ALLOCATE_MATRIX( A, double, N, N ); - PASTE_CODE_ALLOCATE_MATRIX( B, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( X, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( Acpy, double, N, N ); + double *A = malloc( N * N * sizeof(double) ); + double *Acpy = malloc( N * N * sizeof(double) ); + double *B = malloc( N * NRHS * sizeof(double) ); + double *X = malloc( N * NRHS * sizeof(double) ); /* generate A matrix with random values such that it is spd */ MORSE_dplgsy( (double)N, MorseUpperLower, N, A, N, 51 ); diff --git a/example/lapack_to_morse/step1.h b/example/lapack_to_morse/step1.h index 0b76f1de5f61a221fe14707e95622a420277e8c8..92a9fb8b031303fd1e07d5c0702a6f78001b3108 100644 --- a/example/lapack_to_morse/step1.h +++ b/example/lapack_to_morse/step1.h @@ -119,15 +119,4 @@ static void print_header(char *prog_name, int * iparam) { return; } -/** - * Macro to allocate a matrix as a 1D array - */ -#define PASTE_CODE_ALLOCATE_MATRIX(_name_, _type_, _m_, _n_) \ - _type_ *_name_ = NULL; \ - _name_ = (_type_*)malloc( (_m_) * (_n_) * sizeof(_type_) ); \ - if ( ! _name_ ) { \ - fprintf(stderr, "Out of Memory for %s\n", #_name_); \ - return -1; \ - } - #endif /* STEP1_H */ diff --git a/example/lapack_to_morse/step2.c b/example/lapack_to_morse/step2.c index 0a51acd1e39a8c03beb0f6dd8b5b62c8a159f080..fbb13949987b0d2379a3e5fabe0b1943f5e59fb2 100644 --- a/example/lapack_to_morse/step2.c +++ b/example/lapack_to_morse/step2.c @@ -91,10 +91,10 @@ int main(int argc, char *argv[]) { * - set of RHS vectors B : size N x NRHS * - set of solutions vectors X : size N x NRHS */ - PASTE_CODE_ALLOCATE_MATRIX( A, double, N, N ); - PASTE_CODE_ALLOCATE_MATRIX( B, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( X, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( Acpy, double, N, N ); + double *A = malloc( N * N * sizeof(double) ); + double *Acpy = malloc( N * N * sizeof(double) ); + double *B = malloc( N * NRHS * sizeof(double) ); + double *X = malloc( N * NRHS * sizeof(double) ); /* * Initialize the structure required for MORSE tile interface diff --git a/example/lapack_to_morse/step2.h b/example/lapack_to_morse/step2.h index 86eb985dff1f9a49de90860b19dc49fe377c6c58..2e72b11b072dbc93dfa8a6f88b661718400de778 100644 --- a/example/lapack_to_morse/step2.h +++ b/example/lapack_to_morse/step2.h @@ -119,15 +119,4 @@ static void print_header(char *prog_name, int * iparam) { return; } -/** - * Macro to allocate a matrix as a 1D array - */ -#define PASTE_CODE_ALLOCATE_MATRIX(_name_, _type_, _m_, _n_) \ - _type_ *_name_ = NULL; \ - _name_ = (_type_*)malloc( (_m_) * (_n_) * sizeof(_type_) ); \ - if ( ! _name_ ) { \ - fprintf(stderr, "Out of Memory for %s\n", #_name_); \ - return -1; \ - } - #endif /* STEP2_H */ diff --git a/example/link_chameleon/link_chameleon.c b/example/link_chameleon/link_chameleon.c index 612a3c53188923fa0a9a40dbae6966b8f8492eea..33d4eb5782fe2b6d8d0604f0a8e18b2dcd5e4539 100644 --- a/example/link_chameleon/link_chameleon.c +++ b/example/link_chameleon/link_chameleon.c @@ -132,17 +132,6 @@ static void print_header(char *prog_name, int * iparam) { return; } -/** - * Macro to allocate a matrix as a 1D array - */ -#define PASTE_CODE_ALLOCATE_MATRIX(_name_, _type_, _m_, _n_) \ - _type_ *_name_ = NULL; \ - _name_ = (_type_*)malloc( (_m_) * (_n_) * sizeof(_type_) ); \ - if ( ! _name_ ) { \ - fprintf(stderr, "Out of Memory for %s\n", #_name_); \ - return -1; \ - } - /* * test external application link with chameleon */ @@ -203,10 +192,10 @@ int main(int argc, char *argv[]) { * - set of RHS vectors B : size N x NRHS * - set of solutions vectors X : size N x NRHS */ - PASTE_CODE_ALLOCATE_MATRIX( A, double, N, N ); - PASTE_CODE_ALLOCATE_MATRIX( B, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( X, double, N, NRHS ); - PASTE_CODE_ALLOCATE_MATRIX( Acpy, double, N, N ); + double *A = malloc( N * N * sizeof(double) ); + double *Acpy = malloc( N * N * sizeof(double) ); + double *B = malloc( N * NRHS * sizeof(double) ); + double *X = malloc( N * NRHS * sizeof(double) ); /* generate A matrix with random values such that it is spd */ MORSE_dplgsy( (double)N, MorseUpperLower, N, A, N, 51 ); diff --git a/tools/analysis.sh b/tools/analysis.sh index f3864affc42509dffe84dfa2f2b5e911c6a21461..104d5534bb0235c0aff0f09a5e271e82b8821897 100755 --- a/tools/analysis.sh +++ b/tools/analysis.sh @@ -2,7 +2,7 @@ # Performs an analysis of Chameleon source code: # - we consider to be in Chameleon's source code root -# - we consider having the coverage file chameleon-coverage.xml in the root directory +# - we consider having the coverage file chameleon_coverage.xml in the root directory # - we consider having cppcheck, rats, sonar-scanner programs available in the environment # filter sources: @@ -14,9 +14,9 @@ # Undefine this because not relevant in our configuration export UNDEFINITIONS="-UCHAMELEON_USE_OPENCL -UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus" # run cppcheck analysis -cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${UNDEFINITIONS} --file-list=./filelist.txt 2> chameleon-cppcheck.xml +cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingIncludeSystem ${UNDEFINITIONS} --file-list=./filelist.txt 2> chameleon_cppcheck.xml # run rats analysis -rats -w 3 --xml `cat filelist.txt` > chameleon-rats.xml +rats -w 3 --xml `cat filelist.txt` > chameleon_rats.xml # create the sonarqube config file cat > sonar-project.properties << EOF @@ -35,10 +35,10 @@ sonar.sourceEncoding=UTF-8 sonar.cxx.compiler.charset=UTF-8 sonar.cxx.compiler.parser=GCC sonar.cxx.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$ -sonar.cxx.compiler.reportPath=chameleon-build-starpu.log, chameleon-build-starpu-simgrid.log, chameleon-build-quark.log -sonar.cxx.coverage.reportPath=chameleon-coverage.xml -sonar.cxx.cppcheck.reportPath=chameleon-cppcheck.xml -sonar.cxx.rats.reportPath=chameleon-rats.xml +sonar.cxx.compiler.reportPath=chameleon_starpu.log, chameleon_starpu_simgrid.log, chameleon_quark.log +sonar.cxx.coverage.reportPath=chameleon_coverage.xml +sonar.cxx.cppcheck.reportPath=chameleon_cppcheck.xml +sonar.cxx.rats.reportPath=chameleon_rats.xml EOF # run sonar analysis + publish on sonarqube-dev