Skip to content

Commit

Permalink
Tpetra: Strip out remainder of deprecated useDistinctTags usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tasmith4 committed Jun 25, 2022
1 parent d4e9f00 commit 5591d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
14 changes: 3 additions & 11 deletions packages/tpetra/core/src/Tpetra_Details_DistributorPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ DistributorPlan::DistributorPlan(Teuchos::RCP<const Teuchos::Comm<int>> comm)
howInitialized_(DISTRIBUTOR_NOT_INITIALIZED),
reversePlan_(Teuchos::null),
sendType_(DISTRIBUTOR_SEND),
useDistinctTags_(useDistinctTags_default),
sendMessageToSelf_(false),
numSendsToOtherProcs_(0),
maxSendLength_(0),
Expand All @@ -99,7 +98,6 @@ DistributorPlan::DistributorPlan(const DistributorPlan& otherPlan)
howInitialized_(DISTRIBUTOR_INITIALIZED_BY_COPY),
reversePlan_(otherPlan.reversePlan_),
sendType_(otherPlan.sendType_),
useDistinctTags_(otherPlan.useDistinctTags_),
sendMessageToSelf_(otherPlan.sendMessageToSelf_),
numSendsToOtherProcs_(otherPlan.numSendsToOtherProcs_),
procIdsToSendTo_(otherPlan.procIdsToSendTo_),
Expand Down Expand Up @@ -616,7 +614,6 @@ void DistributorPlan::createReversePlan() const
reversePlan_->procsFrom_ = procIdsToSendTo_;
reversePlan_->startsFrom_ = startsTo_;
reversePlan_->indicesFrom_ = indicesTo_;
reversePlan_->useDistinctTags_ = useDistinctTags_;
}

void DistributorPlan::computeReceives()
Expand All @@ -639,12 +636,7 @@ void DistributorPlan::computeReceives()
const int myRank = comm_->getRank();
const int numProcs = comm_->getSize();

// MPI tag for nonblocking receives and blocking sends in this method.
// Note that useDistinctTags_ is deprecated. After deprecation cycle is complete, we should just
// use 0 here (although it's highly unlikely the Actor's communication will conflict with this
// communication, we still avoid the use of tag 0 in Actor, so the hardcoded 0 is in fact still
// unique with respect to the Actor code paths)
const int tag = useDistinctTags_ ? 0 : comm_->getTag();
const int mpiTag = 0;

// toProcsFromMe[i] == the number of messages sent by this process
// to process i. The data in numSendsToOtherProcs_, procIdsToSendTo_, and lengthsTo_
Expand Down Expand Up @@ -786,7 +778,7 @@ void DistributorPlan::computeReceives()
lengthsFromBuffers[i].resize (1);
lengthsFromBuffers[i][0] = as<size_t> (0);
requests[i] = ireceive<int, size_t> (lengthsFromBuffers[i], anySourceProc,
tag, *comm_);
mpiTag, *comm_);
}

// Post the sends: Tell each process to which we are sending how
Expand All @@ -803,7 +795,7 @@ void DistributorPlan::computeReceives()
// this communication pattern will send that process
// lengthsTo_[i] blocks of packets.
const size_t* const lengthsTo_i = &lengthsTo_[i];
send<int, size_t> (lengthsTo_i, 1, as<int> (procIdsToSendTo_[i]), tag, *comm_);
send<int, size_t> (lengthsTo_i, 1, as<int> (procIdsToSendTo_[i]), mpiTag, *comm_);
}
else {
// We don't need a send in the self-message case. If this
Expand Down
18 changes: 0 additions & 18 deletions packages/tpetra/core/src/Tpetra_Details_DistributorPlan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
namespace Tpetra {
namespace Details {

namespace {
const bool useDistinctTags_default = true;
}

/// \brief The type of MPI send that Distributor should use.
///
/// This is an implementation detail of Distributor. Please do
Expand Down Expand Up @@ -115,7 +111,6 @@ class DistributorPlan : public Teuchos::ParameterListAcceptorDefaultBase {

Teuchos::RCP<const Teuchos::Comm<int>> getComm() const { return comm_; }
EDistributorSendType getSendType() const { return sendType_; }
bool useDistinctTags() const { return useDistinctTags_; }
size_t getNumReceives() const { return numReceives_; }
size_t getNumSends() const { return numSendsToOtherProcs_; }
bool hasSelfMessage() const { return sendMessageToSelf_; }
Expand Down Expand Up @@ -153,19 +148,6 @@ class DistributorPlan : public Teuchos::ParameterListAcceptorDefaultBase {
//! @name Parameters read in from the Teuchos::ParameterList
//@{
EDistributorSendType sendType_;

/// \brief Whether to use different tags for different code paths.
///
/// There are currently three code paths in Distributor that post
/// receives and sends:
///
/// 1. Three-argument variant of doPosts()
/// 2. Four-argument variant of doPosts()
/// 3. computeReceives()
///
/// If this option is true, Distributor will use a distinct
/// message tag for each of these paths.
bool useDistinctTags_;
//@}

bool sendMessageToSelf_;
Expand Down

0 comments on commit 5591d04

Please sign in to comment.