edu.isi.pegasus.planner.selector.site.heft
public class Algorithm extends Object
- Our implementation uses downward ranks instead of the upward ranks as mentioned in the paper. The formulas have been updated accordingly. - During the processor selection phase, we do the simple selection and not follow the insertion based approach.
AVERAGE_BANDWIDTH
,
RUNTIME_PROFILE_KEY
,
DEFAULT_NUMBER_OF_FREE_NODES
,
AVERAGE_DATA_SIZE_BETWEEN_JOBS
,
org.griphyn.cPlanner.classes.JobManager#IDLE_NODES
Modifier and Type | Field and Description |
---|---|
static float |
AVERAGE_BANDWIDTH
The average bandwidth between the sites.
|
static float |
AVERAGE_DATA_SIZE_BETWEEN_JOBS
The average data that is transferred in between 2 jobs in the workflow.
|
static int |
DEFAULT_NUMBER_OF_FREE_NODES
The default number of nodes that are associated with a site if not found
in the site catalog.
|
private float |
mAverageCommunicationCost
The average communication cost between nodes.
|
static long |
MAXIMUM_FINISH_TIME
The maximum finish time possible for a job.
|
private String |
mLabel
The label of the workflow.
|
private LogManager |
mLogger
The handle to the LogManager
|
private PegasusProperties |
mProps
The handle to the properties.
|
private String |
mRequestID
The request id associated with the DAX.
|
private Map |
mSiteMap
Map containing the number of free nodes for each site.
|
private List |
mSites
The list of sites where the workflow can run.
|
private SiteStore |
mSiteStore
Handle to the site catalog.
|
private TransformationCatalog |
mTCHandle
The handle to the transformation catalog.
|
protected Mapper |
mTCMapper
Handle to the TCMapper.
|
private Graph |
mWorkflow
The workflow in the graph format, that needs to be scheduled.
|
static String |
PROCESS_CATALOG_IMPL_PROPERTY
The property that designates which Process catalog impl to pick up.
|
static String |
RUNTIME_PROFILE_KEY
The pegasus profile key that gives us the expected runtime.
|
Constructor and Description |
---|
Algorithm(PegasusBag bag)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected float |
calculateAverageComputeTime(Job job)
Returns the average compute time in seconds for a job.
|
protected long[] |
calculateEstimatedStartAndFinishTime(GraphNode node,
String site)
Estimates the start and finish time of a job on a site.
|
protected float |
computeDownwardRank(GraphNode node)
Computes the downward rank of a node.
|
String |
description()
This method returns a String describing the site selection technique
that is being implemented by the implementing class.
|
protected long |
getAvailableTime(String site,
long readyTime)
Returns the available time for a site.
|
protected int |
getExpectedRuntime(Job job,
TransformationCatalogEntry entry)
Return expected runtime.
|
protected double |
getExpectedRuntimeFromAC(Job job,
TransformationCatalogEntry entry)
Return expected runtime from the AC only if the process catalog is
initialized.
|
private float |
getFloatValue(Object key)
A convenience method to get the intValue for the object passed.
|
protected int |
getFreeNodesForSite(String site)
Returns the freenodes for a site.
|
long |
getMakespan()
Returns the makespan of the scheduled workflow.
|
String |
mapJob2ExecPool(Job job,
List pools)
The call out to the site selector to determine on what pool the job
should be scheduled.
|
protected void |
populateSiteMap(List sites)
Populates the number of free nodes for each site, by querying the
Site Catalog.
|
void |
schedule(ADag dag,
List sites)
Schedules the workflow using the heft.
|
void |
schedule(Graph workflow,
List sites,
String label)
Schedules the workflow according to the HEFT algorithm.
|
protected void |
scheduleJob(String site,
long start,
long end)
Schedules a job to a site.
|
public static final String RUNTIME_PROFILE_KEY
public static final String PROCESS_CATALOG_IMPL_PROPERTY
public static final float AVERAGE_BANDWIDTH
public static final float AVERAGE_DATA_SIZE_BETWEEN_JOBS
public static final int DEFAULT_NUMBER_OF_FREE_NODES
public static final long MAXIMUM_FINISH_TIME
private float mAverageCommunicationCost
private Graph mWorkflow
private SiteStore mSiteStore
private List mSites
private Map mSiteMap
Site
object.protected Mapper mTCMapper
private LogManager mLogger
private PegasusProperties mProps
private String mRequestID
private String mLabel
private TransformationCatalog mTCHandle
public Algorithm(PegasusBag bag)
bag
- the bag of Pegasus related objects.public void schedule(ADag dag, List sites)
dag
- the ADag
object containing the abstract workflow
that needs to be mapped.sites
- the list of candidate sites where the workflow can potentially
execute.public void schedule(Graph workflow, List sites, String label)
workflow
- the workflow that has to be scheduled.sites
- the list of candidate sites where the workflow can potentially
execute.label
- the label of the workflowpublic long getMakespan()
protected long[] calculateEstimatedStartAndFinishTime(GraphNode node, String site)
node
- the node that is being scheduledsite
- the site for which the finish time is reqd.protected float computeDownwardRank(GraphNode node)
node
- the GraphNode
whose rank needs to be computed.protected float calculateAverageComputeTime(Job job)
job
- the job whose average compute time is to be computed.protected int getExpectedRuntime(Job job, TransformationCatalogEntry entry)
job
- the job in the workflow.entry
- the TransformationCatalogEntry
object.protected double getExpectedRuntimeFromAC(Job job, TransformationCatalogEntry entry)
job
- the job in the workflow.entry
- the TC entryprotected void populateSiteMap(List sites)
sites
- list of sites.protected int getFreeNodesForSite(String site)
site
- the site identifier.protected void scheduleJob(String site, long start, long end)
site
- the site at which to schedulestart
- the start time for jobend
- the end time of jobprotected long getAvailableTime(String site, long readyTime)
site
- the site at which you want to schedule the job.readyTime
- the time at which all the data reqd by the job will arrive at site.public String description()
public String mapJob2ExecPool(Job job, List pools)
job
- Job the Job
object corresponding to
the job whose execution pool we want to determine.pools
- the list of String
objects representing the
execution pools that can be used.executionpool:jobmanager
where the
jobmanager can be null. If the pool is not found, then set
poolhandle to NONE. null - if some error occured .private float getFloatValue(Object key)
key
- the key to be converted