Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Fixes, main branch (2024.10.26.) #755

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true

jobs:
builds:
containers:
name: ${{ matrix.platform.name }}-${{ matrix.build }}
runs-on: ubuntu-latest
container: ${{ matrix.platform.container }}
Expand Down Expand Up @@ -117,3 +117,19 @@ jobs:
if: "matrix.platform.name == 'CUDA' && matrix.build == 'Debug'"
continue-on-error: true
run: ${GITHUB_WORKSPACE}/.github/find_f64_ptx.py --source ${GITHUB_WORKSPACE} --build build $(find build -name "*.ptx")

macos:
runs-on: macos-14
name: macOS-Release
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install boost
- name: Configure
run: cmake --preset base -S ${GITHUB_WORKSPACE} -B build
- name: Build
run: cmake --build build
- name: Download data files
run: ${GITHUB_WORKSPACE}/data/traccc_data_get_files.sh
- name: Test
run: ctest --test-dir build --output-on-failure
8 changes: 4 additions & 4 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
include( traccc-compiler-options-cpp )

# Set up a common library, shared by all of the tests.
add_library( traccc_benchmarks_common STATIC
add_library( traccc_benchmarks_common INTERFACE
"common/benchmarks/toy_detector_benchmark.hpp" )
target_include_directories( traccc_benchmarks_common
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/common )
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common )
target_link_libraries( traccc_benchmarks_common
PUBLIC benchmark::benchmark benchmark::benchmark_main
traccc::core traccc::io traccc::simulation detray::core detray::test_utils
INTERFACE benchmark::benchmark benchmark::benchmark_main
traccc::core traccc::io traccc::simulation detray::core detray::test_utils
vecmem::core Boost::filesystem)

add_subdirectory(cpu)
Expand Down
8 changes: 4 additions & 4 deletions core/include/traccc/utils/seed_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct seed_generator {
const std::array<scalar, e_bound_size>& stddevs,
const std::size_t sd = 0)
: m_detector(det), m_stddevs(stddevs) {
generator.seed(sd);
m_generator.seed(static_cast<std::mt19937::result_type>(sd));
}

/// Seed generator operation
Expand Down Expand Up @@ -80,7 +80,7 @@ struct seed_generator {
for (std::size_t i = 0; i < e_bound_size; i++) {

bound_param[i] = std::normal_distribution<scalar>(
bound_param[i], m_stddevs[i])(generator);
bound_param[i], m_stddevs[i])(m_generator);

matrix_operator().element(bound_param.covariance(), i, i) =
m_stddevs[i] * m_stddevs[i];
Expand All @@ -91,8 +91,8 @@ struct seed_generator {

private:
// Random generator
std::random_device rd{};
std::mt19937 generator{rd()};
std::random_device m_rd{};
std::mt19937 m_generator{m_rd()};

// Detector object
const detector_t& m_detector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2022 CERN for the benefit of the ACTS project
* (c) 2022-2024 CERN for the benefit of the ACTS project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW could consider following ACTS' change to only list the initial year instead of updating files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually partial to the convention we have in the ATLAS offline code, where we show the last modification date of each file. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. We had a discussion about this, and ultimately decided not to duplicate modification date (that's what blame is for) since it avoids it getting out of date, and the actual year being legally meaningless anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah strong support for the ACTS style of not updating these; avoids a lot of pain in the rear and it has zero legal meaning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You guys are making it sound like it's a black and white issue. But it's very much a shade of grey in my mind.

For instance, what about when we re-design some code. Let's say we break up a class into two separate classes, with "new" names. What would be the appropriate date on the files of the new classes? Would one use the current year? The year when the original class was written?

In the scheme that we've been using so far in the R&D projects, the new files would reflect both that their code came from an earlier time, and that that code has now moved into a new place.

Paul is correct, even we discussed about this in the past. There can be different legitimate conventions for this. But given that the convention in this repository has not been the one lobbied for now, if we want to switch to that convention, we need to do it clearly.

I.e. somebody should open a PR, and update all files accordingly. 🤔 And update the contribution guide. (I'm just kidding. I meant write a contribution guide...)

*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -75,7 +75,7 @@ class fitting_performance_writer {

// Find the contributing particle
// @todo: Use identify_contributing_particles function
std::map<particle, uint64_t> contributing_particles =
std::map<particle, std::size_t> contributing_particles =
meas_to_ptc_map[meas];

const particle ptc = contributing_particles.begin()->first;
Expand Down
3 changes: 2 additions & 1 deletion performance/src/performance/details/is_same_angle.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2022 CERN for the benefit of the ACTS project
* (c) 2022-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand All @@ -10,6 +10,7 @@

// System include(s).
#include <cmath>
#include <numbers>

namespace {

Expand Down
Loading