Codebase list ibutils / d9ac677e-b280-4520-93af-f6b8ef650d18/main debian / patches / Fix-spelling-error-of-tuple.patch
d9ac677e-b280-4520-93af-f6b8ef650d18/main

Tree @d9ac677e-b280-4520-93af-f6b8ef650d18/main (Download .tar.gz)

Fix-spelling-error-of-tuple.patch @d9ac677e-b280-4520-93af-f6b8ef650d18/mainraw · history · blame

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
From 8bc14514d5dae672f92087fbd33d89d9e54aa13d Mon Sep 17 00:00:00 2001
From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Date: Wed, 11 Nov 2020 10:43:35 +0100
Subject: Fix spelling error of tuple

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
---
 ibdm/ibdm/FatTree.cpp | 170 +++++++++++++++++++++---------------------
 1 file changed, 85 insertions(+), 85 deletions(-)

diff --git a/ibdm/ibdm/FatTree.cpp b/ibdm/ibdm/FatTree.cpp
index b61e5ca..678caff 100644
--- a/ibdm/ibdm/FatTree.cpp
+++ b/ibdm/ibdm/FatTree.cpp
@@ -51,16 +51,16 @@ FatTree Utilities:
 // highest value.
 //
 // The algorithm BFS from an arbitrary leaf switch.
-// It then allocates ID tupples to each switch ID[0..N].
+// It then allocates ID tuples to each switch ID[0..N].
 // Only one digit of the ID is allowed to change when going from
 // switch node to the other.
 //
 // We use the term "index" when we refer to
-// The digit indexed 0 ID[0] in the tupple is the rank number.
+// The digit indexed 0 ID[0] in the tuple is the rank number.
 // Going down the tree the digit that might change is D[from->rank+1]
 // Going up the tee the digit that might change is D[from->rank]
 //
-// During the BFS each node is assigned a tupple the first time it is
+// During the BFS each node is assigned a tuple the first time it is
 // visited. During the BFS we also collect the list of ports that connect to
 // each value of the changing D.
 //
@@ -69,8 +69,8 @@ FatTree Utilities:
 // number of sub hierarchy indexes with the exact same number of ports
 //
 
