#include "../../common/Clock.h" #include "../crush.h" using namespace crush; Clock g_clock; #include #include #include using namespace std; int uniform = 10; int branching = 10; int buckettype = 0; int numrep = 1; Bucket *make_bucket(Crush& c, vector& wid, int h, int& ndisks) { if (h == 0) { // uniform Hash hash(123); vector disks; for (int i=0; imake_primes(hash); c.add_bucket(b); //cout << h << " uniformbucket with " << wid[h] << " disks" << endl; return b; } else { // mixed Bucket *b; if (buckettype == 0) b = new TreeBucket(h+1); else if (buckettype == 1 || buckettype == 2) b = new ListBucket(h+1); else if (buckettype == 3) b = new StrawBucket(h+1); for (int i=0; iadd_item(n->get_id(), n->get_weight()); } c.add_bucket(b); //cout << h << " mixedbucket with " << wid[h] << endl; return b; } } int make_hierarchy(Crush& c, vector& wid, int& ndisks) { Bucket *b = make_bucket(c, wid, wid.size()-1, ndisks); return b->get_id(); } double go(int dep, int per) { Hash h(73232313); // crush Crush c; // buckets int root = -1; int ndisks = 0; vector wid; if (1) { wid.push_back(uniform); for (int d=1; d v(numrep); utime_t start = g_clock.now(); set out; map overload; for (int x=1; x <= place; x++) c.do_rule(rule, x, v, out, overload); utime_t end = g_clock.now(); end -= start; double el = (double)end; //cout << "\t" << ndisks; return el; } int main() { uniform = branching = 8; cout << "// dep\tuniform\tbranch\tndisks" << endl; for (int d=2; d<=5; d++) { cout << d;// << "\t" << branching; cout << "\t" << uniform; cout << "\t" << branching; int n = 1; for (int i=0; i