Search in sources :

Example 1 with PerformedIncrease

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

the class ResourceManager method addCloudWorker.

/**
 * Adds a cloud worker
 *
 * @param origin
 * @param worker
 * @param granted
 */
public static void addCloudWorker(ResourceCreationRequest origin, CloudMethodWorker worker, CloudMethodResourceDescription granted) {
    synchronized (pool) {
        CloudProvider cloudProvider = origin.getProvider();
        cloudProvider.confirmedCreation(origin, worker, granted);
        worker.updatedFeatures();
        pool.addDynamicResource(worker);
        pool.defineCriticalSet();
        int[] maxTaskCount = worker.getSimultaneousTasks();
        for (int coreId = 0; coreId < maxTaskCount.length; coreId++) {
            poolCoreMaxConcurrentTasks[coreId] += maxTaskCount[coreId];
        }
    }
    ResourceUpdate<MethodResourceDescription> ru = new PerformedIncrease<>(worker.getDescription());
    resourceUser.updatedResource(worker, ru);
    // Log new resource
    RESOURCES_LOGGER.info("TIMESTAMP = " + String.valueOf(System.currentTimeMillis()));
    RESOURCES_LOGGER.info("INFO_MSG = [New resource available in the pool. Name = " + worker.getName() + "]");
    RUNTIME_LOGGER.info("New resource available in the pool. Name = " + worker.getName());
}
Also used : CloudProvider(es.bsc.compss.types.CloudProvider) MethodResourceDescription(es.bsc.compss.types.resources.MethodResourceDescription) CloudMethodResourceDescription(es.bsc.compss.types.resources.description.CloudMethodResourceDescription) PerformedIncrease(es.bsc.compss.types.resources.updates.PerformedIncrease)

Example 2 with PerformedIncrease

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

the class ResourceManager method increasedCloudWorker.

/**
 * Increases the capabilities of a given cloud worker
 *
 * @param origin
 * @param worker
 * @param extension
 */
public static void increasedCloudWorker(ResourceCreationRequest origin, CloudMethodWorker worker, CloudMethodResourceDescription extension) {
    synchronized (pool) {
        CloudProvider cloudProvider = origin.getProvider();
        cloudProvider.confirmedCreation(origin, worker, extension);
        int[] maxTaskCount = worker.getSimultaneousTasks();
        for (int coreId = 0; coreId < maxTaskCount.length; coreId++) {
            poolCoreMaxConcurrentTasks[coreId] -= maxTaskCount[coreId];
        }
        worker.increaseFeatures(extension);
        maxTaskCount = worker.getSimultaneousTasks();
        for (int coreId = 0; coreId < maxTaskCount.length; coreId++) {
            poolCoreMaxConcurrentTasks[coreId] += maxTaskCount[coreId];
        }
        pool.defineCriticalSet();
    }
    ResourceUpdate<MethodResourceDescription> ru = new PerformedIncrease<>(extension);
    resourceUser.updatedResource(worker, ru);
    // Log modified resource
    RESOURCES_LOGGER.info("TIMESTAMP = " + String.valueOf(System.currentTimeMillis()));
    RESOURCES_LOGGER.info("INFO_MSG = [Resource modified. Name = " + worker.getName() + "]");
    RUNTIME_LOGGER.info("Resource modified. Name = " + worker.getName());
}
Also used : CloudProvider(es.bsc.compss.types.CloudProvider) MethodResourceDescription(es.bsc.compss.types.resources.MethodResourceDescription) CloudMethodResourceDescription(es.bsc.compss.types.resources.description.CloudMethodResourceDescription) PerformedIncrease(es.bsc.compss.types.resources.updates.PerformedIncrease)

Aggregations

CloudProvider (es.bsc.compss.types.CloudProvider)2 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)2 CloudMethodResourceDescription (es.bsc.compss.types.resources.description.CloudMethodResourceDescription)2 PerformedIncrease (es.bsc.compss.types.resources.updates.PerformedIncrease)2