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

Docs: warn about default variables set by conda #5466

Closed
wants to merge 3 commits into from

Conversation

EZoni
Copy link
Member

@EZoni EZoni commented Nov 15, 2024

Adding a warning about conda setting default environment variables when installing CMake, as discussed during the developer meeting.

It will be displayed at the onde of the conda section (https://warpx.readthedocs.io/en/latest/install/dependencies.html#conda-linux-macos-windows):

Screenshot from 2024-11-15 12-39-42

@EZoni EZoni added the component: documentation Docs, readme and manual label Nov 15, 2024
@EZoni EZoni requested a review from WeiqunZhang November 15, 2024 20:44
@RemiLehe
Copy link
Member

In the documentation: could you add the command line that a user should type in order to clear the variable?

@RemiLehe RemiLehe self-assigned this Nov 19, 2024
@EZoni
Copy link
Member Author

EZoni commented Dec 3, 2024

@RemiLehe

I added the note you requested and I think this is ready to merge.

@EZoni EZoni assigned ax3l and unassigned RemiLehe Jan 8, 2025
@EZoni EZoni requested review from WeiqunZhang and ax3l January 8, 2025 01:05
@ax3l
Copy link
Member

ax3l commented Jan 8, 2025

I see this in the conda CXXFLAGS:

$ echo $CXXFLAGS
-fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/axel/micromamba/envs/warpx-cpu-mpich-dev/include

I never realized they set -O2 :-o

@ax3l
Copy link
Member

ax3l commented Jan 8, 2025

I guess I'll add -O3 to all our conda recipes then... phew!

Has anyone done a performance test for the default flags vs unsetting them yet? @EZoni

@EZoni
Copy link
Member Author

EZoni commented Jan 8, 2025

I guess I'll add -O3 to all our conda recipes then... phew!

I did not know either, I discovered this by chance while looking into some other flags. I'm curious to know how to do this, thanks for looking into it.

Has anyone done a performance test for the default flags vs unsetting them yet?

I have not done any specific tests on my end.

@ax3l
Copy link
Member

ax3l commented Jan 8, 2025

Thanks for the update. Yes, tests would be interesting because there are in fact not a ton that -O3 adds in Clang at least over -O2. -Ofast then adds again a good amount of numerical tweeks (fast math) that give big performance boosts (we do such tricks currently on on GPU, but should consider them on CPU once we have our checksum mechanism improved)
https://stackoverflow.com/a/15548189

@ax3l
Copy link
Member

ax3l commented Jan 8, 2025

This is not a problem. We append -O3 after the CXXFLAGS via our CMAKE_BUILD_TYPE (similar to conda-forge/conda-forge.github.io#1859 (comment)).

Example:

$ cmake --build build --verbose
...
cd /home/axel/src/warpx/build/_deps/fetchedopenpmd-build && /home/axel/micromamba/envs/warpx-cpu-mpich-dev/bin/ccache /home/axel/micromamba/envs/warpx-cpu-mpich-dev/bin/x86_64-conda-linux-gnu-c++ -DADIOS2_USE_MPI -DNDEBUG -D_FORTIFY_SOURCE=2 -DopenPMD_USE_VERIFY=1 -I/home/axel/src/warpx/build/_deps/fetchedopenpmd-src/include -I/home/axel/src/warpx/build/_deps/fetchedopenpmd-build/include -isystem /home/axel/src/warpx/build/_deps/fetchedopenpmd-src/share/openPMD/thirdParty/json/single_include -isystem /home/axel/src/warpx/build/_deps/fetchedopenpmd-src/share/openPMD/thirdParty/toml11 -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/axel/micromamba/envs/warpx-cpu-mpich-dev/include -O3 -DNDEBUG -std=c++17 -fPIC -MD -MT _deps/fetchedopenpmd-build/CMakeFiles/openPMD.dir/src/IO/ADIOS/CommonADIOS1IOHandler.cpp.o -MF CMakeFiles/openPMD.dir/src/IO/ADIOS/CommonADIOS1IOHandler.cpp.o.d -o CMakeFiles/openPMD.dir/src/IO/ADIOS/CommonADIOS1IOHandler.cpp.o -c /home/axel/src/warpx/build/_deps/fetchedopenpmd-src/src/IO/ADIOS/CommonADIOS1IOHandler.cpp

@ax3l ax3l closed this Jan 8, 2025
@ax3l ax3l added invalid This doesn't seem right install component: third party Changes in WarpX that reflect a change in a third-party library labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: documentation Docs, readme and manual component: third party Changes in WarpX that reflect a change in a third-party library install invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants