|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object WorkloadFileReader
public class WorkloadFileReader
This class is responsible for reading resource traces from a file and creating a list of jobs.
NOTE:
Link.DEFAULT_MTU
.
However, you can specify
the file size by using setGridletFileSize(int)
.
By default, this class follows the standard workload format as specified
in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling the below methods before
running the simulation:
Workload
Constructor Summary | |
---|---|
WorkloadFileReader(String fileName,
int rating)
Create a new WorkloadFileReader object. |
Method Summary | |
---|---|
ArrayList<WorkloadJob> |
generateWorkload()
Reads job information from a given file. |
boolean |
setComment(String cmt)
Identifies the start of a comment line. |
boolean |
setField(int maxField,
int jobNum,
int submitTime,
int runTime,
int numProc)
Tells this class what to look in the trace file. |
boolean |
setGridletFileSize(int size)
Sets a Gridlet file size (in byte) for sending to/from a resource. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkloadFileReader(String fileName, int rating)
WorkloadFileReader
object.
fileName
- the workload trace filename in one of the following
format: ASCII text, zip, gz.rating
- the resource's PE rating
IllegalArgumentException
- This happens for the following conditions:
Method Detail |
---|
public boolean setGridletFileSize(int size)
size
- a Gridlet file size (in byte)
true
if it is successful, false
otherwisepublic boolean setComment(String cmt)
cmt
- a character that denotes the start of a comment, e.g. ";" or "#"
true
if it is successful, false
otherwisepublic boolean setField(int maxField, int jobNum, int submitTime, int runTime, int numProc)
By default, this class follows the standard workload format as specified
in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling this method.
The parameters must be a positive integer number starting from 1. A special case is where jobNum == -1, meaning the job or gridlet ID starts at 1.
maxField
- max. number of field/column in one rowjobNum
- field/column number for locating the job IDsubmitTime
- field/column number for locating the job submit timerunTime
- field/column number for locating the job run timenumProc
- field/column number for locating the number of PEs
required to run a job
true
if successful, false
otherwise
IllegalArgumentException
- if any of the arguments are not
within the acceptable rangespublic 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 |