Skip to content

Commit

Permalink
Merge Pull Request #13190 from kliegeois/Trilinos/ifpack2_sublines_de…
Browse files Browse the repository at this point in the history
…vice_leak

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Ifpack2: fix a bad memory access on V100'
PR Author: kliegeois
  • Loading branch information
trilinos-autotester authored Jul 1, 2024
2 parents a21f061 + 1a1133a commit c05e782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions packages/ifpack2/example/BlockTriDi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace { // (anonymous)

// Values of command-line arguments.
struct CmdLineArgs {
CmdLineArgs ():blockSize(-1),numIters(10),numRepeats(1),tol(1e-12),nx(172),ny(-1),nz(-1),mx(1),my(1),mz(1),sublinesPerLine(1),sublinesPerLineSchur(1),useStackedTimer(false),usePointMatrix(false),overlapCommAndComp(false){}
CmdLineArgs ():blockSize(-1),numIters(10),numRepeats(1),tol(1e-12),nx(172),ny(-1),nz(-1),mx(1),my(1),mz(1),sublinesPerLine(1),sublinesPerLineSchur(1),useStackedTimer(false),usePointMatrix(false),overlapCommAndComp(false),useSingleFile(false){}

std::string mapFilename;
std::string matrixFilename;
Expand All @@ -39,6 +39,7 @@ struct CmdLineArgs {
bool useStackedTimer;
bool usePointMatrix;
bool overlapCommAndComp;
bool useSingleFile;
std::string problemName;
std::string matrixType;
};
Expand Down Expand Up @@ -72,7 +73,9 @@ getCmdLineArgs (CmdLineArgs& args, int argc, char* argv[])
cmdp.setOption ("withPointMatrix", "withoutPointMatrix", &args.usePointMatrix,
"Whether to run with a point matrix");
cmdp.setOption ("withOverlapCommAndComp", "withoutOverlapCommAndComp", &args.overlapCommAndComp,
"Whether to run with overlapCommAndComp)");
"Whether to run with overlapCommAndComp");
cmdp.setOption ("useSingeFile", "useOneFilePerRank", &args.useSingleFile,
"Whether to read the matrix from one file or one file per rank");
cmdp.setOption("problemName", &args.problemName, "Human-readable problem name for Watchr plot");
cmdp.setOption("matrixType", &args.matrixType, "matrixType");
cmdp.setOption("sublinesPerLineSchur", &args.sublinesPerLineSchur, "sublinesPerLineSchur");
Expand Down Expand Up @@ -473,7 +476,7 @@ main (int argc, char* argv[])
// Read matrix
if(rank0) std::cout<<"Reading matrix (as point)..."<<std::endl;
RCP<const map_type> dummy_col_map;
if (comm->getSize() == 1)
if (args.useSingleFile || comm->getSize() == 1)
A = reader_type::readSparseFile(args.matrixFilename, point_map, dummy_col_map, point_map, point_map);
else {
if(rank0) std::cout<<"Using per-rank reader..."<<std::endl;
Expand Down
3 changes: 1 addition & 2 deletions packages/ifpack2/src/Ifpack2_BlockTriDiContainer_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4364,14 +4364,13 @@ namespace Ifpack2 {
const local_ordinal_type r0 = part2packrowidx0_sub(partidx,local_subpartidx);
const local_ordinal_type nrows = partptr_sub(subpartidx,1) - partptr_sub(subpartidx,0);
const local_ordinal_type blocksize = e_internal_vector_values.extent(2);
const local_ordinal_type num_vectors = blocksize;

//(void) i0;
//(void) nrows;
(void) npacks;

internal_vector_scratch_type_3d_view
WW(member.team_scratch(0), blocksize, num_vectors, vector_loop_size);
WW(member.team_scratch(0), blocksize, 1, vector_loop_size);

Kokkos::parallel_for
(Kokkos::ThreadVectorRange(member, vector_loop_size),[&](const int &v) {
Expand Down

0 comments on commit c05e782

Please sign in to comment.