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

fix: +1 for L1 latency and trigger class check improved #13682

Merged
merged 18 commits into from
Nov 28, 2024

Conversation

lietava
Copy link
Contributor

@lietava lietava commented Nov 12, 2024

Two issues:
1.)
+1 for L1 input latency.
L1 latency for Trigger Class and Trigger input differs by 1. It is constant
2.) check if class has non zero inputs
if parallel runs then this check produce errors. Therefore class mask for trigger classes for a given run is checked only

Copy link
Contributor

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-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1

@lietava
Copy link
Contributor Author

lietava commented Nov 12, 2024

async--pbpb-
async--PbPb-

@lietava lietava marked this pull request as ready for review November 12, 2024 15:21
@lietava lietava requested a review from a team as a code owner November 12, 2024 15:21
@lietava
Copy link
Contributor Author

lietava commented Nov 13, 2024

Hi @shahor02 , for the labels this is needed for all PbPb reco.

@shahor02
Copy link
Collaborator

Hi @lietava , could you please provide more details? Is this only for the pbpb24 or also for pp and pbpb23?
We use L0_L1 also here:

int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;

Is it ok?

@lietava lietava changed the title fix: +1 for L1 latency fix: +1 for L1 latency and trigger class check improved Nov 13, 2024
@lietava
Copy link
Contributor Author

lietava commented Nov 13, 2024

Hi @shahor02 , thanks for question. Please, read description - I updated.
Yes, I am aware that L0-L1 latency is used also on the place you pointed out. That one is used only for trigger classes.
I realised that there is difference 1 BC between trigger class latency and input latency - fw feature.
This latency fix concernes only ZDC inputs - we did not use any other L1 inputs, so it is not critical.
For year 2023 the zdc inputs were properly aligned only in the middle of the run - I would not introduce special fix for that.
For 2024 after fix all inputs should be sitting at LM time.
Then other issue: in decodong inputs (shiftInputs) I am doinf check if trigger class has non zero inputs in same BC. However if there is parallel technical run with internal ctp input generaors it produces a lot of errors. Data are ok , just errors are meningless.
So I introduced fix for that. Disadvantege is that I need to access CTPConfig. If that is a problem I remove error check .
I introduced fix only RawDataDecoder - if you approve this also CTFCoder.h has to access CTPConfig - I did not do that.

shahor02
shahor02 previously approved these changes Nov 13, 2024
Copy link
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

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

Thanks for explanation, will merge after CI

@alibuild
Copy link
Collaborator

alibuild commented Nov 16, 2024

Error while checking build/O2/fullCI for 0de363f at 2024-11-22 09:16:

## 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/O2Physics-latest/log
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:


## sw/BUILD/O2-full-system-test-latest/log
Detected critical problem in logfile reco_ASYNC.log
reco_ASYNC.log:[67706:ctp-entropy-decoder]: [08:15:55][ERROR] Exception while running: InputRecord::get: no input with binding ctpconfig found. Available inputs: ctf_CTP, ctfdict_CTP, trigoffset. Rethrowing.
reco_ASYNC.log-[67706:ctp-entropy-decoder]: [08:15:55][FATAL] Unhandled o2::framework::runtime_error reached the top of main of o2-ctf-reader-workflow, device shutting down. Reason: InputRecord::get: no input with binding ctpconfig found. Available inputs: ctf_CTP, ctfdict_CTP, trigoffset
[67706:ctp-entropy-decoder]: [08:15:55][ERROR] Exception while running: InputRecord::get: no input with binding ctpconfig found. Available inputs: ctf_CTP, ctfdict_CTP, trigoffset. Rethrowing.
[67706:ctp-entropy-decoder]: [08:15:55][FATAL] Unhandled o2::framework::runtime_error reached the top of main of o2-ctf-reader-workflow, device shutting down. Reason: InputRecord::get: no input with binding ctpconfig found. Available inputs: ctf_CTP, ctfdict_CTP, trigoffset
[ERROR] Workflow crashed - PID 67706 (ctp-entropy-decoder) did not exit correctly however it's not clear why. Exit code forced to 128.


