Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed May 29, 2024
1 parent c2e298e commit 617ee47
Show file tree
Hide file tree
Showing 65 changed files with 40,783 additions and 361 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(
VERSION 0.0.1
LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
set(CMAKE_VERBOSE_MAKEFILE YES)
Expand Down
97 changes: 36 additions & 61 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ pipeline {
}
post {
always {
recordIssues(
enabledForFailure: true,
recordIssues(
enabledForFailure: true,
tools: [cppLint(),groovyScript(parserId: 'mathDependencies', pattern: '**/dependencies.log')]
)
deleteDir()
Expand Down Expand Up @@ -240,7 +240,7 @@ pipeline {
}
failFast true
parallel {
stage('Rev/Fwd Unit Tests') {
stage('All Unit Tests') {
agent {
docker {
image 'stanorg/ci:gpu-cpp17'
Expand All @@ -253,71 +253,46 @@ pipeline {
!skipRemainingStages
}
}
steps {
unstash 'MathSetup'
sh "echo CXXFLAGS += -fsanitize=address >> make/local"

script {
if (!(params.optimizeUnitTests || isBranch('develop') || isBranch('master'))) {
sh "echo O=0 >> make/local"
}

runTests("test/unit/math/rev")
runTests("test/unit/math/fwd")
}
}
post { always { retry(3) { deleteDir() } } }
}
stage('Mix Unit Tests') {
agent {
docker {
image 'stanorg/ci:gpu-cpp17'
label 'linux'
args '--cap-add SYS_PTRACE'
}
}
when {
expression {
!skipRemainingStages
}
}
steps {
unstash 'MathSetup'
sh "echo CXXFLAGS += -fsanitize=address >> make/local"
script {
if (!(params.optimizeUnitTests || isBranch('develop') || isBranch('master'))) {
sh "echo O=1 >> make/local"
}
runTests("test/unit/math/mix", true)
}
}
post { always { retry(3) { deleteDir() } } }
}
stage('Prim Unit Tests') {
agent {
docker {
image 'stanorg/ci:gpu-cpp17'
label 'linux'
args '--cap-add SYS_PTRACE'
}
}
when {
expression {
!skipRemainingStages
}
}
steps {
unstash 'MathSetup'
sh "echo CXXFLAGS += -fsanitize=address >> make/local"
script {
if (!(params.optimizeUnitTests || isBranch('develop') || isBranch('master'))) {
sh "echo O=0 >> make/local"
}
runTests("test/unit/*_test.cpp", false)
runTests("test/unit/math/*_test.cpp", false)
runTests("test/unit/math/prim", true)
runTests("test/unit/math/memory", false)
}
sh "cmake -S . -B \"build\" -DCMAKE_BUILD_TYPE=RELEASE"
sh "cd build"
sh "make -j${env.PARALLEL} unit_math_subtests"
sh "
./test/unit/test_unit_math && \
./test/unit/test_unit_math_fwd && \
./test/unit/test_unit_math_fwd_core && \
./test/unit/test_unit_math_fwd_fun && \
./test/unit/test_unit_math_fwd_functor && \
./test/unit/test_unit_math_fwd_meta && \
./test/unit/test_unit_math_fwd_prob && \
./test/unit/test_unit_math_memory && \
./test/unit/test_unit_math_mix && \
./test/unit/test_unit_math_mix_core && \
./test/unit/test_unit_math_mix_fun && \
./test/unit/test_unit_math_mix_functor && \
./test/unit/test_unit_math_mix_meta && \
./test/unit/test_unit_math_mix_prob && \
./test/unit/test_unit_math_prim_core && \
./test/unit/test_unit_math_prim_err && \
./test/unit/test_unit_math_prim_fun && \
./test/unit/test_unit_math_prim_functor && \
./test/unit/test_unit_math_prim_meta && \
./test/unit/test_unit_math_prim_prob && \
./test/unit/test_unit_math_rev && \
./test/unit/test_unit_math_rev_core && \
./test/unit/test_unit_math_rev_err && \
./test/unit/test_unit_math_rev_fun && \
./test/unit/test_unit_math_rev_functor && \
./test/unit/test_unit_math_rev_meta && \
./test/unit/test_unit_math_rev_prob
"
}
post { always { retry(3) { deleteDir() } } }
}
Expand Down Expand Up @@ -575,7 +550,7 @@ pipeline {
always {
node("linux") {
recordIssues(
enabledForFailure: false,
enabledForFailure: false,
tool: clang()
)
}
Expand Down
140 changes: 139 additions & 1 deletion runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,144 @@ def main():
cleanupJumboTests(jumboFiles)
pass

def main2():
doCommand("cmake -S . -B \"build\" -DCMAKE_BUILD_TYPE=RELEASE")
doCommand("make run_generate_tests", True, "build")
doCommand("""
make -j28 -f CMakeFiles/Makefile2 test_prob_bernoulli \
test_prob_beta \
test_prob_beta_binomial \
test_prob_beta_proportion \
test_prob_binomial \
test_prob_cauchy \
test_prob_chi_square \
test_prob_discrete_range \
test_prob_double_exponential \
test_prob_exp_mod_normal \
test_prob_exponential \
test_prob_frechet \
test_prob_gamma \
test_prob_gumbel \
test_prob_hypergeometric \
test_prob_inv_chi_square \
test_prob_inv_gamma \
test_prob_logistic \
test_prob_loglogistic \
test_prob_lognormal \
test_prob_neg_binomial \
test_prob_neg_binomial_2 \
test_prob_normal \
test_prob_normal_sufficient \
test_prob_pareto \
test_prob_pareto_type_2 \
test_prob_poisson \
test_prob_rayleigh \
test_prob_scaled_inv_chi_square \
test_prob_skew_double_exponential \
test_prob_skew_normal \
test_prob_std_normal \
test_prob_student_t \
test_prob_uniform \
test_prob_weibull \
test_prob_wiener \
test_prob_von_mises &&
./test/prob/test_prob_bernoulli &&
./test/prob/test_prob_beta &&
./test/prob/test_prob_beta_binomial &&
./test/prob/test_prob_beta_proportion &&
./test/prob/test_prob_binomial &&
./test/prob/test_prob_cauchy &&
./test/prob/test_prob_chi_square &&
./test/prob/test_prob_discrete_range &&
./test/prob/test_prob_double_exponential &&
./test/prob/test_prob_exp_mod_normal &&
./test/prob/test_prob_exponential &&
./test/prob/test_prob_frechet &&
./test/prob/test_prob_gamma &&
./test/prob/test_prob_gumbel &&
./test/prob/test_prob_hypergeometric &&
./test/prob/test_prob_inv_chi_square &&
./test/prob/test_prob_inv_gamma &&
./test/prob/test_prob_logistic &&
./test/prob/test_prob_loglogistic &&
./test/prob/test_prob_lognormal &&
./test/prob/test_prob_neg_binomial &&
./test/prob/test_prob_neg_binomial_2 &&
./test/prob/test_prob_normal &&
./test/prob/test_prob_normal_sufficient &&
./test/prob/test_prob_pareto &&
./test/prob/test_prob_pareto_type_2 &&
./test/prob/test_prob_poisson &&
./test/prob/test_prob_rayleigh &&
./test/prob/test_prob_scaled_inv_chi_square &&
./test/prob/test_prob_skew_double_exponential &&
./test/prob/test_prob_skew_normal &&
./test/prob/test_prob_std_normal &&
./test/prob/test_prob_student_t &&
./test/prob/test_prob_uniform &&
./test/prob/test_prob_weibull &&
./test/prob/test_prob_wiener &&
./test/prob/test_prob_von_mises
""", True, "build")

doCommand("""
time make -j28 test_unit_math
time make -f CMakeFiles/Makefile2 -j28 test_unit_math \
test_unit_math_fwd \
test_unit_math_fwd_core \
test_unit_math_fwd_fun \
test_unit_math_fwd_functor \
test_unit_math_fwd_meta \
test_unit_math_fwd_prob \
test_unit_math_memory \
test_unit_math_mix \
test_unit_math_mix_core \
test_unit_math_mix_fun \
test_unit_math_mix_functor \
test_unit_math_mix_meta \
test_unit_math_mix_prob \
test_unit_math_prim_core \
test_unit_math_prim_err \
test_unit_math_prim_fun \
test_unit_math_prim_functor \
test_unit_math_prim_meta \
test_unit_math_prim_prob \
test_unit_math_rev \
test_unit_math_rev_core \
test_unit_math_rev_err \
test_unit_math_rev_fun \
test_unit_math_rev_functor \
test_unit_math_rev_meta \
test_unit_math_rev_prob && \
./test/unit/test_unit_math && \
./test/unit/test_unit_math_fwd && \
./test/unit/test_unit_math_fwd_core && \
./test/unit/test_unit_math_fwd_fun && \
./test/unit/test_unit_math_fwd_functor && \
./test/unit/test_unit_math_fwd_meta && \
./test/unit/test_unit_math_fwd_prob && \
./test/unit/test_unit_math_memory && \
./test/unit/test_unit_math_mix && \
./test/unit/test_unit_math_mix_core && \
./test/unit/test_unit_math_mix_fun && \
./test/unit/test_unit_math_mix_functor && \
./test/unit/test_unit_math_mix_meta && \
./test/unit/test_unit_math_mix_prob && \
./test/unit/test_unit_math_prim_core && \
./test/unit/test_unit_math_prim_err && \
./test/unit/test_unit_math_prim_fun && \
./test/unit/test_unit_math_prim_functor && \
./test/unit/test_unit_math_prim_meta && \
./test/unit/test_unit_math_prim_prob && \
./test/unit/test_unit_math_rev && \
./test/unit/test_unit_math_rev_core && \
./test/unit/test_unit_math_rev_err && \
./test/unit/test_unit_math_rev_fun && \
./test/unit/test_unit_math_rev_functor && \
./test/unit/test_unit_math_rev_meta && \
./test/unit/test_unit_math_rev_prob
""", True, "build")


if __name__ == "__main__":
main()
main2()
Loading

0 comments on commit 617ee47

Please sign in to comment.