Search in sources :

Example 1 with ActionNotWaitingException

use of es.bsc.compss.scheduler.exceptions.ActionNotWaitingException in project compss by bsc-wdc.

the class ResourceScheduler method tryToLaunchBlockedActions.

/**
 * Tries to launch blocked actions on resource. When an action cannot be launched, its successors are not tried
 */
@SuppressWarnings("unchecked")
public final void tryToLaunchBlockedActions() {
    LOGGER.debug("[ResourceScheduler] Try to launch blocked actions on resource " + getName());
    while (this.hasBlockedActions()) {
        AllocatableAction firstBlocked = this.getFirstBlocked();
        Implementation selectedImplementation = firstBlocked.getAssignedImplementation();
        if (!firstBlocked.isToReserveResources() || myWorker.canRunNow((T) selectedImplementation.getRequirements())) {
            try {
                firstBlocked.resumeExecution();
                this.removeFirstBlocked();
            } catch (ActionNotWaitingException anwe) {
            // Not possible. If the task is in blocked list it is waiting
            }
        } else {
            break;
        }
    }
}
Also used : ActionNotWaitingException(es.bsc.compss.scheduler.exceptions.ActionNotWaitingException) AllocatableAction(es.bsc.compss.scheduler.types.AllocatableAction) Implementation(es.bsc.compss.types.implementations.Implementation)

Aggregations

ActionNotWaitingException (es.bsc.compss.scheduler.exceptions.ActionNotWaitingException)1 AllocatableAction (es.bsc.compss.scheduler.types.AllocatableAction)1 Implementation (es.bsc.compss.types.implementations.Implementation)1