Skip to content

Commit

Permalink
Merge Pull Request #13363 from trilinos/Trilinos/master_merge_2024081…
Browse files Browse the repository at this point in the history
…6_175818

Automatically Merged using Trilinos Master Merge AutoTester
PR Title: b'Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20240816_175818 branch to master'
PR Author: trilinos-autotester
  • Loading branch information
trilinos-autotester authored Aug 17, 2024
2 parents 26e307f + 3ef94db commit bf922e7
Show file tree
Hide file tree
Showing 2,837 changed files with 94,836 additions and 142,462 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: DoozyX/clang-format-lint-action@11b773b1598aa4ae3b32f023701bca5201c3817d # v0.17
- uses: DoozyX/clang-format-lint-action@d7f6a5bada32b7ea520b5918416e92997678e3fd # v0.18
with:
source: './packages/muelu ./packages/tempus ./packages/teko ./packages/xpetra'
exclude: './packages/tempus/examples'
Expand All @@ -22,7 +22,7 @@ jobs:
- run: git diff HEAD > format_patch.txt
- run: if [ "$(cat format_patch.txt)" == "" ] ; then rm format_patch.txt ; else cat format_patch.txt; fi

- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
id: upload-artf
if: ${{ hashFiles('format_patch.txt') != '' }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand All @@ -85,6 +85,6 @@ jobs:
make -j 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
sarif_file: results.sarif
65 changes: 46 additions & 19 deletions packages/amesos2/example/SimpleSolve_File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,21 @@ int main(int argc, char *argv[]) {

bool printMatrix = false;
bool printSolution = false;
bool checkSolution = false;
bool printTiming = false;
bool allprint = false;
bool verbose = (myRank==0);
std::string filename("arc130.mtx");
std::string mat_filename("arc130.mtx");
std::string rhs_filename("");
std::string solvername("Superlu");
Teuchos::CommandLineProcessor cmdp(false,true);
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
cmdp.setOption("filename",&filename,"Filename for Matrix-Market test matrix.");
cmdp.setOption("filename",&mat_filename,"Filename for Matrix-Market test matrix.");
cmdp.setOption("rhs_filename",&rhs_filename,"Filename for Matrix-Market right-hand-side.");
cmdp.setOption("solvername",&solvername,"Name of solver.");
cmdp.setOption("print-matrix","no-print-matrix",&printMatrix,"Print the full matrix after reading it.");
cmdp.setOption("print-solution","no-print-solution",&printSolution,"Print solution vector after solve.");
cmdp.setOption("check-solution","no-check-solution",&checkSolution,"Check solution vector after solve.");
cmdp.setOption("print-timing","no-print-timing",&printTiming,"Print solver timing statistics");
cmdp.setOption("all-print","root-print",&allprint,"All processors print to out");
if (cmdp.parse(argc,argv) != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL) {
Expand All @@ -76,7 +82,7 @@ int main(int argc, char *argv[]) {

const size_t numVectors = 1;

RCP<MAT> A = Tpetra::MatrixMarket::Reader<MAT>::readSparseFile(filename, comm);
RCP<MAT> A = Tpetra::MatrixMarket::Reader<MAT>::readSparseFile(mat_filename, comm);
if( printMatrix ){
A->describe(*fos, Teuchos::VERB_EXTREME);
}
Expand All @@ -98,29 +104,32 @@ int main(int argc, char *argv[]) {
RCP<MV> X = rcp(new MV(dmnmap,numVectors));
X->randomize();

/* Create B
*
* Use RHS:
*
* [[10]
* [10]
* [10]
* [10]
* [10]
* [10]]
*/
// Create B
RCP<MV> B = rcp(new MV(rngmap,numVectors));
B->putScalar(10);

if (rhs_filename == "") {
/*
* Use RHS:
*
* [[10]
* [10]
* [10]
* [10]
* [10]
* [10]]
*/
B->putScalar(10);
} else {
B = Tpetra::MatrixMarket::Reader<MAT>::readDenseFile (rhs_filename, comm, rngmap);
}

// Constructor from Factory
RCP<Amesos2::Solver<MAT,MV> > solver;
if( !Amesos2::query("Superlu") ){
*fos << "SuperLU solver not enabled. Exiting..." << std::endl;
if( !Amesos2::query(solvername) ){
*fos << solvername << " solver not enabled. Exiting..." << std::endl;
return EXIT_SUCCESS;
}

solver = Amesos2::create<MAT,MV>("Superlu", A, X, B);
solver = Amesos2::create<MAT,MV>(solvername, A, X, B);

solver->symbolicFactorization().numericFactorization().solve();

Expand All @@ -140,6 +149,24 @@ int main(int argc, char *argv[]) {
}
}

if( checkSolution ){
const Scalar one = Teuchos::ScalarTraits<Scalar>::one ();
RCP<MV> R = rcp(new MV(rngmap,numVectors));
A->apply(*X, *R);
R->update(one, *B, -one);
for (size_t j = 0; j < numVectors; ++j) {
auto Rj = R->getVector(j);
auto Bj = B->getVector(j);
auto r_norm = Rj->norm2();
auto b_norm = Bj->norm2();
if (myRank == 0) {
*fos << "Relative Residual norm = " << r_norm << " / " << b_norm << " = "
<< r_norm / b_norm << std::endl;
}
}
if (myRank == 0) *fos << std::endl;
}

if( printTiming ){
// Print some timing statistics
solver->printTiming(*fos);
Expand Down
14 changes: 11 additions & 3 deletions packages/framework/get_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function tril_genconfig_assert_pwd_is_git_repo() {
fi
}

function retry_command() {
cmd=$1
${cmd} || { echo "Retrying after 1m..." ; sleep 60 ; ${cmd} ; } || { echo "Retrying after 5m..." ; sleep 300 ; ${cmd} ; }
}

function tril_genconfig_clone_or_update_repo() {
git_url=$1
sub_dir=$2
Expand All @@ -33,10 +38,12 @@ function tril_genconfig_clone_or_update_repo() {
echo "STATUS: ${sub_dir}: Fetching remote repo"
cd ${sub_dir}
tril_genconfig_assert_pwd_is_git_repo
git fetch
cmd="git fetch"
retry_command "${cmd}"
else
echo "STATUS: ${sub_dir}: Cloning from '${git_url}'"
git clone ${git_url} ${sub_dir}
cmd="git clone ${git_url} ${sub_dir}"
retry_command "${cmd}"
cd ${sub_dir}
fi

Expand All @@ -52,7 +59,8 @@ function tril_genconfig_clone_or_update_repo() {
if [[ "${has_submodules}" == "has-submodules" ]] ; then
echo
echo "STATUS: ${sub_dir}: Update submodules"
git submodule update --force --init --recursive
cmd="git submodule update --force --init --recursive"
retry_command "${cmd}"
cd - > /dev/null
elif [[ "${has_submodules}" != "" ]] ; then
echo "ERROR: argument '${has_submodules}' not allowed! Only 'has-submodules' or ''!"
Expand Down
2 changes: 1 addition & 1 deletion packages/ifpack2/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SET(LIB_REQUIRED_DEP_PACKAGES Belos Teuchos Tpetra KokkosKernels)
SET(LIB_OPTIONAL_DEP_PACKAGES Xpetra Zoltan2Core ThyraTpetraAdapters Amesos2 ShyLU_NodeBasker ShyLU_NodeHTS ShyLU_NodeFastILU)
SET(TEST_REQUIRED_DEP_PACKAGES Belos Galeri)
SET(TEST_OPTIONAL_DEP_PACKAGES Amesos2 ShyLU_NodeHTS ML AztecOO Epetra)
SET(TEST_OPTIONAL_DEP_PACKAGES Amesos2 ShyLU_NodeHTS ML AztecOO Epetra Zoltan2Core)
SET(LIB_REQUIRED_DEP_TPLS)
SET(LIB_OPTIONAL_DEP_TPLS HYPRE Cholmod Lemon METIS MPI)
SET(TEST_REQUIRED_DEP_TPLS)
Expand Down
6 changes: 3 additions & 3 deletions packages/ifpack2/src/Ifpack2_BlockComputeResidualVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ namespace Ifpack2 {
const MultiVectorLocalViewTypeB &b_,
const MultiVectorLocalViewTypeX &x_) {
IFPACK2_BLOCKHELPER_PROFILER_REGION_BEGIN;
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::ComputeResidual::<SeqTag>");
IFPACK2_BLOCKHELPER_TIMER_WITH_FENCE("BlockTriDi::ComputeResidual::<SeqTag>", ComputeResidual0, execution_space);

y = y_; b = b_; x = x_;
if constexpr (is_device<execution_space>::value) {
Expand Down Expand Up @@ -818,7 +818,7 @@ namespace Ifpack2 {
const MultiVectorLocalViewTypeX &x_,
const MultiVectorLocalViewTypeX_Remote &x_remote_) {
IFPACK2_BLOCKHELPER_PROFILER_REGION_BEGIN;
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::ComputeResidual::<AsyncTag>");
IFPACK2_BLOCKHELPER_TIMER_WITH_FENCE("BlockTriDi::ComputeResidual::<AsyncTag>", ComputeResidual0, execution_space);

b = b_; x = x_; x_remote = x_remote_;
if constexpr (is_device<execution_space>::value) {
Expand Down Expand Up @@ -892,7 +892,7 @@ namespace Ifpack2 {
const MultiVectorLocalViewTypeX_Remote &x_remote_,
const bool compute_owned) {
IFPACK2_BLOCKHELPER_PROFILER_REGION_BEGIN;
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::ComputeResidual::<OverlapTag>");
IFPACK2_BLOCKHELPER_TIMER_WITH_FENCE("BlockTriDi::ComputeResidual::<OverlapTag>", ComputeResidual0, execution_space);

b = b_; x = x_; x_remote = x_remote_;
if constexpr (is_device<execution_space>::value) {
Expand Down
16 changes: 4 additions & 12 deletions packages/ifpack2/src/Ifpack2_BlockHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef IFPACK2_BLOCKHELPER_IMPL_HPP
#define IFPACK2_BLOCKHELPER_IMPL_HPP

#include "Ifpack2_BlockHelper_Timers.hpp"

namespace Ifpack2 {

Expand Down Expand Up @@ -155,15 +156,6 @@ namespace Ifpack2 {
};
#endif


#if defined(HAVE_IFPACK2_BLOCKTRIDICONTAINER_TIMERS)
#define IFPACK2_BLOCKHELPER_TIMER(label) TEUCHOS_FUNC_TIME_MONITOR(label);
#define IFPACK2_BLOCKHELPER_TIMER_FENCE(execution_space) execution_space().fence();
#else
#define IFPACK2_BLOCKHELPER_TIMER(label)
#define IFPACK2_BLOCKHELPER_TIMER_FENCE(execution_space)
#endif

#if defined(KOKKOS_ENABLE_CUDA) && defined(IFPACK2_BLOCKHELPER_ENABLE_PROFILE)
#define IFPACK2_BLOCKHELPER_PROFILER_REGION_BEGIN \
KOKKOS_IMPL_CUDA_SAFE_CALL(cudaProfilerStart());
Expand Down Expand Up @@ -404,7 +396,7 @@ namespace Ifpack2 {
void ireduce(const int sweep, const bool force = false) {
if ( ! force && sweep % sweep_step_) return;

IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::NormManager::Ireduce");
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::NormManager::Ireduce", Ireduce);

work_[1] = work_[0];
#ifdef HAVE_IFPACK2_MPI
Expand Down Expand Up @@ -433,7 +425,7 @@ namespace Ifpack2 {
// early return
if (sweep <= 0) return false;

IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::NormManager::CheckDone");
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::NormManager::CheckDone", CheckDone);

TEUCHOS_ASSERT(sweep >= 1);
if ( ! force && (sweep - 1) % sweep_step_) return false;
Expand Down Expand Up @@ -481,7 +473,7 @@ namespace Ifpack2 {
void reduceVector(const ConstUnmanaged<typename BlockHelperDetails::ImplType<MatrixType>::impl_scalar_type_1d_view> zz,
/* */ typename BlockHelperDetails::ImplType<MatrixType>::magnitude_type *vals) {
IFPACK2_BLOCKHELPER_PROFILER_REGION_BEGIN;
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::ReduceVector");
IFPACK2_BLOCKHELPER_TIMER("BlockTriDi::ReduceVector", ReduceVector);

using impl_type = BlockHelperDetails::ImplType<MatrixType>;
using local_ordinal_type = typename impl_type::local_ordinal_type;
Expand Down
36 changes: 36 additions & 0 deletions packages/ifpack2/src/Ifpack2_BlockHelper_Timers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// @HEADER
// *****************************************************************************
// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
//
// Copyright 2009 NTESS and the Ifpack2 contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
// @HEADER

#ifndef IFPACK2_BLOCKHELPER_TIMERS_HPP
#define IFPACK2_BLOCKHELPER_TIMERS_HPP


namespace Ifpack2 {

namespace BlockHelperDetails {

#if defined(HAVE_IFPACK2_BLOCKTRIDICONTAINER_TIMERS)
#define IFPACK2_BLOCKHELPER_TIMER(label, varname) TEUCHOS_FUNC_TIME_MONITOR_DIFF(label, varname);
#define IFPACK2_BLOCKHELPER_TIMER_FENCE(execution_space) execution_space().fence();
#define IFPACK2_BLOCKHELPER_TIMER_DEFAULT_FENCE() Kokkos::DefaultExecutionSpace().fence();
#else
#define IFPACK2_BLOCKHELPER_TIMER(label, varname)
#define IFPACK2_BLOCKHELPER_TIMER_FENCE(execution_space)
#define IFPACK2_BLOCKHELPER_TIMER_DEFAULT_FENCE()
#endif

#define IFPACK2_BLOCKHELPER_TIMER_WITH_FENCE(label, varname, execution_space) \
IFPACK2_BLOCKHELPER_TIMER_FENCE(execution_space) \
IFPACK2_BLOCKHELPER_TIMER(label, varname)

} // namespace BlockHelperDetails

} // namespace Ifpack2

#endif
Loading

0 comments on commit bf922e7

Please sign in to comment.