Skip to content

Commit 2668865

Browse files
authored
Merge pull request #471 from llnl/bugfix/fix_broken_schedules
Fix broken schedules and redundant lib installs
2 parents f31e2e7 + bdb1247 commit 2668865

34 files changed

Lines changed: 270 additions & 208 deletions

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ variables:
1313

1414
SCRIPT_DIR: "scripts"
1515
ATS_FILE: "tests/integration.ats"
16-
PERF_ATS_FILE: "tests/performance/run_perf.py"
16+
PERF_ATS_FILE: "tests/run_perf.py"
1717
SPHERAL_MODULE: "Spheral"
1818
SPACK_PKG_NAME: spheral
1919
DEV_PKG_SPEC: "spheral@develop+mpi~caliper~network%gcc"
@@ -26,14 +26,14 @@ variables:
2626
stages:
2727
- init
2828
- update_tpls
29+
- generate_buildcache
30+
- install_production
31+
- update_permissions
2932
- tpls
3033
- build_and_install
3134
- perf_install
3235
- run_ats
3336
- run_perf
34-
- generate_buildcache
35-
- install_production
36-
- update_permissions
3737
- cleanup
3838
- deploy
3939

.gitlab/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create-pages:
1515
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PIPELINE_SCHEDULE_DESCRIPTION == "Deploy"'
1616
- if: '$CI_COMMIT_MESSAGE =~ /test-deploy/'
1717
script:
18-
- source $HOME/docsvenv/bin/activate
18+
- source $HOME/docsenv/bin/activate
1919
- srun -n 8 --cpus-per-task 14 python3 $SCRIPT_DIR/lc/plot_hist_data.py --threads 14 --pkg-name $SPHERAL_MODULE
2020
artifacts:
2121
paths:

.gitlab/performance.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
rules:
99
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PIPELINE_SCHEDULE_DESCRIPTION == "Performance tests"'
1010
- if: '$CI_COMMIT_MESSAGE =~ /test-perf/'
11+
dependencies: []
1112
script:
12-
# This script submits a job that runs at 7
13-
# Benchmark directory is set in scripts/spheral_ats.py
13+
# Directory storing benchmark data is set in scripts/spheral_ats.py
1414
- INSTALL_DIR=$PERF_INSTALL_DIR/${SPEC#?}
15+
- cd $INSTALL_DIR
1516
- echo "Running performance tests using install at $INSTALL_DIR"
16-
- $INSTALL_DIR/bin/spheral-ats --ciRun --numNodes 2 --delay --batch --logs perf_logs $INSTALL_DIR/$PERF_ATS_FILE || exit_code=$?
17-
- exit $exit_code
17+
- rm -rf perf_logs
18+
- find tests/ -name '*.cali' -print -delete
19+
- ./bin/spheral-ats --ciRun --numNodes 2 --logs perf_logs $INSTALL_DIR/$PERF_ATS_FILE
1820

1921
toss_gcc_mpi_perf:
2022
extends: [.toss_perf_shell, .gcc_mpi, .run_perf]

.gitlab/scripts.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
- job-name.txt
6363

6464
# This copies the install so scheduled perf tests can use it
65+
# Adding test-perf to commit message will trigger the perf install from that branch
6566
.perf_install:
6667
extends: [.retry_rule]
6768
stage: perf_install
@@ -73,11 +74,11 @@
7374
script:
7475
- CI_BUILD_DIR=$(cat ci-dir.txt)
7576
- INSTALL_DIR=$PERF_INSTALL_DIR/${SPEC#?}
76-
- echo "Copying install from $CI_BUILD_DIR/build_gitlab/install to $INSTALL_DIR"
7777
- ml load mpifileutils
7878
- if [[ -d $INSTALL_DIR ]]; then $RUN_CMD -n $NPROC drm $INSTALL_DIR; else echo "No install exists."; fi
79-
- cd $CI_BUILD_DIR
80-
- $RUN_CMD -n $NPROC dcp ./build_gitlab/install $INSTALL_DIR
79+
- cd $CI_BUILD_DIR/build_gitlab/build
80+
- cmake ../../ -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
81+
- make -j $NPROC install
8182
- $RUN_CMD -n $NPROC dchmod --mode go+rx $INSTALL_DIR
8283
artifacts:
8384
paths:
@@ -95,6 +96,8 @@
9596
- cd $CI_BUILD_DIR && cat job-name.txt
9697

9798
- ./build_gitlab/install/bin/spheral-ats --ciRun ./build_gitlab/install/$ATS_FILE || exit_code=$?
99+
# Clean up Caliper files
100+
- find ./build_gitlab/install/tests -name '*.cali' -print0 -delete
98101
- cp -r test-logs $CI_PROJECT_DIR
99102
- exit $exit_code
100103
artifacts:
@@ -112,23 +115,24 @@
112115
GIT_STRATEGY: empty
113116
script:
114117
- CI_BUILD_DIR=$(cat ci-dir.txt)
115-
116118
- ml load mpifileutils
117119
- cd $SPHERAL_BUILDS_DIR
118-
- $RUN_CMD -n 20 drm $CI_BUILD_DIR/..
120+
- $RUN_CMD -n $NPROC drm $CI_BUILD_DIR/..
119121
interruptible: true
120122

121123
# ------------------------------------------------------------------------------
122124
# Shared TPL scripts.
123125
# ------------------------------------------------------------------------------
124126

127+
# Updates the TPLs in the upstream. Adding update-tpls to commit message will trigger this
125128
.update_tpls:
126129
variables:
127130
GIT_STRATEGY: clone
128131
GIT_SUBMODULE_STRATEGY: recursive
129132
stage: update_tpls
130133
rules:
131134
- !reference [.merge_pr_rule, rules]
135+
- if: '$CI_COMMIT_MESSAGE =~ /update-tpls/'
132136
script:
133137
- ./$SCRIPT_DIR/devtools/tpl-manager.py --update-upstream
134138

@@ -138,6 +142,7 @@
138142
GIT_STRATEGY: none
139143
rules:
140144
- !reference [.merge_pr_rule, rules]
145+
- if: '$CI_COMMIT_MESSAGE =~ /update-tpls/'
141146
script:
142147
- ml load mpifileutils
143148
- $RUN_CMD -n $NPROC dchmod --mode go+rx $UPSTREAM_DIR
@@ -204,7 +209,7 @@
204209
- env INSTALL_DIR=$INSTALL_DIR DEV_PKG_SPEC=$DEV_PKG_SPEC BUILD_ALLOC="" SCRIPT_DIR=$SCRIPT_DIR
205210
bash ./$SCRIPT_DIR/lc/install-from-dev-pkg.sh
206211
- ml load mpifileutils
207-
- dchmod --mode go+rx $INSTALL_DIR
212+
- $RUN_CMD -n $NPROC dchmod --mode go+rx $INSTALL_DIR
208213

209214
artifacts:
210215
paths:
@@ -243,12 +248,14 @@
243248
dependencies: []
244249
script:
245250
- cd $SPHERAL_BUILDS_DIR
246-
- MAX_DIR=30
247-
- DIR_LIST=$(ls -ltd * | sed "1, $MAX_DIR d" | rev | cut -d ' ' -f1 | rev | paste -sd ' ' - )
248-
- echo $DIR_LIST
249251
- ml load mpifileutils
250-
- if [[ $DIR_LIST ]]; then $RUN_CMD -n $NPROC drm $DIR_LIST; else echo "No directories to remove at this time."; fi
252+
- |
253+
find . -mindepth 1 -maxdepth 1 -type d -mtime +15 -print0 \
254+
| while IFS= read -r -d '' dir; do
255+
$RUN_CMD -n $NPROC drm "$dir"
256+
done
251257
258+
# Remove performance benchmarks that are older than 6 months
252259
.clean_old_perfs:
253260
stage: cleanup
254261
variables:
@@ -260,9 +267,14 @@
260267
dependencies: []
261268
script:
262269
- BENCHMARK_LOC=$(python3 $SCRIPT_DIR/spheral_ats.py --get-benchmark)
263-
- ml load mpifileutils
264270
- cd $BENCHMARK_LOC
265-
- env TARGET_DIR=$BENCHMARK_LOC bash ./$SCRIPT_DIR/lc/cleanup_files
271+
- ml load mpifileutils
272+
- |
273+
find . -mindepth 2 -type d -mtime +200 -print0 \
274+
| while IFS= read -r -d '' dir; do
275+
echo "Removing $dir"
276+
$RUN_CMD -n $NPROC drm "$dir"
277+
done
266278
267279
# ------------------------------------------------------------------------------
268280
# Script Utilities
@@ -273,6 +285,7 @@
273285
- if: '$CI_COMMIT_REF_NAME == "develop"'
274286
when: always
275287

288+
# Adding test-prod to commit message triggers jobs that rely on this rule
276289
.tag_release_rule:
277290
rules:
278291
- if: $CI_COMMIT_TAG

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project(spheral LANGUAGES C CXX Fortran VERSION ${SPHERAL_VERSION})
66

77
set(SPHERAL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to Spheral source directory")
88
set(SPHERAL_BINARY_DIR ${CMAKE_BINARY_DIR})
9-
set(SPHERAL_TEST_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/tests)
9+
set(SPHERAL_TEST_INSTALL_PREFIX tests)
1010

1111
include(cmake/SetupSpheral.cmake)
1212

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ RUN apt-get update -y && \
6060
python3-dev \
6161
python3-venv \
6262
python3-pip \
63+
python3-tk \
6364
unzip \
6465
libtool \
6566
wget \

RELEASE_NOTES.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,33 @@ Notable changes include:
77
* New features / API changes:
88
* Added view class for PairwiseField (PairwiseFieldView).
99
* Refactored use of pair-wise fields in hydro packages to avoid using pointers and allow empty PairwiseFields.
10-
* Bin files in install (bin/spheral and bin/spheral-ats) now use relative paths instead of being configured for one specific path. This allows installs to be relocatable.
10+
* Bin files in install (bin/spheral and bin/spheral-ats) now use relative paths instead of being configured for one specific path.
1111

12-
* Bug fixes
12+
* Bug fixes:
13+
* Adiak memory leak is fixed by calling adiak::clean() before exit.
14+
* Performance tests no longer import from Spheral proper but only rely on SpheralConfigs.py.
1315

1416
* Build changes / improvements:
1517
* Updated to PYB11Generator 2025.12.1.
1618
* Converted all Spheral Python modules to be submodules of a single PYB11Generator module (SpheralCompiledModules).
1719
For users importing from the master Spheral.py file (or it's dimensional specialization) this change is hidden,
1820
so there is no user interface impact.
21+
* Added update-tpls commit message trigger.
22+
* Spheral mpi python interface ensures proper allocation calls are used on Flux machines to avoid strange hangs that can occur if running outside of allocations.
1923
* Performance testing and CI improvements:
24+
* Structure for performance tests is different, with the tests themselves set in a perf_tests.py file and run_perf.py runs the perf tests using ATS.
2025
* The cleanup old directories job is now a scheduled pipelines that runs weekly.
21-
* The performance tests and deploy jobs are now scheduled pipelines that run nightly.
26+
* The performance tests and deploy jobs are now scheduled pipelines that run on a schedule.
2227
* Gitlab pages now uses Plotly for interactive visualizations.
2328
* Gathering of performance data for the deploy stage is now parallelized over ranks and threads.
24-
* Merges to develop will copy installs to a shared directory for use by the performance testing scripts.
25-
* Updated build system support spack v1
26-
* Updated TPL Manager to support spack v1.1.0
27-
* Updated CI to support python v3.12 and Ubuntu 24.04
29+
* Merges to develop will create installs to a shared directory for use by the performance testing scripts.
30+
* Builds and installs are cleaner:
31+
* Rpaths are no longer overwritten, allowing things set in the Spack host config file to be used.
32+
* Spheral libraries are only installed once now and a Spheral.pth with a relative path to the install lib is used in the virtual python environment.
33+
* Updated build system support spack v1.
34+
* Updated TPL Manager to support spack v1.1.0.
35+
* Updated CI to support python v3.12 and Ubuntu 24.04.
36+
* Added actual Spheral release versions and TPL conditions to Spheral package.
2837

2938
Version v2025.12.0 -- Release date 2025-12-19
3039
==============================================

cmake/InstallTPLs.cmake

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,13 @@ if(POLYTOPE_FOUND)
124124
# Install Polytope python library to our site-packages
125125
if (SPHERAL_ENABLE_PYTHON)
126126
install(FILES ${POLYTOPE_INSTALL_PREFIX}/${POLYTOPE_SITE_PACKAGES_PATH}/polytope.so
127-
DESTINATION ${CMAKE_INSTALL_PREFIX}/.venv/${SPHERAL_SITE_PACKAGES_PATH}/polytope/
127+
DESTINATION .venv/${SPHERAL_SITE_PACKAGES_PATH}/polytope/
128128
)
129+
configure_file(
130+
${POLYTOPE_INSTALL_PREFIX}/${SPHERAL_SITE_PACKAGES_PATH}/polytope/polytope.so
131+
${CMAKE_BINARY_DIR}/.venv/${SPHERAL_SITE_PACKAGES_PATH}/polytope/polytope.so
132+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
133+
COPYONLY)
129134
if (NOT EXISTS ${POLYTOPE_INSTALL_PREFIX}/${POLYTOPE_SITE_PACKAGES_PATH}/polytope.so)
130135
message(FATAL_ERROR
131136
"${POLYTOPE_INSTALL_PREFIX}/${POLYTOPE_SITE_PACKAGES_PATH}/polytope.so not found")
@@ -245,15 +250,3 @@ blt_convert_to_system_includes(TARGETS "${SPHERAL_BLT_DEPENDS}")
245250
if (EXISTS ${EXTERNAL_SPHERAL_TPL_CMAKE})
246251
include(${EXTERNAL_SPHERAL_TPL_CMAKE})
247252
endif()
248-
249-
if (SPHERAL_ENABLE_PYTHON)
250-
configure_file(
251-
${POLYTOPE_INSTALL_PREFIX}/${SPHERAL_SITE_PACKAGES_PATH}/polytope/polytope.so
252-
${CMAKE_BINARY_DIR}/.venv/${SPHERAL_SITE_PACKAGES_PATH}/polytope/polytope.so
253-
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
254-
COPYONLY)
255-
256-
install(FILES ${POLYTOPE_INSTALL_PREFIX}/${SPHERAL_SITE_PACKAGES_PATH}/polytope/polytope.so
257-
DESTINATION ${CMAKE_INSTALL_PREFIX}/.venv/${SPHERAL_SITE_PACKAGES_PATH}/polytope/
258-
)
259-
endif()

cmake/SetupSpheral.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ set(CMAKE_SKIP_BUILD_RPATH FALSE)
137137
# (but later on when installing)
138138
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
139139

140-
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
140+
list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
141141

142142
# add the automatically determined parts of the RPATH
143143
# which point to directories outside the build tree to the install RPATH

cmake/spheral/SpheralAddLibs.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ function(spheral_add_cxx_library package_name _cxx_obj_list)
139139

140140
# Export Spheral target
141141
install(EXPORT ${export_target_name} DESTINATION lib/cmake)
142-
143-
# Set the r-path of the C++ lib such that it is independent of the build dir when installed
144-
set_target_properties(Spheral_${package_name} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
145142
endfunction()
146143

147144
#----------------------------------------------------------------------------------------
@@ -286,7 +283,4 @@ function(spheral_add_pybind11_library package_name module_list_name)
286283

287284
set_property(GLOBAL APPEND PROPERTY ${module_list_name} ${package_name})
288285

289-
# Set the r-path of the C++ lib such that it is independent of the build dir when installed
290-
set_target_properties(${MODULE_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
291-
292286
endfunction()

0 commit comments

Comments
 (0)