Search in sources :

Example 6 with Processor

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

the class MethodResourceDescription method setProcessors.

public void setProcessors(List<Processor> processors) {
    this.processors = processors;
    initProcessorCounters();
    for (Processor p : this.processors) {
        updateCounters(p);
    }
}
Also used : Processor(es.bsc.compss.types.resources.components.Processor)

Example 7 with Processor

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

the class MethodResourceDescription method getDynamicCommonsProcessor.

private Processor getDynamicCommonsProcessor(Processor pThis, Processor p) {
    // Copy the assignable processor (no the requested)
    Processor common = new Processor(pThis);
    // Compute the number of CUs that can be given
    int cus = Math.min(pThis.getComputingUnits(), p.getComputingUnits());
    common.setComputingUnits(cus);
    return common;
}
Also used : Processor(es.bsc.compss.types.resources.components.Processor)

Example 8 with Processor

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

the class MethodResourceDescription method getDynamicDescription.

@Override
public String getDynamicDescription() {
    StringBuilder sb = new StringBuilder();
    sb.append(" Processor: ");
    for (Processor pThis : this.processors) {
        sb.append(pThis.getComputingUnits() + " " + pThis.getArchitecture() + " cores");
    }
    // Memory
    sb.append(" Memory: ");
    if (this.memorySize != UNASSIGNED_FLOAT) {
        sb.append(this.memorySize);
    } else {
        sb.append("Unassigned");
    }
    return sb.toString();
}
Also used : Processor(es.bsc.compss.types.resources.components.Processor)

Example 9 with Processor

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

the class MethodResourceDescription method toString.

/*
     * ******************************************* LOGGERS ******************************************
     */
public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("[DESCRIPTION");
    for (Processor p : this.processors) {
        sb.append(" [PROCESSOR ").append(p.getName());
        sb.append(" TYPE=").append(p.getType());
        sb.append(" COMPUTING_UNITS=").append(p.getComputingUnits());
        sb.append(" SPEED=").append(p.getSpeed());
        sb.append(" INTERNAL_MEMORY=").append(p.getInternalMemory());
        sb.append(" ARCHITECTURE=").append(p.getArchitecture());
        sb.append(" PROP_NAME=").append(p.getPropName());
        sb.append(" PROP_VALUE=").append(p.getPropValue());
        sb.append("]");
    }
    sb.append("[GENERAL_COUNTS");
    sb.append(" TOTAL_CPUs=").append(this.totalCPUs);
    sb.append(" TOTAL_CPU_CU=").append(this.totalCPUComputingUnits);
    sb.append(" TOTAL_GPUs=").append(this.totalGPUs);
    sb.append(" TOTAL_GPU_CU=").append(this.totalGPUComputingUnits);
    sb.append(" TOTAL_FPGAs=").append(this.totalFPGAs);
    sb.append(" TOTAL_FPGA_CU=").append(this.totalFPGAComputingUnits);
    sb.append(" TOTAL_OTHERs=").append(this.totalOTHERs);
    sb.append(" TOTAL_OTHER_CU=").append(this.totalOTHERComputingUnits);
    sb.append("]");
    sb.append(" [MEMORY");
    sb.append(" SIZE=").append(this.memorySize);
    sb.append(" TYPE=").append(this.memoryType);
    sb.append("]");
    sb.append(" [STORAGE");
    sb.append(" SIZE=").append(this.storageSize);
    sb.append(" TYPE=").append(this.storageType);
    sb.append("]");
    sb.append(" [OPERATING_SYSTEM");
    sb.append(" TYPE=").append(this.operatingSystemType);
    sb.append(" DISTRIBUTION=").append(this.operatingSystemDistribution);
    sb.append(" VERSION=").append(this.operatingSystemVersion);
    sb.append("]");
    sb.append(" [SOFTWARE ");
    for (String app : this.appSoftware) {
        sb.append(app).append(", ");
    }
    sb.append("]");
    sb.append(" [HOST_QUEUES ");
    for (String queue : this.hostQueues) {
        sb.append(queue).append(", ");
    }
    sb.append("]");
    sb.append(" [PRICE");
    sb.append(" TIME_UNIT=").append(this.priceTimeUnit);
    sb.append(" PRICE_PER_TIME=").append(this.pricePerUnit);
    sb.append("]");
    sb.append(" [WALLCLOCK=").append(this.wallClockLimit).append("]");
    // End DESCRIPTION
    sb.append("]");
    return sb.toString();
}
Also used : Processor(es.bsc.compss.types.resources.components.Processor)

Example 10 with Processor

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

the class MethodResourceDescription method reduceDynamic.

@Override
public ResourceDescription reduceDynamic(ResourceDescription rd2) {
    MethodResourceDescription mrd2 = (MethodResourceDescription) rd2;
    MethodResourceDescription reduced = new MethodResourceDescription();
    // Processor
    for (Processor p : mrd2.processors) {
        // Looks for a mergeable processor
        boolean processorMerged = false;
        for (Processor pThis : this.processors) {
            if (checkProcessorCompatibility(pThis, p)) {
                processorMerged = true;
                int cus = p.getComputingUnits();
                // Copy the real decreased capabilities
                Processor p_reduced = new Processor(pThis);
                p_reduced.setComputingUnits(cus);
                reduced.addProcessor(p_reduced);
                // Decrease current
                pThis.removeComputingUnits(cus);
                this.decreaseComputingUnits(pThis.getType(), cus);
                // Go for next processor
                break;
            }
        }
        if (!processorMerged) {
            // The reduce is invalid
            return null;
        }
    }
    // Memory
    if (checkMemory(mrd2)) {
        // Copy the real decreased capabilities
        reduced.setMemoryType(this.memoryType);
        if ((mrd2.memorySize == UNASSIGNED_FLOAT) || (this.memorySize == UNASSIGNED_FLOAT)) {
            reduced.setMemorySize(UNASSIGNED_FLOAT);
        } else {
            this.memorySize -= mrd2.memorySize;
            reduced.setMemorySize(mrd2.memorySize);
        }
    } else {
        // The reduce is invalid
        return null;
    }
    // Return the real decreased capabilities
    return reduced;
}
Also used : Processor(es.bsc.compss.types.resources.components.Processor)

Aggregations

Processor (es.bsc.compss.types.resources.components.Processor)22 MethodImplementation (es.bsc.compss.types.implementations.MethodImplementation)4 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)4 Implementation (es.bsc.compss.types.implementations.Implementation)3 LinkedList (java.util.LinkedList)3 BeforeClass (org.junit.BeforeClass)3 Test (org.junit.Test)3 FakeWorker (es.bsc.compss.types.fake.FakeWorker)2 TaskScheduler (es.bsc.compss.components.impl.TaskScheduler)1 FakeWorker (es.bsc.compss.scheduler.types.fake.FakeWorker)1 FakeActionOrchestrator (es.bsc.compss.types.fake.FakeActionOrchestrator)1 FakeResourceScheduler (es.bsc.compss.types.fake.FakeResourceScheduler)1 ServiceImplementation (es.bsc.compss.types.implementations.ServiceImplementation)1 MethodWorker (es.bsc.compss.types.resources.MethodWorker)1 ServiceResourceDescription (es.bsc.compss.types.resources.ServiceResourceDescription)1 ServiceWorker (es.bsc.compss.types.resources.ServiceWorker)1 CloudMethodResourceDescription (es.bsc.compss.types.resources.description.CloudMethodResourceDescription)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1