diff --git a/src/DHT/DHT.c b/src/DHT/DHT.c index a4f07f4b8..cb9ef3005 100644 --- a/src/DHT/DHT.c +++ b/src/DHT/DHT.c @@ -1,10 +1,10 @@ #include "DHT.h" +#include #include #include #include #include -#include #include static void determine_dest(uint64_t hash, int comm_size, @@ -79,7 +79,7 @@ DHT *DHT_create(MPI_Comm comm, uint64_t size, unsigned int data_size, object->recv_entry = malloc(1 + data_size + key_size); object->send_entry = malloc(1 + data_size + key_size); object->index_count = 9 - (index_bytes / 8); - object->index = (uint64_t*)malloc((object->index_count) * sizeof(uint64_t)); + object->index = (uint64_t *)malloc((object->index_count) * sizeof(uint64_t)); object->mem_alloc = mem_alloc; // if set, initialize dht_stats @@ -375,8 +375,8 @@ int DHT_free(DHT *table, int *eviction_counter, int *readerror_counter) { return DHT_SUCCESS; } -#ifdef DHT_STATISTICS int DHT_print_statistics(DHT *table) { +#ifdef DHT_STATISTICS int *written_buckets; int *read_misses, sum_read_misses; int *evictions, sum_evictions; @@ -476,5 +476,5 @@ int DHT_print_statistics(DHT *table) { MPI_Barrier(table->communicator); return DHT_SUCCESS; +#endif } -#endif \ No newline at end of file diff --git a/src/DHT/DHT.h b/src/DHT/DHT.h index 88a4ab632..a17ac3c26 100644 --- a/src/DHT/DHT.h +++ b/src/DHT/DHT.h @@ -250,9 +250,7 @@ extern int DHT_free(DHT* table, int* eviction_counter, int* readerror_counter); * @return int Returns DHT_SUCCESS on success or DHT_MPI_ERROR on internal MPI * error. */ -#ifdef DHT_STATISTICS extern int DHT_print_statistics(DHT* table); -#endif /** * @brief Determine destination rank and index. diff --git a/src/DHT/DHT_Wrapper.cpp b/src/DHT/DHT_Wrapper.cpp index 376e6ac8b..b112e53b5 100644 --- a/src/DHT/DHT_Wrapper.cpp +++ b/src/DHT/DHT_Wrapper.cpp @@ -8,7 +8,7 @@ using namespace poet; using namespace std; -uint64_t get_md5(int key_size, void *key) { +static uint64_t get_md5(int key_size, void *key) { MD5_CTX ctx; unsigned char sum[MD5_DIGEST_LENGTH]; uint64_t retval, *v1, *v2; @@ -120,9 +120,7 @@ int DHT_Wrapper::fileToTable(const char *filename) { void DHT_Wrapper::printStatistics() { int res; -#ifdef DHT_STATISTICS res = DHT_print_statistics(dht_object); -#endif if (res != DHT_SUCCESS) { // MPI ERROR ... WHAT TO DO NOW? @@ -143,11 +141,12 @@ void DHT_Wrapper::fuzzForDHT(int var_count, void *key, double dt) { if (dht_prop_type_vector[i] == "act") { // with log10 if (dht_log) { - if (((double *)key)[i] < 0) + if (((double *)key)[i] < 0) { cerr << "dht_wrapper.cpp::fuzz_for_dht(): Warning! Negative value in " "key!" << endl; - else if (((double *)key)[i] == 0) + fuzzing_buffer[i] = 0; + } else if (((double *)key)[i] == 0) fuzzing_buffer[i] = 0; else fuzzing_buffer[i] =