Skip to content

SIM: Adding experiment versions and dynamic library loading#13148

Merged
sawenzel merged 5 commits into
AliceO2Group:devfrom
f3sch:sim/version
May 28, 2024
Merged

SIM: Adding experiment versions and dynamic library loading#13148
sawenzel merged 5 commits into
AliceO2Group:devfrom
f3sch:sim/version

Conversation

@f3sch
Copy link
Copy Markdown
Collaborator

@f3sch f3sch commented May 20, 2024

Hi @sawenzel, this a draft based on our discussion to have the possibility to specify the detectors via list.
The first commit introduces two new program options, namely detectorVersion version and detectorVersionJSON file and the relevant parsing. Two cases are covered:

  1. only detectorVersion specify: then the version is taken from a predefined map with 'official' versions
  2. both options are specified: then the custom file is parsed to build the same map as in 1. and the modules are taken from there.

AFAICT this 'works' but I did not test this really thoroughly but running 'o2-sim' with different options seems to do what I want.

The second commit introduces dynamic library loading with a custom dll manager modelled as a singleton. As an example I removed the dependency on 'O2{ITS,TPC,TRK}Simulation' which works as expected and I think can be extended to most other detector simulation libraries. I do not have much experience with this and was more fun experiment :).

@github-actions
Copy link
Copy Markdown
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-apass3
async-2023-pbpb-apass4
async-2022-pp-apass6-2023-PbPb-apass2
async-2022-pp-apass4
async-2022-pp-apass4-accepted
async-2022-pp-apass6-2023-PbPb-apass2-accepted
async-2023-pbpb-apass3-accepted
async-2023-pbpb-apass4-accepted
async-2023-pp-apass4
async-2023-pp-apass4-accepted
async-2024-pp-apass1
async-2024-pp-apass1-accepted
async-2022-pp-apass7
async-2022-pp-apass7-accepted
async-2024-pp-cpass0
async-2024-pp-cpass0-accepted

@f3sch f3sch force-pushed the sim/version branch 3 times, most recently from 96c037a to ccde71a Compare May 20, 2024 20:05
@sawenzel
Copy link
Copy Markdown
Collaborator

Thanks. Will take a look.

f3sch added 2 commits May 24, 2024 15:40
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
@f3sch
Copy link
Copy Markdown
Collaborator Author

f3sch commented May 24, 2024

Hi @sawenzel, I update the code and the help description AFAICT it does what we discussed. Maybe after testing, should I undraft to test CI?

@sawenzel sawenzel marked this pull request as ready for review May 24, 2024 14:08
@sawenzel
Copy link
Copy Markdown
Collaborator

Thanks. Already took away the draft status. Will test it once more then merge it.

@sawenzel
Copy link
Copy Markdown
Collaborator

PR is fine for me. Only problem is the build/AliceO2/O2/o2/macOS-arm CI. Some macros seem to fail... should probably take a look. @ktf : Is this a known problem ?

@ktf
Copy link
Copy Markdown
Member

ktf commented May 27, 2024

The mac issue is not a known problem (or better, there was a known issue that got hopefully fixed which was masking this other one, I guess). I need to check what is going on.

@ktf
Copy link
Copy Markdown
Member

ktf commented May 27, 2024

Actually, I think it's a problem with this PR. It looks like a clash between boost filesystem and std::filesystem.

Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
@alibuild
Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI for 569748d at 2024-05-27 23:01:

## sw/BUILD/O2-latest/log
c++: error: unrecognized command-line option '--rtlib=compiler-rt'
c++: error: unrecognized command-line option '--rtlib=compiler-rt'
input_line_9:2944:6: error: expected value in expression
input_line_9:2963:43: error: use of undeclared identifier 'DLLOADER_MAC_LINUX'
Error: /sw/slc8_x86-64/ROOT/v6-30-01-alice4-10/bin/rootcling: compilation failure (/sw/BUILD/18ee7e69ad13d9e917e18c988b8336819f1a9f8c/O2/Common/Utils/G__O2CommonUtils73ecc1ccf6_dictUmbrella.h)
ninja: build stopped: subcommand failed.

Full log here.

Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
@f3sch
Copy link
Copy Markdown
Collaborator Author

f3sch commented May 28, 2024

Hi @ktf, thanks for taking a look, indeed it was clashing with the boost filesystem.
@sawenzel I removed thus this dependency altogether and now CI is green. If you haven’t already done it, can you please test that the parsing is doing what we discussed? Cheers

Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
@sawenzel
Copy link
Copy Markdown
Collaborator

Works fine for me. Thanks a lot for this development. Merging.

@sawenzel sawenzel merged commit be5cdb9 into AliceO2Group:dev May 28, 2024
@f3sch f3sch deleted the sim/version branch November 25, 2024 10:17
@alcaliva alcaliva added the async-2024-pp-apass1 Request porting to async-2024-pp-apass1 label Jan 31, 2025
alcaliva pushed a commit that referenced this pull request Jan 31, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
alcaliva pushed a commit that referenced this pull request Jan 31, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
alcaliva pushed a commit that referenced this pull request Jan 31, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
alcaliva pushed a commit that referenced this pull request Feb 2, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
alcaliva pushed a commit that referenced this pull request Feb 2, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
alcaliva pushed a commit that referenced this pull request Feb 2, 2025
* SIM: Add detectorList option:

Gaining more flexibility with detector geometries.

(a) Allows to select a detector list
from a pre-defined list of ALICE2, ALICE2.1, ALICE3 (corresponding to Run3, Run4, Run5).
Arguments for -m, --skipModules, --readoutDetectors will then be checked against that list.

`o2-sim -n 1 --detectorList ALICE2.1 -m IT3  -o bar2`

(b) Allows to define a custom detector list "MyList" in a JSON file, and following the notation:

`o2-sim --detectorList MyList:${PWD}/myDetector.json`

* SIM: Add dynamic detector library loading

This commit also adds the possibility to instantiate/construct detector modules as a dynamic plugin.
The benefit is that we no longer need to link all possible detector libraries into the simulation executable.

(cherry picked from commit be5cdb9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async-2024-pp-apass1 Request porting to async-2024-pp-apass1

Development

Successfully merging this pull request may close these issues.

5 participants