Skip to content

Commit d7be11b

Browse files
Merge Pull Request #13858 from trilinos/Trilinos/master_merge_20250307_175820
Automatically Merged using Trilinos Master Merge AutoTester PR Title: b'Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20250307_175820 branch to master' PR Author: trilinos-autotester
2 parents 73510a0 + 75faeee commit d7be11b

File tree

977 files changed

+46983
-111628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

977 files changed

+46983
-111628
lines changed

.github/workflows/AT2.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
--num-concurrent-tests=16
113113
- name: Upload artifacts
114114
if: success() || failure()
115-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
115+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
116116
env:
117117
NODE_TLS_REJECT_UNAUTHORIZED: 0
118118
with:
@@ -215,7 +215,7 @@ jobs:
215215
--num-concurrent-tests=16
216216
- name: Upload artifacts
217217
if: success() || failure()
218-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
218+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
219219
env:
220220
NODE_TLS_REJECT_UNAUTHORIZED: 0
221221
with:
@@ -317,7 +317,7 @@ jobs:
317317
--slots-per-gpu=8
318318
- name: Upload artifacts
319319
if: success() || failure()
320-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
320+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
321321
env:
322322
NODE_TLS_REJECT_UNAUTHORIZED: 0
323323
with:
@@ -416,7 +416,7 @@ jobs:
416416
--skip-create-packageenables \
417417
- name: Upload artifacts
418418
if: success() || failure()
419-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
419+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
420420
env:
421421
NODE_TLS_REJECT_UNAUTHORIZED: 0
422422
with:

.github/workflows/spack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
spack develop --no-clone --path $GITHUB_WORKSPACE trilinos@develop
3434
spack add trilinos@develop
3535
spack concretize -f
36-
spack install --cdash-upload-url=https://sems-cdash-son.sandia.gov/cdash/submit.php?project=Trilinos -j16
36+
spack install --cdash-upload-url=https://sems-cdash-son.sandia.gov/cdash/submit.php?project=Trilinos --cdash-track='Pull Request' --cdash-build='PR-${{ github.event.pull_request.number }}-spack' -j16

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ PROJECT(${PROJECT_NAME} NONE)
1818
include("${CMAKE_CURRENT_LIST_DIR}/cmake/UseCCache.cmake")
1919

2020
set(DEPRECATED_PACKAGES Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils)
21+
FOREACH(package ${DEPRECATED_PACKAGES})
22+
set(${package}_DISABLE_STRONG_WARNINGS ON CACHE BOOL "Disable strong compile warnings for ${package}" FORCE)
23+
ENDFOREACH()
2124

2225
# Set an env so we know we are in configure
2326
set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1)

cmake/tribits/core/std_tpls/FindTPLMPI.cmake

+8-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ if(WIN32 AND TPL_ENABLE_MPI)
2020
global_set(TPL_MPI_LIBRARIES ${MPI_LIBRARIES})
2121
endif()
2222

23+
# Don't allow calling find_package(MPI) by default. Force the user to set
24+
# MPI_ALLOW_PACKAGE_PREFIND=TRUE or even MPI_FORCE_PRE_FIND_PACKAGE if then
25+
# want to force the finding of MPI using find_package(MPI).
26+
set(MPI_ALLOW_PACKAGE_PREFIND FALSE CACHE BOOL
27+
"Allow calling find_package(MPI) by default (default is FALSE)")
28+
2329
tribits_tpl_allow_pre_find_package(MPI MPI_ALLOW_PREFIND)
2430
if(MPI_ALLOW_PREFIND)
25-
2631
find_package(MPI)
27-
2832
if(MPI_C_FOUND AND MPI_CXX_FOUND)
2933
tribits_extpkg_create_imported_all_libs_target_and_config_file(
3034
MPI
@@ -35,7 +39,6 @@ endif()
3539

3640
if(NOT TARGET MPI::all_libs)
3741
tribits_tpl_find_include_dirs_and_libraries(MPI)
42+
# NOTE: Above, we need to generate the MPI::all_libs target and the
43+
# MPIConfig.cmake file that will also provide the MPI::all_libs target.
3844
endif()
39-
40-
# NOTE: Above, we need to generate the MPI::all_libs target and the
41-
# MPIConfig.cmake file that will also provide the MPI::all_libs target.

packages/amesos2/example/GappedMtxGIDs-1proc.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ using map_type = Tpetra::Map<>;
4949
using LO = map_type::local_ordinal_type;
5050
using GO = map_type::global_ordinal_type;
5151
using Scalar = double;
52-
using MAT = Tpetra::CrsMatrix<Scalar>;
53-
using MV = Tpetra::MultiVector<Scalar>;
52+
using MAT = Tpetra::CrsMatrix<Scalar,LO,GO>;
53+
using MV = Tpetra::MultiVector<Scalar,LO,GO>;
5454
using reader_type = Tpetra::MatrixMarket::Reader<MAT>;
5555

5656

@@ -81,13 +81,6 @@ int main(int argc, char *argv[]) {
8181
using Teuchos::tuple;
8282
using std::endl;
8383

84-
typedef double Scalar;
85-
typedef Tpetra::Map<>::local_ordinal_type LO;
86-
typedef Tpetra::Map<>::global_ordinal_type GO;
87-
88-
typedef Tpetra::CrsMatrix<Scalar,LO,GO> MAT;
89-
typedef Tpetra::MultiVector<Scalar,LO,GO> MV;
90-
9184
Tpetra::ScopeGuard tpetraScope(&argc,&argv);
9285
{
9386

packages/amesos2/example/SimpleSolve.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) {
120120
global_size_t nrows = 6;
121121
map = rcp( new MAP(nrows,0,comm) );
122122

123-
RCP<MAT> A = rcp( new MAT(map,3) ); // max of three entries in a row
123+
A = rcp( new MAT(map,3) ); // max of three entries in a row
124124

125125
/*
126126
* We will solve a system with a known solution, for which we will be using

packages/amesos2/example/SimpleSolve_File.cpp

+13-4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ int main(int argc, char *argv[]) {
6666

6767
Teuchos::oblackholestream blackhole;
6868

69+
size_t numVectors = 1;
6970
bool multi_solve = false;
7071
bool printMatrix = false;
7172
bool printSolution = false;
@@ -83,6 +84,7 @@ int main(int argc, char *argv[]) {
8384
Teuchos::CommandLineProcessor cmdp(false,true);
8485
cmdp.setOption("verbose","quiet",&verbose,"Print messages and results.");
8586
cmdp.setOption("filename",&mat_filename,"Filename for Matrix-Market test matrix.");
87+
cmdp.setOption("nrhs",&numVectors,"Number of right-hand-side vectors.");
8688
cmdp.setOption("rhs_filename",&rhs_filename,"Filename for Matrix-Market right-hand-side.");
8789
cmdp.setOption("solvername",&solvername,"Name of solver.");
8890
cmdp.setOption("xml_filename",&xml_filename,"XML Filename for Solver parameters.");
@@ -105,8 +107,6 @@ int main(int argc, char *argv[]) {
105107
// Say hello
106108
out << myRank << " : " << Amesos2::version() << " on " << comm->getSize() << " MPIs" << std::endl << std::endl;
107109

108-
const size_t numVectors = 1;
109-
110110
// Read matrix
111111
RCP<MAT> A = Tpetra::MatrixMarket::Reader<MAT>::readSparseFile(mat_filename, comm);
112112

@@ -132,11 +132,20 @@ int main(int argc, char *argv[]) {
132132
* [10]
133133
* [10]]
134134
*/
135-
B->putScalar(10);
135+
if (true) {
136+
X->putScalar(1);
137+
A->apply(*X, *B);
138+
} else {
139+
B->putScalar(10);
140+
}
136141
} else {
137142
B = Tpetra::MatrixMarket::Reader<MAT>::readDenseFile (rhs_filename, comm, rngmap);
143+
numVectors = B->getNumVectors();
138144
}
139145

146+
// Randomize X
147+
X->randomize();
148+
140149
if (useZoltan2 || useParMETIS) {
141150
#if defined(HAVE_AMESOS2_XPETRA) && defined(HAVE_AMESOS2_ZOLTAN2)
142151
// Specify partitioning parameters
@@ -196,7 +205,7 @@ int main(int argc, char *argv[]) {
196205
if( printMatrix ){
197206
A->describe(*fos, Teuchos::VERB_EXTREME);
198207
}
199-
else if( verbose ){
208+
else if( verbose && myRank == 0){
200209
std::cout << std::endl << A->description() << std::endl << std::endl;
201210
}
202211

packages/amesos2/src/Amesos2_EpetraCrsMatrix_MatrixAdapter_decl.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ namespace Amesos2 {
8686
// gather
8787
template<typename KV_S, typename KV_GO, typename KV_GS, typename host_ordinal_type_array, typename host_scalar_type_array>
8888
local_ordinal_t gather_impl(KV_S& nzvals, KV_GO& indices, KV_GS& pointers,
89+
host_ordinal_type_array &perm_g2l,
90+
host_ordinal_type_array &recvCountRows, host_ordinal_type_array &recvDisplRows,
8991
host_ordinal_type_array &recvCounts, host_ordinal_type_array &recvDispls,
9092
host_ordinal_type_array &transpose_map, host_scalar_type_array &nzvals_t,
9193
bool column_major, EPhase current_phase) const
@@ -121,7 +123,6 @@ namespace Amesos2 {
121123
global_ordinal_t rowIndexBase = rowMap->getIndexBase();
122124
global_ordinal_t colIndexBase = colMap->getIndexBase();
123125
// map from global to local
124-
host_ordinal_type_array perm_g2l;
125126
host_ordinal_type_array perm_l2g;
126127
// workspace for column major
127128
KV_GS pointers_t;
@@ -183,6 +184,11 @@ namespace Amesos2 {
183184
Teuchos::gatherv<int, local_ordinal_t> (&lclRowptr[sendIdx], myNRows, &pointers_[1],
184185
recvCounts.data(), recvDispls.data(),
185186
0, *comm);
187+
// save row counts/displs
188+
Kokkos::resize(recvCountRows, nRanks);
189+
Kokkos::resize(recvDisplRows, nRanks+1);
190+
Kokkos::deep_copy(recvCountRows, recvCounts);
191+
Kokkos::deep_copy(recvDisplRows, recvDispls);
186192
if (myRank == 0) {
187193
// shift to global pointers
188194
pointers_[0] = 0;

packages/amesos2/src/Amesos2_EpetraMultiVecAdapter_decl.hpp

+63
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,68 @@ namespace Amesos2 {
239239
node_t> > source_map,
240240
EDistribution distribution );
241241

242+
template<typename KV, typename host_ordinal_type_array>
243+
int
244+
gather (KV& kokkos_new_view,
245+
host_ordinal_type_array &perm_g2l,
246+
host_ordinal_type_array &recvCountRows,
247+
host_ordinal_type_array &recvDisplRows,
248+
EDistribution distribution) const
249+
{
250+
auto comm = this->getComm();
251+
int myRank = comm->getRank();
252+
int nCols = this->mv_->NumVectors();
253+
int nRows = this->mv_->GlobalLength();
254+
int nRows_l = this->mv_->MyLength();
255+
if (myRank == 0) {
256+
Kokkos::resize(kokkos_new_view, nRows, nCols);
257+
if (int(perm_g2l.extent(0)) == nRows) {
258+
Kokkos::resize(this->buf_, nRows, 1);
259+
} else {
260+
Kokkos::resize(this->buf_, 0, 1);
261+
}
262+
}
263+
{
264+
for (int j=0; j<nCols; j++) {
265+
scalar_t * recvbuf = reinterpret_cast<scalar_t*> (myRank != 0 || this->buf_.extent(0) > 0 ? this->buf_.data() : &kokkos_new_view(0,j));
266+
Teuchos::gatherv<int, scalar_t> (const_cast<scalar_t*> ((*this->mv_)[j]), nRows_l,
267+
recvbuf, recvCountRows.data(), recvDisplRows.data(),
268+
0, *comm);
269+
if (myRank == 0 && this->buf_.extent(0) > 0) {
270+
for (int i=0; i<nRows; i++) kokkos_new_view(perm_g2l(i),j) = this->buf_(i,0);
271+
}
272+
}
273+
}
274+
return 0;
275+
}
276+
277+
template<typename KV, typename host_ordinal_type_array>
278+
int
279+
scatter (KV& kokkos_new_view,
280+
host_ordinal_type_array &perm_g2l,
281+
host_ordinal_type_array &sendCountRows,
282+
host_ordinal_type_array &sendDisplRows,
283+
EDistribution distribution) const
284+
{
285+
auto comm = this->getMap()->getComm();
286+
int myRank = comm->getRank();
287+
int nCols = this->mv_->NumVectors();
288+
int nRows = this->mv_->GlobalLength();
289+
int nRows_l = this->mv_->MyLength();
290+
{
291+
for (int j=0; j<nCols; j++) {
292+
if (myRank == 0 && this->buf_.extent(0) > 0) {
293+
for (int i=0; i<nRows; i++) this->buf_(i, 0) = kokkos_new_view(perm_g2l(i),j);
294+
}
295+
scalar_t * sendbuf = reinterpret_cast<scalar_t*> (myRank != 0 || this->buf_.extent(0) > 0 ? this->buf_.data() : &kokkos_new_view(0,j));
296+
Teuchos::scatterv<int, scalar_t> (sendbuf, sendCountRows.data(), sendDisplRows.data(),
297+
reinterpret_cast<scalar_t*> ((*this->mv_)[j]), nRows_l,
298+
0, *comm);
299+
}
300+
}
301+
return 0;
302+
}
303+
242304
/// Get a short description of this adapter class
243305
std::string description() const;
244306

@@ -252,6 +314,7 @@ namespace Amesos2 {
252314

253315
/// The multi-vector this adapter wraps
254316
Teuchos::RCP<multivec_t> mv_;
317+
mutable Kokkos::View<scalar_t**, Kokkos::LayoutLeft, Kokkos::HostSpace> buf_;
255318

256319
mutable Teuchos::RCP<Epetra_Import> importer_;
257320
mutable Teuchos::RCP<Epetra_Export> exporter_;

packages/amesos2/src/Amesos2_EpetraRowMatrix_AbstractMatrixAdapter_decl.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ namespace Amesos2 {
146146
const EPhase current_phase) const;
147147
template<typename KV_S, typename KV_GO, typename KV_GS, typename host_ordinal_type_array, typename host_scalar_type_array>
148148
local_ordinal_t gather_impl(KV_S& nzvals, KV_GO& indices, KV_GS& pointers,
149+
host_ordinal_type_array &perm_g2l,
150+
host_ordinal_type_array &recvCountRows, host_ordinal_type_array &recvDisplRows,
149151
host_ordinal_type_array &recvCounts, host_ordinal_type_array &recvDispls,
150152
host_ordinal_type_array &transpose_map, host_scalar_type_array &nzvals_t,
151153
bool column_major, EPhase current_phase) const;

packages/amesos2/src/Amesos2_EpetraRowMatrix_AbstractMatrixAdapter_def.hpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,19 @@ namespace Amesos2 {
354354
template<typename KV_S, typename KV_GO, typename KV_GS, typename host_ordinal_type_array, typename host_scalar_type_array>
355355
typename AbstractConcreteMatrixAdapter<Epetra_RowMatrix, DerivedMat>::local_ordinal_t
356356
AbstractConcreteMatrixAdapter<Epetra_RowMatrix, DerivedMat>::gather_impl(KV_S& nzvals, KV_GO& indices, KV_GS& pointers,
357+
host_ordinal_type_array &perm_g2l,
358+
host_ordinal_type_array &recvCountRows, host_ordinal_type_array &recvDisplRows,
357359
host_ordinal_type_array &recvCounts, host_ordinal_type_array &recvDispls,
358360
host_ordinal_type_array &transpose_map, host_scalar_type_array &nzvals_t,
359361
bool column_major, EPhase current_phase) const
360362
{
361363
#ifdef __CUDACC__
362364
// NVCC doesn't seem to like the static_cast, even though it is valid
363-
return dynamic_cast<ConcreteMatrixAdapter<DerivedMat>*>(this)->gather_impl(nzvals, indices, pointers, recvCounts, recvDispls, transpose_map, nzvals_t,
364-
column_major, current_phase);
365+
return dynamic_cast<ConcreteMatrixAdapter<DerivedMat>*>(this)->gather_impl(nzvals, indices, pointers, perm_g2l, recvCounts, recvDispls, recvCountRows, recvDisplRows,
366+
transpose_map, nzvals_t, column_major, current_phase);
365367
#else
366-
return static_cast<ConcreteMatrixAdapter<DerivedMat>*>(this)->gather_impl(nzvals, indices, pointers, recvCounts, recvDispls, transpose_map, nzvals_t,
367-
column_major, current_phase);
368+
return static_cast<ConcreteMatrixAdapter<DerivedMat>*>(this)->gather_impl(nzvals, indices, pointers, perm_g2l, recvCounts, recvDispls, recvCountRows, recvDisplRows,
369+
transpose_map, nzvals_t, column_major, current_phase);
368370
#endif
369371
}
370372

packages/amesos2/src/Amesos2_KLU2_decl.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ class KLU2 : public SolverCore<Amesos2::KLU2, Matrix, Vector>
228228
int transFlag_;
229229

230230
bool is_contiguous_;
231+
bool use_gather_;
231232
}; // End class KLU2
232233

233234

0 commit comments

Comments
 (0)