Search in sources :

Example 6 with MOScore

use of es.bsc.compss.scheduler.multiobjective.types.MOScore 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 7 with MOScore

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

the class MOScheduleOptimizer method scheduleOnWorker.

public void scheduleOnWorker(AllocatableAction action, Implementation impl, OptimizationWorker ow) {
    boolean failedSpecificScheduling = false;
    try {
        action.schedule(ow.getResource(), impl);
        try {
            action.tryToLaunch();
        } catch (InvalidSchedulingException ise) {
            failedSpecificScheduling = true;
        }
    } catch (BlockedActionException bae) {
    // Can not happen since there was an original source
    } catch (UnassignedActionException be) {
        failedSpecificScheduling = true;
    }
    if (failedSpecificScheduling) {
        try {
            long actionScore = MOScore.getActionScore(action);
            long dataTime = MOScore.getDataPredecessorTime(action.getDataPredecessors());
            Score aScore = new MOScore(actionScore, dataTime, 0, 0, 0, 0);
            action.schedule(aScore);
            try {
                action.tryToLaunch();
            } catch (InvalidSchedulingException ise2) {
            // Impossible exception if schedule method on action is ok.
            }
        } catch (BlockedActionException | UnassignedActionException be) {
        // Can not happen since there was an original source
        }
    }
}
Also used : MOScore(es.bsc.compss.scheduler.multiobjective.types.MOScore) Score(es.bsc.compss.scheduler.types.Score) UnassignedActionException(es.bsc.compss.scheduler.exceptions.UnassignedActionException) BlockedActionException(es.bsc.compss.scheduler.exceptions.BlockedActionException) InvalidSchedulingException(es.bsc.compss.scheduler.exceptions.InvalidSchedulingException) MOScore(es.bsc.compss.scheduler.multiobjective.types.MOScore)

Aggregations

MOScore (es.bsc.compss.scheduler.multiobjective.types.MOScore)7 Score (es.bsc.compss.scheduler.types.Score)3 BlockedActionException (es.bsc.compss.scheduler.exceptions.BlockedActionException)2 InvalidSchedulingException (es.bsc.compss.scheduler.exceptions.InvalidSchedulingException)2 UnassignedActionException (es.bsc.compss.scheduler.exceptions.UnassignedActionException)2 Gap (es.bsc.compss.scheduler.multiobjective.types.Gap)2 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)2 Implementation (es.bsc.compss.types.implementations.Implementation)2 ActionNotFoundException (es.bsc.compss.scheduler.exceptions.ActionNotFoundException)1 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1