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());
}
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());
}
Aggregations