From 13c591c91c204d62f7f7d1f183d5ddd86b2a3c7f Mon Sep 17 00:00:00 2001 From: aparnasasidharan2017 Date: Mon, 30 Oct 2023 10:31:33 -0500 Subject: [PATCH] test --- PluginKVS/include/KeyValueStore.h | 10 ++++++++++ PluginKVS/srcs/invertedlist.cpp | 1 - emu/include/city.h | 5 +++++ emu/include/rw.h | 1 + emu/srcs/rw.cpp | 16 ++++++++-------- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/PluginKVS/include/KeyValueStore.h b/PluginKVS/include/KeyValueStore.h index 094298c..2fd1d54 100644 --- a/PluginKVS/include/KeyValueStore.h +++ b/PluginKVS/include/KeyValueStore.h @@ -441,6 +441,7 @@ class KeyValueStore N prevkey=0; int ids = 0; std::vector keys; + std::vector keys_p; for(int i=0;iGet (pos,st,keys_p[i],ids); + ids++; + + } + } void get_testworkload(std::string &,std::vector&,std::vector&,int); diff --git a/PluginKVS/srcs/invertedlist.cpp b/PluginKVS/srcs/invertedlist.cpp index 8f4e412..0008370 100644 --- a/PluginKVS/srcs/invertedlist.cpp +++ b/PluginKVS/srcs/invertedlist.cpp @@ -126,7 +126,6 @@ void hdf5_invlist::get_events() KeyT key = r->key; uint64_t hashvalue = hashfcn()(key); int pid = partition_no(key); - assert (pid == myrank); uint64_t pos = hashvalue%maxsize; hsize_t offset = cached_keyindex_mt[2*pos+1]; hsize_t numkeys = cached_keyindex_mt[2*pos]; diff --git a/emu/include/city.h b/emu/include/city.h index 236ff64..638fdf6 100644 --- a/emu/include/city.h +++ b/emu/include/city.h @@ -110,5 +110,10 @@ inline uint64 Hash128to64(const uint128& x) { return b; } +inline uint64_t unsignedlonghash(uint64_t &n) +{ + uint64_t h = std::hash()(n); + return h; +} #endif // CITY_HASH_H_ diff --git a/emu/include/rw.h b/emu/include/rw.h index a588b19..6e1b79d 100644 --- a/emu/include/rw.h +++ b/emu/include/rw.h @@ -15,6 +15,7 @@ //#include "h5_async_lib.h" #include #include +#include "city.h" using namespace boost; diff --git a/emu/srcs/rw.cpp b/emu/srcs/rw.cpp index df4dd53..4086166 100644 --- a/emu/srcs/rw.cpp +++ b/emu/srcs/rw.cpp @@ -558,7 +558,7 @@ bool read_write_process::pread(std::vector>&my_r for(int n=0;nmints; - uint64_t hashvalue = ts; + uint64_t hashvalue = unsignedlonghash(ts); uint64_t pid = hashvalue & mask; pid = pid >> (nbits-nbits_p); send_counts[pid]++; @@ -582,7 +582,7 @@ bool read_write_process::pread(std::vector>&my_r for(int n=0;nmints; - uint64_t hashvalue = ts; + uint64_t hashvalue = unsignedlonghash(ts); uint64_t pid = hashvalue & mask; pid = pid >> (nbits-nbits_p); send_buffer[send_displ[pid]] = ts; @@ -615,7 +615,7 @@ bool read_write_process::pread(std::vector>&my_r for(int j=0;j> (total_bits-numbits_p); int pid = id%numprocs; @@ -1179,7 +1179,7 @@ void read_write_process::create_inverted_list(std::string &s,std::vector p; p.first = ts; p.second = pos; @@ -1350,7 +1350,7 @@ void read_write_process::merge_inverted_list(std::string &s,std::vector> (total_bits-numbits_p); int pid = id%numprocs; @@ -1398,7 +1398,7 @@ void read_write_process::merge_inverted_list(std::string &s,std::vector p; p.first = ts; p.second = pos; @@ -1458,7 +1458,7 @@ void read_write_process::merge_inverted_list(std::string &s,std::vector p; p.first = ts; p.second = index;