Skip to content

Commit

Permalink
Tpetra residual: Add options for skipping of local copy and comm/comp…
Browse files Browse the repository at this point in the history
… overlap
  • Loading branch information
cgcgcg committed Jun 22, 2021
1 parent 54efc13 commit 6c5b2fb
Show file tree
Hide file tree
Showing 3 changed files with 465 additions and 158 deletions.
23 changes: 23 additions & 0 deletions packages/tpetra/core/src/Tpetra_Details_Behavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,29 @@ bool Behavior::hierarchicalUnpack ()
defaultValue);
}

bool Behavior::skipCopyAndPermuteIfPossible ()
{
constexpr char envVarName[] = "TPETRA_SKIP_COPY_AND_PERMUTE";
constexpr bool defaultValue(false);

static bool value_ = defaultValue;
static bool initialized_ = false;
return idempotentlyGetEnvironmentVariableAsBool
(value_, initialized_, envVarName, defaultValue);
}

bool Behavior::overlapCommunicationAndComputation ()
{
constexpr char envVarName[] = "TPETRA_OVERLAP";
constexpr bool defaultValue(false);

static bool value_ = defaultValue;
static bool initialized_ = false;
return idempotentlyGetEnvironmentVariableAsBool
(value_, initialized_, envVarName, defaultValue);
}


} // namespace Details
} // namespace Tpetra

12 changes: 12 additions & 0 deletions packages/tpetra/core/src/Tpetra_Details_Behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ class Behavior {
/// environment variable.
static bool profilingRegionUseKokkosProfiling();

/// \brief Skip copyAndPermute if possible
///
/// This is disabled by default. You may control this at run time via the
/// <tt>TPETRA_SKIP_COPY_AND_PERMUTE</tt> environment variable.
static bool skipCopyAndPermuteIfPossible();

/// \brief Overlap communication and computation.
///
/// This is disabled by default. You may control this at run time via the
/// <tt>TPETRA_OVERLAP</tt> environment variable.
static bool overlapCommunicationAndComputation();


};

Expand Down
Loading

0 comments on commit 6c5b2fb

Please sign in to comment.