Skip to content

Propagate/use TPC occupancy histo via RecoContainer#12975

Closed
shahor02 wants to merge 2 commits intoAliceO2Group:devfrom
shahor02:pr_tpcocc
Closed

Propagate/use TPC occupancy histo via RecoContainer#12975
shahor02 wants to merge 2 commits intoAliceO2Group:devfrom
shahor02:pr_tpcocc

Conversation

@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2024

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass
async-2023-pp-apass1
async-2022-pp-apass6
async-2022-pp-apass4
async-mc
async-data

@davidrohr
Copy link
Collaborator

Thx @shahor02

@davidrohr I see that the https://github.com/AliceO2Group/AliceO2/pull/12970/files#diff-9dcbbb184115454e0b3e3af138b29ae072ab73bbfbbfb074d5ec6654cd9536cdL27-L41 is not finalized yet. Once finished, will you also add new output to the https://github.com/AliceO2Group/AliceO2/pull/12970/files#diff-78507aa7c5a074a27bb8763c800436d6d7b41a2f0676b3af1eec9a801aacce94L35-L38 ?

Yes, it is not final yet. I have done some more work, and rebased your commit on my latest update: #12970

I have added additional output here:

static void fillSharedClustersAndOccupancyMap(const o2::tpc::ClusterNativeAccess* cl, const gsl::span<const o2::tpc::TrackTPC> trks, const o2::tpc::TPCClRefElem* trackRef, unsigned char* shmap, unsigned int* ocmap = nullptr, unsigned int nHbfPerTf = 0, const GPUParam* param = nullptr);

The logic is:

  • If no occupancyMap is provided externally (either from the tracking or from the shared map creator), the constructor of GPUO2InterfaceRefit needs the nHbfPerTf value to create it internally, if the map is required depending on --configKeyValues. If the map is needed but nHbfPerTf=0 I'll throw a fatal. However, I think this does not affect any of your use cases, but e.g. TPC CalculatedEdx uses this internal map creation.
  • For the shared map creator, you can call fillOccupancyMapGetSize (which also needs nHbfPerTf). This will return the required buffer size of the occupancy map in bytes (or 0 in case no map is needed).
    • In case of fillOccupancyMapGetSize() = 0, the shared map creator should just send a dummy message of size 0 to make DPL happy. (TPC tracking will eventually do the same, currently it still lacks the empty dummy message if no map is needed.)
    • I propose that in this case of size is 0, the recoContainer should provide nullptr as occupancymap to the constructor of GPUO2InterfaceRefit. This will make sure that in case inconsistent --configKeyValues are used, we will not try to access a dummy occupancy map.
    • In case of fillOccupancyMapGetSize() != 0, just call fillSharedClustersAndOccupancyMap as before, passing in addition the buffer for ocmap and the value of nHbfPerTf.
    • And obviously also in case of 0, you still need to call fillSharedClustersAndOccupancyMap for the shared cluster map as before, leaving the default arguments = 0 and = nullptr for ocmap and nHbfPerTf.

Note that I've modified https://github.com/AliceO2Group/AliceO2/pull/12970/files#diff-d491487d2d6fbeadbfdfcae25c40b5b0167772d3f51423012d41f9b9b3507e43L39-L43 to https://github.com/AliceO2Group/AliceO2/compare/dev...shahor02:pr_tpcocc?expand=1#diff-d491487d2d6fbeadbfdfcae25c40b5b0167772d3f51423012d41f9b9b3507e43R38, now it also will profit from the shared and occupancy maps via recocontaner.

makes sense. I have seen that the TPC CalcularedEdx also doesn't use the shared map. Not sure if we should add it there as well:

mRefit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, &mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), nullptr, mTracks);

@shahor02
Copy link
Collaborator Author

shahor02 commented Apr 2, 2024

* If no occupancyMap is provided externally (either from the tracking or from the shared map creator), the constructor of `GPUO2InterfaceRefit` needs the `nHbfPerTf` value to create it internally, if the map is required depending on `--configKeyValues`. If the map is needed but `nHbfPerTf=0` I'll throw a fatal. However, I think this does not affect any of your use cases, but e.g. TPC `CalculatedEdx` uses this internal map creation.

Indeed, in all cases the sharing (will be the same with occupancy) maps are provided from the upstream.
The CalculatedEdx seems so far not to be used in any code, if it does, I would also provide external data to it also.

* For the shared map creator, you can call `fillOccupancyMapGetSize` (which also needs `nHbfPerTf`). This will return the required buffer size of the occupancy map in bytes (or 0 in case no map is needed).

OK, but once you provide the occupancy from the TPC reco or shmap creator workflow, at the moment I don't need to call it, right?

  * I propose that in this case of size is 0, the recoContainer should provide `nullptr` as `occupancymap` to the constructor of `GPUO2InterfaceRefit`. This will make sure that in case inconsistent `--configKeyValues` are used, we will not try to access a dummy occupancy map.

RecoContaier has gsl::span objects for the sharing and occupancy maps, so, unless assigned from the DPL input, it already provides a nullptr for both.

  * In case of `fillOccupancyMapGetSize() != 0`, just call `fillSharedClustersAndOccupancyMap` as before, passing in addition the buffer for `ocmap` and the value of `nHbfPerTf`.
  * And obviously also in case of `0`, you still need to call `fillSharedClustersAndOccupancyMap` for the shared cluster map as before, leaving the default arguments `= 0` and `= nullptr` for `ocmap` and `nHbfPerTf`.

mRefit = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mClusterIndex, &mTPCCorrMapsHelper, mFieldNominalGPUBz, mTPCTrackClIdxVecInput->data(), nullptr, mTracks);

see above: it is not used anywere.

@alibuild
Copy link
Collaborator

alibuild commented Apr 2, 2024

Error while checking build/O2/fullCI for 0a6ac5d at 2024-04-03 09:03:

## sw/BUILD/O2-latest/log
c++: error: unrecognized command-line option '--rtlib=compiler-rt'
c++: error: unrecognized command-line option '--rtlib=compiler-rt'


## sw/BUILD/O2-sim-challenge-test-latest/log
./itstpcMatch.log[ERROR] invalid workflow in o2-tpcits-match-workflow: No matching output found for TPC/TPCOCCUPANCYMAP/0 as requested by data processor "itstpc-track-matcher". Candidates:
./mchreco.log[17481:mch-error-writer]: [07:03:06][ERROR] Some Lifetime::Timeframe data got dropped starting at 1
./mchreco.log[17482:mch-track-writer]: [07:03:06][ERROR] Some Lifetime::Timeframe data got dropped starting at 1
./sim-challenge.log[ERROR] invalid workflow in o2-tpcits-match-workflow: No matching output found for TPC/TPCOCCUPANCYMAP/0 as requested by data processor "itstpc-track-matcher". Candidates:
./midreco.log[19440:MIDRecoWriter]: [07:03:37][ERROR] Some Lifetime::Timeframe data got dropped starting at 1
./mchmidMatch.log[20335:muon-track-writer]: [07:03:45][ERROR] Some Lifetime::Timeframe data got dropped starting at 1
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/37}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/38}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/40}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/42}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/43}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/45}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/46}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/47}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/48}
./digi.log[ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/49}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/37}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/38}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/40}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/42}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/43}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/45}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/46}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/47}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/48}
./digi.log[11085:internal-dpl-clock]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/49}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/37}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/38}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/40}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/42}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/43}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/45}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/46}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/47}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/48}
./digi.log[11086:SimReader]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/49}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/37}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/38}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/40}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/42}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/43}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/45}
./digi.log[11087:internal-dpl-ccdb-backend]: [ERROR] Found duplicate input binding with different spec.:collisioncontext {SIM/COLLISIONCONTEXT/46}
[0 more errors; see full log]

Full log here.

@davidrohr
Copy link
Collaborator

* For the shared map creator, you can call `fillOccupancyMapGetSize` (which also needs `nHbfPerTf`). This will return the required buffer size of the occupancy map in bytes (or 0 in case no map is needed).

OK, but once you provide the occupancy from the TPC reco or shmap creator workflow, at the moment I don't need to call it, right?

I changed what is needed here to obtain the correct size: 5fbb39c
But now we still need to pass in the number of hbf per TF in the shared map creator workflow, i.e. I assume we have to query the GRP there.

@shahor02
Copy link
Collaborator Author

shahor02 commented Apr 4, 2024

Already absorbed to #12970

@shahor02 shahor02 closed this Apr 4, 2024
@shahor02 shahor02 deleted the pr_tpcocc branch April 11, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants