Skip to content

Commit

Permalink
Merge pull request #7508 from bartlettroscoe/7376-build-stats (#7376)
Browse files Browse the repository at this point in the history
Build stats compiler wrappers and summary (#7376, CDOFA-119)
  • Loading branch information
bartlettroscoe authored Dec 10, 2020
2 parents 543f0f8 + afca3be commit 2b90697
Show file tree
Hide file tree
Showing 38 changed files with 2,107 additions and 179 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ SET(${PROJECT_NAME}_EXCLUDE_DISABLED_SUBPACKAGES_FROM_DISTRIBUTION_DEFAULT FALSE
# Do all of the processing for this Tribits project
TRIBITS_PROJECT()

INSTALL_BUILD_STATS_SCRIPTS()

# Install TriBITS so that other projects can use it.
ADVANCED_SET(${PROJECT_NAME}_INSTALL_TriBITS ON CACHE BOOL
"If ture, install TriBITS into <lib-install-dir>/cmake/tribits/")
Expand Down
1 change: 1 addition & 0 deletions PackagesList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ TRIBITS_REPOSITORY_DEFINE_PACKAGES(
TrilinosCouplings packages/trilinoscouplings PT
Pike packages/pike PT
xSDKTrilinos packages/xSDKTrilinos ST
TrilinosBuildStats commonTools/build_stats PT
)

# Allow builds even if some packages are missing
Expand Down
10 changes: 10 additions & 0 deletions cmake/CallbackSetupExtraOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ MACRO(TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS)
SET(TRILINOS_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})

ENDMACRO()


#
# Set up for build stats
#

include("${Trilinos_SOURCE_DIR}/commonTools/build_stats/BuildStatsWrappers.cmake")
generate_build_stats_wrappers()
remove_build_stats_file_on_configure()
remove_build_stats_timing_files_on_fresh_configure()
14 changes: 14 additions & 0 deletions cmake/RepositoryDependenciesSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,17 @@ IF(KDD_INT_LONG OR KDD_INT_LONG_LONG OR KDD_INT_UNSIGNED)
ENDIF()
ENDIF()

# Enable Build Status package and enable reporting the reporting test

set(bulidStats "${${PROJECT_NAME}_ENABLE_BUILD_STATS}")
if (
bulidStats
AND
("${${PROJECT_NAME}_ENABLE_TrilinosBuildStats}" STREQUAL "")
)
message("-- " "Setting ${PROJECT_NAME}_ENABLE_TrilinosBuildStats=ON"
" by default because"
" ${PROJECT_NAME}_ENABLE_BUILD_STATS=${bulidStats}"
)
set(${PROJECT_NAME}_ENABLE_TrilinosBuildStats ON)
endif()
7 changes: 7 additions & 0 deletions cmake/ctest/drivers/atdm/ats1/local-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ if [ "${SBATCH_TEST_TIME_LIMIT_MINUTES}" == "" ] ; then
export SBATCH_TEST_TIME_LIMIT_MINUTES=780 # Default 13 hour time limit
fi

if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] && \
[[ ! $JOB_NAME == *"intel"* ]] \
; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi
echo "Trilinos_ENABLE_BUILD_STATS='${Trilinos_ENABLE_BUILD_STATS}'"

# Load environment on the login node
source $WORKSPACE/Trilinos/cmake/std/atdm/load-env.sh $JOB_NAME

Expand Down
4 changes: 4 additions & 0 deletions cmake/ctest/drivers/atdm/ats2/local-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set +x

if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] ; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi

# Need to load env so we define some vars
source $WORKSPACE/Trilinos/cmake/std/atdm/load-env.sh $JOB_NAME

Expand Down
7 changes: 7 additions & 0 deletions cmake/ctest/drivers/atdm/cee-rhel6/local-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ set +x
# Need to load env so we define some vars
source $WORKSPACE/Trilinos/cmake/std/atdm/load-env.sh $JOB_NAME

if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] && \
[[ ! $JOB_NAME == *"intel"* ]] \
; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi
echo "Trilinos_ENABLE_BUILD_STATS='${Trilinos_ENABLE_BUILD_STATS}'"

