diff --git a/AUTHORS b/AUTHORS index bee7c21..575d7f1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ - Guillaume Anciaux -- Lucas Frérot +- Lucas Frérot - Son Pham-Ba - Valentine Rey diff --git a/Jenkinsfile b/Jenkinsfile index 8622067..552627e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,119 +1,119 @@ pipeline { parameters {string(defaultValue: '', description: 'api-token', name: 'API_TOKEN') string(defaultValue: '', description: 'Token for readthedocs', name: 'RTD_TOKEN') string(defaultValue: '', description: 'buildable phid', name: 'BUILD_TARGET_PHID') string(defaultValue: '', description: 'Commit id', name: 'COMMIT_ID') string(defaultValue: '', description: 'Diff id', name: 'DIFF_ID') string(defaultValue: 'PHID-PROJ-gbo56hpf2y5bi7t5jusk', description: 'ID of the project', name: 'PROJECT_ID') } environment { PHABRICATOR_HOST = 'https://c4science.ch/api/' PYTHONPATH = sh returnStdout: true, script: 'echo ${WORKSPACE}/tests/ci/script/' } agent { dockerfile { additionalBuildArgs '--tag tamaas-environment'} } stages { stage('SCM Checkout') { steps { checkout scm: [ $class: 'GitSCM', branches: scm.branches, extensions: [[ $class: 'SubmoduleOption', recursiveSubmodules: true, ]], userRemoteConfigs: scm.userRemoteConfigs ] } } stage('Configure') { steps { sh '''#!/usr/bin/env bash echo "py_exec = \'python3\'" > build-setup.conf echo "build_python = \'true\'" >> build-setup.conf echo "build_tests = \'true\'" >> build-setup.conf echo "use_googletest = \'true\'" >> build-setup.conf echo "legacy_bem = \'true\'" >> build-setup.conf''' } } stage('Compile') { steps { sh '''#!/usr/bin/env bash set -o pipefail rm -rf .sconf_temp .sconsign.dblite build-release scons | tee compilation.txt''' } post { failure { uploadArtifact('compilation.txt', 'Compilation') } } } stage('Run tests') { steps { sh 'PYTHONPATH=build-release/python/ python3 -m pytest --junitxml=results.xml build-release' } } } post { always { createArtifact("results.xml") junit 'results.xml' step([$class: 'XUnitBuilder', thresholds: [ [$class: 'SkippedThreshold', failureThreshold: '0'], [$class: 'FailedThreshold', failureThreshold: '0']], tools: [[$class: 'GoogleTestType', pattern: 'build-release/tests/gtest_results.xml']]]) } success { trigger_rtd() passed_hbm() } failure { failed_hbm() emailext( body: '''${SCRIPT, template="groovy-html.template"}''', mimeType: 'text/html', subject: "[Jenkins] ${currentBuild.fullDisplayName} Failed", recipientProviders: [[$class: 'CulpritsRecipientProvider']], - to: 'lucas.frerot@gmail.com', + to: 'lucas.frerot@protonmail.com', attachLog: true, compressLog: true) } } } def createArtifact(filename) { sh "./tests/ci/scripts/hbm send-uri -k 'Jenkins URI' -u ${BUILD_URL} -l 'View Jenkins result'" sh "./tests/ci/scripts/hbm send-junit-results -f ${filename}" } def uploadArtifact(artifact, name) { sh "./test/ci/scripts/hbm upload-file -f ${artifact} -n \"${name}\" -v ${PROJECT_ID}" } def failed_hbm() { sh "./tests/ci/scripts/hbm failed" } def passed_hbm() { sh "./tests/ci/scripts/hbm passed" } def trigger_rtd() { sh """ set -x curl -X POST -d "token=${RTD_TOKEN}" https://readthedocs.org/api/v2/webhook/tamaas/106141/ """ } diff --git a/src/core/tamaas.hh b/src/core/tamaas.hh index 9aa9c76..7f72bf5 100644 --- a/src/core/tamaas.hh +++ b/src/core/tamaas.hh @@ -1,170 +1,170 @@ /** * @mainpage Tamaas - A high-performance periodic contact library * * @section Introduction * Tamaas is a spectral-integral-equation based contact library. It is made * with love to be fast and friendly! * * @author Guillaume Anciaux - * @author Lucas Frérot + * @author Lucas Frérot * @author Valentine Rey * @author Son Pham-Ba * * @section LICENSE * * Copyright (©) 2016-2020 EPFL (École Polytechnique Fédérale de Lausanne), * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * */ /* -------------------------------------------------------------------------- */ #ifndef TAMAAS_HH #define TAMAAS_HH /* -------------------------------------------------------------------------- */ #define TAMAAS_BACKEND_OMP 1 #define TAMAAS_BACKEND_TBB 2 #define TAMAAS_BACKEND_CPP 3 #ifndef TAMAAS_BACKEND #define TAMAAS_BACKEND TAMAAS_BACKEND_OMP #endif // If the thrust device hasn't been set, set OpenMP #ifndef THRUST_DEVICE_SYSTEM #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_OMP #endif /* -------------------------------------------------------------------------- */ // Standard includes #include #include #include #include #include /* -------------------------------------------------------------------------- */ // Special thrust includes #include #include #ifdef USE_CUDA #include "unified_allocator.hh" #endif #include "fftw_allocator.hh" /* -------------------------------------------------------------------------- */ namespace tamaas { /* -------------------------------------------------------------------------- */ /// @section Cuda specific definitions #define CUDA_LAMBDA __device__ __host__ #ifdef USE_CUDA template using Allocator = UnifiedAllocator; #else template using Allocator = FFTWAllocator; #endif /// @section Common types definitions // If type macros have not been set, put default values #ifndef TAMAAS_REAL_TYPE #define TAMAAS_REAL_TYPE double #endif #ifndef TAMAAS_INT_TYPE #define TAMAAS_INT_TYPE int #endif using Real = TAMAAS_REAL_TYPE; ///< default floating point type using Int = TAMAAS_INT_TYPE; ///< default signed integer type using UInt = std::make_unsigned_t; ///< default unsigned integer type template using complex = thrust::complex; ///< template complex wrapper using Complex = complex; ///< default floating point complex type /// @section Defining random toolbox using ::thrust::random::normal_distribution; using ::thrust::random::uniform_real_distribution; using random_engine = ::thrust::random::default_random_engine; namespace detail { template class Trait, typename Head, typename... Tail> struct fold_trait_tail_rec : std::integral_constant::value, Trait, Tail...>::value> {}; template class Trait, typename Head> struct fold_trait_tail_rec : std::integral_constant::value> {}; } // namespace detail template