-// for comparing tupples
-struct FatTreeTuppleLess : public binary_function <vec_byte, vec_byte, bool> {
+// for comparing tuples
+struct FatTreeTupleLess : public binary_function <vec_byte, vec_byte, bool> {
   bool operator()(const vec_byte& x, const vec_byte& y) const {
     if (x.size() > y.size()) return false;
     if (y.size() > x.size()) return true;
@@ -166,15 +166,15 @@ bool FatTreeNode::goingDown(int lid)
   return false;
 }
 
-typedef map< vec_byte, class FatTreeNode, FatTreeTuppleLess > map_tupple_ftnode;
+typedef map< vec_byte, class FatTreeNode, FatTreeTupleLess > map_tuple_ftnode;
 
 class FatTree {
-  // the node tupple is built out of the following:
+  // the node tuple is built out of the following:
   // d[0] = rank
   // d[1..N-1] = ID digits
   IBFabric          *p_fabric;     // The fabric we attach to
-  map_pnode_vec_byte TuppleByNode;
-  map_tupple_ftnode  NodeByTupple;
+  map_pnode_vec_byte TupleByNode;
+  map_tuple_ftnode   NodeByTuple;
   vec_int            LidByIdx;     // store target HCA lid by its index
   unsigned int       N;            // number of levels in the fabric
   map_str_int        IdxByName;
@@ -187,11 +187,11 @@ class FatTree {
   // return NULL if this check is not met or no ranking available
   IBNode *getLowestLevelSwitchNode();
 
-  // get a free tupple given the reference one and the index to change:
-  vec_byte getFreeTupple(vec_byte refTupple, unsigned int changeIdx);
+  // get a free tuple given the reference one and the index to change:
+  vec_byte getFreeTuple(vec_byte refTuple, unsigned int changeIdx);
 
-  // convert tupple to string
-  string getTuppleStr(vec_byte tupple);
+  // convert tuple to string
+  string getTupleStr(vec_byte tuple);
 
   // simply dump out the FatTree data:
   void dump();
@@ -199,7 +199,7 @@ class FatTree {
   // track a connection to remote switch
   int trackConnection(
 		      FatTreeNode *p_ftNode,
-		      vec_byte     tupple,   // the connected node tupple
+		      vec_byte     tuple,    // the connected node tuple
 		      unsigned int rank,     // rank of the local node
 		      unsigned int remRank,  // rank of the remote node
 		      unsigned int portNum,  // the port number connecting to the remote node
@@ -249,9 +249,9 @@ public:
 
 FatTreeNode* FatTree::getFatTreeNodeByNode(IBNode *p_node) {
   FatTreeNode* p_ftNode;
-  vec_byte tupple(N, 0);
-  tupple = TuppleByNode[p_node];
-  p_ftNode = &NodeByTupple[tupple];
+  vec_byte tuple(N, 0);
+  tuple = TupleByNode[p_node];
+  p_ftNode = &NodeByTuple[tuple];
   return p_ftNode;
 }
 
@@ -310,31 +310,31 @@ IBNode *FatTree::getLowestLevelSwitchNode()
   return(p_leafSwitch);
 }
 
-// get a free tupple given the reference one and the index to change:
+// get a free tuple given the reference one and the index to change:
 // also track the max digit allocated per index
-vec_byte FatTree::getFreeTupple(vec_byte refTupple, unsigned int changeIdx)
+vec_byte FatTree::getFreeTuple(vec_byte refTuple, unsigned int changeIdx)
 {
-  vec_byte res = refTupple;
+  vec_byte res = refTuple;
   int rank = changeIdx - 1;
   for (uint8_t i = 0; i < 255; i++)
     {
       res[changeIdx] = i;
-      map_tupple_ftnode::const_iterator tI = NodeByTupple.find(res);
-      if (tI == NodeByTupple.end())
+      map_tuple_ftnode::const_iterator tI = NodeByTuple.find(res);
+      if (tI == NodeByTuple.end())
 	return res;
     }
-  cout << "ABORT: fail to get free tupple! (in 255 indexies)" << endl;
+  cout << "ABORT: fail to get free tuple! (in 255 indexies)" << endl;
   abort();
 }
 
-string FatTree::getTuppleStr(vec_byte tupple)
+string FatTree::getTupleStr(vec_byte tuple)
 {
   char buf[128];
   buf[0] = '\0';
-  for (unsigned int i = 0; i < tupple.size(); i++)
+  for (unsigned int i = 0; i < tuple.size(); i++)
     {
       if (i) strcat(buf,".");
-      sprintf(buf, "%s%d", buf, tupple[i]);
+      sprintf(buf, "%s%d", buf, tuple[i]);
     }
   return(string(buf));
 }
@@ -343,11 +343,11 @@ string FatTree::getTuppleStr(vec_byte tupple)
 // correct fat tree node childPorts and parentPorts
 int FatTree::trackConnection(
 			     FatTreeNode *p_ftNode, // the connected node
-			     vec_byte     tupple,   // the connected node tupple
+			     vec_byte     tuple,    // the connected node tuple
 			     unsigned int rank,     // rank of the local node
 			     unsigned int remRank,  // rank of the remote node
 			     unsigned int portNum,  // the port number connecting to the remote node
-			     unsigned int remDigit  // the digit of the tupple changing to the remote node
+			     unsigned int remDigit  // the digit of the tuple changing to the remote node
 			     )
 {
   if ( rank < remRank )
@@ -394,8 +394,8 @@ FatTree::extractCoefficients()
   int anyErr = 0;
 
   // go over all nodes
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.begin();
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.begin();
+       tI != NodeByTuple.end();
        tI++)
     {
       FatTreeNode *p_ftNode = &((*tI).second);
@@ -454,11 +454,11 @@ FatTree::extractCoefficients()
 
   if (anyErr) return 1;
 
-  vec_byte firstLeafTupple(N, 0);
-  firstLeafTupple[0] = N-1;
+  vec_byte firstLeafTuple(N, 0);
+  firstLeafTuple[0] = N-1;
   maxHcasPerLeafSwitch = 0;
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.find(firstLeafTupple);
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.find(firstLeafTuple);
+       tI != NodeByTuple.end();
        tI++)
     {
       FatTreeNode *p_ftNode = &((*tI).second);
@@ -506,24 +506,24 @@ FatTree::FatTree(IBFabric *p_f)
   bfsQueue.push_back(p_node);
 
   // also we always allocate the address 0..0 with "rank" digits to the node:
-  vec_byte tupple(N, 0);
+  vec_byte tuple(N, 0);
 
   // adjust the level:
-  tupple[0] = p_node->rank;
-  TuppleByNode[p_node] = tupple;
-  NodeByTupple[tupple] = FatTreeNode(p_node);
+  tuple[0] = p_node->rank;
+  TupleByNode[p_node] = tuple;
+  NodeByTuple[tuple] = FatTreeNode(p_node);
   if (FabricUtilsVerboseLevel & FABU_LOG_VERBOSE)
-    cout << "-I- Assigning tupple:" << getTuppleStr(tupple) << " to:"
+    cout << "-I- Assigning tuple:" << getTupleStr(tuple) << " to:"
 	 << p_node->name << endl;
 
   while (! bfsQueue.empty())
     {
       p_node = bfsQueue.front();
       bfsQueue.pop_front();
-      // we must have a tupple stored - get it
-      tupple = TuppleByNode[p_node];
+      // we must have a tuple stored - get it
+      tuple = TupleByNode[p_node];
       // we also need to get the fat tree node...
-      p_ftNode = &NodeByTupple[tupple];
+      p_ftNode = &NodeByTuple[tuple];
 
       // go over all the node ports
       for (unsigned int pn = 1; pn <= p_node->numPorts; pn++)
@@ -543,7 +543,7 @@ FatTree::FatTree(IBFabric *p_f)
 	    }
 
 	  // now try to see if this node has already a map:
-	  map_pnode_vec_byte::iterator tI = TuppleByNode.find(p_remNode);
+	  map_pnode_vec_byte::iterator tI = TupleByNode.find(p_remNode);
 
 	  // we are allowed to change the digit based on the direction we go:
 	  unsigned int changingDigitIdx;
@@ -563,28 +563,28 @@ FatTree::FatTree(IBFabric *p_f)
 	      return;
 	    }
 
-	  // do we need to allocate a new tupple?
-	  if (tI == TuppleByNode.end())
+	  // do we need to allocate a new tuple?
+	  if (tI == TupleByNode.end())
 	    {
 
-	      // the node is new - so get a new tupple for it:
-	      vec_byte newTupple = tupple;
+	      // the node is new - so get a new tuple for it:
+	      vec_byte newTuple = tuple;
 	      // change the level accordingly
-	      newTupple[0] = p_remNode->rank;
+	      newTuple[0] = p_remNode->rank;
 	      // obtain a free one
-	      newTupple = getFreeTupple(newTupple, changingDigitIdx);
+	      newTuple = getFreeTuple(newTuple, changingDigitIdx);
 
-	      // assign the new tupple and add to next steps:
+	      // assign the new tuple and add to next steps:
 	      if (FabricUtilsVerboseLevel & FABU_LOG_VERBOSE)
-		cout << "-I- Assigning tupple:" << getTuppleStr(newTupple)
+		cout << "-I- Assigning tuple:" << getTupleStr(newTuple)
 		     << " to:" << p_remNode->name << " changed idx:"
-		     << changingDigitIdx << " from:" << getTuppleStr(tupple)
+		     << changingDigitIdx << " from:" << getTupleStr(tuple)
 		     << endl;
 
-	      TuppleByNode[p_remNode] = newTupple;
-	      NodeByTupple[newTupple] = FatTreeNode(p_remNode);
+	      TupleByNode[p_remNode] = newTuple;
+	      NodeByTuple[newTuple] = FatTreeNode(p_remNode);
 
-	      unsigned int digit = newTupple[changingDigitIdx];
+	      unsigned int digit = newTuple[changingDigitIdx];
 
 	      // track the connection
 	      if (FabricUtilsVerboseLevel & FABU_LOG_VERBOSE)
@@ -592,25 +592,25 @@ FatTree::FatTree(IBFabric *p_f)
 		     << p_remNode->name << " through port:" << pn
 		     << " remDigit:" << digit << endl;
 	      if (trackConnection(
-				  p_ftNode, tupple, p_node->rank, p_remNode->rank, pn, digit))
+				  p_ftNode, tuple, p_node->rank, p_remNode->rank, pn, digit))
 		return;
 
 	      bfsQueue.push_back(p_remNode);
 	    }
 	  else
 	    {
-	      // other side already has a tupple - so just track the connection
-	      vec_byte remTupple = (*tI).second;
-	      vec_byte mergedTupple = remTupple;
+	      // other side already has a tuple - so just track the connection
+	      vec_byte remTuple = (*tI).second;
+	      vec_byte mergedTuple = remTuple;
 
-	      unsigned int digit = remTupple[changingDigitIdx];
+	      unsigned int digit = remTuple[changingDigitIdx];
 
 	      if (FabricUtilsVerboseLevel & FABU_LOG_VERBOSE)
 		cout << "-I- Connecting:" << p_node->name  << " to:"
 		     << p_remNode->name << " through port:" << pn
 		     << " remDigit:" << digit  << endl;
 	      if (trackConnection(
-				  p_ftNode, tupple, p_node->rank, p_remNode->rank, pn, digit))
+				  p_ftNode, tuple, p_node->rank, p_remNode->rank, pn, digit))
 		return;
 	    }
 
@@ -624,18 +624,18 @@ FatTree::FatTree(IBFabric *p_f)
   // We need to decide what will be the K of the lowest switches level.
   // It is possible that for all of them the number of HCAs is < num
   // left ports thus we should probably use the lowest number of all
-  vec_byte firstLeafTupple(N, 0);
-  firstLeafTupple[0] = N-1;
+  vec_byte firstLeafTuple(N, 0);
+  firstLeafTuple[0] = N-1;
 
-  // now restart going over all leaf switches by their tupple order and
+  // now restart going over all leaf switches by their tuple order and
   // allocate mapping
   int hcaIdx = 0;
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.find(firstLeafTupple);
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.find(firstLeafTuple);
+       tI != NodeByTuple.end();
        tI++)
     {
       // we collect HCAs connected to the leaf switch and set their childPort
-      // starting at the index associated with the switch tupple.
+      // starting at the index associated with the switch tuple.
       FatTreeNode *p_ftNode = &((*tI).second);
       IBNode *p_node = p_ftNode->p_node;
       unsigned int pIdx = 0;
@@ -917,10 +917,10 @@ int FatTree::route()
   int lid; // the target LID we propagate for this time
 
   // go over all fat tree nodes of the lowest level
-  vec_byte firstLeafTupple(N, 0);
-  firstLeafTupple[0] = N-1;
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.find(firstLeafTupple);
-       tI != NodeByTupple.end();
+  vec_byte firstLeafTuple(N, 0);
+  firstLeafTuple[0] = N-1;
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.find(firstLeafTuple);
+       tI != NodeByTuple.end();
        tI++)
     {
 
@@ -963,8 +963,8 @@ int FatTree::route()
     }
 
   // now go over all switches and route to them
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.begin();
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.begin();
+       tI != NodeByTuple.end();
        tI++)
     {
 
@@ -1051,9 +1051,9 @@ int FatTree::permRoute(vector<string> src, vector<string> dst)
   int hcaIdx = 0;
   int lid; // the target LID we propagate for this time
   // extract radix
-  vec_byte tmpLeafTupple(N,0);
-  tmpLeafTupple[0] = N-1;
-  FatTreeNode* p_ftN = &NodeByTupple[tmpLeafTupple];
+  vec_byte tmpLeafTuple(N,0);
+  tmpLeafTuple[0] = N-1;
+  FatTreeNode* p_ftN = &NodeByTuple[tmpLeafTuple];
   int radix = 0;
   for (int i = 0; i < p_ftN->parentPorts.size(); i++)
     if(p_ftN->parentPorts[i].size())
@@ -1078,10 +1078,10 @@ int FatTree::permRoute(vector<string> src, vector<string> dst)
 
   // build the LFTs
   // go over all fat tree nodes of the lowest level
-  vec_byte firstLeafTupple(N, 0);
-  firstLeafTupple[0] = N-1;
+  vec_byte firstLeafTuple(N, 0);
+  firstLeafTuple[0] = N-1;
   // First prepare downwards routing
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.find(firstLeafTupple); tI != NodeByTupple.end(); tI++) {
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.find(firstLeafTuple); tI != NodeByTuple.end(); tI++) {
     FatTreeNode *p_ftNode = &((*tI).second);
     IBNode *p_node = p_ftNode->p_node;
     // we need to track the number of ports to handle case of missing HCAs
@@ -1124,7 +1124,7 @@ int FatTree::permRoute(vector<string> src, vector<string> dst)
 
   // Now prepare upwards routing
   hcaIdx = 0;
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.find(firstLeafTupple); tI != NodeByTupple.end(); tI++) {
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.find(firstLeafTuple); tI != NodeByTuple.end(); tI++) {
     FatTreeNode *p_ftNode = &((*tI).second);
     IBNode *p_node = p_ftNode->p_node;
 
@@ -1156,8 +1156,8 @@ int FatTree::permRoute(vector<string> src, vector<string> dst)
   }
 
   // now go over all switches and route to them
