Ignore:
Timestamp:
03/15/12 11:14:52 (13 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • xssim/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java

    r104 r129  
    6262 
    6363                                        SubmittedTask subTask = (SubmittedTask) task; 
    64                                         Map<ResourceParameterName, ResourceUnit> choosenResources = null; 
    65                                         choosenResources = chooseResourcesForExecution(resourceManager, subTask); 
    66                                         //String provname = chooseProviderForExecution(resourceManager); 
     64                                         
     65                                        /****************3 ways to schedule task****************/ 
     66                                         
     67                                        //1. Choosing particular resources to perform execution 
     68                                        Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, subTask); 
    6769                                        if (choosenResources != null) { 
    6870                                                addToSchedulingPlan(plan, task, choosenResources); 
    6971                                        } 
     72                                         
     73                                        //2. Choosing resource scheduler/provider to submit task.  If the given resource doesn't contains/isn't  
     74                                        //a scheduler, random resources from the given resource will be chosen in order to perform execution 
     75                                        /*String provName = chooseProviderForExecution(resourceManager); 
     76                                        if (provName != null) { 
     77                                                addToSchedulingPlan(plan, task, provName); 
     78                                        }*/ 
     79 
     80                                        //3. Scheduler will choose random resources to perform execution 
     81                                        //addToSchedulingPlan(plan, task); 
    7082 
    7183                                } 
     
    7789        } 
    7890 
    79         public HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution( 
     91        private HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution( 
    8092                        ClusterResourceManager resourceManager, ExecTaskInterface task) { 
    8193 
     
    140152        } 
    141153 
     154        private String chooseProviderForExecution(ResourceManagerInterface unitsManager) { 
     155                List<ComputingResource> processingElements; 
     156                Properties properties = new Properties(); 
     157                properties.setProperty("type", ResourceType.COMPUTING_NODE.toString()); 
     158                // properties.setProperty("status", ResourceStatus.FREE.toString()); 
     159                processingElements = (List<ComputingResource>) unitsManager.filterResources(properties); 
     160                return processingElements.get(0).getName(); 
     161        } 
     162 
    142163        public String getName() { 
    143164                return getClass().getName(); 
     
    148169        } 
    149170 
    150         public String chooseProviderForExecution(ResourceManagerInterface unitsManager) { 
    151                 List<ComputingResource> processingElements; 
    152                 Properties properties = new Properties(); 
    153                 properties.setProperty("type", ResourceType.COMPUTING_NODE.toString()); 
    154                 // properties.setProperty("status", ResourceStatus.FREE.toString()); 
    155                 processingElements = (List<ComputingResource>) unitsManager.filterResources(properties); 
    156                 return processingElements.get(0).getName(); 
    157         } 
    158  
    159171} 
Note: See TracChangeset for help on using the changeset viewer.