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

Added GEANT4_BUILD_MULTITHREADED env variable: #1189

Merged
merged 9 commits into from
Oct 9, 2018

Conversation

ihrivnac
Copy link
Contributor

  • The variable allows different setting of the GEANT4_BUILD_MULTITHREADED CMake option
  • The default value "OFF" is overridden ("ON") in defaults-o2.sh and defaults-o2-dev-fairroot.sh

@ihrivnac ihrivnac requested a review from a team as a code owner June 12, 2018 12:22
geant4.sh Outdated
@@ -25,6 +25,10 @@ env:
---
#!/bin/bash -e

if [ ! $GEANT4_BUILD_MULTITHREADED ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Change those three lines to:

: {GEANT4_BUILD_MULTITHREADED:=OFF}

which does exactly the same. (Mind the : at the beginning of the line.)

@sawenzel
Copy link
Collaborator

sawenzel commented Jul 3, 2018

I see not activity here. @ihrivnac : I think this can be merged as soon as the suggestions of @dberzano have been addressed.

@sawenzel
Copy link
Collaborator

sawenzel commented Aug 23, 2018

@ihrivnac, @dberzano: I have updated this PR according to the suggestions (since there was no activity for a while). I think we should go on with this.

Please squash the commits together.

Copy link
Contributor

@dberzano dberzano left a comment

Choose a reason for hiding this comment

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

A small glitch to fix. Can you also add the variable to o2-ninja please? Thanks!

geant4.sh Outdated
-DGEANT4_USE_SYSTEM_EXPAT=OFF \
${CXXSTD:+-DCMAKE_CXX_STANDARD=$CXXSTD} \
# if this variable is not defined default it to OFF
: {GEANT4_BUILD_MULTITHREADED:=OFF}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be:

: ${GEANT4_BUILD_MULTITHREADED:=OFF}

(a $ is missing).

@sawenzel
Copy link
Collaborator

Actually I can't modify/edit o2-ninja.sh in relation to this PR (on this very branch). I would prefer doing it in a sep PR directly hereafter.

@dberzano dberzano dismissed their stale review August 23, 2018 14:05

need to update branch; review is blocking update

@dberzano
Copy link
Contributor

Hm I don't understand why you can't edit it. Let me check.

@dberzano
Copy link
Contributor

OK I just did it.

dberzano
dberzano previously approved these changes Aug 23, 2018
@sawenzel
Copy link
Collaborator

What is the status here? The CI test seems to be actually failing.

@sawenzel
Copy link
Collaborator

Can this be merged, please?

@ktf
Copy link
Member

ktf commented Sep 19, 2018

Aren’t the failures related?

@ktf
Copy link
Member

ktf commented Sep 19, 2018

Also, could you please rebase it? There are conflicts.

@dberzano
Copy link
Contributor

dberzano commented Oct 1, 2018

This is ready to be merged at your convenience. I cannot positively review it because I have contributed to it.

@sawenzel, @ktf if you agree can you please review it and merge when green?

@ihrivnac: I had to rebase it once again for the record 🙂

@ktf ktf self-requested a review October 1, 2018 19:11
Copy link
Member

@ktf ktf left a comment

Choose a reason for hiding this comment

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

There seems to be a lot of spurious messages / errors from what seems to be MT related. Are you really sure you want to merge this?

@dberzano
Copy link
Contributor

dberzano commented Oct 1, 2018

I am not, but @sawenzel seems to need it. Maybe him or @ihrivnac can shed some light on the error messages?

@ihrivnac
Copy link
Contributor Author

ihrivnac commented Oct 2, 2018

There seems to be a problem with switching the GEANT4_BUILD_TLS_MODEL option from "global-dynamic" to "initial-exec"; this option was set to get working the dynamical loading of libraries via ROOT gSystem when running in MT mode, however it brought an overhead (~3%) when running in sequential mode with libraries built with MT enables.
In our local test, it looked that this option is not needed anymore, but from the tests here it looks like it is still needed for certain platforms. I suggest to try everything with the TLS model "global-dynamic". I will commit the update in my branch.
Could you let me know what's the platform (os, compiler) which is used for the PR checks?

@dberzano
Copy link
Contributor

dberzano commented Oct 2, 2018

CC7, GCC v7.3.0

@dberzano
Copy link
Contributor

dberzano commented Oct 2, 2018

Note that we can selectively enable it on certain platforms if you tell us so.

@ihrivnac
Copy link
Contributor Author

ihrivnac commented Oct 2, 2018

The platforms which we tested locally were:
Ubuntu:16.04 (Sandro), MAC OS HIgh Sierra 10.13.4 (me)
So we may need a selective setting here.

@sawenzel
Copy link
Collaborator

sawenzel commented Oct 2, 2018

Fine. But if the production environment has this problem it means that we are back to accepting a 3% penalty just by theoretically enabling this mode (without even using it). At least I have a problem with this. Is there no other way to avoid this? How are other experiments solving this issue?

@ktf
Copy link
Member

ktf commented Oct 2, 2018

CMS uses global-dynamic:

https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_10_3_X/gcc700/geant4.spec

not sure if they have anything extra in the framework itself.

Barthelemy
Barthelemy previously approved these changes Oct 2, 2018
Copy link
Contributor

@Barthelemy Barthelemy left a comment

Choose a reason for hiding this comment

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

I approve but I have no idea on the subject :)

