Commit 32d8c350 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#177 Valgrind shell script replaced by a Python script: the idea is to provide...

#177 Valgrind shell script replaced by a Python script: the idea is to provide one script per target. A new stage is introduced to do so. The gitlab Yaml file has been commented to speed-up the 'usual' process and see if the valgrind stage works as intended (probably not: not tested locally at all...).
parent 719fa034
valgrind:
stage: analysis
valgrind-elasticity:
stage: valgrind
image: registry.gitlab.inria.fr/morefem/analysistools/valgrind:latest
script:
- Scripts/Tools/run_valgrind.sh
- python Scripts/Tools/run_valgrind_elasticity.py
dependencies: []
artifacts:
name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-valgrind"
name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-valgrind-elasticity"
expire_in: 2 days
when: always
paths:
- memcheck_matrix_operations.txt
- memcheck_elasticity.txt
- memcheck_heat.txt
- memcheck_hyperelasticity.txt
- memcheck_laplacian.txt
- memcheck_rivlin_cube.txt
- memcheck_stokes.txt
after_script:
- rm -rf build_4_valgrind/
only:
- develop@morefem/corelibrary/morefem
- /(sonarqube)/
- /(valgrind)/
cppcheck:
......
stages:
- build_and_test
- check_warnings
- valgrind
- analysis
- generate_sonarqube
- valgrind
# As suggested by https://blog.sparksuite.com/7-ways-to-speed-up-gitlab-ci-cd-times-29f60aab69f9
variables:
......
......@@ -96,7 +96,7 @@ if __name__ == "__main__":
do_define_tags = True
print("include:")
print(" - local: '/ExternalTools/Gitlab-CI/common.yml'\n\n")
print(" - local: '/ExternalTools/Gitlab-CI/common.yml'")
print(" - local: '/ExternalTools/Gitlab-CI/analysis.yml'\n\n")
configuration_list = \
......
......@@ -2,252 +2,252 @@ include:
- local: '/ExternalTools/Gitlab-CI/common.yml'
- local: '/ExternalTools/Gitlab-CI/analysis.yml'
build_ubuntu_gcc_debug_several_shared_libraries:
extends: .build_template_linux
tags:
- ubuntu
- gcc
- debug
variables:
OS: "ubuntu"
COMPILER: "gcc"
MODE: "debug"
LIB_NATURE: "shared"
OS: "ubuntu"
IS_ONLY_ONE_LIB: "False"
check_ubuntu_gcc_debug_several_shared_libraries:
extends: .check_compilation_warning_template_docker
tags:
- ubuntu
- gcc
- debug
dependencies:
- build_ubuntu_gcc_debug_several_shared_libraries
variables:
OS: "ubuntu"
COMPILER: "gcc"
MODE: "debug"
LIB_NATURE: "shared"
OS: "ubuntu"
IS_ONLY_ONE_LIB: "False"
build_ubuntu_gcc_release_one_static_library:
extends: .build_template_linux
tags:
- ubuntu
- gcc
- release
variables:
OS: "ubuntu"
COMPILER: "gcc"
MODE: "release"
LIB_NATURE: "static"
OS: "ubuntu"
IS_ONLY_ONE_LIB: "True"
check_ubuntu_gcc_release_one_static_library:
extends: .check_compilation_warning_template_docker
tags:
- ubuntu
- gcc
- release
dependencies:
- build_ubuntu_gcc_release_one_static_library
variables:
OS: "ubuntu"
COMPILER: "gcc"
MODE: "release"
LIB_NATURE: "static"
OS: "ubuntu"
IS_ONLY_ONE_LIB: "True"
build_fedora_gcc_debug_one_shared_library:
extends: .build_template_linux
tags:
- fedora
- gcc
- debug
variables:
OS: "fedora"
COMPILER: "gcc"
MODE: "debug"
LIB_NATURE: "shared"
OS: "fedora"
IS_ONLY_ONE_LIB: "True"
check_fedora_gcc_debug_one_shared_library:
extends: .check_compilation_warning_template_docker
tags:
- fedora
- gcc
- debug
dependencies:
- build_fedora_gcc_debug_one_shared_library
variables:
OS: "fedora"
COMPILER: "gcc"
MODE: "debug"
LIB_NATURE: "shared"
OS: "fedora"
IS_ONLY_ONE_LIB: "True"
build_fedora_gcc_release_several_static_libraries:
extends: .build_template_linux
tags:
- fedora
- gcc
- release
variables:
OS: "fedora"
COMPILER: "gcc"
MODE: "release"
LIB_NATURE: "static"
OS: "fedora"
IS_ONLY_ONE_LIB: "False"
check_fedora_gcc_release_several_static_libraries:
extends: .check_compilation_warning_template_docker
tags:
- fedora
- gcc
- release
dependencies:
- build_fedora_gcc_release_several_static_libraries
variables:
OS: "fedora"
COMPILER: "gcc"
MODE: "release"
LIB_NATURE: "static"
OS: "fedora"
IS_ONLY_ONE_LIB: "False"
build_fedora_clang_debug_several_shared_libraries:
extends: .build_template_linux
tags:
- fedora
- clang
- debug
variables:
OS: "fedora"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "shared"
OS: "fedora"
IS_ONLY_ONE_LIB: "False"
check_fedora_clang_debug_several_shared_libraries:
extends: .check_compilation_warning_template_docker
tags:
- fedora
- clang
- debug
dependencies:
- build_fedora_clang_debug_several_shared_libraries
variables:
OS: "fedora"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "shared"
OS: "fedora"
IS_ONLY_ONE_LIB: "False"
build_fedora_clang_release_one_static_library:
extends: .build_template_linux
tags:
- fedora
- clang
- release
variables:
OS: "fedora"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
OS: "fedora"
IS_ONLY_ONE_LIB: "True"
check_fedora_clang_release_one_static_library:
extends: .check_compilation_warning_template_docker
tags:
- fedora
- clang
- release
dependencies:
- build_fedora_clang_release_one_static_library
variables:
OS: "fedora"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
OS: "fedora"
IS_ONLY_ONE_LIB: "True"
build_macos_clang_debug_several_static_libraries:
extends: .build_template_macos
tags:
- macos
- clang
- debug
variables:
OS: "macos"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "static"
OS: "macos"
IS_ONLY_ONE_LIB: "False"
check_macos_clang_debug_several_static_libraries:
extends: .check_compilation_warning_template_macos
tags:
- macos
- clang
- debug
dependencies:
- build_macos_clang_debug_several_static_libraries
variables:
OS: "macos"
COMPILER: "clang"
MODE: "debug"
LIB_NATURE: "static"
OS: "macos"
IS_ONLY_ONE_LIB: "False"
build_macos_clang_release_one_static_library:
extends: .build_template_macos
tags:
- macos
- clang
- release
variables:
OS: "macos"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
OS: "macos"
IS_ONLY_ONE_LIB: "True"
check_macos_clang_release_one_static_library:
extends: .check_compilation_warning_template_macos
tags:
- macos
- clang
- release
dependencies:
- build_macos_clang_release_one_static_library
variables:
OS: "macos"
COMPILER: "clang"
MODE: "release"
LIB_NATURE: "static"
OS: "macos"
IS_ONLY_ONE_LIB: "True"
# build_ubuntu_gcc_debug_several_shared_libraries:
# extends: .build_template_linux
# tags:
# - ubuntu
# - gcc
# - debug
# variables:
# OS: "ubuntu"
# COMPILER: "gcc"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "ubuntu"
# IS_ONLY_ONE_LIB: "False"
#
# check_ubuntu_gcc_debug_several_shared_libraries:
# extends: .check_compilation_warning_template_docker
# tags:
# - ubuntu
# - gcc
# - debug
# dependencies:
# - build_ubuntu_gcc_debug_several_shared_libraries
# variables:
# OS: "ubuntu"
# COMPILER: "gcc"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "ubuntu"
# IS_ONLY_ONE_LIB: "False"
#
#
# build_ubuntu_gcc_release_one_static_library:
# extends: .build_template_linux
# tags:
# - ubuntu
# - gcc
# - release
# variables:
# OS: "ubuntu"
# COMPILER: "gcc"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "ubuntu"
# IS_ONLY_ONE_LIB: "True"
#
# check_ubuntu_gcc_release_one_static_library:
# extends: .check_compilation_warning_template_docker
# tags:
# - ubuntu
# - gcc
# - release
# dependencies:
# - build_ubuntu_gcc_release_one_static_library
# variables:
# OS: "ubuntu"
# COMPILER: "gcc"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "ubuntu"
# IS_ONLY_ONE_LIB: "True"
#
#
# build_fedora_gcc_debug_one_shared_library:
# extends: .build_template_linux
# tags:
# - fedora
# - gcc
# - debug
# variables:
# OS: "fedora"
# COMPILER: "gcc"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "True"
#
# check_fedora_gcc_debug_one_shared_library:
# extends: .check_compilation_warning_template_docker
# tags:
# - fedora
# - gcc
# - debug
# dependencies:
# - build_fedora_gcc_debug_one_shared_library
# variables:
# OS: "fedora"
# COMPILER: "gcc"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "True"
#
#
# build_fedora_gcc_release_several_static_libraries:
# extends: .build_template_linux
# tags:
# - fedora
# - gcc
# - release
# variables:
# OS: "fedora"
# COMPILER: "gcc"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "False"
#
# check_fedora_gcc_release_several_static_libraries:
# extends: .check_compilation_warning_template_docker
# tags:
# - fedora
# - gcc
# - release
# dependencies:
# - build_fedora_gcc_release_several_static_libraries
# variables:
# OS: "fedora"
# COMPILER: "gcc"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "False"
#
#
# build_fedora_clang_debug_several_shared_libraries:
# extends: .build_template_linux
# tags:
# - fedora
# - clang
# - debug
# variables:
# OS: "fedora"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "False"
#
# check_fedora_clang_debug_several_shared_libraries:
# extends: .check_compilation_warning_template_docker
# tags:
# - fedora
# - clang
# - debug
# dependencies:
# - build_fedora_clang_debug_several_shared_libraries
# variables:
# OS: "fedora"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "shared"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "False"
#
#
# build_fedora_clang_release_one_static_library:
# extends: .build_template_linux
# tags:
# - fedora
# - clang
# - release
# variables:
# OS: "fedora"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "True"
#
# check_fedora_clang_release_one_static_library:
# extends: .check_compilation_warning_template_docker
# tags:
# - fedora
# - clang
# - release
# dependencies:
# - build_fedora_clang_release_one_static_library
# variables:
# OS: "fedora"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "fedora"
# IS_ONLY_ONE_LIB: "True"
#
#
# build_macos_clang_debug_several_static_libraries:
# extends: .build_template_macos
# tags:
# - macos
# - clang
# - debug
# variables:
# OS: "macos"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "static"
# OS: "macos"
# IS_ONLY_ONE_LIB: "False"
#
# check_macos_clang_debug_several_static_libraries:
# extends: .check_compilation_warning_template_macos
# tags:
# - macos
# - clang
# - debug
# dependencies:
# - build_macos_clang_debug_several_static_libraries
# variables:
# OS: "macos"
# COMPILER: "clang"
# MODE: "debug"
# LIB_NATURE: "static"
# OS: "macos"
# IS_ONLY_ONE_LIB: "False"
#
#
# build_macos_clang_release_one_static_library:
# extends: .build_template_macos
# tags:
# - macos
# - clang
# - release
# variables:
# OS: "macos"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "macos"
# IS_ONLY_ONE_LIB: "True"
#
# check_macos_clang_release_one_static_library:
# extends: .check_compilation_warning_template_macos
# tags:
# - macos
# - clang
# - release
# dependencies:
# - build_macos_clang_release_one_static_library
# variables:
# OS: "macos"
# COMPILER: "clang"
# MODE: "release"
# LIB_NATURE: "static"
# OS: "macos"
# IS_ONLY_ONE_LIB: "True"
#
#
#
......@@ -17,8 +17,8 @@ if __name__ == "__main__":
]
FILE=open('morefem-rats.xml', 'w')
xml_output = open('morefem-rats.xml', 'w')
subprocess.Popen(cmd, shell=False, stdout=FILE, stderr=FILE).communicate()
subprocess.Popen(cmd, shell=False, stdout=xml_output, stderr=xml_output).communicate()
print("Output written in morefem-rats.xml")
\ No newline at end of file
#!/bin/bash
# Assumes current path is MOREFEM_ROOT to use this script.
# Utility function used at the end of each Valgrind run.
function printDone()
{
echo "Memcheck done for $1, output file $2 written."
}
# arg1: executable, arg2: lua input, arg3: memcheck_output_file
function runValgrind()
{
EXECUTABLE="Sources/$1"
OUTPUT="${MOREFEM_ROOT}/$3"
valgrind --error-exitcode=1 --log-file=$OUTPUT --gen-suppressions=all --show-leak-kinds=all --show-reachable=yes --track-origins=yes --leak-check=full --errors-for-leak-kinds=all --suppressions=../ExternalTools/Valgrind/openmpi.suppr --suppressions=../ExternalTools/Valgrind/libgomp.suppr --suppressions=../ExternalTools/Valgrind/libc.suppr $EXECUTABLE -i $2 -e MOREFEM_RESULT_DIR=${PWD}
printDone $1 $3
}
export MOREFEM_ROOT=${PWD}
mkdir -p build_4_valgrind
cd build_4_valgrind && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja" --third_party_directory=/opt --mode="debug"
ninja
runValgrind MoReFEMTestPetscMatrixOperations ../Sources/Test/ThirdParty/PETSc/MatrixOperations/demo.lua memcheck_matrix_operations.txt
runValgrind MoReFEM4Elasticity ../Sources/ModelInstances/Elasticity/demo_2d_binary.lua memcheck_elasticity.txt
runValgrind MoReFEM4Heat ../Sources/ModelInstances/Heat/demo_input_heat.lua memcheck_heat.txt
runValgrind MoReFEM4Hyperelasticity ../Sources/ModelInstances/Hyperelasticity/demo_input_hyperelasticity.lua memcheck_hyperelasticity.txt
runValgrind MoReFEM4Laplacian ../Sources/ModelInstances/Laplacian/demo_input_laplacian.lua memcheck_laplacian.txt
runValgrind MoReFEM4RivlinCube ../Sources/ModelInstances/RivlinCube/demo_input_rivlin_cube_hexahedra.lua memcheck_rivlin_cube.txt
runValgrind MoReFEM4Stokes ../Sources/ModelInstances/Stokes/demo.lua memcheck_stokes.txt
import os
from run_valgrid_tools import buildAndRunValgrind
if __name__ == "__main__":
morefem_model_instances_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "Sources", "ModelInstances")