Ignore:
Timestamp:
02/26/13 08:41:50 (12 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall
Files:
4 added
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Processes.java

    r481 r883  
    4141                CountType countType = choice.getProcessesCount(); 
    4242                if(countType != null) { 
    43                         return countType.getValue().getContent().intValue(); 
     43                        return countType.getValue().getContent(); 
    4444                }  
    4545                 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Task.java

    r490 r883  
    66import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType; 
    77import org.qcg.broker.schemas.resreqs.ExecutionTimeType; 
     8import org.qcg.broker.schemas.resreqs.ExecutionType; 
     9import org.qcg.broker.schemas.resreqs.PhaseBehaviourType; 
    810import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements; 
    911import org.qcg.broker.schemas.resreqs.Requirements; 
     12import org.qcg.broker.schemas.resreqs.ResourceConsumptionProfileType; 
     13import org.qcg.broker.schemas.resreqs.ResourceConsumptionType; 
    1014import org.qcg.broker.schemas.resreqs.TaskResourceRequirements; 
    1115import org.qcg.broker.schemas.resreqs.TimePeriod; 
     
    3034import schedframe.scheduling.WorkloadUnitHandler; 
    3135import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
     36import schedframe.scheduling.tasks.phases.ResourceConsumption; 
     37import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile; 
    3238import schedframe.scheduling.tasks.requirements.ResourceParameterName; 
    3339 
     
    7177        private int senderId; 
    7278        private long workloadLogWaitTime; 
     79         
     80        private ResourceConsumptionProfile resourceConsumptionProfile; 
    7381 
    7482        public Task(org.qcg.broker.schemas.resreqs.Task task){ 
     
    9199        } 
    92100 
     101        private void preparePhases() { 
     102                List<ResourceConsumption> resourceConsumptionList = new ArrayList<ResourceConsumption>(); 
     103                 
     104                if(task.getExecution() == null || task.getExecution().getResourceConsumptionProfile() == null){ 
     105                        ResourceConsumption resConsumption = null; 
     106                        try { 
     107                                resConsumption = new ResourceConsumption(this.length, getComputingResourceRequirements()); 
     108                        } catch (NoSuchFieldException e) { 
     109                                // TODO Auto-generated catch block 
     110                                e.printStackTrace(); 
     111                        } 
     112                        resourceConsumptionList.add(resConsumption); 
     113                } 
     114                else{ 
     115                        for(ResourceConsumptionType resConsumption: task.getExecution().getResourceConsumptionProfile().getResourceConsumption()){ 
     116                                ResourceConsumption resourceConsumption = new ResourceConsumption(resConsumption); 
     117                                resourceConsumptionList.add(resourceConsumption); 
     118                        } 
     119                } 
     120                this.resourceConsumptionProfile = new ResourceConsumptionProfile(resourceConsumptionList); 
     121                 
     122        //      System.out.println("======"+task.getExecution().getExecutable().getApplication().getName()); 
     123        } 
     124         
    93125        public DateTime getExecutionStartTime() throws NoSuchFieldException { 
    94126                if(this.startTime != null) 
     
    421453        public void setLength(long length) { 
    422454                this.length = length; 
     455                preparePhases(); 
    423456        } 
    424457 
     
    485518                wuh.handleTask(this); 
    486519        } 
     520         
     521        public ResourceConsumptionProfile getResourceConsumptionProfile(){ 
     522                return resourceConsumptionProfile; 
     523        } 
     524         
     525        public String getApplicationName(){ 
     526                return task.getExecution().getExecutable().getApplication().getName(); 
     527        } 
    487528} 
Note: See TracChangeset for help on using the changeset viewer.