Browse Source

Correct the heap size computation when N/M is small and M is large

Ian Goldberg 1 year ago
parent
commit
a022ff705c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      gen_enclave_config.py

+ 2 - 1
gen_enclave_config.py

@@ -47,8 +47,9 @@ def get_heap_size(N, M, T, B, PRIVATE_ROUTE=True, PRO=1, PRI=1, PUO=1, PUI=1, nu
         heap_size += (clients_per_server * B * 3) + ((M-1)**2 * B * 4)
 
     # num_WN_to_precompute times size of each WN
+    wn_size = max(clients_per_server, 2*(M-1)**2)
     heap_size += (num_WN_to_precompute * num_out_mult * \
-        (clients_per_server * math.ceil(math.log(clients_per_server,2)) * 8))
+        (wn_size * math.ceil(math.log(wn_size,2)) * 8))
 
     heap_size_page_aligned = math.ceil(heap_size/4096) * 4096
     return heap_size_page_aligned