1313 WARPX_CI_NUM_MAKE_JOBS : 2
1414 WARPX_CI_CCACHE : ' TRUE'
1515 WARPX_CI_OPENPMD : ' TRUE'
16- FFTW_HOME : ' /usr/'
17- BLASPP_HOME : ' /usr/local/'
18- LAPACKPP_HOME : ' /usr/local/'
16+ WARPX_CI_TMP : ' /tmp/ci'
17+ FFTW_HOME : ' /usr'
18+ BLASPP_HOME : ' /usr/local'
19+ LAPACKPP_HOME : ' /usr/local'
1920 OMP_NUM_THREADS : 1
2021
2122 strategy :
@@ -42,12 +43,38 @@ jobs:
4243 timeoutInMinutes : 90
4344
4445 steps :
45- - script : |
46+ # set up caches:
47+ # - once stored under a key, they become immutable (even if cache content changes)
48+ # - for a refresh the key has to change, e.g., hash of a tracked file in the key
49+ - task : Cache@2
50+ inputs :
51+ key : ' Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh'
52+ restoreKeys : |
53+ Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh
54+ Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake
55+ Ccache | "$(System.JobName)"
56+ Ccache
57+ path : /home/vsts/.ccache
58+ cacheHitVar : CCACHE_CACHE_RESTORED
59+ displayName : Cache Ccache Objects
60+
61+ - task : Cache@2
62+ inputs :
63+ key : ' Python3 | "$(System.JobName)" | run_test.sh'
64+ restoreKeys : |
65+ Python3 | "$(System.JobName)" | run_test.sh
66+ Python3 | "$(System.JobName)"
67+ Python3
68+ path : /home/vsts/.local/lib/python3.8
69+ cacheHitVar : PYTHON38_CACHE_RESTORED
70+ displayName : Cache Python Libraries
71+
72+ - bash : |
4673 cat /proc/cpuinfo | grep "model name" | sort -u
47- sudo apt update
4874 sudo apt install -y ccache gcc gfortran g++ openmpi-bin libopenmpi-dev \
4975 libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
5076 python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
77+ ccache --set-config=max_size=10.0G
5178 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
5279 sudo update-alternatives --set python /usr/bin/python3
5380 python -m pip install --upgrade pip
@@ -58,21 +85,27 @@ jobs:
5885 export PATH="$HOME/.local/bin:$PATH"
5986 python -m pip install --upgrade matplotlib mpi4py numpy scipy yt
6087 export CEI_SUDO="sudo"
88+ export CEI_TMP="/tmp/cei"
6189 sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
6290 sudo chmod a+x /usr/local/bin/cmake-easyinstall
6391 if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
6492 cmake-easyinstall --prefix=/usr/local git+https://github.com/openPMD/[email protected] \ 93+ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
6594 -DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
6695 python -m pip install --upgrade openpmd-api
6796 fi
6897 if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
6998 cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \
99+ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
70100 -Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
71101 cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/lapackpp.git \
102+ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
72103 -Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
73104 fi
74105 displayName: 'Install dependencies'
106+ # condition: eq(variables.CCACHE_CACHE_RESTORED, 'false') and ...
75107
76- - script : |
108+ - bash : |
77109 ./run_test.sh
110+ rm -rf ${WARPX_CI_TMP}
78111 displayName: 'Build & test'
0 commit comments