Changeset 129 for xssim/trunk


Ignore:
Timestamp:
03/15/12 11:14:52 (13 years ago)
Author:
wojtekp
Message:
 
Location:
xssim/trunk/src/example/localplugin
Files:
6 deleted
2 edited

Legend:

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

    r104 r129  
    8989        } 
    9090         
     91        public void addToSchedulingPlan(SchedulingPlanNew plan, TaskInterface<?> task){ 
     92                 
     93                AllocationNew allocation = new AllocationNew(); 
     94                allocation.setProcessesCount(1); 
     95                allocation.setProviderName(null); 
     96                 
     97                ScheduledTaskNew scheduledTask = new ScheduledTaskNew(task); 
     98                scheduledTask.setTaskId(task.getId()); 
     99                scheduledTask.setJobId(task.getJobId()); 
     100                scheduledTask.addAllocation(allocation);                 
     101                 
     102                plan.addTask(scheduledTask); 
     103        } 
    91104 
    92105} 
  • 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.