Skip to content

Commit 50883ef

Browse files
committed
Azure CI: Cache
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.
1 parent 0e80973 commit 50883ef

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

.azure-pipelines.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,44 @@ jobs:
4242
timeoutInMinutes: 90
4343

4444
steps:
45+
- bash: |
46+
sudo apt update
47+
sudo apt-get install -y ccache python3 python3-pip
48+
echo "##vso[task.prependpath]/usr/lib/ccache"
49+
ccache --set-config=max_size=10.0G
50+
displayName: Install pip, ccache and update PATH to use linked versions of gcc, cc, etc
51+
52+
# set up caches:
53+
# - once stored under a key, they become immutable (even if cache content changes)
54+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
55+
- task: Cache@2
56+
inputs:
57+
key: 'Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh'
58+
restoreKeys: |
59+
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh
60+
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake
61+
Ccache | "$(System.JobName)"
62+
Ccache
63+
path: /home/vsts/.ccache
64+
cacheHitVar: CCACHE_CACHE_RESTORED
65+
displayName: Cache CCache Objects
66+
67+
- task: Cache@2
68+
inputs:
69+
key: 'Python3 | "$(System.JobName)" | run_test.sh'
70+
restoreKeys: |
71+
Python3 | "$(System.JobName)" | run_test.sh
72+
Python3 | "$(System.JobName)"
73+
Python3
74+
path: /home/vsts/.local/lib/python3.8
75+
cacheHitVar: PYTHON38_CACHE_RESTORED
76+
displayName: Cache Python Libraries
77+
4578
- script: |
4679
cat /proc/cpuinfo | grep "model name" | sort -u
47-
sudo apt update
48-
sudo apt install -y ccache gcc gfortran g++ openmpi-bin libopenmpi-dev \
80+
sudo apt install -y gcc gfortran g++ openmpi-bin libopenmpi-dev \
4981
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
50-
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
82+
python3-venv python3-setuptools libblas-dev liblapack-dev
5183
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
5284
sudo update-alternatives --set python /usr/bin/python3
5385
python -m pip install --upgrade pip
@@ -62,16 +94,20 @@ jobs:
6294
sudo chmod a+x /usr/local/bin/cmake-easyinstall
6395
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
6496
cmake-easyinstall --prefix=/usr/local git+https://github.com/openPMD/openPMD-api.git@0.14.3 \
97+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
6598
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
6699
python -m pip install --upgrade openpmd-api
67100
fi
68101
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
69102
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \
103+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
70104
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
71105
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/lapackpp.git \
106+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
72107
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
73108
fi
74109
displayName: 'Install dependencies'
110+
# condition: eq(variables.CCACHE_CACHE_RESTORED, 'false') and ...
75111

76112
- script: |
77113
./run_test.sh

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ endif()
250250
# fancy binary name for build variants
251251
set_warpx_binary_name()
252252

253+
set_target_properties(app WarpX PROPERTIES
254+
CXX_VISIBILITY_PRESET hidden
255+
CUDA_VISIBILITY_PRESET hidden
256+
VISIBILITY_INLINES_HIDDEN ON
257+
)
258+
253259

254260
# Defines #####################################################################
255261
#

0 commit comments

Comments
 (0)