Skip to content

Commit

Permalink
Merge branch 'master' into issue/1290-speeding-up-scatter-simulation-…
Browse files Browse the repository at this point in the history
…for-blocks-geometry
  • Loading branch information
Markus Jehl committed Feb 14, 2024
2 parents beeeea9 + 250da05 commit 674d1ef
Show file tree
Hide file tree
Showing 1,315 changed files with 116,905 additions and 122,732 deletions.
6 changes: 4 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ BraceWrapping:
SplitEmptyFunction: false
SplitEmptyRecord: true
SplitEmptyNamespace: true
# non-standard GNU
SplitEmptyFunction: false
BinPackParameters: false
BinPackArguments: false
ColumnLimit: 130
IndentPPDirectives: AfterHash
PointerAlignment: Left
SortIncludes: false
SortUsingDeclarations: false
SpaceBeforeParens: ControlStatements
PackConstructorInitializers: Never
AllowShortFunctionsOnASingleLine: InlineOnly
Standard: Cpp11
...
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*.v -text -diff
*.s -text -diff
*.scn -text -diff
*.l -text -diff
*.root -text -diff
*.gz -text -diff
*.nii -text -diff
*.sh eol=lf
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/GHA_increase_disk_space.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
df -h
# locations from the internet, e.g. https://github.com/easimon/maximize-build-space
# saves about 2GB
if [ -d /usr/share/dotnet ]; then
echo removing dotnet
sudo rm -rf /usr/share/dotnet
fi
# saves about 10 GB
if [ -d "$AGENT_TOOLSDIRECTORY" ]; then
echo removing agent_tools
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
# saves about 10 GB
if [ -d /usr/local/lib/android ]; then
echo removing android files
sudo rm -rf /usr/local/lib/android
fi
if [ -d /opt/ghc ]; then
echo removing android files
sudo rm -rf /opt/ghc
fi
df -h
89 changes: 76 additions & 13 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Build and ctest and recon_test_pack CI

on:
push:
branches: [ master ]
branches:
- master
- tof_sino_UCL
paths-ignore:
- '.appveyor.yml'
- 'CITATION.cff'
Expand All @@ -12,7 +14,9 @@ on:
- '**/*.tex'

pull_request:
branches: [ master ]
branches:
- master
- tof_sino_UCL
paths-ignore:
- '.appveyor.yml'
- 'CITATION.cff'
Expand All @@ -37,6 +41,7 @@ jobs:
- os: ubuntu-latest
compiler: gcc
compiler_version: 9
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=ON"
BUILD_TYPE: "Release"
parallelproj: "ON"
Expand All @@ -45,6 +50,7 @@ jobs:
- os: ubuntu-latest
compiler: clang
#compiler_version:
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=ON"
BUILD_TYPE: "Release"
parallelproj: "ON"
Expand All @@ -54,6 +60,7 @@ jobs:
- os: ubuntu-latest
compiler: gcc
compiler_version: 10
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=17"
BUILD_TYPE: "Debug"
parallelproj: "OFF"
Expand All @@ -62,14 +69,25 @@ jobs:
- os: ubuntu-latest
compiler: gcc
compiler_version: 12
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=14"
BUILD_TYPE: "RelWithDebInfo"
parallelproj: "ON"
ROOT: "OFF"
ITK: "ON"
- os: ubuntu-latest
compiler: gcc
compiler_version: 12
cuda_version: "12.1.0"
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=14"
BUILD_TYPE: "Release"
parallelproj: "ON"
ROOT: "OFF"
ITK: "ON"
- os: macOS-latest
compiler: gcc
compiler_version: 11
cuda_version: "0"
BUILD_FLAGS: "-DSTIR_OPENMP=OFF"
parallelproj: "OFF"
BUILD_TYPE: "Debug"
Expand All @@ -88,7 +106,7 @@ jobs:
# let's run all of them, as opposed to aborting when one fails
fail-fast: false

name: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }}-pp=${{ matrix.parallelproj }}-ROOT=${{ matrix.ROOT }}
name: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-cuda${{ matrix.cuda_version }}-${{ matrix.BUILD_TYPE }}-pp=${{ matrix.parallelproj }}-ROOT=${{ matrix.ROOT }}

steps:
- name: disk space
Expand All @@ -112,10 +130,22 @@ jobs:
# no idea how to do this
;;
esac
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: disk space
shell: bash
run: |
case ${{matrix.os}} in
(ubuntu* | macOS*)
sudo .github/workflows/GHA_increase_disk_space.sh
;;
(windows*)
# no idea what to do here
;;
esac
- name: set_compiler_variables
shell: bash
run: |
Expand Down Expand Up @@ -152,6 +182,13 @@ jobs:
echo CC="$CC" >> $GITHUB_ENV
echo CXX="$CXX" >> $GITHUB_ENV
- if: matrix.cuda_version != '0'
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda_version }}
linux-local-args: '["--toolkit"]'

- name: install_dependencies
shell: bash
run: |
Expand Down Expand Up @@ -209,10 +246,13 @@ jobs:
python -m pip install pytest
if test "${{matrix.parallelproj}}XX" == "ONXX"; then
git clone --depth 1 --branch v1.3.7 https://github.com/gschramm/parallelproj
git clone --depth 1 --branch v1.7.3 https://github.com/gschramm/parallelproj
mkdir parallelproj/build
cd parallelproj/build
cmake .. -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DSKIP_CUDA_LIB:BOOL=ON
if test "${{matrix.cuda_version}}" == "0"; then
extra_args="-DSKIP_CUDA_LIB:BOOL=ON"
fi
cmake .. -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${extra_args}
cmake --build . --target install --config Release
cd ../..
fi
Expand Down Expand Up @@ -243,7 +283,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }}
key: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-cuda${{ matrix.cuda_version }}-${{ matrix.BUILD_TYPE }}
max-size: "2G"

- name: configure
Expand All @@ -266,7 +306,7 @@ jobs:
EXTRA_BUILD_FLAGS="-DBUILD_SWIG_PYTHON=ON -DPYTHON_EXECUTABLE=`which python`"
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DDOWNLOAD_ZENODO_TEST_DATA=ON"
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DDISABLE_STIR_LOCAL=OFF -DSTIR_LOCAL=${GITHUB_WORKSPACE}/examples/C++/src"
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DDISABLE_STIR_LOCAL=OFF -DSTIR_LOCAL=${GITHUB_WORKSPACE}/examples/C++/using_STIR_LOCAL"
echo "cmake flags $BUILD_FLAGS $EXTRA_BUILD_FLAGS"
mkdir build
cd build
Expand Down Expand Up @@ -295,11 +335,23 @@ jobs:
env:
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
run: |
set -vx
cd ${GITHUB_WORKSPACE}/build
# find test exclusions. Complicated due to need of single -E argument and | pattern
if test ${{matrix.cuda_version}} != "0"; then
# No CUDA drivers on GitHub Actions
EXCLUDE="parallelproj|test_blocks_on_cylindrical_projectors"
fi
# don't run all of them in Debug mode as it takes too long
if test ${BUILD_TYPE} = Debug; then
EXCLUDE="-E test_data_processor_projectors|test_export_array|test_ArcCorrection|test_blocks_on_cylindrical_projectors"
EXCLUDE_Debug="test_data_processor_projectors|test_export_array|test_ArcCorrection"
EXCLUDE="${EXCLUDE_Debug}${EXCLUDE:+"|"}${EXCLUDE}"
fi
# prepend -E
if [ ! -z "${EXCLUDE}" ]; then
EXCLUDE="-E ${EXCLUDE}"
fi
# execute tests
ctest --output-on-failure -C ${BUILD_TYPE} ${EXCLUDE}
- name: recon_test_pack
Expand Down Expand Up @@ -330,15 +382,17 @@ jobs:
uses: actions/upload-artifact@v3
if: failure()
with:
name: recon_test_pack_log_files-${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }}-pp=${{ matrix.parallelproj }}-ROOT=${{ matrix.ROOT }}
name: recon_test_pack_log_files-${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-cuda${{ matrix.cuda_version }}-${{ matrix.BUILD_TYPE }}-pp=${{ matrix.parallelproj }}-ROOT=${{ matrix.ROOT }}
path: ${{ github.workspace }}/recon_test_pack/**/*.log
${{ github.workspace }}/recon_test_pack/**/my_*v
${{ github.workspace }}/recon_test_pack/**/my_*s
retention-days: 7

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session if triggered
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled == 'true' }}

- name: examples
shell: bash
Expand All @@ -350,8 +404,8 @@ jobs:
./run_simulation.sh 1> /dev/null
# Run the Demo executables
EXE_LOC=${GITHUB_WORKSPACE}/build/src/examples/C++
cd ${GITHUB_WORKSPACE}/examples/C++/src
EXE_LOC=${GITHUB_WORKSPACE}/build/src/examples/C++/using_STIR_LOCAL
cd ${GITHUB_WORKSPACE}/examples/C++/using_STIR_LOCAL
generate_image generate_image.par
forward_project sino.hs image.hv small.hs
Expand All @@ -362,6 +416,15 @@ jobs:
${EXE_LOC}/demo4_obj_fun demo4_obj_fun.par
${EXE_LOC}/demo5_line_search demo5_line_search.par
# build and run C++/using_installed_STIR
cd ${GITHUB_WORKSPACE}/examples/C++/using_installed_STIR
cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
cmake --build build/ --config Release --target install
# run demo
demo_create_image
# just check if its output makes sense
list_image_info test.hv
- name: Python
shell: bash
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check
name: Run pre-commit check
on:
- push
- pull_request
Expand All @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
name: pre-commit
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: sudo apt-get install -yqq clang-format
- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v3.0.0
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ install_manifest.txt
# Ignore Visual Studio Code User-specific files
build/
install/
.vscode/

# MATLAB

Expand All @@ -94,6 +95,6 @@ install/
examples/ROOT_files/ROOT_STIR_consistency/Gate_macros/main_GATE_macro_test*.mac
examples/ROOT_files/ROOT_STIR_consistency/pretest_output/root_data_test*.root
examples/ROOT_files/ROOT_STIR_consistency/pretest_output/root_header_test*.hroot
examples/ROOT_files/ROOT_STIR_consistency/pretest_output/root_header_test*_lor_pos.txt
examples/ROOT_files/ROOT_STIR_consistency/*voxel_data_*.*
examples/ROOT_files/ROOT_STIR_consistency/pretest_output/stir_image*.*

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repos:
- repo: git://github.com/doublify/pre-commit-clang-format
- repo: https://github.com/doublify/pre-commit-clang-format
rev: '62302476'
hooks:
- id: clang-format
Expand Down
Loading

0 comments on commit 674d1ef

Please sign in to comment.