Changeset 490 for DCWoRMS/trunk/src/simulator
- Timestamp:
- 10/09/12 13:58:06 (13 years ago)
- Location:
- DCWoRMS/trunk/src/simulator
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/simulator/ConfigurationOptions.java
r477 r490 8 8 import java.util.PropertyResourceBundle; 9 9 import java.util.ResourceBundle; 10 import java.util.logging.FileHandler;11 10 12 11 /** … … 53 52 public static final String READ_SCENARIO_INPUT_FOLDER = READ_SCENARIO_MODIFIER 54 53 + ".inputfolder"; 55 public static final String READ_SCENARIO_INPUT_TAR = READ_SCENARIO_MODIFIER+ ".tar";56 54 57 55 /** The name of the workload file */ … … 59 57 + ".workloadfilename"; 60 58 61 /** Shall a detailed history be printed */62 public static final String PRINT_HISTORY_MODIFIER = "printhistory";63 64 59 /** The default name of a workload file */ 65 60 public static final String DEFAULT_WORKLOAD_FILE_NAME = "workload.swf"; 66 61 67 62 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 73 64 74 65 public static final String CREATEDIAGRAMS = "creatediagrams"; … … 79 70 public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks"; 80 71 public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime"; 81 public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations";82 72 83 73 public static final String CREATESTATISTICS = "createstatistics"; 84 74 public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 85 75 public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 86 public static final String GRIDLET_HISTORY_STATISTICS = CREATESTATISTICS + ".gridlethistory";87 76 public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 88 77 public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; … … 111 100 /* =============================================================================================== */ 112 101 113 public String providerListFile = null;114 102 115 103 … … 152 140 public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME; 153 141 154 /**155 * a txt file name with topology description156 */157 public String networkTopologyFileName = null;158 142 159 143 /** … … 171 155 public boolean overwriteFiles = false; 172 156 173 /**174 * true if the history files are to be generated (makes the simulation175 * slower)176 */177 public boolean printHistory = false;178 157 179 158 /** … … 183 162 184 163 public boolean creatediagrams_processors = true; 185 public boolean creatediagrams_reservations = true;186 164 public boolean creatediagrams_resources = true; 187 165 public boolean creatediagrams_energyusage = true; 188 166 public boolean creatediagrams_tasks = true; 189 167 public boolean creatediagrams_taskswaitingtime = true; 190 public double 168 public double creatediagrams_resources_scale = 1; 191 169 192 170 public boolean createaccumulatedresourcesstatistics = true; 193 171 public boolean createextendedtasksstatistics = true; 194 public boolean creategridlethistorystatistics = true;195 172 public boolean createjobsstatistics = true; 196 173 public boolean createsimulationstatistics = true; 197 174 public boolean formatstatisticsoutput = false; 198 175 199 public static final String ENV_DESC_MODIFIER = "envdesc"; 200 public String envDescFileName = null; 176 public String[] resForEnergyChart; 177 public String[] resForUtilizationChart; 178 201 179 /** 202 180 * An empty constructor. … … 231 209 232 210 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 239 212 240 213 try { … … 264 237 } 265 238 266 267 try {268 co.networkTopologyFileName = bundle269 .getString(NETWORK_TOPOLOGY_FILE_MODIFIER);270 } catch(MissingResourceException e){271 co.networkTopologyFileName = null;272 }273 274 239 if (co.createScenario == false) { 275 240 // read scenario … … 279 244 } catch (MissingResourceException e) { 280 245 co.inputFolder = null; 281 }282 283 try {284 co.inputTar = getSeparatorTerminatedPath(bundle285 .getString(READ_SCENARIO_INPUT_TAR));286 } catch (MissingResourceException e) {287 co.inputTar = null;288 246 } 289 247 … … 307 265 co.createXMLSupplement = false; 308 266 } 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 317 268 // create diagrams 318 269 … … 330 281 co.creatediagrams_processors = createDiagrams; 331 282 } 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 } 341 289 } catch(MissingResourceException e){ 342 290 co.creatediagrams_resources = createDiagrams; … … 349 297 } 350 298 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 } 353 303 } catch(MissingResourceException e){ 354 304 co.creatediagrams_energyusage = createDiagrams; … … 367 317 } 368 318 369 370 319 try { 371 320 co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME); … … 388 337 co.createextendedtasksstatistics = true; 389 338 } 390 try { 391 co.creategridlethistorystatistics = Boolean.valueOf( 392 bundle.getString(GRIDLET_HISTORY_STATISTICS)).booleanValue(); 393 } catch(MissingResourceException e){ 394 co.creategridlethistorystatistics = true; 395 } 339 396 340 try { 397 341 co.createjobsstatistics = Boolean.valueOf( … … 419 363 } 420 364 return co; 421 }422 423 /**424 * Creates a new configuration object in the CREATE_SCENARIO mode.425 *426 * @param gridSchedulingPluginName427 * @param forecastFinishTimePluginName428 * @param localAllocPolicyPluginName429 * @param resdescFileName430 * @param taskParamFileName431 * @param outputFolder432 * @param outputWorkloadFileName433 * @param overwriteFiles434 * @param printHistory435 */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 mode451 this.createScenario = true;452 }453 454 /**455 * Creates a new configuration object in the READ_SCENARIO mode.456 *457 * @param gridSchedulingPluginName458 * @param forecastFinishTimePluginName459 * @param localAllocPolicyPluginName460 * @param resdescFileName461 * @param inputFolder462 * @param inputWorkloadFileName463 * @param overwriteFiles464 * @param printHistory465 */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 mode479 this.createScenario = false;480 365 } 481 366 -
DCWoRMS/trunk/src/simulator/DCWormsUsers.java
r481 r490 1 1 package simulator; 2 2 3 import dcworms.schedframe.scheduling.utils.JobDescription; 4 import dcworms.schedframe.scheduling.utils.TaskDescription; 3 5 import eduni.simjava.Sim_event; 4 6 import eduni.simjava.Sim_system; 5 7 import gridsim.GridSim; 6 8 import gridsim.GridSimTags; 7 import gridsim.Gridlet;8 9 import gridsim.IO_data; 9 10 import gridsim.gssim.DCWormsTags; 10 11 import gridsim.net.InfoPacket; 11 import gssim.schedframe.scheduling.utils.JobDescription;12 import gssim.schedframe.scheduling.utils.TaskDescription;13 12 14 13 import java.util.ArrayList; -
DCWoRMS/trunk/src/simulator/GenericUser.java
r477 r490 2 2 3 3 4 import gssim.schedframe.scheduling.utils.JobDescription;5 import gssim.schedframe.scheduling.utils.TaskDescription;6 4 7 5 import java.util.List; 6 7 import dcworms.schedframe.scheduling.utils.JobDescription; 8 import dcworms.schedframe.scheduling.utils.TaskDescription; 8 9 9 10 import schedframe.scheduling.tasks.Job; -
DCWoRMS/trunk/src/simulator/reader/ResourceReader.java
r477 r490 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 … … 97 102 ResourceController rc = new ResourceController(mainScheduler, computingResources); 98 103 rc.setInitList(toInit); 104 rc.setCompResLayers(compResLayers); 99 105 return rc; 100 106 } … … 192 198 ComputingResource parentResource = resStructure.pop(); 193 199 toInit.add(parentResource); 200 compResLayers.add(parentResource.getType().getName()); 194 201 List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren(); 195 202 if (childrenResDesc == null){ -
DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
r481 r490 19 19 import java.util.TreeMap; 20 20 21 import org.apache.commons.lang.ArrayUtils; 21 22 import org.apache.commons.logging.Log; 22 23 import org.apache.commons.logging.LogFactory; … … 55 56 import schedframe.exceptions.ResourceException; 56 57 import schedframe.resources.ResourceType; 57 import schedframe.resources. StandardResourceType;58 import schedframe.resources.UserResourceType; 58 59 import schedframe.resources.computing.ComputingResource; 59 60 import schedframe.resources.computing.extensions.Extension; … … 87 88 import csiro.mit.utils.jfreechart.timetablechart.data.TimetableEventSource; 88 89 import csiro.mit.utils.jfreechart.timetablechart.renderer.TimetableRenderer; 90 import dcworms.schedframe.scheduling.ExecTask; 91 import dcworms.schedframe.scheduling.Executable; 89 92 import eduni.simjava.Sim_stat; 90 import gssim.schedframe.scheduling.ExecTask;91 import gssim.schedframe.scheduling.Executable;92 93 93 94 public class DCWormsStatistics implements SimulationStatistics { … … 149 150 protected HashMap<String, List<String>> task_processorsMap; 150 151 151 protected JobRegistry Impljr;152 protected JobRegistry jr; 152 153 153 154 … … 168 169 169 170 this.resourceController = resourceController; 170 jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER");171 jr = new JobRegistryImpl(""); 171 172 init(); 172 173 } … … 231 232 simulationStatsFile.close(); 232 233 } 233 234 } 235 236 234 } 237 235 238 236 /************* RESOURCE STATISTICS SECTION **************/ … … 241 239 242 240 //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 } 268 254 269 255 peGanttMap = new HashMap<String, TimetableEventSource>(); … … 305 291 } 306 292 307 for(St andardResourceType resType: resForAnalyze){293 for(String resourceName: resourceController.getComputingResourceLayers()){ 308 294 List<ComputingResource> resources = null; 309 295 try { 310 296 resources = new ArrayList<ComputingResource>(); 311 297 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()); 316 302 } catch (Exception e) { 317 303 continue; 318 304 } 319 if(type_stats.containsKey(res Type)){305 if(type_stats.containsKey(resourceName)){ 320 306 Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>(); 321 307 Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>(); … … 323 309 ResourceUsageStats resourceUsage = null; 324 310 ResourceEnergyStats energyUsage = null; 325 if(type_stats.get(res Type).contains(Stats.textLoad)){311 if(type_stats.get(resourceName).contains(Stats.textLoad)){ 326 312 resourceUsage = gatherResourceLoadStats(resource, basicResStats); 327 313 resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad)); … … 331 317 } 332 318 } 333 if(type_stats.get(res Type).contains(Stats.chartLoad)){319 if(type_stats.get(resourceName).contains(Stats.chartLoad)){ 334 320 if (configuration.creatediagrams_resources) { 335 321 createResourceLoadDiagram(resourceUsage); 336 322 } 337 323 } 338 if(type_stats.get(res Type).contains(Stats.textEnergy)){324 if(type_stats.get(resourceName).contains(Stats.textEnergy)){ 339 325 energyUsage = gatherResourceEnergyStats(resource); 340 326 energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage)); … … 352 338 boolean top = true; 353 339 while(parent != null){ 354 if(een != null && een.getPowerProfile() != null) 355 { 340 if(een != null && een.getPowerProfile() != null) { 356 341 top = false; 357 342 break; … … 368 353 } 369 354 } 370 if(type_stats.get(res Type).contains(Stats.chartEnergy)){355 if(type_stats.get(resourceName).contains(Stats.chartEnergy)){ 371 356 372 357 if (configuration.creatediagrams_energyusage) { … … 760 745 private JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName, 761 746 Title subtitle, String simulationTime) { 762 String energy = " ENERGY[W]";747 String energy = "POWER [W]"; 763 748 boolean urls = false; 764 749 boolean tooltip = true; -
DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java
r481 r490 1 1 package simulator.stats.implementation; 2 2 3 import gssim.schedframe.scheduling.Executable;4 3 5 4 import java.util.List; 5 6 import dcworms.schedframe.scheduling.Executable; 6 7 7 8 import simulator.stats.implementation.out.StatsSerializer; -
DCWoRMS/trunk/src/simulator/utils/XsltTransformations.java
r477 r490 1 1 package simulator.utils; 2 2 3 import gssim.schedframe.scheduling.utils.JobDescription;4 import gssim.schedframe.scheduling.utils.TaskDescription;5 3 6 4 import java.io.IOException; … … 20 18 import javax.xml.transform.stream.StreamSource; 21 19 import javax.xml.xpath.XPathExpressionException; 20 21 import dcworms.schedframe.scheduling.utils.JobDescription; 22 import dcworms.schedframe.scheduling.utils.TaskDescription; 22 23 23 24 /** -
DCWoRMS/trunk/src/simulator/workload/WorkloadLoader.java
r477 r490 2 2 3 3 import org.qcg.broker.schemas.jobdesc.QcgJob; 4 import gssim.schedframe.scheduling.utils.JobDescription;5 import gssim.schedframe.scheduling.utils.TaskDescription;6 4 7 5 import java.io.IOException; … … 24 22 import org.exolab.castor.xml.MarshalException; 25 23 import org.exolab.castor.xml.ValidationException; 24 25 import dcworms.schedframe.scheduling.utils.JobDescription; 26 import dcworms.schedframe.scheduling.utils.TaskDescription; 26 27 27 28
Note: See TracChangeset
for help on using the changeset viewer.