-
Notifications
You must be signed in to change notification settings - Fork 201
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
Move Fornberg coefficients calculations from WarpX to ablastr #5619
Move Fornberg coefficients calculations from WarpX to ablastr #5619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a tangential question, but do we currently have any CI check that compiles with GNU Make instead of CMake? I wonder if code changes like the ones in this file are actually tested automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can answer myself. Yes, I see at least one CI workflow here that uses GNU Make:
WarpX/.github/workflows/cuda.yml
Lines 100 to 134 in e0421a1
# make sure legacy build system continues to build, i.e., that we don't forget | |
# to add new .cpp files | |
build_nvcc_gnumake: | |
name: NVCC 11.8.0 GNUmake | |
runs-on: ubuntu-20.04 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install dependencies | |
run: | | |
.github/workflows/dependencies/nvcc11-8.sh | |
- name: CCache Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: build WarpX | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=600M | |
ccache -z | |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} | |
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} | |
which nvcc || echo "nvcc not in PATH!" | |
git clone https://github.com/AMReX-Codes/amrex.git ../amrex | |
cd ../amrex && git checkout --detach 78bdf0faabc4101d5333ebb421e553efcc7ec04e && cd - | |
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_FFT=TRUE USE_CCACHE=TRUE -j 4 | |
ccache -s | |
du -hs ~/.cache/ccache |
The calculation of Fornberg stencil coefficients is rather general, and it can be shared with other projects of the BLAST family. Therefore, this PR moves the responsible functions into
ablastr
.Specifically, the PR does the following:
FiniteDifference.H
andFiniteDifference.cpp
) are created underablastr/math
(CMakeLists.txt
andMake.package
accordingly)getFornbergStencilCoefficients
and theReorderFornbergCoefficients
function (originally defined in an anonymous namespace inWarpX.cpp
) are moved to these new files, inside the namespaceablastr::math
AMREX_ALWAYS_ASSERT_WITH_MESSAGE
becomesABLASTR_ALWAYS_ASSERT_WITH_MESSAGE
)WarpX.cpp
andSpectralKSpace.cpp
(where the aforementioned functions were called) are updatedNote that with this PR
SpectralKSpace.cpp
does not need anymore to include the heavyWarpX.H
header.