Changeset 539 for DCWoRMS/trunk/build/classes/simulator/reader
- Timestamp:
- 10/31/12 13:52:06 (12 years ago)
- Location:
- DCWoRMS/trunk/build/classes/simulator/reader
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/build/classes/simulator/reader/ResourceReader.java
r477 r539 11 11 import java.util.Deque; 12 12 import java.util.HashMap; 13 import java.util.LinkedHashSet; 13 14 import java.util.LinkedList; 14 15 import java.util.List; 15 16 import java.util.Map; 17 import java.util.Set; 16 18 17 19 import org.exolab.castor.types.AnyNode; … … 54 56 private String globalSchedulingPluginName; 55 57 58 private Set<String> compResLayers; 59 56 60 public ResourceReader(ConfigurationOptions options) throws IOException { 57 61 … … 59 63 globalSchedulingPluginName = "example.globalplugin.GridFCFSRoundRobinPlugin"; 60 64 prepareCalendar(); 65 compResLayers = new LinkedHashSet<String>(); 61 66 } 62 67 … … 64 69 UnknownParameter { 65 70 66 //File file = new File("src/test/rewolucja/schemas/example/coolemall/example4.xml");67 71 File file = new File(resDescFileName); 68 //File file = new File("example/tomekp/experiment1/tomExp3.xml");69 /*long s =System.currentTimeMillis();70 System.out.println("start: ");71 List<Processor> list = new ArrayList<Processor>();72 for(int i =0;i<3000000;i++){73 schemas.ComputingResource compResDef = new schemas.ComputingResource();74 compResDef.setName("a"+i);75 compResDef.setClazz("Processor");76 CompResourceDescription resDesc = new CompResourceDescription(compResDef);77 Processor proc = new Processor(resDesc);78 list.add(proc);79 }80 long e = System.currentTimeMillis();81 System.out.println("end: ");82 System.out.println(e-s);*/83 72 Environment env = Environment.unmarshal(new FileReader(file)); 84 73 … … 97 86 ResourceController rc = new ResourceController(mainScheduler, computingResources); 98 87 rc.setInitList(toInit); 88 rc.setCompResLayers(compResLayers); 99 89 return rc; 100 90 } … … 177 167 178 168 List<ComputingResource> mainCompResourceList = new ArrayList<ComputingResource>(); 179 180 169 Deque<ComputingResourceDescription> toExamine = new ArrayDeque<ComputingResourceDescription>(); 181 170 Deque<ComputingResource> resStructure = new ArrayDeque<ComputingResource>(); … … 192 181 ComputingResource parentResource = resStructure.pop(); 193 182 toInit.add(parentResource); 183 compResLayers.add(parentResource.getType().getName()); 194 184 List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren(); 195 185 if (childrenResDesc == null){ … … 250 240 //TODO - refactor (remove - create scheduler on the basis of resource description) 251 241 Scheduler mainScheduler = null; 252 if(mainSchedulers.size() == 1 && mainSchedulers.get(0).get_name().equals("grid")){242 if(mainSchedulers.size() == 1 /*&& mainSchedulers.get(0).get_name().equals("grid")*/){ 253 243 mainScheduler = mainSchedulers.get(0); 254 244 } … … 261 251 ManagedResources managedResources = new ManagedResources(mainCompResourceList, new HashMap<ResourceUnitName, List<ResourceUnit>>()); 262 252 mainScheduler = ResourceFactory.createScheduler(StandardResourceType.GS, "grid", schedulingPlugin , execTimeEstimationPlugin, queues, managedResources); 263 /*ManagementSystem ms = new GridBroker("grid", 264 globalSchedulingPluginName, execTimeEstimationPlugin); 265 mainScheduler = new Scheduler(ms, mainCompResourceList);*/ 253 266 254 for(Scheduler lr: mainSchedulers){ 267 255 mainScheduler.addChild(lr); … … 280 268 TaskQueueList queues = new TaskQueueList(1); 281 269 282 if(schedulerDef.getQueue () != null && schedulerDef.getQueueCount() > 0){283 int queueCount = schedulerDef.getQueue Count();270 if(schedulerDef.getQueues()!= null){ 271 int queueCount = schedulerDef.getQueues().getQueueCount(); 284 272 for(int i = 0; i < queueCount; i++){ 285 schemas.QueueType queueDef = schedulerDef.getQueue (i);273 schemas.QueueType queueDef = schedulerDef.getQueues().getQueue(i); 286 274 TaskQueue queue = new TaskQueue(queueDef.getReservation()); 287 275 queue.setName(queueDef.getName());
Note: See TracChangeset
for help on using the changeset viewer.