Search in sources :

Example 11 with Gap

use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.

the class MOResourceScheduler method generateResourceScore.

/*--------------------------------------------------
     ---------------------------------------------------
     ------------------ Score Methods ------------------
     ---------------------------------------------------
     --------------------------------------------------*/
/**
 * @param action
 * @param params
 * @param actionScore
 * @return
 */
@Override
public Score generateResourceScore(AllocatableAction action, TaskDescription params, Score actionScore) {
    long resScore = Score.calculateDataLocalityScore(params, myWorker);
    for (AllocatableAction pred : action.getDataPredecessors()) {
        if (pred.isPending() && pred.getAssignedResource() == this) {
            resScore++;
        }
    }
    resScore = params.getParameters().length - resScore;
    long lessTimeStamp = Long.MAX_VALUE;
    Gap g = gaps.peekFirst();
    if (g != null) {
        lessTimeStamp = g.getInitialTime();
        if (lessTimeStamp < 0) {
            lessTimeStamp = 0;
        }
    }
    long actionPriority = actionScore.getActionScore();
    long expectedDataAvailable = ((MOScore) actionScore).getExpectedDataAvailable() + resScore * MOConfiguration.DATA_TRANSFER_DELAY;
    return new MOScore(actionPriority, expectedDataAvailable, lessTimeStamp, 0, 0, 0);
}
Also used : Gap(es.bsc.compss.scheduler.multiobjective.types.Gap) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction) MOScore(es.bsc.compss.scheduler.multiobjective.types.MOScore)

Example 12 with Gap

use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.

the class MOResourceScheduler method generateCurrentImplementationScore.

public MOScore generateCurrentImplementationScore(AllocatableAction action, Implementation impl, Score resourceScore) {
    // Check if it is to be deleted
    long resourceFreeTime = Long.MAX_VALUE;
    Gap g = gaps.peekFirst();
    if (g != null) {
        resourceFreeTime = ((MOSchedulingInformation) action.getSchedulingInfo()).getExpectedStart();
    }
    long expectedDataAvailable = ((MOScore) resourceScore).getExpectedDataAvailable();
    long actionPriority = resourceScore.getActionScore();
    return generateMOScore(resourceFreeTime, expectedDataAvailable, actionPriority, impl);
}
Also used : Gap(es.bsc.compss.scheduler.multiobjective.types.Gap) MOScore(es.bsc.compss.scheduler.multiobjective.types.MOScore)

Example 13 with Gap

use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.

the class MOResourceScheduler method scheduleAction.

/*--------------------------------------------------
     ---------------------------------------------------
     ---------------- Scheduler Methods ----------------
     ---------------------------------------------------
     --------------------------------------------------*/
@Override
public void scheduleAction(AllocatableAction action) {
    synchronized (gaps) {
        if (opAction != null) {
            // If optimization in progress
            ((MOSchedulingInformation) opAction.getSchedulingInfo()).addSuccessor(action);
            Gap opActionGap = new Gap(0, 0, opAction, action.getAssignedImplementation().getRequirements().copy(), 0);
            ((MOSchedulingInformation) action.getSchedulingInfo()).addPredecessor(opActionGap);
        } else {
            scheduleUsingGaps(action, gaps);
        }
    }
}
Also used : Gap(es.bsc.compss.scheduler.multiobjective.types.Gap)

Example 14 with Gap

use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.

the class MOSchedulingInformation method isExecutable.

@Override
public final boolean isExecutable() {
    boolean b = true;
    lock();
    for (Gap g : resourcePredecessors) {
        b = b && (g.getOrigin() == null);
    }
    unlock();
    return b;
}
Also used : Gap(es.bsc.compss.scheduler.multiobjective.types.Gap)

Example 15 with Gap

use of es.bsc.compss.scheduler.multiobjective.types.Gap in project compss by bsc-wdc.

the class MOSchedulingInformation method toString.

@Override
public String toString() {
    StringBuilder sb = new StringBuilder("\tlastUpdate: " + lastUpdate + "\n" + "\texpectedStart: " + expectedStart + "\n" + "\texpectedEnd:" + expectedEnd + "\n");
    sb.append("\t").append("schedPredecessors: ");
    for (Gap g : getPredecessors()) {
        sb.append(" ").append(g.getOrigin());
    }
    sb.append("\n");
    sb.append("\t").append("schedSuccessors: ");
    for (AllocatableAction aa : getSuccessors()) {
        sb.append(" ").append(aa);
    }
    sb.append("\n");
    sb.append("\tOptimization Successors").append(optimizingSuccessors);
    return sb.toString();
}
Also used : Gap(es.bsc.compss.scheduler.multiobjective.types.Gap) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Aggregations

Gap (es.bsc.compss.scheduler.multiobjective.types.Gap)15 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)9 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)7 ResourceDescription (es.bsc.compss.types.resources.ResourceDescription)6 LinkedList (java.util.LinkedList)4 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)3 PriorityQueue (java.util.PriorityQueue)3 MOScore (es.bsc.compss.scheduler.multiobjective.types.MOScore)2 OptimizationAction (es.bsc.compss.scheduler.multiobjective.types.OptimizationAction)2 Implementation (es.bsc.compss.types.implementations.Implementation)2 ConcurrentModificationException (java.util.ConcurrentModificationException)2 ActionNotFoundException (es.bsc.compss.scheduler.exceptions.ActionNotFoundException)1 LocalOptimizationState (es.bsc.compss.scheduler.multiobjective.types.LocalOptimizationState)1 SchedulingEvent (es.bsc.compss.scheduler.multiobjective.types.SchedulingEvent)1