37 #include <openssl/md5.h> 43 MD5_Init (&mdContext);
44 sum = malloc(
sizeof(
unsigned char)*MD5_DIGEST_LENGTH);
48 MD5_Update (&mdContext,
buffer, blocksize);
49 MD5_Final (
sum, &mdContext);
55 assert(0 &&
"NotImplemented");
62 #define MATRIX_A 0xB5026F5AA96619E9ULL 63 #define UM 0xFFFFFFFF80000000ULL 64 #define LM 0x7FFFFFFFULL 67 static unsigned long long mt[
NN];
84 unsigned long long key_length,
85 unsigned long long seed)
87 unsigned long long i, j, k;
90 k = (
NN > key_length ?
NN : key_length);
92 mt[
i] = (
mt[
i] ^ ((
mt[
i-1] ^ (
mt[
i-1] >> 62)) * 3935559000370003845ULL))
96 if (j >= key_length) j=0;
98 for (k=
NN-1; k; k--) {
99 mt[
i] = (
mt[
i] ^ ((
mt[
i-1] ^ (
mt[
i-1] >> 62)) * 2862933555777941757ULL))
115 unsigned long long x;
116 static unsigned long long mag01[2]={0x100000ULL,
MATRIX_A};
127 mt[
i] =
mt[
i+
MM] ^ (
x>>1) ^ mag01[(
int)(
x&1ULL)];
134 mt[
NN-1] =
mt[
MM-1] ^ (
x>>1) ^ mag01[(
int)(
x&1ULL)];
141 x ^= (
x >> 29) & 0x5555555555555555ULL;
142 x ^= (
x << 17) & 0x71D67FFFEDA60000ULL;
143 x ^= (
x << 37) & 0xFFF7EEE000000000ULL;
175 unsigned long long init[4] = {0x12345ULL, 0x23456ULL, 0x34567ULL, 0x45678ULL};
176 unsigned long long length = 4;
190 struct timeval *
diff)
192 diff->tv_sec += end->tv_sec -
start->tv_sec;
194 diff->tv_usec += end->tv_usec -
start->tv_usec;
207 end->tv_sec -=
start->tv_sec;
208 end->tv_usec -=
start->tv_usec;
212 double tsec(
const struct timeval *tval)
214 return tval->tv_sec + ((double)tval->tv_usec)/1000000;
217 double rate(
bcnt_t items,
const struct timeval *tval,
int scale)
219 return ((
double)items)/
tsec(tval)/scale;
222 unsigned long long getnum(
const char *str,
const char *msg)
227 static const char suffix[] =
"bkmgBKMG";
229 static const bcnt_t multiplier[] = {
240 num = strtoull(str, &end, 0);
243 pos = strchr(suffix, *end);
245 num *= multiplier[pos - suffix];
247 errx(1,
"conversion of \"%s\" to \"%s\" failed\n",
static int(* diff[M0_PARITY_CAL_ALGO_NR])(struct m0_parity_math *math, struct m0_buf *old, struct m0_buf *new, struct m0_buf *parity, uint32_t index)
double tsec(const struct timeval *tval)
unsigned char * calc_md5sum(char *buffer, int blocksize)
void init_genrand64(unsigned long long seed)
static void low(struct m0_net_buffer_pool *bp)
double rate(bcnt_t items, const struct timeval *tval, int scale)
double genrand64_real1(void)
void init_rand_generator(unsigned long long seed)
unsigned long long getnum(const char *str, const char *msg)
double genrand64_real2(void)
unsigned long long genrand64_int64(void)
void init_by_array64(unsigned long long init_key[], unsigned long long key_length, unsigned long long seed)
void timeval_sub(struct timeval *end, struct timeval *start)
unsigned long long bcnt_t
void timeval_add(struct timeval *sum, struct timeval *term)
int init(struct workload *w)
static void timeval_norm(struct timeval *t)
void cr_log(enum cr_log_level lev, const char *fmt,...)
static int start(struct m0_fom *fom)
long long genrand64_int63(void)
struct m0_rpc_fop_session_terminate term
int generate_fid(int seed, unsigned long *low, unsigned long *high)
void timeval_diff(const struct timeval *start, const struct timeval *end, struct timeval *diff)
static unsigned long long mt[NN]
double genrand64_real3(void)