@@ -12,13 +12,16 @@ class Channel {
1212 : pimpl_{new ChannelModel<std::remove_cv_t <std::remove_reference_t <T>>>(
1313 std::forward<T>(channel))},
1414 send_communication_phase_active_ (false ),
15- receive_communication_phase_active_ (false ) {}
15+ receive_communication_phase_active_ (false ) {
16+ REDEV_FUNCTION_TIMER;
17+ }
1618
1719 // For cases where we may be interested in storing the comm variant rather
1820 // than the exact type this function can be used to reduce the runtime
1921 // overhead of converting from the variant to the explicit type back to the
2022 // variant
2123 template <typename T> [[nodiscard]] CommV CreateCommV (std::string name, MPI_Comm comm) {
24+ REDEV_FUNCTION_TIMER;
2225 return pimpl_->CreateComm (std::move (name), comm,
2326 InvCommunicatorTypeMap<T>::value);
2427 }
@@ -27,32 +30,39 @@ class Channel {
2730 // that expects a typed communicator to be created.
2831 template <typename T>
2932 [[nodiscard]] BidirectionalComm<T> CreateComm (std::string name, MPI_Comm comm) {
33+ REDEV_FUNCTION_TIMER;
3034 return std::get<BidirectionalComm<T>>(CreateCommV<T>(std::move (name), comm));
3135 }
3236 void BeginSendCommunicationPhase () {
37+ REDEV_FUNCTION_TIMER;
3338 REDEV_ALWAYS_ASSERT (InSendCommunicationPhase () == false );
3439 pimpl_->BeginSendCommunicationPhase ();
3540 send_communication_phase_active_ = true ;
3641 }
3742 void EndSendCommunicationPhase () {
43+ REDEV_FUNCTION_TIMER;
3844 REDEV_ALWAYS_ASSERT (InSendCommunicationPhase () == true );
3945 pimpl_->EndSendCommunicationPhase ();
4046 send_communication_phase_active_ = false ;
4147 }
4248 void BeginReceiveCommunicationPhase () {
49+ REDEV_FUNCTION_TIMER;
4350 REDEV_ALWAYS_ASSERT (InReceiveCommunicationPhase () == false );
4451 pimpl_->BeginReceiveCommunicationPhase ();
4552 receive_communication_phase_active_ = true ;
4653 }
4754 void EndReceiveCommunicationPhase () {
55+ REDEV_FUNCTION_TIMER;
4856 REDEV_ALWAYS_ASSERT (InReceiveCommunicationPhase () == true );
4957 pimpl_->EndReceiveCommunicationPhase ();
5058 receive_communication_phase_active_ = false ;
5159 }
5260 [[nodiscard]] bool InSendCommunicationPhase () const noexcept {
61+ REDEV_FUNCTION_TIMER;
5362 return send_communication_phase_active_;
5463 }
5564 [[nodiscard]] bool InReceiveCommunicationPhase () const noexcept {
65+ REDEV_FUNCTION_TIMER;
5666 return receive_communication_phase_active_;
5767 }
5868
@@ -88,6 +98,7 @@ class Channel {
8898 ~ChannelModel () noexcept final {}
8999 [[nodiscard]] CommV CreateComm (std::string &&name, MPI_Comm comm,
90100 CommunicatorDataType type) final {
101+ REDEV_FUNCTION_TIMER;
91102 switch (type) {
92103 case CommunicatorDataType::INT8:
93104 return CommV{impl_.template CreateComm <
@@ -145,15 +156,19 @@ class Channel {
145156 return {};
146157 }
147158 void BeginSendCommunicationPhase () final {
159+ REDEV_FUNCTION_TIMER;
148160 impl_.BeginSendCommunicationPhase ();
149161 }
150162 void EndSendCommunicationPhase () final {
163+ REDEV_FUNCTION_TIMER;
151164 impl_.EndSendCommunicationPhase ();
152165 }
153166 void BeginReceiveCommunicationPhase () final {
167+ REDEV_FUNCTION_TIMER;
154168 impl_.BeginReceiveCommunicationPhase ();
155169 }
156170 void EndReceiveCommunicationPhase () final {
171+ REDEV_FUNCTION_TIMER;
157172 impl_.EndReceiveCommunicationPhase ();
158173 }
159174
0 commit comments