Search in sources :

Example 16 with ResourceDescription

use of es.bsc.compss.types.resources.ResourceDescription in project compss by bsc-wdc.

the class LocalOptimizationState method replaceAction.

public void replaceAction(AllocatableAction<P, T, I> action) {
    this.action = action;
    if (this.action != null) {
        missingResources = this.action.getAssignedImplementation().getRequirements().copy();
        // Check if the new peek can run in the already freed resources.
        for (Gap<P, T, I> gap : gaps) {
            ResourceDescription empty = gap.getResources().copy();
            topStartTime = gap.getInitialTime();
            ResourceDescription.reduceCommonDynamics(empty, missingResources);
            if (missingResources.isDynamicUseless()) {
                break;
            }
        }
    } else {
        missingResources = null;
        topStartTime = 0l;
    }
}
Also used : ResourceDescription(es.bsc.compss.types.resources.ResourceDescription) WorkerResourceDescription(es.bsc.compss.types.resources.WorkerResourceDescription)

Example 17 with ResourceDescription

use of es.bsc.compss.types.resources.ResourceDescription in project compss by bsc-wdc.

the class LocalOptimizationState method checkGapForReserve.

private boolean checkGapForReserve(Gap<P, T, I> g, ResourceDescription requirements, long reserveStart, LinkedList<Gap<P, T, I>> previousGaps) {
    boolean remove = false;
    AllocatableAction<P, T, I> gapAction = g.getOrigin();
    ResourceDescription rd = g.getResources();
    ResourceDescription reduction = ResourceDescription.reduceCommonDynamics(rd, requirements);
    Gap<P, T, I> tmpGap = new Gap<>(g.getInitialTime(), reserveStart, g.getOrigin(), reduction, 0);
    previousGaps.add(tmpGap);
    if (gapAction != null) {
        FullGraphSchedulingInformation<P, T, I> gapDSI = (FullGraphSchedulingInformation<P, T, I>) gapAction.getSchedulingInfo();
        // Remove resources from the first gap
        gapDSI.addGap();
    }
    // If the gap has been fully used
    if (rd.isDynamicUseless()) {
        // Remove the gap
        remove = true;
        if (gapAction != null) {
            FullGraphSchedulingInformation<P, T, I> gapDSI = (FullGraphSchedulingInformation<P, T, I>) gapAction.getSchedulingInfo();
            gapDSI.removeGap();
        }
    }
    return remove;
}
Also used : FullGraphSchedulingInformation(es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.FullGraphSchedulingInformation) ResourceDescription(es.bsc.compss.types.resources.ResourceDescription) WorkerResourceDescription(es.bsc.compss.types.resources.WorkerResourceDescription)

Aggregations

ResourceDescription (es.bsc.compss.types.resources.ResourceDescription)17 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)17 Gap (es.bsc.compss.scheduler.multiobjective.types.Gap)6 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)6 LinkedList (java.util.LinkedList)5 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)3 MOSchedulingInformation (es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation)2 Implementation (es.bsc.compss.types.implementations.Implementation)2 FullGraphSchedulingInformation (es.bsc.es.bsc.compss.scheduler.fullGraphScheduler.FullGraphSchedulingInformation)2 Profile (es.bsc.es.bsc.compss.scheduler.types.Profile)2 ConcurrentModificationException (java.util.ConcurrentModificationException)2 PriorityQueue (java.util.PriorityQueue)2 ActionNotFoundException (es.bsc.compss.scheduler.exceptions.ActionNotFoundException)1 OptimizationAction (es.bsc.compss.scheduler.multiobjective.types.OptimizationAction)1 SchedulingEvent (es.bsc.compss.scheduler.multiobjective.types.SchedulingEvent)1 AllocatableAction (es.bsc.es.bsc.compss.scheduler.types.AllocatableAction)1 FullGraphScore (es.bsc.es.bsc.compss.scheduler.types.FullGraphScore)1 Gap (es.bsc.es.bsc.compss.scheduler.types.Gap)1 LocalOptimizationState (es.bsc.es.bsc.compss.scheduler.types.LocalOptimizationState)1 SchedulingEvent (es.bsc.es.bsc.compss.scheduler.types.SchedulingEvent)1