Search in sources :

Example 6 with Worker

use of es.bsc.compss.types.resources.Worker in project compss by bsc-wdc.

the class TestCompatible method resourceManagerTest.

/*
     * **********************************************************************************************************
     * RESOURCE MANAGER TEST IMPLEMENTATION
     * **********************************************************************************************************
     */
private static void resourceManagerTest() {
    coreCount = CoreManager.getCoreCount();
    ActionOrchestrator orchestrator = COMPSsRuntimeImpl.getOrchestrator();
    // Check for each implementation the correctness of its resources
    System.out.println("[LOG] Number of cores = " + coreCount);
    for (int coreId = 0; coreId < coreCount; coreId++) {
        System.out.println("[LOG] Checking Core" + coreId);
        Action a = new Action(orchestrator, coreId);
        Map<Worker<?>, List<Implementation>> m = a.findAvailableWorkers();
        // For the test construction, all implementations can be run. Check it
        if (m.size() == 0) {
            System.err.println("[ERROR] CoreId " + coreId + " cannot be run");
            List<Implementation> impls = CoreManager.getCoreImplementations(coreId);
            for (Implementation impl : impls) {
                System.out.println("-- Impl: " + impl.getRequirements().toString());
            }
            System.exit(-1);
        }
        // Check that all assigned resources are really valid
        checkCoreResources(coreId, m);
    }
}
Also used : ActionOrchestrator(es.bsc.compss.scheduler.types.ActionOrchestrator) Action(commons.Action) ServiceWorker(es.bsc.compss.types.resources.ServiceWorker) Worker(es.bsc.compss.types.resources.Worker) MethodWorker(es.bsc.compss.types.resources.MethodWorker) List(java.util.List) LinkedList(java.util.LinkedList) Implementation(es.bsc.compss.types.implementations.Implementation) ServiceImplementation(es.bsc.compss.types.implementations.ServiceImplementation) MethodImplementation(es.bsc.compss.types.implementations.MethodImplementation)

Aggregations

Worker (es.bsc.compss.types.resources.Worker)6 Action (commons.Action)3 ActionOrchestrator (es.bsc.compss.scheduler.types.ActionOrchestrator)3 Implementation (es.bsc.compss.types.implementations.Implementation)3 MethodWorker (es.bsc.compss.types.resources.MethodWorker)3 WorkerResourceDescription (es.bsc.compss.types.resources.WorkerResourceDescription)3 LinkedList (java.util.LinkedList)3 List (java.util.List)3 MethodImplementation (es.bsc.compss.types.implementations.MethodImplementation)2 ServiceImplementation (es.bsc.compss.types.implementations.ServiceImplementation)2 ServiceWorker (es.bsc.compss.types.resources.ServiceWorker)2 HashMap (java.util.HashMap)2 ResourceScheduler (es.bsc.compss.components.impl.ResourceScheduler)1 BlockedActionException (es.bsc.compss.scheduler.exceptions.BlockedActionException)1 FailedActionException (es.bsc.compss.scheduler.exceptions.FailedActionException)1 UnassignedActionException (es.bsc.compss.scheduler.exceptions.UnassignedActionException)1 CloudMethodWorker (es.bsc.compss.types.resources.CloudMethodWorker)1 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)1 ShutdownListener (es.bsc.compss.types.resources.ShutdownListener)1 Semaphore (java.util.concurrent.Semaphore)1