## sw/BUILD/o2checkcode-latest/log
--
========== List of errors found ==========
++ GRERR=0
++ grep -v clang-diagnostic-error error-log.txt
++ grep ' error:'
++ GRERR=1
++ [[ 1 == 0 ]]
++ mkdir -p /sw/INSTALLROOT/8d2c25513627b95731c00de6f69ff2fc8b4d21bd/slc8_x86-64/o2checkcode/1.0-local590/etc/modulefiles
++ cat
--

Full log here.

@lietava
Copy link
Contributor Author

lietava commented Nov 24, 2024

HI @shahor02 , I think this went through ?
Or we wait for finishing jira discussion ?

@lietava
Copy link
Contributor Author

lietava commented Nov 24, 2024

Hi @shahor02 , I did changes.
I modified also original name in TriggerOffset which is probably not ok ?
Then I am not sure how TriggerOffset reads database - I do not do it explicily ?

@lietava
Copy link
Contributor Author

lietava commented Nov 24, 2024

@shahor02 : ok I see your answer on jira - going to change

@shahor02
Copy link
Collaborator

What you can do is: leave and use these changes but leave also the old L0_L1 data member.

@shahor02
Copy link
Collaborator

To load it from the CCDB you should do the same as in the entropy decoders, i.e. add to your raw decoder

inputs.emplace_back("trigoffset", "CTP", "Trig_Offset", 0, Lifetime::Condition, ccdbParamSpec("CTP/Config/TriggerOffsets"));

and read the input with mTrigOffsBinding="trigoffset" as in
pc.inputs().get<o2::ctp::TriggerOffsetsParam*>(mTrigOffsBinding); // this is a configurable param
.
That's all.

@lietava
Copy link
Contributor Author

lietava commented Nov 27, 2024

@shahor02 : can you, please, if I understood you correctly ?

@@ -89,7 +89,7 @@ int RawDataDecoder::addCTPDigit(uint32_t linkCRU, uint32_t orbit, gbtword80_t& d
}
} else if (linkCRU == o2::ctp::GBTLinkIDClassRec) {
int32_t BCShiftCorrection = -o2::ctp::TriggerOffsetsParam::Instance().customOffset[o2::detectors::DetID::CTP];
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1_classes - 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You have already L0_L1_classes as 280, do you need to subtract 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was like that before: there was '-1' with 280 always for classes. So I keep it backward compatible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lietava what about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, what do you mean - I commented above:
It was like that before: there was '-1' with 280 always for classes. So I keep it backward compatible.
And as L0_L1_classes is not in old database onjects - it will be 280 in that case as before (default in old TriggerOffsetParams). For new CCDB we should put also 280. Or we actually do not need new entry as with the current
L0_L1 classes is default of class and L0_L1 inputs is 281.
Or let me know if something not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

HI @shahor02 ,
I did validation 559672 and 559243.
Validation means that o2-ctp-reco-workflow --no-lumi --ctpinputs-decoding
gives that same digits as CTF decoder
and both are consistent wirh filling scheme.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lietava yes, you have ignored the comment above, could you please check?

Comment on lines 140 to 145
if (mDecodeinputs) {
const auto ctpcfg = inputs.get<o2::ctp::CTPConfiguration*>("ctpconfig");
if (ctpcfg != nullptr) {
mDecoder.setCTPConfig(*ctpcfg);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be done only once in the beginning of the run processing, right? Why don't you do thin in after https://github.com/AliceO2Group/AliceO2/pull/13682/files#diff-730222aede43b6dd828e45b24b01ba97b3d88fc8c073a79837364b2fb9408b65R237 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, also for EntropyDecoderSpec

@lietava
Copy link
Contributor Author

lietava commented Nov 27, 2024

HI @shahor02 , I did modification for updating ctpconfig only if run changes in both ctp and ctf decoders.

@alibuild
Copy link
Collaborator

Error while checking build/O2/fullCI for f8c8b97 at 2024-11-27 23:07:

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

Full log here.

@lietava
Copy link
Contributor Author

lietava commented Nov 28, 2024

HI @shahor02 , please, let me know if I missed something or you have more comments.

@@ -135,6 +137,11 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx)
if (fatal_flag) {
ret = mDecoder.decodeRawFatal(inputs, filter);
} else {
if (mDecodeinputs) {
const auto ctpcfg = inputs.get<o2::ctp::CTPConfiguration*>("ctpconfig");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

what will happen if ctpcfg will not be found ?
nullptr is returned ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fatal

Detectors/CTP/macro/TestConfig.C Outdated Show resolved Hide resolved
@@ -89,7 +89,7 @@ int RawDataDecoder::addCTPDigit(uint32_t linkCRU, uint32_t orbit, gbtword80_t& d
}
} else if (linkCRU == o2::ctp::GBTLinkIDClassRec) {
int32_t BCShiftCorrection = -o2::ctp::TriggerOffsetsParam::Instance().customOffset[o2::detectors::DetID::CTP];
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1_classes - 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was like that before: there was '-1' with 280 always for classes. So I keep it backward compatible.

Comment on lines 140 to 145
if (mDecodeinputs) {
const auto ctpcfg = inputs.get<o2::ctp::CTPConfiguration*>("ctpconfig");
if (ctpcfg != nullptr) {
mDecoder.setCTPConfig(*ctpcfg);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, also for EntropyDecoderSpec

@@ -89,7 +89,7 @@ int RawDataDecoder::addCTPDigit(uint32_t linkCRU, uint32_t orbit, gbtword80_t& d
}
} else if (linkCRU == o2::ctp::GBTLinkIDClassRec) {
int32_t BCShiftCorrection = -o2::ctp::TriggerOffsetsParam::Instance().customOffset[o2::detectors::DetID::CTP];
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1_classes - 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, what do you mean - I commented above:
It was like that before: there was '-1' with 280 always for classes. So I keep it backward compatible.
And as L0_L1_classes is not in old database onjects - it will be 280 in that case as before (default in old TriggerOffsetParams). For new CCDB we should put also 280. Or we actually do not need new entry as with the current
L0_L1 classes is default of class and L0_L1 inputs is 281.
Or let me know if something not correct.

@@ -89,7 +89,7 @@ int RawDataDecoder::addCTPDigit(uint32_t linkCRU, uint32_t orbit, gbtword80_t& d
}
} else if (linkCRU == o2::ctp::GBTLinkIDClassRec) {
int32_t BCShiftCorrection = -o2::ctp::TriggerOffsetsParam::Instance().customOffset[o2::detectors::DetID::CTP];
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1_classes - 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

HI @shahor02 ,
I did validation 559672 and 559243.
Validation means that o2-ctp-reco-workflow --no-lumi --ctpinputs-decoding
gives that same digits as CTF decoder
and both are consistent wirh filling scheme.

@shahor02
Copy link
Collaborator

Would not it be now 279? L0_L1_classes is 280.

@lietava
Copy link
Contributor Author

lietava commented Nov 28, 2024

ON te current version, i.e. like in branch dev:
in the TriggerOssetsParams there is 280:


This was used for classes in ctprawdecoder:
int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance().L0_L1 - 1;

as there was no CCDB reading
In CTF decoder classes are never done. There in:
o2::ctp::RawDataDecoder::shiftInputs(digitsMap, digits, mFirstTFOrbit);

281 was used in:
auto L1shift = L0shift + o2::ctp::TriggerOffsetsParam::Instance().L0_L1;

because CCDB was read

@lietava
Copy link
Contributor Author

lietava commented Nov 28, 2024

I believe my new code is doing exactly the same and it also does correct ctpinputs decodong when done
in ctprawdecoder:
workflow --shm-segment-size 12000000000 --no-lumi --ctpinputs-decoding -b
which was not case before.

@shahor02 shahor02 merged commit 66b81d8 into AliceO2Group:dev Nov 28, 2024
16 checks passed
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