Skip to content

Commit

Permalink
Merged master.
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master' into spack_improvements
  • Loading branch information
brenthuisman committed Aug 2, 2023
2 parents f9674fc + cfed35d commit e3c6532
Show file tree
Hide file tree
Showing 86 changed files with 400 additions and 282 deletions.
1 change: 1 addition & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Benchmarks
on:
pull_request:
branches: [ master ]
paths-ignore: 'doc/**'

jobs:
build:
Expand Down
File renamed without changes.
28 changes: 0 additions & 28 deletions .github/workflows/check-submodules.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
jobs:
build:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'
- name: Get packages
run: |
python -m pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Sanitize
on:
pull_request:
branches: [ master ]
paths-ignore: 'doc/**'

jobs:
build:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test docs

on:
push:
branches: [ master ]
paths: 'doc/**'
pull_request:
branches: [ master ]
paths: 'doc/**'

jobs:
testdocs:
name: "Docs build test"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.7]
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.config.cmake }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip and setup venv
run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo "PATH=$PATH" >> $GITHUB_ENV
- name: Clone w/ submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Python packages
run: python -m pip install -r doc/requirements.txt -U
- name: Build Arbor Docs
run: |
mkdir build
cd build
cmake .. -DARB_WITH_PYTHON=ON -DPython3_EXECUTABLE=`which python` -DARB_USE_BUNDLED_LIBS=ON
make html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Test Everything
name: Test Matrix

on:
push:
branches: [ master ]
paths-ignore: 'doc/**'
pull_request:
branches: [ master ]
paths-ignore: 'doc/**'

jobs:
testallconfigs:
Expand Down Expand Up @@ -191,67 +193,3 @@ jobs:
# run: scripts/run_python_examples.sh
- name: Test executables
run: ./scripts/test_executables.sh
testpip:
name: "Pip build test + Python examples test"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.7]
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Clone w/ submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update pip and setup venv
run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo PATH=$PATH >> $GITHUB_ENV
- name: Debug info Python
run: |
which python
python --version
pip --version
- name: Build and install Arbor using pip + build flags
run: CMAKE_ARGS="-DARB_VECTORIZE=ON -DARB_ARCH=native" pip install . --user
- name: Check that build flags match
run: |
python -c "import arbor; print(arbor.config())" | grep -q "'arch': 'native'"
- name: Run Python tests
run: python -m unittest discover -v -s python
- name: Run Python examples
run: scripts/run_python_examples.sh
- name: Test executables
run: scripts/test_executables.sh
testdocs:
name: "Docs build test"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.7]
steps:
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.config.cmake }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip and setup venv
run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo "PATH=$PATH" >> $GITHUB_ENV
- name: Clone w/ submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Python packages
run: python -m pip install -r doc/requirements.txt -U
- name: Build Arbor Docs
run: |
mkdir build
cd build
cmake .. -DARB_WITH_PYTHON=ON -DPython3_EXECUTABLE=`which python` -DARB_USE_BUNDLED_LIBS=ON
make html
44 changes: 44 additions & 0 deletions .github/workflows/test-pip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test pip

on:
push:
branches: [ master ]
paths-ignore: 'doc/**'
pull_request:
branches: [ master ]
paths-ignore: 'doc/**'

jobs:
testpip:
name: "Pip build test + Python examples test"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.7]
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Clone w/ submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update pip and setup venv
run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo PATH=$PATH >> $GITHUB_ENV
- name: Debug info Python
run: |
which python
python --version
pip --version
- name: Build and install Arbor using pip + build flags
run: CMAKE_ARGS="-DARB_VECTORIZE=ON -DARB_ARCH=native" pip install . --user
- name: Check that build flags match
run: |
python -c "import arbor; print(arbor.config())" | grep -q "'arch': 'native'"
- name: Run Python tests
run: python -m unittest discover -v -s python
- name: Run Python examples
run: scripts/run_python_examples.sh
- name: Test executables
run: scripts/test_executables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: Spack
on:
push:
branches: [ master ]
paths-ignore: 'doc/**'
pull_request:
branches: [ master ]
paths-ignore: 'doc/**'

jobs:
build:
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Have LTO where possible, ie add -flto
check_ipo_supported(RESULT HAVE_LTO OUTPUT ERR_LTO)
if(HAVE_LTO AND NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
message (STATUS "LTO support found, enabling")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "No LTO: ${ERR_LTO}")
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
if(HAVE_LTO)
message (STATUS "LTO support found, enabling")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "No LTO: ${ERR_LTO}")
endif()
endif()

# Turn on this option to force the compilers to produce color output when output is
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![ci](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-everything.yml)
[![pythonwheels](https://github.com/arbor-sim/arbor/actions/workflows/release.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/release.yml)
[![ci](https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-matrix.yml)
[![spack](https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-spack.yml)
[![pip](https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/test-pip.yml)
[![pythonwheels](https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml/badge.svg)](https://github.com/arbor-sim/arbor/actions/workflows/build-pip-wheels.yml)
[![gitpod](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/arbor-sim/arbor)
[![docs](https://readthedocs.org/projects/arbor/badge/?version=latest)](https://docs.arbor-sim.org/en/latest/)
[![gitter](https://badges.gitter.im/arbor-sim/community.svg)](https://gitter.im/arbor-sim/community)
Expand Down
9 changes: 5 additions & 4 deletions arbor/backends/gpu/forest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ struct ARB_ARBOR_API forest {


struct level_iterator {
constexpr static unsigned npos = unsigned(-1);

level_iterator(tree* t, unsigned level) {
tree_ = t;
only_on_level = level;
Expand Down Expand Up @@ -94,16 +96,15 @@ struct level_iterator {
next_children = index + 1;
} else {
// we are done with the iteration
current_level = -1;
current_node = -1;
next_children = -1;
current_level = npos;
current_node = npos;
next_children = npos;
}

}
}

unsigned next() {
constexpr unsigned npos = unsigned(-1);
if (!valid()) {
// we are done
return npos;
Expand Down
5 changes: 2 additions & 3 deletions arbor/backends/gpu/shared_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ std::pair<arb_value_type, arb_value_type> minmax_value_impl(arb_size_type n, con

// Ion state methods:

ion_state::ion_state(int charge,
const fvm_ion_config& ion_data,
ion_state::ion_state(const fvm_ion_config& ion_data,
unsigned, // alignment/padding ignored.
solver_ptr ptr):
write_eX_(ion_data.revpot_written),
Expand All @@ -62,7 +61,7 @@ ion_state::ion_state(int charge,
reset_Xi_(make_const_view(ion_data.reset_iconc)),
reset_Xo_(make_const_view(ion_data.reset_econc)),
init_eX_(make_const_view(ion_data.init_revpot)),
charge(1u, charge),
charge(1u, static_cast<arb_value_type>(ion_data.charge)),
solver(std::move(ptr)) {
arb_assert(node_index_.size()==init_Xi_.size());
arb_assert(node_index_.size()==init_Xo_.size());
Expand Down
8 changes: 3 additions & 5 deletions arbor/backends/gpu/shared_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ struct ARB_ARBOR_API ion_state {

ion_state() = default;

ion_state(
int charge,
const fvm_ion_config& ion_data,
unsigned align,
solver_ptr ptr);
ion_state(const fvm_ion_config& ion_data,
unsigned align,
solver_ptr ptr);

// Set ion concentrations to weighted proportion of default concentrations.
void init_concentration();
Expand Down
6 changes: 3 additions & 3 deletions arbor/communication/communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ communicator::communicator(const recipe& rec,
constexpr inline
bool is_external(cell_gid_type c) {
// index of the MSB of cell_gid_type in bits
constexpr auto msb = 1 << (std::numeric_limits<cell_gid_type>::digits - 1);
constexpr auto msb = static_cast<cell_gid_type>(1 << (std::numeric_limits<cell_gid_type>::digits - 1));
// If set, we are external
return bool(c & msb);
}

constexpr inline
cell_member_type global_cell_of(const cell_remote_label_type& c) {
constexpr auto msb = 1 << (std::numeric_limits<cell_gid_type>::digits - 1);
constexpr auto msb = static_cast<cell_gid_type>(1 << (std::numeric_limits<cell_gid_type>::digits - 1));
// set the MSB
return {c.rid | msb, c.index};
}

constexpr inline
cell_member_type global_cell_of(const cell_member_type& c) {
constexpr auto msb = 1 << (std::numeric_limits<cell_gid_type>::digits - 1);
constexpr auto msb = static_cast<cell_gid_type>(1 << (std::numeric_limits<cell_gid_type>::digits - 1));
// set the MSB
return {c.gid | msb, c.index};
}
Expand Down
6 changes: 3 additions & 3 deletions arbor/cv_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct cv_policy_bar_: cv_policy_base {
}

locset cv_boundary_points(const cable_cell& c) const override {
return unique_sum(ls::restrict(lhs_.cv_boundary_points(c), complement(rhs_.domain())), rhs_.cv_boundary_points(c));
return unique_sum(ls::restrict_to(lhs_.cv_boundary_points(c), complement(rhs_.domain())), rhs_.cv_boundary_points(c));
}

region domain() const override { return join(lhs_.domain(), rhs_.domain()); }
Expand All @@ -82,7 +82,7 @@ locset cv_policy_explicit::cv_boundary_points(const cable_cell& cell) const {
ls::support(
util::foldl(
[this](locset l, const auto& comp) {
return sum(std::move(l), ls::restrict(locs_, comp));
return sum(std::move(l), ls::restrict_to(locs_, comp));
},
ls::boundary(domain_),
components(cell.morphology(), thingify(domain_, cell.provider()))));
Expand Down Expand Up @@ -190,7 +190,7 @@ locset cv_policy_every_segment::cv_boundary_points(const cable_cell& cell) const

return unique_sum(
ls::cboundary(domain_),
ls::restrict(ls::segment_boundaries(), domain_));
ls::restrict_to(ls::segment_boundaries(), domain_));
}
cv_policy_base_ptr cv_policy_every_segment::clone() const {
return cv_policy_base_ptr(new cv_policy_every_segment(*this));
Expand Down
4 changes: 3 additions & 1 deletion arbor/fvm_lowered_cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ struct probe_association_map {
}

// Return range of fvm_probe_data values associated with probeset_id.
auto data_on(cell_member_type probeset_id) const {
// Trailing return type added here to avoid warnings about ODR violations when building shared
// lib together with LTO - needs to be re-checked in the future
auto data_on(cell_member_type probeset_id) const -> decltype(util::transform_view(util::make_range(data.equal_range(probeset_id)), util::second)) {
return util::transform_view(util::make_range(data.equal_range(probeset_id)), util::second);
}
};
Expand Down
Loading

0 comments on commit e3c6532

Please sign in to comment.