|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object WorkloadLublin99
public class WorkloadLublin99
The main purpose of this class is to create a realistic simulation environment where your jobs are competing with others. This class is responsible for creating jobs according to the workload model generator presented by Lublin and Feitelson.
Details on how the distributions have been implemented and how their parameters can be configured are described below. Please note that the following text was extracted from the C implementation of the model performed by Uri Lublin and Dror Feitelson:
The load generated can be changed by changing the values of the model parameters. Remember to set the number-of-nodes' parameters to fit your system. I distinguish between the two different types (batch or interactive) if the useJobType in the constructors is set to true. The program starts by initialising the model's parameters (according to the following constants definitions -- parameters values). Notice that if job type is set to true, there are different values to batch-parameters and interactive-parameters, and if this flag is false then they both get the same value (and the arbitrary type interactive). The workload calculates for each job its arrival arrival time (using 2 gamma distributions), number of nodes (using a two-stage-uniform distribution), runtime (using the number of nodes and hyper-gamma distribution) and type.
Some definitions:
sum(ri * ni) load = --------------- P * max(ai)
We can calculate an approximation (exact if 'ri' and 'ni' are independent)
r * n approximate-load = ------- P * a
The model controls the r,m,a. One can change them by changing the values of the model's parameters.
----------------------
Changing the runtime:
----------------------
Let g ~ gamma(alpha,beta) then the expectation and variation of g are:
E(g) = alpha*beta ; Var(g) = alpha*(beta^2)
so the coefficient of variation is CV = sqrt(Var(g))/E(g) = 1/sqrt(alpha).
One who wishes to enlarge the gamma random value without changing the CV
can set a larger value to the parameter beta . If one wishes that the CV will
change he may set a larger value to alpha parameter.
Let hg ~ hyper-gamma(a1,b1,a2,b2,p) then the expectation and variation are:
E(hg) = p*a1*b1 + (1-p)*a2*b2
Var(hg) = p^2*a1*b1^2 + (1-p)^2*a2*b2^2
One who wishes to enlarge the hyper-gamma (or the runtime) random value may
do that using one (or more) of the three following ways:
setRunTimeParameters(int, double, double, double, double, double, double)
in order to change the runtime parameters of jobs.
------------------------
Changing the correlation between the number of nodes a job needs and its runtime:
------------------------
The parameter 'pa' is responsible for that correlation. Since its negative
as the number of nodes get larger so is the runtime.
One who wishes no correlation between the nodes-number and the runtime should
set 'pa' to be 0 or a small negative number close to 0.
One who wishes to have strong such a correlation should set 'pa' to be not so
close to 0 , for example -0.05 or -0.1 . Note that this affect the runtime
which will be larger. One can take care of that by changing the other runtime
parameters (a1,b1,a2,b2,pb).
-----------------------------
Changing the number of nodes:
-----------------------------
Let u ~ uniform(a,b) then the expectation of u is E(u) = (a+b)/2.
Let tsu ~ two-stage-uniform(Ulow,Umed,Uhi,Uprob) then the expectation of tsu
is E(tsu) = Uprob*(Ulow+Umed)/2 + (1-Uprob)*(Umed+Uhi)/2 =
= (Uprob*Ulow + Umed + (1-Uprob)*Uhi)/2.
Use setParallelJobProbabilities(int, double, double, double, double)
to change the number of nodes and probability of parallel jobs.
Use setPower2Probability(int, double)
to change the probability of
power of two jobs.
Use setSerialProbability(int, double)
to change the probability for
serial or sequential jobs.
--------------------------
Changing the arrival time:
--------------------------
The arrival time is calculated in two stages:
(24 --> 0 , 25 --> 1 , ... , (24+BUCKETS) --> BUCKETS)One who wishes to change the mean inter-arrival time may do that in the following way:
Use setInterArrivalTimeParameters(int, double, double, double, double, double)
to change the inter-arrival parameters.
For more information on the workload model implemented here, please read
the following paper:
Uri Lublin and Dror G. Feitelson, The Workload on Parallel Supercomputers:
Modeling the Characteristics of Rigid Jobs. J. Parallel & Distributed
Comput. 63(11), pp. 1105-1122, Nov 2003.
GridSim.init(int, Calendar, boolean)
Field Summary | |
---|---|
static double |
A1
|
static double |
A1_ACTIVE
|
static double |
A1_BATCH
The parameters for the running time The running time is computed using hyper-gamma distribution. |
static double |
A2
|
static double |
A2_ACTIVE
|
static double |
A2_BATCH
|
static double |
AARR
|
static double |
AARR_ACTIVE
|
static double |
AARR_BATCH
|
static double |
ANUM
|
static double |
ANUM_ACTIVE
|
static double |
ANUM_BATCH
|
static double |
ARAR
|
static double |
ARAR_ACTIVE
|
static double |
ARAR_BATCH
|
static double |
B1
|
static double |
B1_ACTIVE
|
static double |
B1_BATCH
|
static double |
B2
|
static double |
B2_ACTIVE
|
static double |
B2_BATCH
|
static double |
BARR
|
static double |
BARR_ACTIVE
|
static double |
BARR_BATCH
|
static int |
BATCH_JOBS
Represents batch jobs |
static double |
BNUM
|
static double |
BNUM_ACTIVE
|
static double |
BNUM_BATCH
|
static int |
INTERACTIVE_JOBS
Represents interactive jobs |
static double |
PA
|
static double |
PA_ACTIVE
|
static double |
PA_BATCH
|
static double |
PB
|
static double |
PB_ACTIVE
|
static double |
PB_BATCH
|
static double |
POW2_PROB
|
static double |
POW2_PROB_ACTIVE
The default proportion of interactive jobs with power 2 number of nodes |
static double |
POW2_PROB_BATCH
The default proportion of batch jobs with power 2 number of nodes |
protected Random |
random
|
static double |
SERIAL_PROB
|
static double |
SERIAL_PROB_ACTIVE
The default proportion of interactive serial jobs |
static double |
SERIAL_PROB_BATCH
The default proportion of batch serial jobs |
static double |
UHI
|
static double |
UHI_ACTIVE
UHi is the default log2 of the maximal size of an interactive job in the system (system's size) |
static double |
UHI_BATCH
UHi is the default log2 of the maximal size of a batch job in the system (system's size) |
static double |
ULOW
|
static double |
ULOW_ACTIVE
ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform which is used to calculate the number of nodes for parallel jobs. |
static double |
ULOW_BATCH
ULow, UMed, UHi and Uprob are the parameters for the two-stage-uniform which is used to calculate the number of nodes for parallel jobs. |
static double |
UMED
|
static double |
UMED_ACTIVE
Default UMed for interactive jobs. |
static double |
UMED_BATCH
Default UMed for batch jobs. |
static double |
UPROB
|
static double |
UPROB_ACTIVE
Default UProb for interactive jobs. |
static double |
UPROB_BATCH
Default UProb for batch jobs. |
(package private) double[][] |
weights
|
Constructor Summary | |
---|---|
WorkloadLublin99(int rating,
boolean jobType,
long seed)
Create a new workload model object. |
Method Summary | |
---|---|
ArrayList<WorkloadJob> |
generateWorkload()
Generates jobs according to the model. |
double[] |
getInterArrivalTimeParameters(int jobType)
Returns the parameters for the inter-arrival time The inter-arriving time is calculated using two gamma distributions. |
double |
getParallelJobUHi(int jobType)
Gets the log2 of the maximal size of a job in the system (system's size) |
double |
getParallelJobULow(int jobType)
Gets the the log2 of the minimal size of job in the system (you can add or subtract 0.2 to give less/more probability to the minimal size). |
double |
getParallelJobUMed(int jobType)
Gets the medium size of parallel jobs in the system. |
double |
getParallelJobUProb(int jobType)
Gets the probability of the job being a parallel job |
double |
getPower2Probability(int jobType)
Gets the probability for power of two jobs |
double[] |
getRunTimeParameters(int jobType)
Gets the runtime parameters. |
double |
getSerialProbability(int jobType)
Gets the probability for serial jobs |
int |
getStartHour()
Gets the hour of the day when the simulation should start |
boolean |
setGridletFileSize(int size)
Sets a Gridlet file size (in byte) for sending to/from a resource. |
boolean |
setInterArrivalTimeParameters(int jobType,
double aarr,
double barr,
double anum,
double bnum,
double arar)
Sets the parameters for the inter-arrival time. |
boolean |
setMaximumWorkloadDuration(double duration)
Sets the maximum time duration of the workload. |
boolean |
setNumJobs(int numJobs)
Sets the maximum number of jobs to be generated by this workload model |
boolean |
setParallelJobProbabilities(int jobType,
double uLow,
double uMed,
double uHi,
double uProb)
Sets the parameters for the two-stage-uniform which is used to calculate the number of nodes for parallel jobs. |
boolean |
setPower2Probability(int jobType,
double prob)
Sets the probability for power of two jobs |
boolean |
setRunTimeParameters(int jobType,
double a1,
double a2,
double b1,
double b2,
double pa,
double pb)
Sets the parameters for the running time The running time is computed using hyper-gamma distribution. |
boolean |
setSerialProbability(int jobType,
double prob)
Sets the probability for serial jobs |
boolean |
setStartHour(int start)
Sets the hour of the day when the simulation should start |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Random random
public static final int INTERACTIVE_JOBS
public static final int BATCH_JOBS
public static final double SERIAL_PROB_BATCH
public static final double POW2_PROB_BATCH
public static final double ULOW_BATCH
public static final double UHI_BATCH
public static final double UMED_BATCH
public static final double UPROB_BATCH
public static final double SERIAL_PROB_ACTIVE
public static final double POW2_PROB_ACTIVE
public static final double ULOW_ACTIVE
public static final double UHI_ACTIVE
public static final double UMED_ACTIVE
public static final double UPROB_ACTIVE
public static final double A1_BATCH
public static final double B1_BATCH
public static final double A2_BATCH
public static final double B2_BATCH
public static final double PA_BATCH
public static final double PB_BATCH
public static final double A1_ACTIVE
public static final double B1_ACTIVE
public static final double A2_ACTIVE
public static final double B2_ACTIVE
public static final double PA_ACTIVE
public static final double PB_ACTIVE
public static final double AARR_BATCH
public static final double BARR_BATCH
public static final double ANUM_BATCH
public static final double BNUM_BATCH
public static final double ARAR_BATCH
public static final double AARR_ACTIVE
public static final double BARR_ACTIVE
public static final double ANUM_ACTIVE
public static final double BNUM_ACTIVE
public static final double ARAR_ACTIVE
public static final double SERIAL_PROB
public static final double POW2_PROB
public static final double ULOW
public static final double UMED
public static final double UHI
public static final double UPROB
public static final double A1
public static final double B1
public static final double A2
public static final double B2
public static final double PA
public static final double PB
public static final double AARR
public static final double BARR
public static final double ANUM
public static final double BNUM
public static final double ARAR
double[][] weights
Constructor Detail |
---|
public WorkloadLublin99(int rating, boolean jobType, long seed)
rating
- the resource's PE ratingjobType
- useJobType us if we should differ between batch and interactive
jobs or not. If the value is true
, then we use both batch and interactive
values for the parameters and the output sample includes both interactive
and batch jobs. We choose the type of the job to be the type whose next
job arrives to the system first (smaller next arrival time).
If the value is false
, then we use the "whole sample" parameters. The output
sample includes jobs from the same type (arbitrarily we choose batch).
We force the type to be interactive by setting the next arrival time of
interactive jobs to be Long.MAX_VALUE
-- always larger than the batchs's
next arrival.seed
- seed used by the random number generator
IllegalArgumentException
- if resource PE rating <= 0Method Detail |
---|
public boolean setSerialProbability(int jobType, double prob)
jobType
- the type of jobsprob
- the probability
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getSerialProbability(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public boolean setPower2Probability(int jobType, double prob)
jobType
- the type of jobsprob
- the probability
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getPower2Probability(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public boolean setParallelJobProbabilities(int jobType, double uLow, double uMed, double uHi, double uProb)
jobType
- the type of jobsuLow
- is the log2 of the minimal size of job in the system
(you can add or subtract 0.2 to give less/more probability to the
minimal size).uMed
- should be in [uHi-1.5 , uHi-3.5]uHi
- is the log2 of the maximal size of a job in the system
(system's size)uProb
- should be in [0.7 - 0.95]
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getParallelJobUProb(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getParallelJobUHi(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getParallelJobUMed(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public double getParallelJobULow(int jobType)
jobType
- the type of jobs
INTERACTIVE_JOBS
,
BATCH_JOBS
public boolean setRunTimeParameters(int jobType, double a1, double a2, double b1, double b2, double pa, double pb)
jobType
- the type of jobsa1
- hyper-gamma distribution parameter.a2
- hyper-gamma distribution parameter.b1
- hyper-gamma distribution parameter.b2
- hyper-gamma distribution parameter.pa
- hyper-gamma distribution parameter.pb
- hyper-gamma distribution parameter.
public double[] getRunTimeParameters(int jobType)
jobType
- the type of jobs
public boolean setInterArrivalTimeParameters(int jobType, double aarr, double barr, double anum, double bnum, double arar)
jobType
- the type of job for which the inter-arrival parameters
will be modified.aarr
- the first parameter for gamma(aarr,barr) distributionbarr
- the second parameter for gamma(aarr,barr) distributionanum
- the first parameter for gamma(bnum,anum) distributionbnum
- the second parameter for gamma(bnum,anum) distributionarar
- Arrive-Rush-All-Ratio
public double[] getInterArrivalTimeParameters(int jobType)
jobType
- the type of jobs
public boolean setNumJobs(int numJobs)
numJobs
- the number of jobs
public boolean setMaximumWorkloadDuration(double duration)
duration
- the maximum duration of the workload.
public int getStartHour()
public boolean setStartHour(int start)
start
- the start hour to set (between 0 and 23)
public boolean setGridletFileSize(int size)
size
- a Gridlet file size (in byte)
public ArrayList<WorkloadJob> generateWorkload()
generateWorkload
in interface WorkloadModel
null
in case of failure.
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |