From 7ffebd2e741342a256448694cf6ab6878b8b72d0 Mon Sep 17 00:00:00 2001
From: Thierry <thierry.gautier@inrialpes.fr>
Date: Mon, 13 Nov 2017 16:51:06 +0100
Subject: [PATCH] [fix] threshold for dynamic hashtable

---
 runtime/src/kmp_taskdeps.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/runtime/src/kmp_taskdeps.cpp b/runtime/src/kmp_taskdeps.cpp
index 3045c60..a6ad799 100644
--- a/runtime/src/kmp_taskdeps.cpp
+++ b/runtime/src/kmp_taskdeps.cpp
@@ -93,7 +93,7 @@ static inline kmp_int32 __kmp_dephash_hash(kmp_intptr_t addr, size_t hsize) {
   kmp_intptr_t v = 0;
   v ^= (addr >> 32);
   v ^= (addr >> 16);
-  v ^= (addr >> 6); /* 8 in Kaapi */
+  v ^= (addr >> 8); /* 8 in Kaapi */
   v ^= (addr >> 2); /* better that 8 */
   return ((uint32_t) v) & (KMP_DEPHASH_SIZE(hsize)-1);
 #endif
@@ -156,9 +156,9 @@ static void __kmp_dephash_resize(kmp_info_t *thread,
 
   size_t old_size = h->size;
 #if (LIBOMP_USE_DYNHASH==0)
-  size_t h_size = old_size*2;
+  size_t h_size = old_size*4;
 #else
-  size_t h_size = old_size+1; /* #bits for the size */
+  size_t h_size = old_size+2; /* #bits for the size */
 #endif
 
   size_t size = KMP_DEPHASH_SIZE(h_size) * sizeof(kmp_dephash_bucket_t);
@@ -732,7 +732,7 @@ static bool __kmp_check_deps(kmp_int32 gtid, kmp_depnode_t *node,
 #if LIBOMP_USE_PARALLEL_SPAWN
   __kmp_acquire_lock(&thread->th.th_team->t.t_single_lock, gtid);
 #endif
-  while (hash->nconflicts && ((double)hash->nconflicts >= (0.1*hash->nelements)))
+  while (hash->nconflicts && ((double)hash->nconflicts >= (0.05*hash->nelements)))
   {
     {
 #if 0
-- 
GitLab