Changeset 490 for DCWoRMS/trunk/src


Ignore:
Timestamp:
10/09/12 13:58:06 (13 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/trunk/src
Files:
6 added
1 deleted
30 edited
6 copied
1 moved

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/ExecTask.java

    r481 r490  
    1 package gssim.schedframe.scheduling; 
     1package dcworms.schedframe.scheduling; 
    22 
    33import java.util.List; 
     
    1111        public Object getExpectedSpecificResource(ResourceParameterName resourceName); 
    1212 
    13         public void visitResource(String resName); 
     13        public void trackResource(String resName); 
    1414        public List<String> getVisitedResources(); 
    1515} 
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/Executable.java

    r481 r490  
    1 package gssim.schedframe.scheduling; 
     1package dcworms.schedframe.scheduling; 
    22 
    33 
     
    1515import org.joda.time.ReadableDuration; 
    1616 
     17 
    1718import schedframe.resources.computing.ComputingResource; 
    1819import schedframe.resources.units.ProcessingElements; 
    1920import schedframe.resources.units.StandardResourceUnitName; 
    2021import schedframe.scheduling.ResourceHistoryItem; 
    21 import schedframe.scheduling.UsedResourceList; 
     22import schedframe.scheduling.UsedResourcesList; 
    2223import schedframe.scheduling.WorkloadUnitHandler; 
    2324import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
     
    4748        //TO DO remove and benefit from visitedResources 
    4849        protected String schedName; 
    49         protected UsedResourceList<ResourceHistoryItem> usedResources; 
     50        protected UsedResourcesList usedResources; 
    5051        //TO DO consider removing 
    5152        protected List<String> visitedResources; 
     
    6162                this.status = DCWormsTags.CREATED; 
    6263                 
    63                 this.usedResources = new UsedResourceList<ResourceHistoryItem>(); 
     64                this.usedResources = new UsedResourcesList(); 
    6465                this.visitedResources = new ArrayList<String>(); 
    6566                init(); 
     
    7172                this.processesSetId = procesesSet.getId();  
    7273                 
    73                 this.usedResources = new UsedResourceList<ResourceHistoryItem>(); 
     74                this.usedResources = new UsedResourcesList(); 
    7475                this.visitedResources = new ArrayList<String>(); 
    7576                init(); 
     
    7778         
    7879        protected void init() { 
    79                 double currentTime =  DateTimeUtilsExt.getDateTimeAt(arrivalTime).getMillis() / 1000; 
     80                double currentTime = DateTimeUtilsExt.getDateTimeAt(arrivalTime).getMillis() / 1000; 
    8081                this.submissionTime =  currentTime; 
    8182        this.totalCompletionTime = 0.0; 
     
    157158        } 
    158159 
    159         if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags.FAILED_RESOURCE_UNAVAILABLE) 
    160         { 
    161             throw new Exception("Gridlet.setGridletStatus() : Error - " + 
    162                     "Invalid integer range for Gridlet status."); 
     160        if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags.FAILED_RESOURCE_UNAVAILABLE) { 
     161            throw new Exception("Executable.setStatuts() : Error - " + 
     162                    "Invalid integer range for Execiutable status."); 
    163163        } 
    164164 
     
    175175                } 
    176176 
    177         if (prevStatus == DCWormsTags.INEXEC) 
    178         { 
    179  
     177        if (prevStatus == DCWormsTags.INEXEC) { 
    180178            if (status == DCWormsTags.CANCELED || status == DCWormsTags.PAUSED || 
    181                 status == DCWormsTags.SUCCESS) 
    182             { 
     179                status == DCWormsTags.SUCCESS) { 
    183180                totalCompletionTime += (currentTime -  execStartTime); 
    184181            } 
    185182        } 
    186183 
    187         if (prevStatus == DCWormsTags.RESUMED && status == DCWormsTags.SUCCESS) 
    188         { 
     184        if (prevStatus == DCWormsTags.RESUMED && status == DCWormsTags.SUCCESS) { 
    189185            totalCompletionTime += (currentTime -  execStartTime); 
    190186        } 
    191187 
    192188        if (status == DCWormsTags.INEXEC || 
    193             (prevStatus == DCWormsTags.PAUSED && status == DCWormsTags.RESUMED) ) 
    194         { 
     189            (prevStatus == DCWormsTags.PAUSED && status == DCWormsTags.RESUMED) ) { 
    195190                execStartTime = currentTime; 
     191                 
    196192                ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    197193                for (ComputingResource resource : pes) { 
    198194 
    199                         visitResource(resource.getName()); 
     195                        trackResource(resource.getName()); 
     196                         
    200197                        ComputingResource parent = resource.getParent(); 
    201  
    202198                                List<String> visitedResource = getVisitedResources(); 
    203                         while (parent != null && !ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), parent.getName())) { 
    204                                 visitResource(parent.getName()); 
     199                                String [] visitedResourcesArray = visitedResource.toArray(new String[visitedResource.size()]); 
     200                        while (parent != null && !ArrayUtils.contains(visitedResourcesArray, parent.getName())) { 
     201                                trackResource(parent.getName()); 
    205202                                parent = parent.getParent(); 
    206203                        } 
     
    254251        } 
    255252         
    256         public UsedResourceList<ResourceHistoryItem> getUsedResources(){ 
     253        public UsedResourcesList getUsedResources(){ 
    257254                return this.usedResources; 
    258255        } 
     
    284281        } 
    285282         
    286         public void visitResource(String resName){ 
     283        public void trackResource(String resName){ 
    287284                visitedResources.add(resName); 
    288285        } 
     
    346343        return execStartTime - submissionTime; 
    347344    } 
    348  
    349345     
    350346    public void finalizeExecutable(){ 
    351  
     347                try { 
     348                        setStatus(DCWormsTags.SUCCESS); 
     349                } catch (Exception e) { 
     350                        // TODO Auto-generated catch block 
     351                        e.printStackTrace(); 
     352                } 
    352353    } 
    353354     
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java

    r481 r490  
    1 package gssim.schedframe.scheduling.plugin.local; 
     1package dcworms.schedframe.scheduling.plugin.local; 
    22 
    33import org.joda.time.DateTime; 
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java

    r477 r490  
    1 package gssim.schedframe.scheduling.queues; 
     1package dcworms.schedframe.scheduling.queues; 
    22 
    33import java.util.ArrayList; 
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/JobDescription.java

    r477 r490  
    1 package gssim.schedframe.scheduling.utils; 
     1package dcworms.schedframe.scheduling.utils; 
    22 
    33import java.io.StringReader; 
  • DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/TaskDescription.java

    r477 r490  
    1 package gssim.schedframe.scheduling.utils; 
     1package dcworms.schedframe.scheduling.utils; 
    22 
    33import java.io.StringReader; 
  • DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java

    r481 r490  
    44import schedframe.PluginConfiguration; 
    55import schedframe.events.scheduling.SchedulingEventType; 
    6 import schedframe.scheduling.TaskListImpl; 
     6import schedframe.scheduling.TaskList; 
    77import schedframe.scheduling.manager.resources.ResourceManager; 
    88import schedframe.scheduling.plugin.SchedulingPluginConfiguration; 
     
    2222        } 
    2323         
    24         public int placeTasksInQueues(TaskListImpl newTasks, TaskQueueList queues, ResourceManager resourceManager, 
     24        public int placeTasksInQueues(TaskList newTasks, TaskQueueList queues, ResourceManager resourceManager, 
    2525                        ModuleList moduleList) { 
    2626 
  • DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java

    r481 r490  
    1010import schedframe.resources.units.ResourceUnit; 
    1111import schedframe.resources.units.ResourceUnitName; 
    12 import schedframe.scheduling.TaskListImpl; 
     12import schedframe.scheduling.TaskList; 
    1313import schedframe.scheduling.manager.resources.ResourceManager; 
    1414import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
     
    4545        } 
    4646         
    47         public int placeTasksInQueues(TaskListImpl newTasks, 
     47        public int placeTasksInQueues(TaskList newTasks, 
    4848                        TaskQueueList queues,  
    4949                        ResourceManager resourceManager, ModuleList moduleList) { 
  • DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java

    r481 r490  
    22 
    33import gridsim.gssim.DCWormsTags; 
    4 import gssim.schedframe.scheduling.Executable; 
    54 
    65import java.util.ArrayList; 
     
    1918import schedframe.resources.units.ResourceUnitName; 
    2019import schedframe.resources.units.StandardResourceUnitName; 
    21 import schedframe.scheduling.ResourceHistoryItem; 
    22 import schedframe.scheduling.UsedResourceList; 
     20import schedframe.scheduling.UsedResourcesList; 
    2321import schedframe.scheduling.manager.resources.ClusterResourceManager; 
    2422import schedframe.scheduling.manager.resources.ResourceManager; 
     
    3129import schedframe.scheduling.tasks.TaskInterface; 
    3230import schedframe.scheduling.tasks.WorkloadUnit; 
     31import dcworms.schedframe.scheduling.Executable; 
    3332 
    3433public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalSchedulingPlugin { 
     
    7776                        TaskFinishedEvent finEvent = (TaskFinishedEvent) event; 
    7877                        Executable exec = (Executable) jobRegistry.getExecutable(finEvent.getJobId(), finEvent.getTaskId()); 
    79                         UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources(); 
     78                        UsedResourcesList usedResourcesList = exec.getUsedResources(); 
    8079                        ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    8180                        List<Processor> processors =  new ArrayList<Processor>(); 
  • DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java

    r477 r490  
    11package example.timeestimation; 
    22 
    3 import gssim.schedframe.scheduling.ExecTask; 
    43 
    54import java.util.Map; 
     5 
     6import dcworms.schedframe.scheduling.ExecTask; 
    67 
    78import schedframe.events.scheduling.SchedulingEvent; 
  • DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java

    r481 r490  
    11package gridsim.gssim.filter; 
    22 
     3import dcworms.schedframe.scheduling.Executable; 
    34import eduni.simjava.Sim_event; 
    45import gridsim.filter.FilterResult; 
    5 import gssim.schedframe.scheduling.Executable; 
    66 
    77/** 
     
    1111public class ExecTaskFilter extends FilterResult { 
    1212 
    13         public ExecTaskFilter(int gridletID, int tag) { 
    14                 super(gridletID, tag); 
     13        public ExecTaskFilter(int taskId, int tag) { 
     14                super(taskId, tag); 
    1515        } 
    1616 
  • DCWoRMS/trunk/src/schedframe/ExecutablesList.java

    r481 r490  
    11package schedframe; 
    22 
    3 import gssim.schedframe.scheduling.ExecTask; 
    4 import gssim.schedframe.scheduling.Executable; 
    53 
    64import java.util.ArrayList; 
     
    119import java.util.ListIterator; 
    1210 
     11import dcworms.schedframe.scheduling.ExecTask; 
     12import dcworms.schedframe.scheduling.Executable; 
     13 
    1314public class ExecutablesList implements List<ExecTask> { 
    1415 
    1516        private List<ExecTask> executables; 
     17         
    1618        public ExecutablesList (){ 
    1719                executables = Collections.synchronizedList(new ArrayList<ExecTask>()); 
    1820        } 
    19  
    2021 
    2122        public List<Executable> getJobExecutables(String jobId){ 
  • DCWoRMS/trunk/src/schedframe/ResourceController.java

    r477 r490  
    1919        protected static List<ComputingResource> computingResources; 
    2020        protected Deque<Initializable> toInit; 
     21        protected Set<String> compResLayers; 
    2122         
    2223        public  ResourceController(Scheduler logicalStructure, List<ComputingResource> compResources){ 
     
    144145        } 
    145146 
     147        public Set<String> getComputingResourceLayers() { 
     148                return compResLayers; 
     149        } 
     150 
     151        public void setCompResLayers(Set<String> compResLayers) { 
     152                this.compResLayers = compResLayers; 
     153        } 
     154 
     155 
    146156} 
  • DCWoRMS/trunk/src/schedframe/scheduling/UsedResourcesList.java

    r477 r490  
    33import java.util.LinkedList; 
    44 
    5 public class UsedResourceList<E> extends LinkedList<E>{ 
     5public class UsedResourcesList extends LinkedList<ResourceHistoryItem>{ 
    66 
    77        /** 
  • DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java

    r481 r490  
    11package schedframe.scheduling; 
    22 
    3 import schedframe.scheduling.tasks.Job; 
     3import dcworms.schedframe.scheduling.ExecTask; 
     4import schedframe.scheduling.tasks.JobInterface; 
     5import schedframe.scheduling.tasks.TaskInterface; 
    46 
    5 import schedframe.scheduling.tasks.TaskInterface; 
    6 import gssim.schedframe.scheduling.ExecTask; 
    7  
    8 public  interface WorkloadUnitHandler{ 
     7public interface WorkloadUnitHandler{ 
    98         
    10         public void handleJob(Job job); 
     9        public void handleJob(JobInterface<?> job); 
    1110         
    1211        public void handleTask(TaskInterface<?> task); 
  • DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/LocalResourceManager.java

    r477 r490  
    1313import java.util.Properties; 
    1414import java.util.Set; 
    15 import java.util.Stack; 
    1615 
    1716import schedframe.exceptions.ResourceException; 
     
    175174                return resourceUnit; 
    176175        } 
    177         /*public List<AbstractResourceUnit> getAvailableResourceUnits(String resourceName) throws Exception { 
    178                 ComputingResource resource = getResourceByName(resourceName); 
    179                 List<AbstractResourceUnit> resourceUnits = new ArrayList<AbstractResourceUnit>(); 
    180                 while(resource != null){ 
    181                         for(List<AbstractResourceUnit> resUnits: resource.getResourceCharacteristic().getResourceUnits().values()) 
    182                                 resUnits.addAll(resourceUnits); 
    183                         resource = resource.getParent(); 
    184                 } 
    185                  
    186                 return resourceUnits; 
    187         }*/ 
    188176 
    189177        public List<? extends ComputingResource> filterResources(Properties properties) { 
     
    242230                                computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core); 
    243231                        } catch (ResourceException e) { 
    244                                 throw new RuntimeException("GSSIM internal error"); 
     232                                throw new RuntimeException("DCWorms internal error"); 
    245233                        } 
    246234                        PEUnit peUnit = new ProcessingElements(computingResources); 
     
    253241                                computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor); 
    254242                        } catch (ResourceException e) { 
    255                                 throw new RuntimeException("GSSIM internal error"); 
     243                                throw new RuntimeException("DCWorms internal error"); 
    256244                        } 
    257245                        PEUnit peUnit = new ProcessingElements(computingResources); 
     
    318306                        return false; 
    319307                } 
    320                 /*ResourceUnit peUnit = resources.get(StandardResourceUnitName.PE); 
    321  
    322                 if (peUnit != null) { 
    323                         if (peUnit instanceof ProcessingElements) { 
    324                                 ProcessingElements choosenProcessors = (ProcessingElements) peUnit; 
    325  
    326                                 for (int i = 0; i < choosenProcessors.size(); i++) { 
    327                                         choosenProcessors.get(i).setStatus(ResourceStatus.BUSY); 
    328                                 } 
    329                         } 
    330                 }*/ 
    331  
    332                 /*Memory m = (Memory) resources.get(StandardResourceUnitName.MEMORY); 
    333                 if (m != null) { 
    334                         m.getProvisioner().setState(ResourceUnitState.BUSY); 
    335                 }*/ 
    336308                 
    337309                for(ResourceUnitName resUnitName: resources.keySet()){ 
     
    345317        public void freeResources(Map<ResourceUnitName, ResourceUnit> resources) { 
    346318                 
    347                 /*ResourceUnit peUnit = resources.get(StandardResourceUnitName.PE); 
    348                  
    349                 if (peUnit instanceof ProcessingElements) { 
    350                         ProcessingElements processingElements = (ProcessingElements) peUnit; 
    351  
    352                         for (int i = 0; i < processingElements.size(); i++) { 
    353                                 processingElements.get(i).setStatus(ResourceStatus.FREE); 
    354                         } 
    355                 }*/ 
    356  
    357                 /*Memory m = (Memory) resources.get(StandardResourceUnitName.MEMORY); 
    358                 if (m != null) { 
    359                         m.getProvisioner().setState(ResourceUnitState.FREE); 
    360                 }*/ 
    361                  
    362319                for(ResourceUnitName resUnitName: resources.keySet()){ 
    363320                        ResourceUnit resUnit = resources.get(resUnitName); 
     
    366323        } 
    367324 
    368  
    369325} 
  • DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java

    r481 r490  
    11package schedframe.scheduling.manager.tasks; 
    22 
    3 import gssim.schedframe.scheduling.ExecTask; 
    43 
    54import java.util.List; 
     5 
     6import dcworms.schedframe.scheduling.ExecTask; 
    67 
    78import schedframe.ExecutablesList; 
  • DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java

    r481 r490  
    22 
    33import gridsim.gssim.DCWormsTags; 
    4 import gssim.schedframe.scheduling.ExecTask; 
    54 
    65import java.util.ArrayList; 
     
    1211import org.qcg.broker.schemas.resreqs.ParentType; 
    1312import org.qcg.broker.schemas.resreqs.types.TaskStatesName; 
     13 
     14import dcworms.schedframe.scheduling.ExecTask; 
    1415 
    1516import qcg.shared.constants.BrokerConstants; 
     
    8283                synchronized (executables)  { 
    8384                        for (ExecTask task : executables) { 
    84                                 if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId)==0) { 
     85                                if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId) == 0) { 
    8586                                        return task; 
    8687                                } 
  • DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java

    r481 r490  
    33import schedframe.Plugin; 
    44import schedframe.events.scheduling.SchedulingEvent; 
     5import schedframe.scheduling.TaskList; 
    56import schedframe.scheduling.TaskListImpl; 
    67import schedframe.scheduling.manager.resources.ResourceManager; 
     
    1213public interface SchedulingPlugin extends Plugin{ 
    1314 
    14         public int placeTasksInQueues(TaskListImpl newTasks, 
     15        public int placeTasksInQueues(TaskList newTasks, 
    1516                        TaskQueueList queues,  
    1617                        ResourceManager resourceManager, ModuleList modules); 
  • DCWoRMS/trunk/src/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java

    r477 r490  
    11package schedframe.scheduling.plugin.estimation; 
    22 
    3 import gssim.schedframe.scheduling.ExecTask; 
    43 
    54import java.util.Map; 
     5 
     6import dcworms.schedframe.scheduling.ExecTask; 
    67 
    78import schedframe.Plugin; 
  • DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java

    r481 r490  
    77import org.apache.commons.logging.LogFactory; 
    88import org.joda.time.DateTimeUtilsExt; 
     9 
     10import dcworms.schedframe.scheduling.ExecTask; 
     11import dcworms.schedframe.scheduling.Executable; 
     12import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue; 
    913 
    1014import schedframe.PluginConfiguration; 
     
    3438import gridsim.IO_data; 
    3539import gridsim.gssim.DCWormsTags; 
    36 import gssim.schedframe.scheduling.ExecTask; 
    37 import gssim.schedframe.scheduling.Executable; 
    38 import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue; 
    3940 
    4041public abstract class AbstractManagementSystem { 
     
    144145                        return; 
    145146                } 
    146                 //Executable exec = (Executable) wu; 
    147147                removeFromQueue(task); 
    148148                scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, task);        
     
    199199        } 
    200200         
    201         protected boolean removeFromQueue(WorkloadUnit wu) { 
     201        protected boolean removeFromQueue(TaskInterface<?> task) { 
    202202                for(TaskQueue queue : queues){ 
    203                         if(queue.contains(wu)){ 
    204                                 queue.remove(wu); 
     203                        if(queue.contains(task)){ 
     204                                queue.remove(task); 
    205205                                return true; 
    206206                        } 
  • DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java

    r481 r490  
    1111import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus; 
    1212 
     13import dcworms.schedframe.scheduling.ExecTask; 
     14import dcworms.schedframe.scheduling.Executable; 
     15 
    1316import qcg.shared.constants.BrokerConstants; 
    14 import schedframe.events.scheduling.SchedulingEvent; 
    1517import schedframe.events.scheduling.TaskArrivedEvent; 
    1618import schedframe.events.scheduling.TimerEvent; 
     19import schedframe.scheduling.TaskListImpl; 
    1720import schedframe.scheduling.WorkloadUnitHandler; 
    18 import schedframe.scheduling.TaskListImpl; 
    1921import schedframe.scheduling.plan.AllocationInterface; 
    2022import schedframe.scheduling.plan.ScheduledTaskInterface; 
     
    3537import gridsim.IO_data; 
    3638import gridsim.gssim.DCWormsTags; 
    37 import gssim.schedframe.scheduling.ExecTask; 
    38 import gssim.schedframe.scheduling.Executable; 
    3939 
    4040public class GlobalManagementSystem extends AbstractManagementSystem { 
     
    8080                 
    8181                registerWorkloadUnit(wu); 
    82                 /*Job job = (Job) wu; 
    83                 jobRegistry.addJob(job); 
    84  
    85                 if (log.isInfoEnabled()) 
    86                         log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis())); 
    87  
    88                 List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>(); 
    89                 jobsList.add(job); 
    90                 WorkloadUnitList readyWorkloadUnits = new WorkloadUnitList(); 
    91                 readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobsList)); 
    92                 schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues, getResourceManager(), moduleList); 
    93  
    94                 schedule(new TaskArrivedEvent());*/ 
    9582 
    9683        } 
     
    10491         
    10592 
    106         protected void scheduleAvaialbleTasks(Job job){ 
     93        protected void schedule(JobInterface<?> job){ 
    10794                List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>(); 
    10895                jobsList.add(job); 
     
    11198                 
    11299                schedulingPlugin.placeTasksInQueues(readyTasks, queues, getResourceManager(), moduleList); 
    113                 schedule(new TaskArrivedEvent()); 
    114         } 
    115          
    116         protected void schedule(SchedulingEvent schedulingEvent) { 
    117  
    118100                SchedulingPlanInterface<?> decision = schedulingPlugin.schedule( 
    119                                 schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList); 
     101                                new TaskArrivedEvent(), queues, getJobRegistry(),  getResourceManager(), moduleList); 
    120102                if (decision != null) 
    121103                        executeSchedulingPlan(decision); 
    122104        } 
    123          
     105 
    124106        public void notifyReturnedWorkloadUnit(WorkloadUnit wu) { 
    125107                Executable exec = (Executable) wu; 
     
    133115                try { 
    134116                        Job job = jobRegistry.getJob(exec.getJobId()); 
    135                         /*Task task = job.getTask(exec.getTaskId()); 
     117                        Task task = job.getTask(exec.getTaskId()); 
    136118                        if(exec.getProcessesId() == null){ 
    137119                                try { 
    138120                                        task.setStatus(exec.getStatus()); 
    139121                                } catch (Exception e) { 
    140                                         // TODO Auto-generated catch block 
    141                                         e.printStackTrace(); 
     122 
    142123                                } 
    143124                        } else { 
     
    150131                                        } 
    151132                                } 
    152                         }*/ 
     133                        } 
    153134                         
    154135                        if(job.isFinished()){ 
     
    156137                        } 
    157138                        else { 
    158                                 scheduleAvaialbleTasks(job); 
    159                                 /*List<JobInterface<?>> jobs = new ArrayList<JobInterface<?>>(); 
    160                                 jobs.add(jobRegistry.getJobInfo(job.getId())); 
    161                                 WorkloadUnitList readyWorkloadUnits = new WorkloadUnitList(); 
    162                                 readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobs)); 
    163                                 schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues, 
    164                                                 getResourceManager(), moduleList); 
    165                                 schedule(new TaskArrivedEvent());*/ 
     139                                schedule(job); 
    166140                        } 
    167141                         
     
    269243                IO_data data = new IO_data(task, 0, resID); 
    270244                scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);   
    271                  
    272                 //scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);                       
     245                //scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);       
     246                 
    273247                if(log.isDebugEnabled()) 
    274248                        log.debug("Submitted job " + task.getId() + " to " + providerName); 
     
    278252        class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{ 
    279253 
    280                 public void handleJob(Job job){ 
    281  
     254                public void handleJob(JobInterface<?> job){ 
    282255                        if (log.isInfoEnabled()) 
    283256                                log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis())); 
    284257 
    285258                        jobRegistry.addJob(job); 
    286                         scheduleAvaialbleTasks(job); 
     259                        schedule(job); 
    287260                } 
    288261                 
     
    294267                        throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler."); 
    295268                } 
    296  
    297269        } 
    298270 
  • DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r481 r490  
    11package schedframe.scheduling.policy.local; 
    22 
     3import dcworms.schedframe.scheduling.ExecTask; 
     4import dcworms.schedframe.scheduling.Executable; 
    35import eduni.simjava.Sim_event; 
    46import eduni.simjava.Sim_system; 
     
    79import gridsim.gssim.DCWormsTags; 
    810import gridsim.gssim.filter.ExecTaskFilter; 
    9 import gssim.schedframe.scheduling.ExecTask; 
    10 import gssim.schedframe.scheduling.Executable; 
    1111 
    1212import java.util.ArrayList; 
     
    4141import schedframe.scheduling.ResourceHistoryItem; 
    4242import schedframe.scheduling.Scheduler; 
     43import schedframe.scheduling.TaskList; 
    4344import schedframe.scheduling.TaskListImpl; 
    44 import schedframe.scheduling.UsedResourceList; 
     45import schedframe.scheduling.UsedResourcesList; 
    4546import schedframe.scheduling.WorkloadUnitHandler; 
    4647import schedframe.scheduling.manager.resources.LocalResourceManager; 
     
    7879 
    7980                super(providerId, entityName, execTimeEstimationPlugin, queues); 
    80  
    81                 //schedulingPlugin = (LocalSchedulingPlugin) InstanceFactory.createInstance(schedulingPluginClassName, LocalSchedulingPlugin.class); 
    8281                 
    8382                if (schedPlugin == null) { 
     
    8584                } 
    8685                this.schedulingPlugin =  schedPlugin; 
    87                 accTotalLoad = new Accumulator(); 
    88                 moduleList = new ModuleListImpl(1); 
    89  
     86                this.moduleList = new ModuleListImpl(1); 
     87                 
     88                this.accTotalLoad = new Accumulator(); 
    9089        } 
    9190 
    9291        public void init(Scheduler sched, ManagedResources managedResources) { 
    9392                super.init(sched, managedResources); 
    94                 //scheduler = sched; 
    95                 //resourceManager = ResourceManagerFactory.createResourceManager(scheduler); 
    9693                double load = 0; 
    9794                accTotalLoad.add(load); 
     
    115112                        } 
    116113                        sendTimerEvent(); 
    117  
    118114                        break; 
    119115 
    120116                case DCWormsTags.TASK_READY_FOR_EXECUTION: 
    121117                         
    122                         ExecTask data = (ExecTask) ev.get_data(); 
    123                         try { 
    124                                 data.setStatus(DCWormsTags.READY); 
     118                        ExecTask execTask = (ExecTask) ev.get_data(); 
     119                        try { 
     120                                execTask.setStatus(DCWormsTags.READY); 
    125121                                if (pluginSupportsEvent(tag)) { 
    126                                         SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId()); 
     122                                        SchedulingEvent event = new StartTaskExecutionEvent(execTask.getJobId(), execTask.getId()); 
    127123                                        SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
    128124                                                        queues,  getJobRegistry(), getResourceManager(), moduleList); 
     
    136132                case DCWormsTags.TASK_EXECUTION_FINISHED: 
    137133                        obj = ev.get_data(); 
    138                         ExecTask exec = (ExecTask) obj; 
    139                         if (exec.getStatus() == DCWormsTags.INEXEC) { 
    140                                 finalizeExecutable(exec); 
    141  
    142                                 sendFinishedWorkloadUnit(exec); 
    143                                 //task.setGridletStatus(Gridlet.SUCCESS); 
    144                                 //task.finalizeGridlet(); 
    145                                 log.debug(exec.getJobId() + "_" + exec.getId() + " finished execution on " + new DateTime()); 
     134                        execTask = (ExecTask) obj; 
     135                        if (execTask.getStatus() == DCWormsTags.INEXEC) { 
     136                                 
     137                                finalizeExecutable(execTask); 
     138                                sendFinishedWorkloadUnit(execTask); 
     139                                log.debug(execTask.getJobId() + "_" + execTask.getId() + " finished execution on " + new DateTime()); 
    146140                                log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size())); 
    147                                 /*UsedResourceList<ResourceHistoryItem> lastUsedList = task.getUsedResources(); 
    148                                 Map<ResourceUnitName, AbstractResourceUnit> lastUsed = lastUsedList.getLast() 
    149                                                 .getResourceUnits(); 
    150                                 getAllocationManager().freeResources(lastUsed); 
    151                                 ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PROCESSINGELEMENTS); 
    152                                 for (ComputingResource resource : pes) { 
    153                                         resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, task)); 
     141                                if (pluginSupportsEvent(tag)) { 
     142                                        SchedulingEvent event = new TaskFinishedEvent(execTask.getJobId(), execTask.getId()); 
     143                                        SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event, 
     144                                                        queues, getJobRegistry(), getResourceManager(), moduleList); 
     145                                        executeSchedulingPlan(decision); 
    154146                                } 
    155                                 SubTaskFilter filter = new SubTaskFilter(task.getGridletID(), GssimTags.TASK_REQUESTED_TIME_EXPIRED); 
    156                                 scheduler.sim_cancel(filter, null); 
    157                                 super.sendFinishJob((Executable) task.getGridlet());*/ 
    158                         } 
     147                        } 
     148 
     149                        Job job = jobRegistry.getJob(execTask.getJobId()); 
     150                        if(!job.isFinished()){ 
     151                                getWorkloadUnitHandler().handleJob(job); 
     152                        } 
     153                        break; 
     154                         
     155                case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED: 
     156                        obj = ev.get_data(); 
     157                        execTask = (Executable) obj; 
    159158                        if (pluginSupportsEvent(tag)) { 
    160                                 SchedulingEvent event = new TaskFinishedEvent(exec.getJobId(), exec.getId()); 
     159                                SchedulingEvent event = new TaskRequestedTimeExpiredEvent(execTask.getJobId(), execTask.getId()); 
    161160                                SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event, 
    162161                                                queues, getJobRegistry(), getResourceManager(), moduleList); 
    163162                                executeSchedulingPlan(decision); 
    164163                        } 
    165                         Job job = jobRegistry.getJob(exec.getJobId()); 
    166                         if(!job.isFinished()){ 
    167                                 getWorkloadUnitHandler().handleJob(job); 
    168                         } 
    169  
    170164                        break; 
    171                 case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED: 
    172                         obj = ev.get_data(); 
    173                         exec = (Executable) obj; 
    174                         if (pluginSupportsEvent(tag)) { 
    175                                 SchedulingEvent event = new TaskRequestedTimeExpiredEvent(exec.getJobId(), exec.getId()); 
    176                                 SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event, 
    177                                                 queues, getJobRegistry(), getResourceManager(), moduleList); 
    178                                 executeSchedulingPlan(decision); 
    179                         } 
    180  
    181                         break; 
     165                         
    182166                case DCWormsTags.UPDATE: 
    183167                        updateProcessingTimes(ev); 
     
    185169                } 
    186170        } 
    187          
    188171 
    189172        public void notifyReturnedWorkloadUnit(WorkloadUnit wu) { 
     
    223206                                } else { 
    224207                                        ExecTask exec = (ExecTask) task; 
    225                                         executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task)); 
     208                                        executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), exec)); 
    226209                                } 
    227210                        } 
     
    237220                        return; 
    238221                removeFromQueue(task); 
    239                 //double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength(); 
     222 
    240223                SchedulingEvent event = new SchedulingEvent(SchedulingEventType.START_TASK_EXECUTION); 
    241224                int time = Double.valueOf( 
     
    251234                ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime); 
    252235                exec.addUsedResources(resHistItem); 
    253  
    254                 scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, 
    255                                 exec); 
     236                try { 
     237                        exec.setStatus(DCWormsTags.INEXEC); 
     238                } catch (Exception e) { 
     239                        // TODO Auto-generated catch block 
     240                        e.printStackTrace(); 
     241                } 
     242                scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, exec); 
    256243 
    257244                try { 
     
    262249                        scheduler.sendInternal(t, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec); 
    263250                } 
    264                  
    265                 try { 
    266                         exec.setStatus(DCWormsTags.INEXEC); 
    267                 } catch (Exception e1) { 
    268                         // TODO Auto-generated catch block 
    269                         e1.printStackTrace(); 
    270                 } 
     251 
    271252                log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size())); 
    272253                 
    273254                PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE); 
    274                 if(peUnit instanceof ProcessingElements){ 
     255                 
     256                notifyComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec); 
     257                 
     258                /*if(peUnit instanceof ProcessingElements){ 
    275259                        ProcessingElements pes = (ProcessingElements) peUnit; 
    276260                        for (ComputingResource resource : pes) { 
    277                                 resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
     261                                resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, exec)); 
    278262                        } 
    279263                } else { 
     
    282266                                resource = ResourceController.getComputingResourceByName(peUnit.getResourceId()); 
    283267                        } catch (ResourceException e) { 
    284                                  
    285                         } 
    286                         resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
    287                 } 
    288                 /*ProcessingElements pes = (ProcessingElements) choosenResources.get(StandardResourceUnitName.PE); 
    289                 for (ComputingResource resource : pes) { 
    290                         resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, submittedTask)); 
    291                 }*/ 
     268                                return; 
     269                        } 
     270                        resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, exec)); 
     271                } 
     272*/ 
    292273 
    293274                /*for(ExecTaskInterface etask : jobRegistry.getRunningTasks()){ 
     
    301282                 
    302283                Executable exec = (Executable)execTask; 
    303                 try { 
    304                         exec.setStatus(DCWormsTags.SUCCESS); 
    305                 } catch (Exception e1) { 
    306                         // TODO Auto-generated catch block 
    307                         e1.printStackTrace(); 
    308                 } 
    309284                exec.finalizeExecutable(); 
    310                 UsedResourceList<ResourceHistoryItem> lastUsedList = exec.getUsedResources(); 
    311                 Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast() 
    312                                 .getResourceUnits(); 
    313                 getAllocationManager().freeResources(lastUsed); 
    314                  
    315                 PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE); 
    316                 if(peUnit instanceof ProcessingElements){ 
    317                         ProcessingElements pes = (ProcessingElements) peUnit; 
    318                         for (ComputingResource resource : pes) { 
    319                                 resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
    320                         } 
    321                 } else { 
    322                         ComputingResource resource = null; 
    323                         try { 
    324                                 resource = ResourceController.getComputingResourceByName(peUnit.getResourceId()); 
    325                         } catch (ResourceException e) { 
    326                                  
    327                         } 
    328                         resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
    329                 } 
    330                 /*ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PE); 
    331                 for (ComputingResource resource : pes) { 
    332                         resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask)); 
    333                 }*/ 
     285                 
    334286                ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_REQUESTED_TIME_EXPIRED); 
    335287                scheduler.sim_cancel(filter, null); 
    336288                 
    337  
     289                Task task; 
    338290                Job job = jobRegistry.getJob(exec.getJobId()); 
    339  
    340                 Task task = null; 
    341291                try { 
    342292                        task = job.getTask(exec.getTaskId()); 
    343293                } catch (NoSuchFieldException e) { 
    344                         e.printStackTrace(); 
     294                        return; 
    345295                } 
    346296                if(exec.getProcessesId() == null){ 
     
    360310                        } 
    361311                } 
     312                 
     313                UsedResourcesList lastUsedList = exec.getUsedResources(); 
     314                Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast() 
     315                                .getResourceUnits(); 
     316                getAllocationManager().freeResources(lastUsed); 
     317                 
     318                PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE); 
     319                notifyComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec); 
     320                /*if(peUnit instanceof ProcessingElements){ 
     321                        ProcessingElements pes = (ProcessingElements) peUnit; 
     322                        for (ComputingResource resource : pes) { 
     323                                resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
     324                        } 
     325                } else { 
     326                        ComputingResource resource = null; 
     327                        try { 
     328                                resource = ResourceController.getComputingResourceByName(peUnit.getResourceId()); 
     329                        } catch (ResourceException e) { 
     330                                return; 
     331                        } 
     332                        resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec)); 
     333                }*/ 
     334 
    362335                //sendFinishedWorkloadUnit(executable); 
    363336        } 
     
    374347                        ExecTask task = iter.next(); 
    375348                        Executable exec = (Executable)task; 
    376                         UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources(); 
    377                         ResourceUnit unit = usedResourcesList.getLast().getResourceUnits() 
     349                        UsedResourcesList usedResourcesList = exec.getUsedResources(); 
     350                        PEUnit peUnit = (PEUnit)usedResourcesList.getLast().getResourceUnits() 
    378351                                        .get(StandardResourceUnitName.PE); 
    379352 
    380                         double load = getMIShare(timeSpan, (PEUnit) unit); 
     353                        double load = getMIShare(timeSpan, peUnit); 
    381354                        exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration()); 
    382355                        addTotalLoad(load); 
    383356                } 
    384357        } 
    385  
     358        private void notifyComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){ 
     359 
     360                if(peUnit instanceof ProcessingElements){ 
     361                        ProcessingElements pes = (ProcessingElements) peUnit; 
     362                        for (ComputingResource resource : pes) { 
     363                                resource.handleEvent(new EnergyEvent(eventType, obj)); 
     364                        } 
     365                } else { 
     366                        ComputingResource resource = null; 
     367                        try { 
     368                                resource = ResourceController.getComputingResourceByName(peUnit.getResourceId()); 
     369                        } catch (ResourceException e) { 
     370                                return; 
     371                        } 
     372                        resource.handleEvent(new EnergyEvent(eventType, obj)); 
     373                } 
     374        } 
     375         
    386376        private double getMIShare(double timeSpan, PEUnit pes) { 
    387377                double localLoad; 
     
    402392        protected void updateProcessingTimes(Sim_event ev) { 
    403393                updateProcessingProgress(); 
    404                 for (ExecTask task : jobRegistry.getRunningTasks()) { 
    405                         Executable exec = (Executable)task; 
     394                for (ExecTask execTask : jobRegistry.getRunningTasks()) { 
     395                        Executable exec = (Executable)execTask; 
    406396                        List<String> visitedResource = exec.getVisitedResources(); 
    407397                        String originResource = ev.get_data().toString(); 
     
    411401                         
    412402                        Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits(); 
    413                         //double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength(); 
    414403                        double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED),  
    415                                         task, choosenResources, exec.getCompletionPercentage()); 
    416  
    417                         /*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) { 
    418                                 continue; 
    419                         }*/ 
     404                                        execTask, choosenResources, exec.getCompletionPercentage()); 
     405 
    420406                        //check if the new estimated end time is equal to the previous one; if yes the continue without update 
    421407                        if( DoubleMath.subtract((exec.getExecStartTime() + exec.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){ 
     
    424410                        ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 
    425411                        scheduler.sim_cancel(filter, null); 
    426                         scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, task); 
    427  
     412                        scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, execTask); 
    428413                } 
    429414        }        
     
    443428                                numberOfPE = numberOfPE + resUnit.getAmount(); 
    444429                        } 
    445                         //numberOfPE = getResourceManager().getPE().size(); 
    446430                } catch (Exception e) { 
    447431                        numberOfPE = 1; 
     
    464448                        ExecTask task) { 
    465449 
     450                Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>(); 
    466451                ResourceManager resourceManager = this.resourceManager; 
    467452                if(resourceName != null){ 
     
    472457                                return null; 
    473458                        } 
    474  
    475459                        resourceManager = new LocalResourceManager(resource); 
    476460                } 
    477                 Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>(); 
    478  
    479461 
    480462                int cpuRequest; 
     
    485467                } 
    486468 
    487                 //PEUnit processingUnits = null; 
    488469                if (cpuRequest != 0) { 
    489470                         
     
    494475                                return null; 
    495476                        } 
     477                         
    496478                        List<ResourceUnit> choosenPEUnits = new ArrayList<ResourceUnit>(); 
    497  
    498479                        for (int i = 0; i < availableUnits.size() && cpuRequest > 0; i++) { 
    499480                                PEUnit peUnit = (PEUnit) availableUnits .get(i); 
     
    508489                                return null; 
    509490                        } 
    510  
    511491                        map.put(StandardResourceUnitName.PE, choosenPEUnits.get(0)); 
    512492                } 
     
    529509        class LocalWorkloadUnitHandler implements WorkloadUnitHandler{ 
    530510                 
    531                 public void handleJob(Job job){ 
     511                public void handleJob(JobInterface<?> job){ 
    532512 
    533513                        if (log.isInfoEnabled()) 
     
    536516                        List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>(); 
    537517                        jobsList.add(job); 
    538                         TaskListImpl readyTasks = new TaskListImpl(); 
     518                        TaskListImpl availableTasks = new TaskListImpl(); 
    539519                        for(Task task: jobRegistry.getAvailableTasks(jobsList)){ 
    540520                                task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED); 
    541                                 readyTasks.add(task); 
    542                         } 
    543  
    544                         for(WorkloadUnit e:readyTasks){  
    545                                 registerWorkloadUnit(e); 
    546                         } 
    547                 } 
    548                  
    549                 public void handleTask(TaskInterface<?> ti){ 
    550                         Task task = (Task)ti; 
     521                                availableTasks.add(task); 
     522                        } 
     523 
     524                        for(TaskInterface<?> task: availableTasks){      
     525                                registerWorkloadUnit(task); 
     526                        } 
     527                } 
     528                 
     529                public void handleTask(TaskInterface<?> t){ 
     530                        Task task = (Task)t; 
    551531                        List<AbstractProcesses> processes = task.getProcesses(); 
    552532 
     
    564544                 
    565545                public void handleExecutable(ExecTask task){ 
     546                         
    566547                        Executable exec = (Executable) task; 
    567  
    568                         // int cost = 
    569                         // this.resourceManager.getResourceCharacteristic().getResUnits() != 
    570                         // null ? 
    571                         // this.resourceManager.getResourceCharacteristic().getResUnits().get(ResourceParameterName.COST).getAmount() 
    572                         // : 1; 
    573  
    574                         exec.visitResource(scheduler.get_name()); 
     548                        jobRegistry.addExecTask(exec); 
     549                         
     550                        exec.trackResource(scheduler.get_name()); 
    575551                        Scheduler parentScheduler = scheduler.getParent(); 
    576                         while (parentScheduler != null && !exec.getVisitedResources().contains(parentScheduler.get_name())) { 
    577                                 exec.visitResource(parentScheduler.get_name()); 
     552                        List<String> visitedResource = exec.getVisitedResources(); 
     553                        String [] visitedResourcesArray = visitedResource.toArray(new String[visitedResource.size()]); 
     554                        while (parentScheduler != null && !ArrayUtils.contains(visitedResourcesArray, parentScheduler.get_name())) { 
     555                                exec.trackResource(parentScheduler.get_name()); 
    578556                                parentScheduler = parentScheduler.getParent(); 
    579557                        } 
    580                          
    581558                        exec.setSchedulerName(scheduler.get_id()); 
    582                         jobRegistry.addExecTask(exec); 
    583                         TaskListImpl newTasks = new TaskListImpl(); 
     559                         
     560                        TaskList newTasks = new TaskListImpl(); 
    584561                        newTasks.add(exec); 
    585562                 
  • DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java

    r481 r490  
    22 
    33import gridsim.gssim.DCWormsTags; 
    4 import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue; 
    54 
    65import org.joda.time.DateTime; 
     6 
     7import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue; 
    78 
    89import schedframe.scheduling.tasks.TaskInterface; 
  • DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java

    r481 r490  
    203203                 
    204204                List<Task> readyTasks = new ArrayList<Task>(); 
    205  
    206205                int size = tasks.size(); 
     206                 
    207207                for(int i = 0; i < size; i++){ 
    208208                        int parCnt; 
     
    215215                        } catch(Exception e){ 
    216216                                parCnt = 0; 
    217                                 //e.printStackTrace(); 
    218                         } 
    219                         if(parCnt == 0) 
    220                         { 
     217                        } 
     218                        if(parCnt == 0) { 
    221219                                readyTasks.add(task); 
    222220                        } 
    223                         else 
    224                         { 
     221                        else { 
    225222                                for(int j = 0; j < parCnt; j++){ 
    226223                                        ParentType par = task.getDescription().getWorkflow().getParent(j); 
  • DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java

    r481 r490  
    7878                this.brokerSubmitTime = null; 
    7979                this.duration = null; 
    80         //      this.gridletID_ = (getJobId() + "_" + getId()).hashCode(); 
    8180                prepareTopology(); 
    8281        } 
     
    8988                this.brokerSubmitTime = null; 
    9089                this.duration = null; 
    91         //      this.gridletID_ = (getJobId() + getId()).hashCode(); 
    9290                prepareTopology(); 
    9391        } 
  • DCWoRMS/trunk/src/simulator/ConfigurationOptions.java

    r477 r490  
    88import java.util.PropertyResourceBundle; 
    99import java.util.ResourceBundle; 
    10 import java.util.logging.FileHandler; 
    1110 
    1211/** 
     
    5352        public static final String READ_SCENARIO_INPUT_FOLDER = READ_SCENARIO_MODIFIER 
    5453                        + ".inputfolder"; 
    55         public static final String READ_SCENARIO_INPUT_TAR = READ_SCENARIO_MODIFIER+ ".tar"; 
    5654         
    5755        /** The name of the workload file */ 
     
    5957                        + ".workloadfilename"; 
    6058 
    61         /** Shall a detailed history be printed */ 
    62         public static final String PRINT_HISTORY_MODIFIER = "printhistory"; 
    63  
    6459        /** The default name of a workload file */ 
    6560        public static final String DEFAULT_WORKLOAD_FILE_NAME = "workload.swf"; 
    6661 
    6762        public static final String CREATE_XML_SUPPLEMENT_FILES = "createXMLSupplement"; 
    68          
    69         public static final String PROVIDER_LIST_FILE = "in/provider.list"; 
    70          
    71         /** Network topology file path */ 
    72         public static final String NETWORK_TOPOLOGY_FILE_MODIFIER = "networktopologyfilename"; 
     63 
    7364         
    7465        public static final String CREATEDIAGRAMS = "creatediagrams"; 
     
    7970        public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks"; 
    8071        public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime"; 
    81         public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations"; 
    8272         
    8373        public static final String CREATESTATISTICS = "createstatistics"; 
    8474        public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 
    8575        public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 
    86         public static final String GRIDLET_HISTORY_STATISTICS = CREATESTATISTICS + ".gridlethistory"; 
    8776        public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 
    8877        public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; 
     
    111100        /* =============================================================================================== */ 
    112101         
    113         public String providerListFile = null; 
    114102 
    115103 
     
    152140        public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME; 
    153141 
    154         /** 
    155          * a txt file name with topology description 
    156          */ 
    157         public String networkTopologyFileName = null; 
    158142         
    159143        /** 
     
    171155        public boolean overwriteFiles = false; 
    172156 
    173         /** 
    174          * true if the history files are to be generated (makes the simulation 
    175          * slower) 
    176          */ 
    177         public boolean printHistory = false; 
    178157         
    179158        /** 
     
    183162 
    184163        public boolean creatediagrams_processors = true; 
    185         public boolean creatediagrams_reservations = true; 
    186164        public boolean creatediagrams_resources = true; 
    187165        public boolean creatediagrams_energyusage = true; 
    188166        public boolean creatediagrams_tasks = true; 
    189167        public boolean creatediagrams_taskswaitingtime = true; 
    190         public double     creatediagrams_resources_scale = 1; 
     168        public double  creatediagrams_resources_scale = 1; 
    191169         
    192170        public boolean createaccumulatedresourcesstatistics = true; 
    193171        public boolean createextendedtasksstatistics = true; 
    194         public boolean creategridlethistorystatistics = true; 
    195172        public boolean createjobsstatistics = true; 
    196173        public boolean createsimulationstatistics = true; 
    197174        public boolean formatstatisticsoutput = false; 
    198175         
    199         public static final String ENV_DESC_MODIFIER = "envdesc"; 
    200         public String envDescFileName = null; 
     176        public String[] resForEnergyChart; 
     177        public String[] resForUtilizationChart; 
     178         
    201179        /** 
    202180         * An empty constructor. 
     
    231209                 
    232210                co.resdescFileName = bundle.getString(RESOURCE_DESC_MODIFIER); 
    233                  
    234                 try { 
    235                         co.envDescFileName = bundle.getString(ENV_DESC_MODIFIER); 
    236                 } catch(MissingResourceException e){ 
    237                         co.envDescFileName = null; 
    238                 } 
     211 
    239212                 
    240213                try { 
     
    264237                } 
    265238 
    266  
    267                 try { 
    268                         co.networkTopologyFileName = bundle 
    269                                         .getString(NETWORK_TOPOLOGY_FILE_MODIFIER); 
    270                 } catch(MissingResourceException e){ 
    271                         co.networkTopologyFileName = null; 
    272                 } 
    273                  
    274239                if (co.createScenario == false) { 
    275240                        // read scenario 
     
    279244                        } catch (MissingResourceException e) { 
    280245                                co.inputFolder = null; 
    281                         } 
    282                          
    283                         try { 
    284                                 co.inputTar = getSeparatorTerminatedPath(bundle 
    285                                         .getString(READ_SCENARIO_INPUT_TAR)); 
    286                         } catch (MissingResourceException e) { 
    287                                 co.inputTar = null; 
    288246                        } 
    289247                         
     
    307265                        co.createXMLSupplement = false; 
    308266                } 
    309                  
    310                 try { 
    311                         co.printHistory = Boolean.valueOf( 
    312                                         bundle.getString(PRINT_HISTORY_MODIFIER)).booleanValue(); 
    313                 } catch(MissingResourceException e){ 
    314                         co.printHistory = false; 
    315                 } 
    316                  
     267 
    317268                // create diagrams 
    318269                 
     
    330281                        co.creatediagrams_processors = createDiagrams; 
    331282                } 
    332                 try { 
    333                         co.creatediagrams_reservations = Boolean.valueOf( 
    334                                         bundle.getString(CREATEDIAGRAMS_RESERVATIONS)).booleanValue() && createDiagrams; 
    335                 } catch(MissingResourceException e){ 
    336                         co.creatediagrams_reservations = createDiagrams; 
    337                 } 
    338                 try { 
    339                         co.creatediagrams_resources = Boolean.valueOf( 
    340                                         bundle.getString(CREATEDIAGRAMS_UTILIZATION)).booleanValue() && createDiagrams; 
     283 
     284                try { 
     285                        co.resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";"); 
     286                        if(co.resForUtilizationChart.length > 0){ 
     287                                co.creatediagrams_resources = true && createDiagrams; 
     288                        } 
    341289                } catch(MissingResourceException e){ 
    342290                        co.creatediagrams_resources = createDiagrams; 
     
    349297                } 
    350298                try { 
    351                         co.creatediagrams_energyusage = Boolean.valueOf( 
    352                                         bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams; 
     299                        co.resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";"); 
     300                        if(co.resForEnergyChart.length > 0){ 
     301                                co.creatediagrams_energyusage = true && createDiagrams; 
     302                        } 
    353303                } catch(MissingResourceException e){ 
    354304                        co.creatediagrams_energyusage = createDiagrams; 
     
    367317                } 
    368318                 
    369                  
    370319                try { 
    371320                        co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME); 
     
    388337                        co.createextendedtasksstatistics = true; 
    389338                } 
    390                 try { 
    391                         co.creategridlethistorystatistics = Boolean.valueOf( 
    392                                         bundle.getString(GRIDLET_HISTORY_STATISTICS)).booleanValue(); 
    393                 } catch(MissingResourceException e){ 
    394                         co.creategridlethistorystatistics = true; 
    395                 } 
     339 
    396340                try { 
    397341                        co.createjobsstatistics = Boolean.valueOf( 
     
    419363                } 
    420364                return co; 
    421         } 
    422  
    423         /** 
    424          * Creates a new configuration object in the CREATE_SCENARIO mode. 
    425          *  
    426          * @param gridSchedulingPluginName 
    427          * @param forecastFinishTimePluginName 
    428          * @param localAllocPolicyPluginName 
    429          * @param resdescFileName 
    430          * @param taskParamFileName 
    431          * @param outputFolder 
    432          * @param outputWorkloadFileName 
    433          * @param overwriteFiles 
    434          * @param printHistory 
    435          */ 
    436         public ConfigurationOptions(String gridSchedulingPluginName, 
    437                         String exectimeestimationplugin, 
    438                         String localAllocPolicyPluginName, String resdescFileName, 
    439                         String taskParamFileName, String outputFolder, 
    440                         String outputWorkloadFileName, boolean overwriteFiles, 
    441                         boolean printHistory) { 
    442                 super(); 
    443                 this.resdescFileName = resdescFileName; 
    444                 this.workloadDescFileName = taskParamFileName; 
    445                 this.outputFolder = getSeparatorTerminatedPath(outputFolder); 
    446                 this.outputWorkloadFileName = outputWorkloadFileName; 
    447                 this.overwriteFiles = overwriteFiles; 
    448                 this.printHistory = printHistory; 
    449  
    450                 // the create mode 
    451                 this.createScenario = true; 
    452         } 
    453  
    454         /** 
    455          * Creates a new configuration object in the READ_SCENARIO mode. 
    456          *  
    457          * @param gridSchedulingPluginName 
    458          * @param forecastFinishTimePluginName 
    459          * @param localAllocPolicyPluginName 
    460          * @param resdescFileName 
    461          * @param inputFolder 
    462          * @param inputWorkloadFileName 
    463          * @param overwriteFiles 
    464          * @param printHistory 
    465          */ 
    466         public ConfigurationOptions(String gridSchedulingPluginName, 
    467                         String exectimeestimationplugin, 
    468                         String localAllocPolicyPluginName, String resdescFileName, 
    469                         String inputFolder, String inputWorkloadFileName, 
    470                         boolean overwriteFiles, boolean printHistory) { 
    471                 super(); 
    472                 this.resdescFileName = resdescFileName; 
    473                 this.inputFolder = getSeparatorTerminatedPath(inputFolder); 
    474                 this.inputWorkloadFileName = inputWorkloadFileName; 
    475                 this.overwriteFiles = overwriteFiles; 
    476                 this.printHistory = printHistory; 
    477                 //FileHandler.loadDataset(new File("iris.data"), 4, ","); 
    478                 // the read mode 
    479                 this.createScenario = false; 
    480365        } 
    481366 
  • DCWoRMS/trunk/src/simulator/DCWormsUsers.java

    r481 r490  
    11package simulator; 
    22 
     3import dcworms.schedframe.scheduling.utils.JobDescription; 
     4import dcworms.schedframe.scheduling.utils.TaskDescription; 
    35import eduni.simjava.Sim_event; 
    46import eduni.simjava.Sim_system; 
    57import gridsim.GridSim; 
    68import gridsim.GridSimTags; 
    7 import gridsim.Gridlet; 
    89import gridsim.IO_data; 
    910import gridsim.gssim.DCWormsTags; 
    1011import gridsim.net.InfoPacket; 
    11 import gssim.schedframe.scheduling.utils.JobDescription; 
    12 import gssim.schedframe.scheduling.utils.TaskDescription; 
    1312 
    1413import java.util.ArrayList; 
  • DCWoRMS/trunk/src/simulator/GenericUser.java

    r477 r490  
    22 
    33 
    4 import gssim.schedframe.scheduling.utils.JobDescription; 
    5 import gssim.schedframe.scheduling.utils.TaskDescription; 
    64 
    75import java.util.List; 
     6 
     7import dcworms.schedframe.scheduling.utils.JobDescription; 
     8import dcworms.schedframe.scheduling.utils.TaskDescription; 
    89 
    910import schedframe.scheduling.tasks.Job; 
  • DCWoRMS/trunk/src/simulator/reader/ResourceReader.java

    r477 r490  
    1111import java.util.Deque; 
    1212import java.util.HashMap; 
     13import java.util.LinkedHashSet; 
    1314import java.util.LinkedList; 
    1415import java.util.List; 
    1516import java.util.Map; 
     17import java.util.Set; 
    1618 
    1719import org.exolab.castor.types.AnyNode; 
     
    5456        private String globalSchedulingPluginName; 
    5557         
     58        private Set<String> compResLayers; 
     59         
    5660        public ResourceReader(ConfigurationOptions options) throws IOException { 
    5761 
     
    5963                globalSchedulingPluginName = "example.globalplugin.GridFCFSRoundRobinPlugin"; 
    6064                prepareCalendar(); 
     65                compResLayers = new LinkedHashSet<String>(); 
    6166        } 
    6267 
     
    97102                ResourceController rc = new ResourceController(mainScheduler, computingResources); 
    98103                rc.setInitList(toInit); 
     104                rc.setCompResLayers(compResLayers); 
    99105                return rc; 
    100106        } 
     
    192198                        ComputingResource parentResource = resStructure.pop(); 
    193199                        toInit.add(parentResource); 
     200                        compResLayers.add(parentResource.getType().getName()); 
    194201                        List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren(); 
    195202                        if (childrenResDesc == null){ 
  • DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java

    r481 r490  
    1919import java.util.TreeMap; 
    2020 
     21import org.apache.commons.lang.ArrayUtils; 
    2122import org.apache.commons.logging.Log; 
    2223import org.apache.commons.logging.LogFactory; 
     
    5556import schedframe.exceptions.ResourceException; 
    5657import schedframe.resources.ResourceType; 
    57 import schedframe.resources.StandardResourceType; 
     58import schedframe.resources.UserResourceType; 
    5859import schedframe.resources.computing.ComputingResource; 
    5960import schedframe.resources.computing.extensions.Extension; 
     
    8788import csiro.mit.utils.jfreechart.timetablechart.data.TimetableEventSource; 
    8889import csiro.mit.utils.jfreechart.timetablechart.renderer.TimetableRenderer; 
     90import dcworms.schedframe.scheduling.ExecTask; 
     91import dcworms.schedframe.scheduling.Executable; 
    8992import eduni.simjava.Sim_stat; 
    90 import gssim.schedframe.scheduling.ExecTask; 
    91 import gssim.schedframe.scheduling.Executable; 
    9293 
    9394public class DCWormsStatistics implements SimulationStatistics { 
     
    149150        protected HashMap<String, List<String>> task_processorsMap; 
    150151 
    151         protected JobRegistryImpl jr; 
     152        protected JobRegistry jr; 
    152153 
    153154         
     
    168169 
    169170                this.resourceController = resourceController; 
    170                  jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER"); 
     171                jr = new JobRegistryImpl(""); 
    171172                init(); 
    172173        } 
     
    231232                        simulationStatsFile.close(); 
    232233                } 
    233  
    234         } 
    235  
    236  
     234        } 
    237235 
    238236        /************* RESOURCE STATISTICS SECTION **************/ 
     
    241239                 
    242240                //TEMPORARY CONFIGURATION SECTION 
    243                 StandardResourceType [] resForAnalyze = {StandardResourceType.DataCenter, StandardResourceType.ComputingNode, StandardResourceType.Processor}; 
    244                 HashMap<StandardResourceType, List<Stats>> type_stats = new HashMap<StandardResourceType, List<Stats>>(); 
    245                  
    246                 List<Stats> crStats = new ArrayList<Stats>(); 
    247                 crStats.add(Stats.textLoad); 
    248                 crStats.add(Stats.chartLoad); 
    249                 crStats.add(Stats.textEnergy); 
    250                 crStats.add(Stats.chartEnergy); 
    251                 type_stats.put(StandardResourceType.DataCenter, crStats); 
    252                  
    253                 List<Stats> cnStats = new ArrayList<Stats>(); 
    254                 cnStats.add(Stats.textLoad); 
    255                 cnStats.add(Stats.chartLoad); 
    256                 cnStats.add(Stats.textEnergy); 
    257                 cnStats.add(Stats.chartEnergy); 
    258                 type_stats.put(StandardResourceType.ComputingNode, cnStats); 
    259                  
    260                 List<Stats> cpuStats = new ArrayList<Stats>(); 
    261                 cpuStats.add(Stats.textLoad); 
    262                 cpuStats.add(Stats.chartLoad); 
    263                 cpuStats.add(Stats.textEnergy); 
    264                 //cpuStats.add(Stats.chartEnergy); 
    265                 type_stats.put(StandardResourceType.Processor, cpuStats); 
    266                  
    267                  
     241                 
     242                HashMap<String, List<Stats>> type_stats = new HashMap<String, List<Stats>>(); 
     243                 
     244                for(String resourceName: resourceController.getComputingResourceLayers()){ 
     245                        List<Stats> cStats = new ArrayList<Stats>(); 
     246                        cStats.add(Stats.textLoad); 
     247                        if(ArrayUtils.contains(configuration.resForUtilizationChart, resourceName)) 
     248                                cStats.add(Stats.chartLoad); 
     249                        cStats.add(Stats.textEnergy); 
     250                        if(ArrayUtils.contains(configuration.resForEnergyChart, resourceName)) 
     251                                cStats.add(Stats.chartEnergy); 
     252                        type_stats.put(resourceName, cStats); 
     253                }                
    268254                 
    269255                peGanttMap = new HashMap<String, TimetableEventSource>(); 
     
    305291                } 
    306292                 
    307                 for(StandardResourceType resType: resForAnalyze){ 
     293                for(String resourceName: resourceController.getComputingResourceLayers()){ 
    308294                        List<ComputingResource> resources = null; 
    309295                        try { 
    310296                                resources = new ArrayList<ComputingResource>(); 
    311297                                for(ComputingResource compRes: resourceController.getComputingResources() ){ 
    312                                         resources.addAll(compRes.getDescendantsByType(resType)); 
    313                                 } 
    314                                 /*if(resourceController.getComputingResources().get(0).getType().equals(resType)) 
    315                                         resources.addAll(resourceController.getComputingResources());*/ 
     298                                        resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName))); 
     299                                } 
     300                                if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName)) 
     301                                        resources.addAll(resourceController.getComputingResources()); 
    316302                        } catch (Exception e) { 
    317303                                continue; 
    318304                        } 
    319                         if(type_stats.containsKey(resType)){ 
     305                        if(type_stats.containsKey(resourceName)){ 
    320306                                Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>(); 
    321307                                Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>(); 
     
    323309                                        ResourceUsageStats resourceUsage = null; 
    324310                                        ResourceEnergyStats energyUsage = null; 
    325                                         if(type_stats.get(resType).contains(Stats.textLoad)){ 
     311                                        if(type_stats.get(resourceName).contains(Stats.textLoad)){ 
    326312                                                resourceUsage = gatherResourceLoadStats(resource, basicResStats); 
    327313                                                resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad)); 
     
    331317                                                } 
    332318                                        } 
    333                                         if(type_stats.get(resType).contains(Stats.chartLoad)){ 
     319                                        if(type_stats.get(resourceName).contains(Stats.chartLoad)){ 
    334320                                                if (configuration.creatediagrams_resources) { 
    335321                                                        createResourceLoadDiagram(resourceUsage); 
    336322                                                } 
    337323                                        } 
    338                                         if(type_stats.get(resType).contains(Stats.textEnergy)){ 
     324                                        if(type_stats.get(resourceName).contains(Stats.textEnergy)){ 
    339325                                                energyUsage = gatherResourceEnergyStats(resource); 
    340326                                                energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage)); 
     
    352338                                                        boolean top = true; 
    353339                                                        while(parent != null){ 
    354                                                                 if(een != null &&  een.getPowerProfile() != null) 
    355                                                                 { 
     340                                                                if(een != null &&  een.getPowerProfile() != null) { 
    356341                                                                        top = false; 
    357342                                                                        break; 
     
    368353                                                } 
    369354                                        } 
    370                                         if(type_stats.get(resType).contains(Stats.chartEnergy)){ 
     355                                        if(type_stats.get(resourceName).contains(Stats.chartEnergy)){ 
    371356 
    372357                                                if (configuration.creatediagrams_energyusage) { 
     
    760745        private JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName, 
    761746                        Title subtitle, String simulationTime) { 
    762                 String energy = "ENERGY [W]"; 
     747                String energy = "POWER [W]"; 
    763748                boolean urls = false; 
    764749                boolean tooltip = true; 
  • DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java

    r481 r490  
    11package simulator.stats.implementation; 
    22 
    3 import gssim.schedframe.scheduling.Executable; 
    43 
    54import java.util.List; 
     5 
     6import dcworms.schedframe.scheduling.Executable; 
    67 
    78import simulator.stats.implementation.out.StatsSerializer; 
  • DCWoRMS/trunk/src/simulator/utils/XsltTransformations.java

    r477 r490  
    11package simulator.utils; 
    22 
    3 import gssim.schedframe.scheduling.utils.JobDescription; 
    4 import gssim.schedframe.scheduling.utils.TaskDescription; 
    53 
    64import java.io.IOException; 
     
    2018import javax.xml.transform.stream.StreamSource; 
    2119import javax.xml.xpath.XPathExpressionException; 
     20 
     21import dcworms.schedframe.scheduling.utils.JobDescription; 
     22import dcworms.schedframe.scheduling.utils.TaskDescription; 
    2223 
    2324/** 
  • DCWoRMS/trunk/src/simulator/workload/WorkloadLoader.java

    r477 r490  
    22 
    33import org.qcg.broker.schemas.jobdesc.QcgJob; 
    4 import gssim.schedframe.scheduling.utils.JobDescription; 
    5 import gssim.schedframe.scheduling.utils.TaskDescription; 
    64 
    75import java.io.IOException; 
     
    2422import org.exolab.castor.xml.MarshalException; 
    2523import org.exolab.castor.xml.ValidationException; 
     24 
     25import dcworms.schedframe.scheduling.utils.JobDescription; 
     26import dcworms.schedframe.scheduling.utils.TaskDescription; 
    2627 
    2728 
Note: See TracChangeset for help on using the changeset viewer.