Skip to content

Commit 4521c6d

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 4521c6d

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

.azure-pipelines.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
BLASPP_HOME: '/usr/local/'
1818
LAPACKPP_HOME: '/usr/local/'
1919
OMP_NUM_THREADS: 1
20+
CCACHE_DIR: $(Pipeline.Workspace)/ccache
2021

2122
strategy:
2223
matrix:
@@ -42,12 +43,44 @@ jobs:
4243
timeoutInMinutes: 90
4344

4445
steps:
46+
- bash: |
47+
sudo apt update
48+
sudo apt-get install -y ccache python3 python3-pip
49+
echo "##vso[task.prependpath]/usr/lib/ccache"
50+
ccache --set-config=max_size=10.0G
51+
displayName: Install pip, ccache and update PATH to use linked versions of gcc, cc, etc
52+
53+
# set up caches:
54+
# - once stored under a key, they become immutable (even if cache content changes)
55+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
56+
- task: Cache@2
57+
inputs:
58+
key: 'ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh'
59+
restoreKeys: |
60+
ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh
61+
ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake
62+
ccache | "$(System.JobName)"
63+
ccache
64+
path: $(CCACHE_DIR)
65+
cacheHitVar: CCACHE_CACHE_RESTORED
66+
displayName: Cache CCache Objects
67+
68+
- task: Cache@2
69+
inputs:
70+
key: 'python3 | "$(System.JobName)" | run_test.sh'
71+
restoreKeys: |
72+
python3 | "$(System.JobName)" | run_test.sh
73+
python3 | "$(System.JobName)"
74+
python3
75+
path: /home/vsts/.local/lib/python3.8
76+
cacheHitVar: PYTHON38_CACHE_RESTORED
77+
displayName: Cache Python Libraries
78+
4579
- script: |
4680
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 \
81+
sudo apt install -y gcc gfortran g++ openmpi-bin libopenmpi-dev \
4982
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
50-
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
83+
python3-venv python3-setuptools libblas-dev liblapack-dev
5184
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
5285
sudo update-alternatives --set python /usr/bin/python3
5386
python -m pip install --upgrade pip
@@ -62,16 +95,20 @@ jobs:
6295
sudo chmod a+x /usr/local/bin/cmake-easyinstall
6396
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
6497
cmake-easyinstall --prefix=/usr/local git+https://github.com/openPMD/[email protected] \
98+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
6599
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
66100
python -m pip install --upgrade openpmd-api
67101
fi
68102
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
69103
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \
104+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
70105
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
71106
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/lapackpp.git \
107+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
72108
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
73109
fi
74110
displayName: 'Install dependencies'
111+
# condition: eq(variables.CCACHE_CACHE_RESTORED, 'false') and ...
75112

76113
- script: |
77114
./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)