acts icon indicating copy to clipboard operation
acts copied to clipboard

fix: Require TBB to be found by cmake

Open benjaminhuth opened this issue 1 year ago • 19 comments

Previously, the configuration could trun through even if TBB is not present on the system.

benjaminhuth avatar Aug 14 '24 11:08 benjaminhuth

📊: Physics performance monitoring for 538aad1a77b3de78e5d0c78a4dd979ee58913bde

Full contents

physmon summary

github-actions[bot] avatar Aug 14 '24 11:08 github-actions[bot]

Just to put Paul's point another way... why do we need to requite TBB, when ACTS works fine (single-threaded) without it? (Or at least it used to, last time I checked.)

timadye avatar Aug 14 '24 16:08 timadye

Okay, sure, but compilation fails in that case I think (at least that was what I experienced). Do we test the case where no TBB is present?

Shouldn't we use some more explicit logic here like having an option such as ACTS_EXAMPLES_NO_TBB or something like that?

benjaminhuth avatar Aug 14 '24 16:08 benjaminhuth

@benjaminhuth We do have ACTS_USE_EXAMPLES_TBB, we just fall back to OFF if we don't find TBB. I'm ok to make this explicit only without fallback.

paulgessinger avatar Aug 14 '24 19:08 paulgessinger

I agree, if ACTS_USE_EXAMPLES_TBB is on we should definitely use it without a fallback. Not finding it is an error case IMO

andiwand avatar Aug 15 '24 06:08 andiwand

But mostly ACTS_USE_EXAMPLES_TBB is on by default, rather than requested by the user with an explicit -DACTS_USE_EXAMPLES_TBB=ON. In this case, it is nice to have the fallback to OFF to make building ACTS easier for users that just want get something working without having to install tbb or find another CMake option. Is this possible to fall back to OFF iif it isn't specified?

The question remains why it didn't compile for you. That may be a more important issue to solve.

timadye avatar Aug 15 '24 14:08 timadye

I think you're right @timadye: I should try to reproduce the compile failure.

Anyhow: I think if ACTS_USE_EXAMPLES_TBB=ON and TBB is not found, we should fail the cmake configuration. maybe with a message that indicates that -D ACTS_USE_EXAMPLES_TBB=ON is the right option to make it work.

benjaminhuth avatar Aug 15 '24 14:08 benjaminhuth

Maybe I am missing something but this is what is actually change in the PR, right? expect for a more descriptive message

andiwand avatar Aug 19 '24 09:08 andiwand

@andiwand Almost, but it's using the TBB_FOUND variable in a way that doesn't make sense anymore without the fallback. I think it's maybe a 10 line refactor to clean it up.

paulgessinger avatar Aug 20 '24 06:08 paulgessinger

I found the source of the compile errore: The track finding algorithm unconditionally uses tbb::combinable because of the memory statistics. Should we hide this behind a preprocessor define @paulgessinger ?

https://github.com/acts-project/acts/blob/a28acc306ccd11f064c81a68e8eb7f3cc7526c2c/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp#L44

benjaminhuth avatar Aug 20 '24 08:08 benjaminhuth

@benjaminhuth True, that was me, and I forgot about it to be honest. I don't have a strong opinion what the best solution is. I would probably lean towards avoiding making the single threaded use case require workarounds in many places, and therefore switch back to hard-requiring TBB?

paulgessinger avatar Aug 20 '24 11:08 paulgessinger

I think it is a pity to add a required dependency without good reason. It seems this one should be quite easy to #ifndef ACTS_EXAMPLES_NO_TBB around the #include and m_memoryStatistics definition and use (2 places). I think that just means we don't get memory stats in the case without tbb.

A more complete solution would be to make a dummy class like tbbWrap.hpp does, but I don't think that's necessary in this case.

timadye avatar Aug 20 '24 12:08 timadye

@timadye It's a required dependency for our example framework, not the core lib, but I see your point.

I don't know, your call @benjaminhuth

paulgessinger avatar Aug 21 '24 07:08 paulgessinger

Okay, during testing I found an additional place with explicit TBB dependency:

https://github.com/acts-project/acts/blob/7c272316b739a72bf45d92e5eb336295e5b41201/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp#L174

Actually since this involves the FPE mechanism I would now lean towards dropping the possibility to build without TBB...

On the other hand, if we would stick to TBB being optional, we should definitively test it in the CI.

benjaminhuth avatar Aug 21 '24 09:08 benjaminhuth

I think that these build errors were not observered for such a long time also indicates the option is not widely used.

benjaminhuth avatar Aug 21 '24 09:08 benjaminhuth

OK, I guess I can't argue with that.

Do these direct uses of tbb conflict with tbbWrap's other function of bypassing tbb setup when running in a single-threaded mode? That definitely was useful to simplify debugging.

timadye avatar Aug 21 '24 09:08 timadye

Do these direct uses of tbb conflict with tbbWrap's other function of bypassing tbb setup when running in a single-threaded mode? That definitely was useful to simplify debugging.

I think this should stay untouched, since I only remove the macro-logic in case tbb is not present, but not the wrapper objects.

benjaminhuth avatar Aug 21 '24 14:08 benjaminhuth

Quality Gate Failed Quality Gate failed

Failed conditions
25.21% Line Coverage on New Code (required ≥ 50%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Aug 21 '24 16:08 sonarqubecloud[bot]

@benjaminhuth getting_started.md needs an update I believe. I can override the coverage failure afterwards.

paulgessinger avatar Aug 22 '24 09:08 paulgessinger

:white_check_mark: Athena integration test results

:white_check_mark: All tests successful

status job report
:green_circle: report_pull_request
:green_circle: run_art_test: test_run4_acts_vertex_PU200
:green_circle: run_art_test: test_run4_ttbar_PU200
:green_circle: run_art_test: test_data18_13TeV_1000evt
:green_circle: run_art_test: test_ttbarPU40_reco
:green_circle: run_workflow_tests_run4_mc
:green_circle: run_workflow_tests_run2_mc
:green_circle: run_workflow_tests_run2_data
:green_circle: run_workflow_tests_run3_mc
:green_circle: run_workflow_tests_run3_data
:green_circle: test_ActsDumpGeometryIdentifiers
:green_circle: test_ActsCheckObjectCountsCachedWorkflow
:green_circle: test_ActsCheckObjectCountsWorkflow
:green_circle: test_ActsEFTrackFit
:green_circle: test_ActsPersistifySeeds
:green_circle: test_ActsBenchmarkWithSpot
:green_circle: test_ActsAnalogueClustering
:green_circle: test_ActsWorkflowHeavyIons
:green_circle: test_ActsWorkflowFastTracking
:green_circle: test_ActsWorkflowCached
:green_circle: test_ActsWorkflow
:green_circle: test_ActsValidateAmbiguityResolution
:green_circle: test_ActsValidateResolvedTracks
:green_circle: test_ActsValidateTracks
:green_circle: test_ActsValidateActsCoreSpacePoints
:green_circle: test_ActsValidateActsSpacePoints
:green_circle: test_ActsValidateSeeds
:green_circle: test_ActsValidateOrthogonalSeeds
:green_circle: test_ActsValidateClusters
:green_circle: test_ActsPersistifyEDM
:green_circle: test_ActsGSFRefitting
:green_circle: test_ActsKfRefitting
:green_circle: test_ActsExtrapolationAlgTest
:green_circle: test_ActsITkTest
:green_circle: run_unit_tests

acts-project-service avatar Oct 31 '24 00:10 acts-project-service