Search in sources :

Example 11 with MOSchedulingInformation

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

the class LocalOptimizationState method releaseResources.

public void releaseResources(long expectedStart, AllocatableAction action) {
    if (action.getAssignedImplementation() != null) {
        Gap gap;
        gap = new Gap(expectedStart, Long.MAX_VALUE, action, action.getAssignedImplementation().getRequirements().copy(), 0);
        MOSchedulingInformation dsi = (MOSchedulingInformation) action.getSchedulingInfo();
        dsi.addGap();
        gaps.add(gap);
        if (missingResources != null) {
            ResourceDescription empty = gap.getResources().copy();
            topStartTime = gap.getInitialTime();
            ResourceDescription.reduceCommonDynamics(empty, missingResources);
        }
    } else {
        LOGGER.debug(LOG_PREFIX + "Action has null implementation. Nothing done at release resources *** ");
    }
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) ResourceDescription(es.bsc.compss.types.resources.ResourceDescription) WorkerResourceDescription(es.bsc.compss.types.resources.WorkerResourceDescription)

Example 12 with MOSchedulingInformation

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

the class LocalOptimizationState method releaseDataSuccessors.

public void releaseDataSuccessors(MOSchedulingInformation dsi, long timeLimit) {
    List<AllocatableAction> successors = dsi.getOptimizingSuccessors();
    for (AllocatableAction successor : successors) {
        MOSchedulingInformation successorDSI = (MOSchedulingInformation) successor.getSchedulingInfo();
        int missingParams = 0;
        long startTime = 0;
        boolean retry = true;
        while (retry) {
            try {
                List<AllocatableAction> predecessors = successor.getDataPredecessors();
                for (AllocatableAction predecessor : predecessors) {
                    MOSchedulingInformation predDSI = ((MOSchedulingInformation) predecessor.getSchedulingInfo());
                    if (predecessor.getAssignedResource() != worker) {
                        startTime = Math.max(startTime, predDSI.getExpectedEnd());
                    } else if (predDSI.isOnOptimization()) {
                        missingParams++;
                    } else {
                        startTime = Math.max(startTime, predDSI.getExpectedEnd());
                    }
                }
                retry = false;
            } catch (ConcurrentModificationException cme) {
                missingParams = 0;
                startTime = 0;
            }
        }
        successorDSI.setExpectedStart(startTime);
        if (missingParams == 0) {
            if (successorDSI.getExpectedStart() <= timeLimit) {
                selectableActions.offer(successor);
            } else {
                readyActions.add(successor);
            }
        }
    }
    dsi.clearOptimizingSuccessors();
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) ConcurrentModificationException(java.util.ConcurrentModificationException) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 13 with MOSchedulingInformation

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

the class PriorityActionSet method poll.

public AllocatableAction poll() {
    AllocatableAction currentPeek;
    while ((currentPeek = priority.poll()) != null) {
        Integer coreId = currentPeek.getCoreId();
        AllocatableAction nextPeek;
        if (coreId == null) {
            noCoreActions.poll();
            nextPeek = noCoreActions.peek();
        } else {
            coreActions[coreId].poll();
            nextPeek = coreActions[coreId].peek();
        }
        if (nextPeek != null) {
            priority.offer(nextPeek);
        }
        MOSchedulingInformation dsi = (MOSchedulingInformation) currentPeek.getSchedulingInfo();
        if (dsi.isToReschedule()) {
            break;
        }
    }
    return currentPeek;
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 14 with MOSchedulingInformation

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

the class PriorityActionSet method peek.

public AllocatableAction peek() {
    AllocatableAction currentPeek = priority.peek();
    while (currentPeek != null && !((MOSchedulingInformation) currentPeek.getSchedulingInfo()).isToReschedule()) {
        removeFirst(currentPeek.getCoreId());
        currentPeek = priority.peek();
    }
    return currentPeek;
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction)

Example 15 with MOSchedulingInformation

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

the class PriorityActionSet method peekAll.

public PriorityQueue<AllocatableAction> peekAll() {
    PriorityQueue<AllocatableAction> peeks = new PriorityQueue<AllocatableAction>(coreActions.length + 1, comparator);
    AllocatableAction currentCore = noCoreActions.peek();
    if (currentCore != null && !((MOSchedulingInformation) currentCore.getSchedulingInfo()).isToReschedule()) {
        noCoreActions.poll();
        currentCore = noCoreActions.peek();
    }
    if (currentCore != null) {
        peeks.offer(currentCore);
    }
    for (PriorityQueue<AllocatableAction> core : coreActions) {
        currentCore = core.peek();
        if (currentCore != null && !((MOSchedulingInformation) currentCore.getSchedulingInfo()).isToReschedule()) {
            core.poll();
            currentCore = core.peek();
        }
        if (currentCore != null) {
            peeks.offer(currentCore);
        }
    }
    return peeks;
}
Also used : MOSchedulingInformation(es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction) PriorityQueue(java.util.PriorityQueue)

Aggregations

MOSchedulingInformation (es.bsc.compss.scheduler.multiobjective.MOSchedulingInformation)15 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)11 Implementation (es.bsc.compss.types.implementations.Implementation)2 ResourceDescription (es.bsc.compss.types.resources.ResourceDescription)2 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)2 PriorityQueue (java.util.PriorityQueue)2 Profile (es.bsc.compss.scheduler.types.Profile)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1