/home/aching/Avery/Work.School/Research/pvfs2-lock/s3asim/src/misc.h File Reference

#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>

Functions

double generate_rand_zero_one (unsigned int *seed)
int generate_int_range (unsigned int *seed, int min, int max)
int find_frag (unsigned int *seed, int total_frags)

Function Documentation

int find_frag ( unsigned int *  seed_p,
int  total_frags 
)

The function is called for each result to determine which fragment will have the result.

Parameters:
seed_p Pointer to the seed to generate pseudo-random output.
total_frags Fragment count.
Returns:
The index of the fragment which has this result.

int generate_int_range ( unsigned int *  seed_p,
int  min,
int  max 
)

Generate a pseudo-random integer between min and max.

Parameters:
seed_p Pointer to the seed to generate pseudo-random output.
min Minimum integer value
max Maximum integer value
Returns:
The pseudo-random integer in betwen min to max.

double generate_rand_zero_one ( unsigned int *  seed_p  ) 

Generate a pseudo-random double between 0 and 1.

Parameters:
seed_p Pointer to the seed to generate pseudo-random output.
Returns:
The pseudo-random double in between 0 to 1.


Generated on Sun May 20 13:10:04 2007 for s3asim by  doxygen 1.4.7