OpenMPI  0.1.1
hash.h
1 /*
2  This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2012.
3  Authors: Michael Heyde
4 */
5 
6 #ifndef HASH_H
7 #define HASH_H
8 
9 #include "OTF_inttypes.h"
10 
11 /* 0x1000 = 4096 */
12 #define HASH_SIZE 0X1000
13 #define HASH_GET_KEY(key) \
14 { \
15  key += ~(key << 15); \
16  key ^= (key >> 10); \
17  key += (key << 3); \
18  key ^= (key >> 6); \
19  key += ~(key << 11); \
20  key ^= (key >> 16); \
21  key &= HASH_SIZE - 1; \
22 }
23 
24 typedef struct mapInfoProcessS
25 {
26  uint32_t process;
27  uint64_t lastValue;
28  uint64_t lastTime;
29  double highestRate;
30  struct mapInfoProcessS *next;
32 
33 /* initialize the hash */
34 mapInfoProcessT* hash_new( void );
35 
36 /* add an entry to the hash */
37 mapInfoProcessT* hash_add( mapInfoProcessT *hash, uint32_t process );
38 
39 /* search an entry in the hash */
40 mapInfoProcessT* hash_search( mapInfoProcessT *hash, uint32_t process );
41 
42 /* free all mem of the hash */
43 void hash_delete( mapInfoProcessT *hash );
44 
45 #endif /* HASH_H */
Definition: hash.h:24
Deals with all data type related issues.