Search in sources :

Example 31 with AllocatableAction

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

the class MOResourceScheduler method classifyPendingSchedulings.

public void classifyPendingSchedulings(List<AllocatableAction> pendingSchedulings, LocalOptimizationState state) {
    for (AllocatableAction action : pendingSchedulings) {
        // Action has an artificial resource dependency with the opAction
        MOSchedulingInformation actionDSI = (MOSchedulingInformation) action.getSchedulingInfo();
        actionDSI.scheduled();
        actionDSI.setOnOptimization(true);
        actionDSI.setToReschedule(true);
        // Data Dependencies analysis
        boolean hasInternal = false;
        boolean hasExternal = false;
        long startTime = 0;
        try {
            List<AllocatableAction> dPreds = action.getDataPredecessors();
            for (AllocatableAction dPred : dPreds) {
                MOSchedulingInformation dPredDSI = (MOSchedulingInformation) dPred.getSchedulingInfo();
                if (dPred.getAssignedResource() == this) {
                    if (dPredDSI.tryToLock()) {
                        if (dPredDSI.isScheduled()) {
                            hasInternal = true;
                            dPredDSI.addOptimizingSuccessor(action);
                        }
                        dPredDSI.unlock();
                    }
                // else
                // The predecessor is trying to be unscheduled but it is
                // blocked by another successor reschedule.
                } else {
                    hasExternal = true;
                    startTime = Math.max(startTime, dPredDSI.getExpectedEnd());
                }
            }
        } catch (ConcurrentModificationException cme) {
            hasInternal = false;
            hasExternal = false;
            startTime = 0;
        }
        actionDSI.setExpectedStart(startTime);
        state.classifyAction(action, hasInternal, hasExternal, true, startTime);
    }
}
Also used : ConcurrentModificationException(java.util.ConcurrentModificationException) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 32 with AllocatableAction

use of es.bsc.compss.scheduler.types.AllocatableAction 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)

Example 33 with AllocatableAction

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

the class LocalOptimizationState method progressOnTime.

public void progressOnTime(long time) {
    while (readyActions.size() > 0) {
        AllocatableAction top = readyActions.peek();
        MOSchedulingInformation topDSI = (MOSchedulingInformation) top.getSchedulingInfo();
        long start = topDSI.getExpectedStart();
        if (start > time) {
            break;
        }
        readyActions.poll();
        selectableActions.offer(top);
    }
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 34 with AllocatableAction

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

the class LocalOptimizationState method blockDataSuccessors.

public void blockDataSuccessors(MOSchedulingInformation dsi) {
    List<AllocatableAction> successors = dsi.getOptimizingSuccessors();
    for (AllocatableAction successor : successors) {
        MOSchedulingInformation sucDSI = (MOSchedulingInformation) successor.getSchedulingInfo();
        sucDSI.lock();
        if (sucDSI.isOnOptimization()) {
            sucDSI.clearPredecessors();
            sucDSI.clearSuccessors();
            dataBlockedAction(successor);
            blockDataSuccessors(sucDSI);
            sucDSI.setExpectedStart(Long.MAX_VALUE);
            sucDSI.setExpectedEnd(Long.MAX_VALUE);
            sucDSI.setOnOptimization(false);
        }
        sucDSI.unlock();
    }
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 35 with AllocatableAction

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

the class LocalOptimizationState method addTmpGap.

public void addTmpGap(Gap g) {
    AllocatableAction gapAction = g.getOrigin();
    MOSchedulingInformation gapDSI = (MOSchedulingInformation) gapAction.getSchedulingInfo();
    gapDSI.addGap();
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Aggregations

AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)43 LinkedList (java.util.LinkedList)13 MOSchedulingInformation (es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation)11 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)10 PriorityQueue (java.util.PriorityQueue)10 Gap (es.bsc.compss.scheduler.multiobjective.types.Gap)9 Score (es.bsc.compss.scheduler.types.Score)7 BlockedActionException (es.bsc.compss.scheduler.exceptions.BlockedActionException)6 Implementation (es.bsc.compss.types.implementations.Implementation)6 ResourceDescription (es.bsc.compss.types.resources.ResourceDescription)6 ActionNotFoundException (es.bsc.compss.scheduler.exceptions.ActionNotFoundException)5 ConcurrentModificationException (java.util.ConcurrentModificationException)5 ObjectValue (es.bsc.compss.scheduler.types.ObjectValue)4 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)3 HashSet (java.util.HashSet)3 FailedActionException (es.bsc.compss.scheduler.exceptions.FailedActionException)2 UnassignedActionException (es.bsc.compss.scheduler.exceptions.UnassignedActionException)2 MOScore (es.bsc.compss.scheduler.multiobjective.types.MOScore)2 OptimizationAction (es.bsc.compss.scheduler.multiobjective.types.OptimizationAction)2 Profile (es.bsc.compss.scheduler.types.Profile)2