Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitlab/utils/run-experiment.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

TEST_RUNTIME_FILE="${CI_PROJECT_DIR:-$(pwd)}/.gitlab_test_runtime_seconds"

# Activate Virtual Environment
. /usr/workspace/benchpark-dev/benchpark-venv/$SYS_TYPE/bin/activate

Expand Down Expand Up @@ -44,8 +46,12 @@ if [ "$HOST" == "dane" ] && \
find . -type f -name execute_experiment -exec sed -i 's/\bsrun\b/flux run --exclusive/g' {} +
fi

# Runs experiments where n_nodes == 1, and Print Log
# Runs experiments where n_nodes == 1
rm -f "${TEST_RUNTIME_FILE}"
SECONDS=0
ramble --disable-logger --workspace-dir . on --executor '{execute_experiment}' --where '{n_nodes} == 1'
printf '%s\n' "$SECONDS" > "${TEST_RUNTIME_FILE}"
# Print Log
find experiments/ -type f -name "*.out" -exec cat {} +
# Fail if log files are empty or don't exist
find experiments/ -type f -name "*.out" | grep -q . || { echo "No .out files found"; exit 1; }; find experiments/ -type f -name "*.out" -empty -print -quit | grep -q . && { echo "Empty .out file found"; exit 1; }
Expand Down
7 changes: 6 additions & 1 deletion .gitlab/utils/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
fi
- |
if [[ $RUN_CTEST == "true" ]]; then
TEST_RUNTIME_SECONDS=""
if [[ -f .gitlab_test_runtime_seconds ]]; then
TEST_RUNTIME_SECONDS=$(cat .gitlab_test_runtime_seconds)
fi
# associative array (Bash 4+)
declare -A DASHBOARD_NAMES
# Map cluster names to their full dashboard names
Expand All @@ -50,7 +54,8 @@
-DDASHBOARD_NAME="${DASHBOARD_NAME}" \
-DBUILD_NAME="${BENCHMARK}${BV} ${VARIANT} ${SYSTEM_ARGS}" \
-DSITE="$(hostname)" \
-DTEST_TYPE="${TEST_TYPE}"
-DTEST_TYPE="${TEST_TYPE}" \
-DTEST_RUNTIME_SECONDS="${TEST_RUNTIME_SECONDS}"
else
echo "Skipping ctest execution due to CI_JOB_STATUS=$CI_JOB_STATUS"
fi
Expand Down
17 changes: 17 additions & 0 deletions CTestGitlab.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ ctest_update()
ctest_configure()
ctest_test(INCLUDE "Gitlab")

if(DEFINED TEST_RUNTIME_SECONDS AND NOT "${TEST_RUNTIME_SECONDS}" STREQUAL "")
file(READ "${CTEST_BINARY_DIRECTORY}/Testing/TAG" _tag_file)
string(REGEX MATCH "^[^\n]+" _tag "${_tag_file}")
set(_test_xml "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}/Test.xml")

if(EXISTS "${_test_xml}")
file(READ "${_test_xml}" _xml)
string(REGEX REPLACE
"<NamedMeasurement type=\"numeric/double\" name=\"Execution Time\">[ \t\r\n]*<Value>[^<]+</Value>"
"<NamedMeasurement type=\"numeric/double\" name=\"Execution Time\">\n\t\t\t\t\t<Value>${TEST_RUNTIME_SECONDS}</Value>"
_xml
"${_xml}"
)
file(WRITE "${_test_xml}" "${_xml}")
endif()
endif()

# Submit results to CDash only for Nightly runs.
if ("${TEST_TYPE}" STREQUAL "Nightly")
ctest_submit(
Expand Down
Loading