@@ -105,10 +105,10 @@ template <
105
105
auto finalHandler>
106
106
void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::adjustForPowerOfTwo() {
107
107
if (is_part_of_adjustment_group_ and not is_even_) {
108
- if constexpr (isdebug) {
109
- fmt::print (
110
- " [{}] Part1: Sending to Node {} \n " , this_node_, this_node_ - 1 );
111
- }
108
+ vt_debug_print (
109
+ terse, allreduce, " [{}] RecursiveDoubling Part1: Sending to Node {} \n " , this_node_,
110
+ this_node_ - 1
111
+ );
112
112
113
113
proxy_[this_node_ - 1 ]
114
114
.template send <&RecursiveDoubling::adjustForPowerOfTwoHandler>(val_);
@@ -120,17 +120,6 @@ template <
120
120
auto finalHandler>
121
121
void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::
122
122
adjustForPowerOfTwoHandler (AllreduceDblMsg<DataT>* msg) {
123
- if constexpr (isdebug) {
124
- std::string data (1024 , 0x0 );
125
- for (auto val : msg->val_ ) {
126
- data.append (fmt::format (" {} " , val));
127
- }
128
- fmt::print (
129
- " [{}] Part1 Handler: Received data ({}) "
130
- " from {}\n " ,
131
- this_node_, data, theContext ()->getFromNodeCurrentTask ());
132
- }
133
-
134
123
Op<DataT>()(val_, msg->val_ );
135
124
136
125
finished_adjustment_part_ = true ;
@@ -180,10 +169,11 @@ void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::reduceIter() {
180
169
181
170
auto vdest = vrt_node_ ^ mask_;
182
171
auto dest = (vdest < nprocs_rem_) ? vdest * 2 : vdest + nprocs_rem_;
183
- if constexpr (isdebug) {
184
- fmt::print (
185
- " [{}] Part2 Step {}: Sending to Node {} \n " , this_node_, step_, dest);
186
- }
172
+ vt_debug_print (
173
+ terse, allreduce,
174
+ " [{}] RecursiveDoubling Part2 (step {}): Sending to Node {} \n " , this_node_,
175
+ step_, dest
176
+ );
187
177
188
178
proxy_[dest].template send <&RecursiveDoubling::reduceIterHandler>(
189
179
val_, step_);
@@ -219,18 +209,13 @@ template <
219
209
auto finalHandler>
220
210
void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::reduceIterHandler(
221
211
AllreduceDblMsg<DataT>* msg) {
222
- if constexpr (isdebug) {
223
- std::string data (1024 , 0x0 );
224
- for (auto val : msg->val_ ) {
225
- data.append (fmt::format (" {} " , val));
226
- }
227
- fmt::print (
228
- " [{}] Part2 Step {} mask_= {} nprocs_pof2_ = {}: "
229
- " Received data ({}) "
230
- " from {}\n " ,
231
- this_node_, msg->step_ , mask_, nprocs_pof2_, data,
232
- theContext ()->getFromNodeCurrentTask ());
233
- }
212
+ vt_debug_print (
213
+ terse, allreduce,
214
+ " [{}] RecursiveDoubling Part2 (step {}): mask_= {} nprocs_pof2_ = {}: "
215
+ " from {}\n " ,
216
+ this_node_, msg->step_ , mask_, nprocs_pof2_,
217
+ theContext ()->getFromNodeCurrentTask ()
218
+ );
234
219
235
220
messages_.at (msg->step_ ) = promoteMsg (msg);
236
221
steps_recv_[msg->step_ ] = true ;
@@ -255,10 +240,11 @@ template <
255
240
auto finalHandler>
256
241
void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::sendToExcludedNodes() {
257
242
if (is_part_of_adjustment_group_ and is_even_) {
258
- if constexpr (isdebug) {
259
- fmt::print (
260
- " [{}] Part3 : Sending to Node {} \n " , this_node_, this_node_ + 1 );
261
- }
243
+ vt_debug_print (
244
+ terse, allreduce, " [{}] RecursiveDoubling Part3: Sending to Node {} \n " , this_node_,
245
+ this_node_ + 1
246
+ );
247
+
262
248
proxy_[this_node_ + 1 ]
263
249
.template send <&RecursiveDoubling::sendToExcludedNodesHandler>(val_);
264
250
}
0 commit comments