use of es.bsc.compss.types.CloudProvider in project compss by bsc-wdc.
the class CloudManager method getPendingCoreCounts.
/**
* Queries the amount of tasks that will be able to run simulataneously once all the VMs have been created
*
* @return Returns all the pending creation requests
*/
public int[] getPendingCoreCounts() {
int coreCount = CoreManager.getCoreCount();
int[] pendingCoreCounts = new int[coreCount];
for (CloudProvider cp : providers.values()) {
int[] providerCounts = cp.getPendingCoreCounts();
for (int coreId = 0; coreId < providerCounts.length; coreId++) {
pendingCoreCounts[coreId] += providerCounts[coreId];
}
}
return pendingCoreCounts;
}
use of es.bsc.compss.types.CloudProvider in project compss by bsc-wdc.
the class CloudManager method getCurrentState.
public String getCurrentState(String prefix) {
StringBuilder sb = new StringBuilder();
// Current state
sb.append(prefix).append("CLOUD = [").append("\n");
sb.append(prefix).append("\t").append("CURRENT_STATE = [").append("\n");
for (CloudProvider cp : providers.values()) {
sb.append(cp.getCurrentState(prefix + "\t" + "\t"));
}
sb.append(prefix).append("\t").append("]").append("\n");
// Pending requests
sb.append(prefix).append("\t").append("PENDING_REQUESTS = [").append("\n");
for (CloudProvider cp : providers.values()) {
for (ResourceCreationRequest rcr : cp.getPendingRequests()) {
Map<CloudInstanceTypeDescription, int[]> composition = rcr.getRequested().getTypeComposition();
// REQUEST ARE COMPOSED OF A SINGLE INSTANCE TYPE
for (CloudInstanceTypeDescription citd : composition.keySet()) {
sb.append(prefix).append("\t").append("\t").append("REQUEST = ").append(citd.getName()).append("\n");
}
}
}
sb.append(prefix).append("\t").append("]").append("\n");
sb.append(prefix).append("]");
return sb.toString();
}
Aggregations