@sawenzel
Copy link
Collaborator

sawenzel commented Oct 2, 2018

For the record, the reasoning to put initial-exec in commit 86ed6651973a56db can be found here: https://alice.its.cern.ch/jira/browse/O2-172.

@sawenzel
Copy link
Collaborator

sawenzel commented Oct 2, 2018

I note that even with global-dynamic the test crashes and has tons of warnings.

@ihrivnac
Copy link
Contributor Author

ihrivnac commented Oct 2, 2018

In the new log, only the new test o2sim_G4_mt fails, and it happens at exit, so there is some problem with final clean-up, which I will investigate.
On the other hand, according to Geant4 banner, the Geant4 libraries were not rebuilt with changing the build option; also, I don't see in the log if geant4_vmc libraries were re-built. Is it possible to check this on the test machine?
The large number of warning come from FairRoot framework:
### [WARN] The method CheckIfSensitive has to be implemented in the detector class which
inherits from FairModule
and it is not relevant to this PR. I'd expect that they are present in the Passed tests, too. Could we check the logs of o2sim_G3 and o2sim_G4?

@ihrivnac
Copy link
Contributor Author

ihrivnac commented Oct 3, 2018

I proposed a fixed for the warnings in O2 PR #1382. With introducing the new function InitializeO2Detector() in O2 there was disconnected the initialisation of sensitive volumes, triggered by DefineSensitiveVolumes() in FairRoot.
On the other hand I am not able to reproduce the break at the end of run. Is it possible to produce a back trace from this crash on the test machine?

ihrivnac and others added 6 commits October 9, 2018 10:15
- The variable allows different setting of the GEANT4_BUILD_MULTITHREADED CMake option
- The default value "OFF" is overriden ("ON") in defaults-o2.sh and defaults-o2-dev-fairroot.sh
@dberzano
Copy link
Contributor

dberzano commented Oct 9, 2018

@ihrivnac there is something systematically wrong in your Git workflow (you keep bringing here commits that don't belong and are already in master).

  • If you want to align this pull request to the changes made upstream, simply press the Update branch button on the GitHub interface
  • If you want to do the same but manually, simply git pull --rebase origin master && git push -f when you are on your geant4_mt branch

Hope this helps!

@ihrivnac
Copy link
Contributor Author

ihrivnac commented Oct 9, 2018

Thanks. I clicked on "Update branch" in github, and got again the red button:
"Merging is blocked" ...

@dberzano
Copy link
Contributor

dberzano commented Oct 9, 2018

Yes, merging is blocked because there is a negative review. Were the comments from @ktf addressed?

@ktf
Copy link
Member

ktf commented Oct 9, 2018

At leasts all the tests are green now, however there is no way to check if the spurious messages. Didn't we copy successful test logs? That said, no more objections as long as things are green.

@dberzano dberzano merged commit 137b1c3 into alisw:master Oct 9, 2018
@dberzano
Copy link
Contributor

dberzano commented Oct 9, 2018

Successful logs are not retained ATM.

@sawenzel
Copy link
Collaborator

I would have preferred resolving the performance problem before merging. Will re-open https://alice.its.cern.ch/jira/browse/O2-172 since we are back to global-dynamic threading which has runtime overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants