Browse Source

Don't optimistically use smaller WaksmanNetworks than was asked for

If we use a smaller one than we were asked for now, we may find we
needed it later.
Ian Goldberg 11 months ago
parent
commit
3fef8f3fe4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Enclave/sort.cpp

+ 4 - 1
Enclave/sort.cpp

@@ -97,7 +97,10 @@ uint32_t shuffle_mtobliv(threadid_t nthreads, uint8_t* items, uint16_t msg_size,
             printf("No precomputed WaksmanNetworks of size at most %u\n", Na);
             assert(false);
         }
-        if (N.first < Nr) {
+        // We're actually going to only use WaksmanNetworks of size
+        // exactly Na.  Otherwise we might use a smaller WN than we
+        // were asked for, but we might need that one later.
+        if (N.first < Na /*Nr*/) {
             continue;
         }
         // We're in the right range, but see if we have an actual