# Make adjustments for mini build of Trilinos for SPARC
if atdm_match_buildname_keyword mini ; then
echo "This is a mini build of Trilinos for SPARC!"
Expand Down
14 changes: 12 additions & 2 deletions cmake/ctest/drivers/atdm/cts1/local-driver.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
#!/bin/bash -l

set +x

if [ "${SLURM_CTEST_TIMEOUT}" == "" ] ; then
SLURM_CTEST_TIMEOUT=1:20:00
# This is just running tests, not the entire build!
fi

if [ "${Trilinos_CTEST_DO_ALL_AT_ONCE}" == "" ] ; then
export Trilinos_CTEST_DO_ALL_AT_ONCE=TRUE
if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] && \
[[ ! $JOB_NAME == *"intel"* ]] \
; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi
echo "Trilinos_ENABLE_BUILD_STATS='${Trilinos_ENABLE_BUILD_STATS}'"
# NOTE: That above matching is a bit fragile but it avoids needing to load a
# full env and it is good enough for driving nightly builds. (I would never
# do this with a build name coming from a user.)

set -x

source $WORKSPACE/Trilinos/cmake/ctest/drivers/atdm/ctest-s-driver-config-build.sh

set -x

if [[ "${CTEST_DO_TEST}" != "OFF" ]] ; then
atdm_run_script_on_compute_node \
$WORKSPACE/Trilinos/cmake/ctest/drivers/atdm/ctest-s-driver-test.sh \
$PWD/ctest-s-driver-test.out \
${SLURM_CTEST_TIMEOUT}
fi # CTEST_DO_TEST
11 changes: 7 additions & 4 deletions cmake/ctest/drivers/atdm/ride/local-driver.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/bash -l

set +x

if [ "${BSUB_CTEST_TIME_LIMIT}" == "" ] ; then
export BSUB_CTEST_TIME_LIMIT=12:00
fi

if [ "${Trilinos_CTEST_DO_ALL_AT_ONCE}" == "" ] ; then
export Trilinos_CTEST_DO_ALL_AT_ONCE=TRUE
fi

if [ "${EXCLUDE_NODES_FROM_BSUB}" == "" ] ; then
if [ "${ATDM_CONFIG_CDASH_HOSTNAME}" == "white" ] ; then
EXCLUDE_NODES_FROM_BSUB="-R hname!=white26&&hname!=white27"
fi
fi

if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] ; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi
echo "Trilinos_ENABLE_BUILD_STATS='${Trilinos_ENABLE_BUILD_STATS}'"

source $WORKSPACE/Trilinos/cmake/std/atdm/load-env.sh $JOB_NAME

set -x
Expand Down
8 changes: 4 additions & 4 deletions cmake/ctest/drivers/atdm/sems-rhel6/local-driver.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash -l

if [ "${Trilinos_CTEST_DO_ALL_AT_ONCE}" == "" ] ; then
export Trilinos_CTEST_DO_ALL_AT_ONCE=TRUE
fi
set +x

set -x
if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] ; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi

$WORKSPACE/Trilinos/cmake/ctest/drivers/atdm/ctest-s-driver.sh
8 changes: 4 additions & 4 deletions cmake/ctest/drivers/atdm/sems-rhel7/local-driver.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash -l

if [ "${Trilinos_CTEST_DO_ALL_AT_ONCE}" == "" ] ; then
export Trilinos_CTEST_DO_ALL_AT_ONCE=TRUE
fi
set +x

set -x
if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] ; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi

$WORKSPACE/Trilinos/cmake/ctest/drivers/atdm/ctest-s-driver.sh
3 changes: 3 additions & 0 deletions cmake/ctest/drivers/atdm/utils/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ echo
echo "ATDM config env vars:"
set | grep ATDM_CONFIG_
echo
echo "OpenMP env vars:"
set | grep ^OMP_
echo
echo "PATH=$PATH"

#
Expand Down
4 changes: 4 additions & 0 deletions cmake/ctest/drivers/atdm/van1-tx2/local-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if [[ "${SALLOC_CTEST_LIMIT_MINUTES}" == "" ]] ; then
# do everything.
fi

if [[ "${Trilinos_ENABLE_BUILD_STATS}" == "" ]] ; then
export Trilinos_ENABLE_BUILD_STATS=ON
fi

source $WORKSPACE/Trilinos/cmake/std/atdm/load-env.sh $JOB_NAME
echo

