Skip to content

Commit

Permalink
Azure CI: Cache
Browse files Browse the repository at this point in the history
Try to use caching for as much as possible on Azure.
This might help to reuse AMReX objects between our weekly updates.
It might also be just way too large and get evicted quickly.
  • Loading branch information
ax3l committed Dec 3, 2021
1 parent 84023ef commit d60b543
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 6 deletions.
49 changes: 43 additions & 6 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
WARPX_CI_NUM_MAKE_JOBS: 2
WARPX_CI_CCACHE: 'TRUE'
WARPX_CI_OPENPMD: 'TRUE'
FFTW_HOME: '/usr/'
BLASPP_HOME: '/usr/local/'
LAPACKPP_HOME: '/usr/local/'
WARPX_CI_TMP: '/tmp/ci'
FFTW_HOME: '/usr'
BLASPP_HOME: '/usr/local'
LAPACKPP_HOME: '/usr/local'
OMP_NUM_THREADS: 1

strategy:
Expand All @@ -42,12 +43,39 @@ jobs:
timeoutInMinutes: 90

steps:
- script: |
# set up caches:
# - once stored under a key, they become immutable (even if cache content changes)
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
- task: Cache@2
inputs:
key: 'Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh'
restoreKeys: |
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake
Ccache | "$(System.JobName)"
Ccache
path: /home/vsts/.ccache
cacheHitVar: CCACHE_CACHE_RESTORED
displayName: Cache Ccache Objects

- task: Cache@2
inputs:
key: 'Python3 | "$(System.JobName)" | run_test.sh'
restoreKeys: |
Python3 | "$(System.JobName)" | run_test.sh
Python3 | "$(System.JobName)"
Python3
path: /home/vsts/.local/lib/python3.8
cacheHitVar: PYTHON38_CACHE_RESTORED
displayName: Cache Python Libraries

- bash: |
cat /proc/cpuinfo | grep "model name" | sort -u
sudo apt update
df -h
sudo apt install -y ccache gcc gfortran g++ openmpi-bin libopenmpi-dev \
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
ccache --set-config=max_size=10.0G
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
sudo update-alternatives --set python /usr/bin/python3
python -m pip install --upgrade pip
Expand All @@ -58,21 +86,30 @@ jobs:
export PATH="$HOME/.local/bin:$PATH"
python -m pip install --upgrade matplotlib mpi4py numpy scipy yt
export CEI_SUDO="sudo"
export CEI_TMP="/tmp/cei"
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
sudo chmod a+x /usr/local/bin/cmake-easyinstall
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
cmake-easyinstall --prefix=/usr/local git+https://github.com/openPMD/[email protected] \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
python -m pip install --upgrade openpmd-api
fi
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/lapackpp.git \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
fi
df -h
displayName: 'Install dependencies'
# condition: eq(variables.CCACHE_CACHE_RESTORED, 'false') and ...

- script: |
- bash: |
df -h
./run_test.sh
rm -rf ${WARPX_CI_TMP}
df -h
displayName: 'Build & test'
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ endif()
# fancy binary name for build variants
set_warpx_binary_name()

set_target_properties(app WarpX PROPERTIES
CXX_VISIBILITY_PRESET hidden
CUDA_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
)


# Defines #####################################################################
#
Expand Down

0 comments on commit d60b543

Please sign in to comment.