-  for (map_tupple_ftnode::iterator tI = NodeByTupple.begin();
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::iterator tI = NodeByTuple.begin();
+       tI != NodeByTuple.end();
        tI++)
     {
 
@@ -1222,8 +1222,8 @@ void FatTree::dump()
 {
   unsigned int level, prevLevel = 2;
   cout << "---------------------------------- FAT TREE DUMP -----------------------------" << endl;
-  for (map_tupple_ftnode::const_iterator tI = NodeByTupple.begin();
-       tI != NodeByTupple.end();
+  for (map_tuple_ftnode::const_iterator tI = NodeByTuple.begin();
+       tI != NodeByTuple.end();
        tI++)
     {
       level = (*tI).first[0];
@@ -1234,7 +1234,7 @@ void FatTree::dump()
 	}
 
       FatTreeNode const *p_ftNode = &((*tI).second);
-      cout << "    " << p_ftNode->p_node->name << " tupple:" << getTuppleStr((*tI).first) << endl;
+      cout << "    " << p_ftNode->p_node->name << " tuple:" << getTupleStr((*tI).first) << endl;
       for (unsigned int i = 0; i < p_ftNode->parentPorts.size(); i++)
 	{
 	  if (p_ftNode->parentPorts[i].size())
-- 
2.25.1