Expand Down
4 changes: 4 additions & 0 deletions cmake/std/PullRequestLinuxCommonTestingSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,7 @@ SET(SuperLU_LIBRARY_DIRS "$ENV{SEMS_SUPERLU_LIBRARY_PATH}" CACHE PATH "Set by de

set (TPL_Scotch_INCLUDE_DIRS "$ENV{SEMS_SCOTCH_INCLUDE_PATH}" CACHE PATH "Set by default for PR testing")
set (Scotch_LIBRARY_DIRS "$ENV{SEMS_SCOTCH_LIBRARY_PATH}" CACHE PATH "Set by default for PR testing")

# Build stats compiler wrappers (#7376)
set(Trilinos_ENABLE_BUILD_STATS OFF CACHE BOOL "Set in PullRequestLinuxCommonTestingSettings.cmake")
# Turn them off for now in all PR builds until more review can be done.
4 changes: 3 additions & 1 deletion cmake/std/PullRequestLinuxPython2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ set (TPL_ENABLE_Netcdf OFF CACHE BOOL "Set by default for PR testing")
set (TPL_ENABLE_SuperLU OFF CACHE BOOL "Set by default for PR testing")
set (TPL_ENABLE_Scotch OFF CACHE BOOL "Set by default for PR testing")

include("${CMAKE_CURRENT_LIST_DIR}/PullRequestLinuxCommonTestingSettings.cmake")
# No build stats for Python-only PR (#7376)
set(Trilinos_ENABLE_BUILD_STATS OFF CACHE BOOL "Set in PullRequestLinuxPython2.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/PullRequestLinuxCommonTestingSettings.cmake")
3 changes: 3 additions & 0 deletions cmake/std/PullRequestLinuxPython3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ set (TPL_ENABLE_Netcdf OFF CACHE BOOL "Set by default for PR testing")
set (TPL_ENABLE_SuperLU OFF CACHE BOOL "Set by default for PR testing")
set (TPL_ENABLE_Scotch OFF CACHE BOOL "Set by default for PR testing")

# No build stats for Python-only PR (#7376)
set(Trilinos_ENABLE_BUILD_STATS OFF CACHE BOOL "Set in PullRequestLinuxPython3.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/PullRequestLinuxCommonTestingSettings.cmake")

9 changes: 8 additions & 1 deletion cmake/tribits/ci_support/CDashQueryAnalyzeReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def readCsvFileIntoListOfDicts(csvFileName, requiredColumnHeadersList=[],

def getColumnHeadersFromCsvFileReader(csvFileName, csvReader):
try:
columnHeadersList = csvReader.next()
columnHeadersList = csvReaderNext(csvReader)
stripWhiltespaceFromStrList(columnHeadersList)
return columnHeadersList
except StopIteration:
Expand All @@ -513,6 +513,13 @@ def getColumnHeadersFromCsvFileReader(csvFileName, csvReader):
)


def csvReaderNext(csvReader):
if sys.version_info < (3,):
return csvReader.next()
else:
return next(csvReader)


def assertExpectedColumnHeadersFromCsvFile(csvFileName, requiredColumnHeadersList,
optionalColumnHeadersList, columnHeadersList,
):
Expand Down
2 changes: 2 additions & 0 deletions cmake/tribits/python_utils/GeneralScriptSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ def runSysCmndInterface(cmnd, outFile=None, rtnOutput=False, extraEnv=None, \
child = subprocess.Popen(cmnd, shell=True, stdout=subprocess.PIPE,
env=fullEnv)
data = child.stdout.read()
child.stdout.close()
#print("data = '" + str(data) + "'")
child.wait()
rtnCode = child.returncode
Expand All @@ -427,6 +428,7 @@ def runSysCmndInterface(cmnd, outFile=None, rtnOutput=False, extraEnv=None, \
outFileHandle = open(outFile, 'w')
rtnCode = subprocess.call(cmnd, shell=True, stderr=subprocess.STDOUT,
stdout=outFileHandle, env=fullEnv)
if outFileHandle: outFileHandle.close()
rtnObject = rtnCode
finally:
if pwd: os.chdir(pwd)
Expand Down
Loading

0 comments on commit 2b90697

Please sign in to comment.