Skip to content

Add kokkos and its simtbx/LS49 tests to Azure build #728

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

Merged
merged 16 commits into from
Mar 30, 2022
2 changes: 1 addition & 1 deletion .azure-pipelines/xfel/download-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cd modules
git clone https://github.com/nksauter/LS49.git
git clone https://gitlab.com/cctbx/ls49_big_data.git
git clone https://github.com/lanl/lunus.git
git clone -b azure https://github.com/bkpoon/lunus.git
displayName: Download sources

- script: |
Expand Down
19 changes: 15 additions & 4 deletions .azure-pipelines/xfel/unix-conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ steps:
#conda create -y --offline -n $(PYTHON_VERSION) --file $(Pipeline.Workspace)/channel/env.txt
conda create -y -n $(PYTHON_VERSION) --file $(Pipeline.Workspace)/modules/dials/.conda-envs/$(OS).txt python=$(PYTHON_FULL_VERSION)
conda install -y -c conda-forge --no-deps -n $(PYTHON_VERSION) junit-xml
conda install -y -c conda-forge pandas distro -n $(PYTHON_VERSION)
conda install -y -c conda-forge cmake pandas distro -n $(PYTHON_VERSION)
displayName: Create conda environment

# build
Expand All @@ -78,7 +78,18 @@ steps:
conda activate $(PYTHON_VERSION)
cd $(Pipeline.Workspace)
rm -rf modules/boost
python bootstrap.py --builder=xfel --use-conda $CONDA_PREFIX --nproc=4 --config-flags="--enable_openmp_if_possible=True" --config-flags="--compiler=conda" --config-flags="--use_environment_flags" --config-flags="--enable_cxx11" --config-flags="--no_bin_python" --no-boost-src build
python bootstrap.py \
--builder=xfel \
--use-conda $CONDA_PREFIX \
--nproc=4 \
--config-flags="--enable_openmp_if_possible=True" \
--config-flags="--compiler=conda" \
--config-flags="--use_environment_flags" \
--config-flags="--enable_cxx11" \
--config-flags="--no_bin_python" \
--config-flags="--enable_kokkos" \
--no-boost-src \
build
if [ "$(OS)" = "linux" ]; then
cd build
source conda_setpaths.sh
Expand All @@ -98,8 +109,8 @@ steps:
libtbx.configure xfel_regression LS49 ls49_big_data
chmod +x $(Pipeline.Workspace)/modules/xfel_regression/merging_test_data/xfel_merge.sh
chmod +x $(Pipeline.Workspace)/modules/xfel_regression/merging_test_data/merge_thermo.csh
export OMP_NUM_THREADS=4
libtbx.run_tests_parallel module=uc_metrics module=simtbx module=xfel_regression module=LS49 nproc=4
export OMP_NUM_THREADS=2
libtbx.run_tests_parallel module=uc_metrics module=simtbx module=xfel_regression module=LS49 nproc=2
failOnStderr: false
displayName: Test

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/xfel/unix-psana-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:
source $(Pipeline.Workspace)/miniforge/etc/profile.d/conda.sh
conda env create -f $(Pipeline.Workspace)/modules/cctbx_project/xfel/conda_envs/psana_environment.yml
conda install -y -c conda-forge --no-deps -n psana_env junit-xml
conda install -y -c conda-forge pandas distro -n psana_env
conda install -y -c conda-forge cmake pandas distro -n psana_env
displayName: Create conda environment

# build
Expand Down
2 changes: 2 additions & 0 deletions simtbx/kokkos/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ kokkos_cxxflags = subprocess.check_output(
cwd=os.environ['KOKKOS_PATH'])
kokkos_cxxflags = kokkos_cxxflags.split(b'\n')
kokkos_cxxflags = kokkos_cxxflags[1].decode('utf8').split()
if kokkos_cxxflags and kokkos_cxxflags[0] == 'echo':
kokkos_cxxflags = [f.strip('"') for f in kokkos_cxxflags[1:]]
print('KOKKOS_CXXFLAGS:', kokkos_cxxflags)
print('='*79)

Expand Down
2 changes: 1 addition & 1 deletion simtbx/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
tst_list_parallel.append(par_tst)

tst_list_parallel += db_tst_list_onlyCuda
elif OPT.enable_kokkos:
elif OPT.enable_kokkos and sys.platform.startswith('linux'):
tst_list_parallel = [
["$D/nanoBragg/tst_gauss_argchk.py","CPU"], # tests CPU argchk optimization
"$D/kokkos/tst_kokkos_lib.py", # GPU in kokkos
Expand Down